C# Class Microsoft.SourceBrowser.HtmlGenerator.Paths

ファイルを表示 Open project: KirillOsenkov/SourceBrowser Class Usage Examples

Public Methods

Method 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

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

Method Details

CalculateRelativePathToRoot() public static method

public static CalculateRelativePathToRoot ( string filePath, string rootFolder ) : string
filePath string
rootFolder string
return string

EnsureTrailingSlash() public static method

public static EnsureTrailingSlash ( this path ) : string
path this
return string

GetCssPathFromFile() public static method

public static GetCssPathFromFile ( string solutionDestinationPath, string fileName ) : string
solutionDestinationPath string
fileName string
return string

GetDocumentDestinationPath() public static method

public static GetDocumentDestinationPath ( Microsoft.CodeAnalysis.Document document, string projectDestinationFolder ) : string
document Microsoft.CodeAnalysis.Document
projectDestinationFolder string
return string

GetFullPathInFolderCone() public static method

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
return string

GetMD5Hash() public static method

public static GetMD5Hash ( string input, int digits ) : string
input string
digits int
return string

GetMD5HashULong() public static method

public static GetMD5HashULong ( string input, int digits ) : ulong
input string
digits int
return ulong

GetRelativeFilePathInProject() public static method

public static GetRelativeFilePathInProject ( Microsoft.CodeAnalysis.Document document ) : string
document Microsoft.CodeAnalysis.Document
return string

GetRelativePathInProject() public static method

public static GetRelativePathInProject ( Microsoft.CodeAnalysis.SyntaxTree syntaxTree, Microsoft.CodeAnalysis.Project project ) : string
syntaxTree Microsoft.CodeAnalysis.SyntaxTree
project Microsoft.CodeAnalysis.Project
return string

LoadProcessedAssemblies() public static method

public static LoadProcessedAssemblies ( ) : HashSet
return HashSet

MakeRelativeToFile() public static method

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
return string

MakeRelativeToFolder() public static method

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
return string

PrepareDestinationFolder() public static method

public static PrepareDestinationFolder ( bool forceOverwrite = false ) : void
forceOverwrite bool
return void

SanitizeFileName() public static method

public static SanitizeFileName ( string fileName ) : string
fileName string
return string

SanitizeFolder() public static method

public static SanitizeFolder ( string folderName ) : string
folderName string
return string

StripExtension() public static method

public static StripExtension ( string fileName ) : string
fileName string
return string