C# Class Microsoft.SourceBrowser.HtmlGenerator.Paths

Afficher le fichier Open project: KirillOsenkov/SourceBrowser Class Usage Examples

Méthodes publiques

Méthode Description
CalculateRelativePathToRoot ( string filePath, string rootFolder ) : string
EnsureTrailingSlash ( this path ) : string
GetCssPathFromFile ( string solutionDestinationPath, string fileName ) : string
GetDocumentDestinationPath ( Microsoft.CodeAnalysis.Document document, string projectDestinationFolder ) : string
GetFullPathInFolderCone ( string folder, string filePath ) : string

This makes sure that a filePath that can be outside the folder is replanted inside the folder. This is important when a project references a file outside the project cone and we want to display it as if it is inside the project.

GetMD5Hash ( string input, int digits ) : string
GetMD5HashULong ( string input, int digits ) : ulong
GetRelativeFilePathInProject ( Microsoft.CodeAnalysis.Document document ) : string
GetRelativePathInProject ( Microsoft.CodeAnalysis.SyntaxTree syntaxTree, Microsoft.CodeAnalysis.Project project ) : string
LoadProcessedAssemblies ( ) : HashSet
MakeRelativeToFile ( string filePath, string relativeToPath ) : string

Returns a path to filePath if you start in a folder where the file relativeToPath is located.

MakeRelativeToFolder ( string filePath, string relativeToPath ) : string

Returns a path to filePath if you start in folder relativeToPath.

PrepareDestinationFolder ( bool forceOverwrite = false ) : void
SanitizeFileName ( string fileName ) : string
SanitizeFolder ( string folderName ) : string
StripExtension ( string fileName ) : string

Private Methods

Méthode Description
GetFullPathInFolderConeForRootedFilePath ( string folder, string rootedFilePath ) : string
IsValidFolder ( string folderName ) : bool
ReplaceInvalidChars ( string fileName, char invalidChars ) : string

Method Details

CalculateRelativePathToRoot() public static méthode

public static CalculateRelativePathToRoot ( string filePath, string rootFolder ) : string
filePath string
rootFolder string
Résultat string

EnsureTrailingSlash() public static méthode

public static EnsureTrailingSlash ( this path ) : string
path this
Résultat string

GetCssPathFromFile() public static méthode

public static GetCssPathFromFile ( string solutionDestinationPath, string fileName ) : string
solutionDestinationPath string
fileName string
Résultat string

GetDocumentDestinationPath() public static méthode

public static GetDocumentDestinationPath ( Microsoft.CodeAnalysis.Document document, string projectDestinationFolder ) : string
document Microsoft.CodeAnalysis.Document
projectDestinationFolder string
Résultat string

GetFullPathInFolderCone() public static méthode

This makes sure that a filePath that can be outside the folder is replanted inside the folder. This is important when a project references a file outside the project cone and we want to display it as if it is inside the project.
public static GetFullPathInFolderCone ( string folder, string filePath ) : string
folder string
filePath string
Résultat string

GetMD5Hash() public static méthode

public static GetMD5Hash ( string input, int digits ) : string
input string
digits int
Résultat string

GetMD5HashULong() public static méthode

public static GetMD5HashULong ( string input, int digits ) : ulong
input string
digits int
Résultat ulong

GetRelativeFilePathInProject() public static méthode

public static GetRelativeFilePathInProject ( Microsoft.CodeAnalysis.Document document ) : string
document Microsoft.CodeAnalysis.Document
Résultat string

GetRelativePathInProject() public static méthode

public static GetRelativePathInProject ( Microsoft.CodeAnalysis.SyntaxTree syntaxTree, Microsoft.CodeAnalysis.Project project ) : string
syntaxTree Microsoft.CodeAnalysis.SyntaxTree
project Microsoft.CodeAnalysis.Project
Résultat string

LoadProcessedAssemblies() public static méthode

public static LoadProcessedAssemblies ( ) : HashSet
Résultat HashSet

MakeRelativeToFile() public static méthode

Returns a path to filePath if you start in a folder where the file relativeToPath is located.
public static MakeRelativeToFile ( string filePath, string relativeToPath ) : string
filePath string C:\A\B\1.txt
relativeToPath string C:\C\D\2.txt
Résultat string

MakeRelativeToFolder() public static méthode

Returns a path to filePath if you start in folder relativeToPath.
public static MakeRelativeToFolder ( string filePath, string relativeToPath ) : string
filePath string C:\A\B\1.txt
relativeToPath string C:\C\D
Résultat string

PrepareDestinationFolder() public static méthode

public static PrepareDestinationFolder ( bool forceOverwrite = false ) : void
forceOverwrite bool
Résultat void

SanitizeFileName() public static méthode

public static SanitizeFileName ( string fileName ) : string
fileName string
Résultat string

SanitizeFolder() public static méthode

public static SanitizeFolder ( string folderName ) : string
folderName string
Résultat string

StripExtension() public static méthode

public static StripExtension ( string fileName ) : string
fileName string
Résultat string