C# Class Gammtek.Conduit.IO.ConduitPath

Show file Open project: ME3Explorer/ME3Explorer

Public Methods

Method Description
CleanDirectorySeparators ( string filePath, char directorySeparatorChar = '\0' ) : string

Takes a path string and makes all of the path separator characters consistent. Also removes unnecessary multiple separators.

GetExecutingAssemblyDirectory ( ) : string

Gets the executing assembly directory. This method is using Assembly.CodeBase property to properly resolve original assembly directory in case shadow copying is enabled.

GetExecutingAssemblyLocation ( ) : string

Gets the executing assembly path (including filename). This method is using Assembly.CodeBase property to properly resolve original assembly path in case shadow copying is enabled.

MakePathRelativeTo ( string sourcePath, string relativeToDirectory, bool treatSourceAsDirectory = false ) : string

Given a file path and a directory, returns a file path that is relative to the specified directory

Method Details

CleanDirectorySeparators() public static method

Takes a path string and makes all of the path separator characters consistent. Also removes unnecessary multiple separators.
public static CleanDirectorySeparators ( string filePath, char directorySeparatorChar = '\0' ) : string
filePath string File path with potentially inconsistent slashes
directorySeparatorChar char
return string

GetExecutingAssemblyDirectory() public static method

Gets the executing assembly directory. This method is using Assembly.CodeBase property to properly resolve original assembly directory in case shadow copying is enabled.
public static GetExecutingAssemblyDirectory ( ) : string
return string

GetExecutingAssemblyLocation() public static method

Gets the executing assembly path (including filename). This method is using Assembly.CodeBase property to properly resolve original assembly path in case shadow copying is enabled.
public static GetExecutingAssemblyLocation ( ) : string
return string

MakePathRelativeTo() public static method

Given a file path and a directory, returns a file path that is relative to the specified directory
public static MakePathRelativeTo ( string sourcePath, string relativeToDirectory, bool treatSourceAsDirectory = false ) : string
sourcePath string File path to convert
relativeToDirectory string /// The directory that the source file path should be converted to be relative to. If this path is not rooted, it will /// be assumed to be relative to the current working directory. ///
treatSourceAsDirectory bool True if we should treat the source path like a directory even if it doesn't end with a path separator
return string