C# 클래스 Duality.PathHelper

Provides helper methods for handling Paths.
파일 보기 프로젝트 열기: BraveSirAndrew/duality

공개 메소드들

메소드 설명
CopyDirectory ( string sourcePath, string targetPath, bool overwrite = false, Predicate filter = null ) : bool

Deep-Copies the source directory to the target path.

FilesEqual ( string filePathA, string filePathB ) : bool

Determines whether the contents of two files are completely equal.

GetFileHash ( string filePath ) : int

Calculates a hash value from the full (byte by byte) content of a file.

GetFreePath ( string pathBase, string pathExt ) : string

Returns a path that isn't taken yet.

GetMutualDirectory ( string path, string path2 ) : string

Returns a mutual base path of two different paths.

GetValidFileName ( string fileName ) : string

Takes a string that is supposed to be a file name and converts it into an actually valid file name, replacing invalid characters by undercores.

IsPathLocatedIn ( string path, string baseDir ) : bool

Returns whether one path is a sub-path of another.

IsPathVisible ( string path ) : bool

Returns whether the specified file or directory is visible, i.e. not hidden.

MakeFilePathRelative ( string filePath, string relativeToDir = "." ) : string

Returns the relative path from one path to another.

비공개 메소드들

메소드 설명
IsPathValid ( string path ) : bool

메소드 상세

CopyDirectory() 공개 정적인 메소드

Deep-Copies the source directory to the target path.
public static CopyDirectory ( string sourcePath, string targetPath, bool overwrite = false, Predicate filter = null ) : bool
sourcePath string
targetPath string
overwrite bool
filter Predicate
리턴 bool

FilesEqual() 공개 정적인 메소드

Determines whether the contents of two files are completely equal.
public static FilesEqual ( string filePathA, string filePathB ) : bool
filePathA string
filePathB string
리턴 bool

GetFileHash() 공개 정적인 메소드

Calculates a hash value from the full (byte by byte) content of a file.
public static GetFileHash ( string filePath ) : int
filePath string
리턴 int

GetFreePath() 공개 정적인 메소드

Returns a path that isn't taken yet.
public static GetFreePath ( string pathBase, string pathExt ) : string
pathBase string The path to use as base for finding a available path.
pathExt string The (file) extension to add to the new path.
리턴 string

GetMutualDirectory() 공개 정적인 메소드

Returns a mutual base path of two different paths.
public static GetMutualDirectory ( string path, string path2 ) : string
path string The first path.
path2 string The second path.
리턴 string

GetValidFileName() 공개 정적인 메소드

Takes a string that is supposed to be a file name and converts it into an actually valid file name, replacing invalid characters by undercores.
public static GetValidFileName ( string fileName ) : string
fileName string A string that is supposed to be a file name.
리턴 string

IsPathLocatedIn() 공개 정적인 메소드

Returns whether one path is a sub-path of another.
public static IsPathLocatedIn ( string path, string baseDir ) : bool
path string The supposed sub-path.
baseDir string The (directory) path in which the supposed sub-path might be located in.
리턴 bool

IsPathVisible() 공개 정적인 메소드

Returns whether the specified file or directory is visible, i.e. not hidden.
public static IsPathVisible ( string path ) : bool
path string
리턴 bool

MakeFilePathRelative() 공개 정적인 메소드

Returns the relative path from one path to another.
public static MakeFilePathRelative ( string filePath, string relativeToDir = "." ) : string
filePath string The path to make relative.
relativeToDir string The path to make it relative to.
리턴 string