C# Class SonarLint.VisualStudio.Integration.PathHelper

Show file Open project: SonarSource-VisualStudio/sonarlint-visualstudio

Public Methods

Method Description
CalculateRelativePath ( string fromFullPath, string toFullPath ) : string

Compute the path of toFullPath, relative to fromFullPath.

EscapeFileName ( string unescapedName ) : string

Replace all invalid file path characters with the underscore ("_").

ForceDirectoryEnding ( string str ) : string

Append a Path.DirectorySeparatorChar to the end of the string if one does not already exist.

IsPathRootedUnderRoot ( string path, string rootDirectory ) : bool

Gets whether or not the given path has exists under the given rootDirectory.

ResolveRelativePath ( string relativePath, string resolutionRootFullPath ) : string

Resolve a relative path against the given root path.

Private Methods

Method Description
ToFilePathString ( Uri uri ) : string

Method Details

CalculateRelativePath() public static method

Compute the path of toFullPath, relative to fromFullPath.
public static CalculateRelativePath ( string fromFullPath, string toFullPath ) : string
fromFullPath string Path with which to make relative to
toFullPath string Absolute path
return string

EscapeFileName() public static method

Replace all invalid file path characters with the underscore ("_").
public static EscapeFileName ( string unescapedName ) : string
unescapedName string
return string

ForceDirectoryEnding() public static method

Append a Path.DirectorySeparatorChar to the end of the string if one does not already exist.
public static ForceDirectoryEnding ( string str ) : string
str string
return string

IsPathRootedUnderRoot() public static method

Gets whether or not the given path has exists under the given rootDirectory.
public static IsPathRootedUnderRoot ( string path, string rootDirectory ) : bool
path string
rootDirectory string
return bool

ResolveRelativePath() public static method

Resolve a relative path against the given root path.
public static ResolveRelativePath ( string relativePath, string resolutionRootFullPath ) : string
relativePath string Relative path to resolve
resolutionRootFullPath string Root full path for the resolution of
return string