C# Class NUnit.ProjectEditor.PathUtils

Static methods for manipulating project paths, including both directories and files. Some synonyms for System.Path methods are included as well.
Datei anzeigen Open project: nunit/nunit-project-editor

Public Properties

Property Type Description
SEPARATORS char[]

Protected Properties

Property Type Description
PreferredDirectorySeparatorChar char

Public Methods

Method Description
Canonicalize ( string path ) : string

Return the canonical form of a path, using '/' as the directory separator

IsAssemblyFileType ( string path ) : bool
RelativePath ( string from, string to ) : string

Returns the relative path from a base directory to another directory or file.

SamePath ( string path1, string path2, bool ignoreCase = false ) : bool

True if the two paths are the same. However, two paths to the same file or directory using different network shares or drive letters are not treated as equal.

SamePathOrUnder ( string path1, string path2, bool ignoreCase = false ) : bool

True if the two paths are the same or if the second is directly or indirectly under the first. Note that paths using different network shares or drive letters are considered unrelated, even if they end up referencing the same subtrees in the file system.

Private Methods

Method Description
PathUtils ( ) : System
PathsEqual ( string path1, string path2 ) : bool
SplitPath ( string path ) : string[]

Method Details

Canonicalize() public static method

Return the canonical form of a path, using '/' as the directory separator
public static Canonicalize ( string path ) : string
path string
return string

IsAssemblyFileType() public static method

public static IsAssemblyFileType ( string path ) : bool
path string
return bool

RelativePath() public static method

Returns the relative path from a base directory to another directory or file.
public static RelativePath ( string from, string to ) : string
from string
to string
return string

SamePath() public static method

True if the two paths are the same. However, two paths to the same file or directory using different network shares or drive letters are not treated as equal.
public static SamePath ( string path1, string path2, bool ignoreCase = false ) : bool
path1 string
path2 string
ignoreCase bool
return bool

SamePathOrUnder() public static method

True if the two paths are the same or if the second is directly or indirectly under the first. Note that paths using different network shares or drive letters are considered unrelated, even if they end up referencing the same subtrees in the file system.
public static SamePathOrUnder ( string path1, string path2, bool ignoreCase = false ) : bool
path1 string
path2 string
ignoreCase bool
return bool

Property Details

PreferredDirectorySeparatorChar protected_oe static_oe property

protected static char PreferredDirectorySeparatorChar
return char

SEPARATORS public_oe static_oe property

public static char[] SEPARATORS
return char[]