C# Class Microsoft.DocAsCode.Common.PathUtility

Datei anzeigen Open project: dotnet/docfx Class Usage Examples

Public Methods

Method Description
CopyFile ( string path, string targetPath, bool overwrite = false ) : void
CopyFilesToFolder ( this files, string sourceFolder, string destinationFolder, bool overwrite, Action messageHandler, bool>.Func errorHandler ) : IEnumerable
FormatPath ( this path, UriKind kind, string basePath = null ) : string

Also change backslash to forward slash

GetFileListFromFile ( string filePath ) : List
GetFullPath ( string folder, string href ) : string
IsPathUnderSpecificFolder ( string path, string folder ) : bool
IsRelativePath ( string path ) : bool
IsVaildFilePath ( string path ) : bool

http://stackoverflow.com/questions/422090/in-c-sharp-check-that-filename-is-possibly-valid-not-that-it-exists

MakeRelativePath ( string basePath, string absolutePath ) : string

Creates a relative path from one file or folder to another.

NormalizePath ( string path ) : string
SaveFileListToFile ( List fileList, string filePath ) : void
ToValidFilePath ( this input ) : string

Method Details

CopyFile() public static method

public static CopyFile ( string path, string targetPath, bool overwrite = false ) : void
path string
targetPath string
overwrite bool
return void

CopyFilesToFolder() public static method

public static CopyFilesToFolder ( this files, string sourceFolder, string destinationFolder, bool overwrite, Action messageHandler, bool>.Func errorHandler ) : IEnumerable
files this
sourceFolder string
destinationFolder string
overwrite bool
messageHandler Action
errorHandler bool>.Func
return IEnumerable

FormatPath() public static method

Also change backslash to forward slash
public static FormatPath ( this path, UriKind kind, string basePath = null ) : string
path this
kind UriKind
basePath string
return string

GetFileListFromFile() public static method

public static GetFileListFromFile ( string filePath ) : List
filePath string
return List

GetFullPath() public static method

public static GetFullPath ( string folder, string href ) : string
folder string
href string
return string

IsPathUnderSpecificFolder() public static method

public static IsPathUnderSpecificFolder ( string path, string folder ) : bool
path string
folder string
return bool

IsRelativePath() public static method

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

IsVaildFilePath() public static method

http://stackoverflow.com/questions/422090/in-c-sharp-check-that-filename-is-possibly-valid-not-that-it-exists
public static IsVaildFilePath ( string path ) : bool
path string
return bool

MakeRelativePath() public static method

Creates a relative path from one file or folder to another.
public static MakeRelativePath ( string basePath, string absolutePath ) : string
basePath string Contains the directory that defines the start of the relative path.
absolutePath string Contains the path that defines the endpoint of the relative path.
return string

NormalizePath() public static method

public static NormalizePath ( string path ) : string
path string
return string

SaveFileListToFile() public static method

public static SaveFileListToFile ( List fileList, string filePath ) : void
fileList List
filePath string
return void

ToValidFilePath() public static method

public static ToValidFilePath ( this input ) : string
input this
return string