C# 클래스 Utilities.FileUtilities

Utility class providing a collection of static utility methods.
파일 보기 프로젝트 열기: agardiner/hfmcmd

공개 메소드들

메소드 설명
ConvertWildcardPatternToRE ( string pattern ) : Regex

Converts a pattern containing ? and * characters into a case- insensitive regular expression.

EnsureDirExists ( string path ) : void

Checks if the specified directory exists, throwing an exception if it doesn't.

EnsureFileExists ( string path ) : void

Checks if the specified path exists, throwing an exception if it doesn't.

EnsureFileWriteable ( string path ) : void

Checks if the specified path can be written to.

FindMatchingFiles ( string sourceDir, string namePattern, bool includeSubDirs ) : List

Given a starting directory and a filename pattern, returns a list paths of files that match the name pattern.

GetBytes ( string str ) : byte[]

Convert a string to a byte array, using ASCII encoding.

GetDirectoryName ( string path ) : string

Returns the name of the directory, given a path to a directory

GetMatchingFiles ( string pathPattern ) : List

Given a path containing wildcards, returns the file(s) that match pattern.

PathDifference ( string path1, string path2 ) : string

Returns the part of path2 that is not in path1.

비공개 메소드들

메소드 설명
FindMatchingFiles ( string sourceDir, Regex nameRE, bool includeSubDirs, int depth ) : List

메소드 상세

ConvertWildcardPatternToRE() 공개 정적인 메소드

Converts a pattern containing ? and * characters into a case- insensitive regular expression.
public static ConvertWildcardPatternToRE ( string pattern ) : Regex
pattern string
리턴 System.Text.RegularExpressions.Regex

EnsureDirExists() 공개 정적인 메소드

Checks if the specified directory exists, throwing an exception if it doesn't.
public static EnsureDirExists ( string path ) : void
path string
리턴 void

EnsureFileExists() 공개 정적인 메소드

Checks if the specified path exists, throwing an exception if it doesn't.
public static EnsureFileExists ( string path ) : void
path string
리턴 void

EnsureFileWriteable() 공개 정적인 메소드

Checks if the specified path can be written to.
public static EnsureFileWriteable ( string path ) : void
path string
리턴 void

FindMatchingFiles() 공개 정적인 메소드

Given a starting directory and a filename pattern, returns a list paths of files that match the name pattern.
public static FindMatchingFiles ( string sourceDir, string namePattern, bool includeSubDirs ) : List
sourceDir string
namePattern string
includeSubDirs bool
리턴 List

GetBytes() 공개 정적인 메소드

Convert a string to a byte array, using ASCII encoding.
public static GetBytes ( string str ) : byte[]
str string
리턴 byte[]

GetDirectoryName() 공개 정적인 메소드

Returns the name of the directory, given a path to a directory
public static GetDirectoryName ( string path ) : string
path string
리턴 string

GetMatchingFiles() 공개 정적인 메소드

Given a path containing wildcards, returns the file(s) that match pattern.
public static GetMatchingFiles ( string pathPattern ) : List
pathPattern string
리턴 List

PathDifference() 공개 정적인 메소드

Returns the part of path2 that is not in path1.
public static PathDifference ( string path1, string path2 ) : string
path1 string
path2 string
리턴 string