C# 클래스 Nexus.Client.Util.FileUtil

Utility functions to work with files.
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5 1 사용 예제들

공개 메소드들

메소드 설명
ClearAttributes ( DirectoryInfo p_difPath, bool p_booRecurse ) : void

Clears the attributes of the given directory.

This sets the directory's attributes to FileAttributes.Normal. This operation is optionally recursive.

ClearAttributes ( string p_strPath, bool p_booRecurse ) : void

Clears the attributes of the given path.

This sets the path's attributes to FileAttributes.Normal. This operation is optionally recursive.

ContainsInvalidPathChars ( string p_strPath ) : bool

Determines if the given path contains invalid characters.

Copy ( TxFileManager p_tfmFileManager, string p_strSource, string p_strDestination, bool>.Func p_fncCopyCallback ) : bool

Copies the source to the destination.

If the source is a directory, it is copied recursively.

Copy ( string p_strSource, string p_strDestination, bool>.Func p_fncCopyCallback ) : bool

Copies the source to the destination.

If the source is a directory, it is copied recursively.

CreateTempDirectory ( ) : string

Creates a temporary directory.

ForceDelete ( string p_strPath ) : void

Forces deletion of the given path.

This method is recursive if the given path is a directory. This method will clear read only/system attributes if required to delete the path.

IsDrivePath ( string p_strPath ) : bool

Determines whether or not the given path represents a drive.

IsValidPath ( string p_strPath ) : bool

Determines if the given path is valid.

Move ( string p_strFrom, string p_strTo, bool p_booOverwrite ) : void

Moves the specified file to the specified path, optionally overwritting any existing file.

NormalizePath ( string p_strPath ) : string

Normalizes the given path.

This removes multiple consecutive path separators and makes sure all path separators are Path.DirectorySeparatorChar.

RelativizePath ( string p_strRoot, string p_strPath ) : string

Generates a path that is relative to another path.

StripInvalidPathChars ( string p_strPath ) : string

Removes all invalid characters from the given path.

WriteAllBytes ( string p_strPath, byte p_bteData ) : void

Writes the given data to the specified file.

If the specified file exists, it will be overwritten. If the specified file does not exist, it is created. If the directory containing the specified file does not exist, it is created.

WriteAllText ( string p_strPath, string p_strData ) : void

Writes the given data to the specified file.

If the specified file exists, it will be overwritten. If the specified file does not exist, it is created. If the directory containing the specified file does not exist, it is created.

보호된 메소드들

메소드 설명
CreateTempDirectory ( string p_strBasePath ) : string

Creates a temporary directory rooted at the given path.

메소드 상세

ClearAttributes() 공개 정적인 메소드

Clears the attributes of the given directory.
This sets the directory's attributes to FileAttributes.Normal. This operation is optionally recursive.
public static ClearAttributes ( DirectoryInfo p_difPath, bool p_booRecurse ) : void
p_difPath System.IO.DirectoryInfo The directory whose attributes are to be cleared.
p_booRecurse bool Whether or not to clear the attributes on all children files and folers.
리턴 void

ClearAttributes() 공개 정적인 메소드

Clears the attributes of the given path.
This sets the path's attributes to FileAttributes.Normal. This operation is optionally recursive.
public static ClearAttributes ( string p_strPath, bool p_booRecurse ) : void
p_strPath string The path whose attributes are to be cleared.
p_booRecurse bool Whether or not to clear the attributes on all children files and folers.
리턴 void

ContainsInvalidPathChars() 공개 정적인 메소드

Determines if the given path contains invalid characters.
public static ContainsInvalidPathChars ( string p_strPath ) : bool
p_strPath string The path to examine.
리턴 bool

Copy() 공개 정적인 메소드

Copies the source to the destination.
If the source is a directory, it is copied recursively.
public static Copy ( TxFileManager p_tfmFileManager, string p_strSource, string p_strDestination, bool>.Func p_fncCopyCallback ) : bool
p_tfmFileManager ChinhDo.Transactions.TxFileManager The transactional file manager to use to copy the files.
p_strSource string The path from which to copy.
p_strDestination string The path to which to copy.
p_fncCopyCallback bool>.Func A callback method that notifies the caller when a file has been copied, /// and provides the opportunity to cancel the copy operation.
리턴 bool

Copy() 공개 정적인 메소드

Copies the source to the destination.
If the source is a directory, it is copied recursively.
public static Copy ( string p_strSource, string p_strDestination, bool>.Func p_fncCopyCallback ) : bool
p_strSource string The path from which to copy.
p_strDestination string The path to which to copy.
p_fncCopyCallback bool>.Func A callback method that notifies the caller when a file has been copied, /// and provides the opportunity to cancel the copy operation.
리턴 bool

CreateTempDirectory() 공개 메소드

Creates a temporary directory.
public CreateTempDirectory ( ) : string
리턴 string

CreateTempDirectory() 보호된 메소드

Creates a temporary directory rooted at the given path.
protected CreateTempDirectory ( string p_strBasePath ) : string
p_strBasePath string The path under which to create the temporary directory.
리턴 string

ForceDelete() 공개 정적인 메소드

Forces deletion of the given path.
This method is recursive if the given path is a directory. This method will clear read only/system attributes if required to delete the path.
public static ForceDelete ( string p_strPath ) : void
p_strPath string The path to delete.
리턴 void

IsDrivePath() 공개 정적인 메소드

Determines whether or not the given path represents a drive.
public static IsDrivePath ( string p_strPath ) : bool
p_strPath string The path for which it is to be determine whether it represents a drive.
리턴 bool

IsValidPath() 공개 정적인 메소드

Determines if the given path is valid.
public static IsValidPath ( string p_strPath ) : bool
p_strPath string The path to examine.
리턴 bool

Move() 공개 정적인 메소드

Moves the specified file to the specified path, optionally overwritting any existing file.
public static Move ( string p_strFrom, string p_strTo, bool p_booOverwrite ) : void
p_strFrom string The path to the file to move.
p_strTo string the path to which to move the file.
p_booOverwrite bool Whether to overwrite any file found at the destination.
리턴 void

NormalizePath() 공개 정적인 메소드

Normalizes the given path.
This removes multiple consecutive path separators and makes sure all path separators are Path.DirectorySeparatorChar.
public static NormalizePath ( string p_strPath ) : string
p_strPath string The path to normalize.
리턴 string

RelativizePath() 공개 정적인 메소드

Generates a path that is relative to another path.
Thrown if either parameter is null.
public static RelativizePath ( string p_strRoot, string p_strPath ) : string
p_strRoot string The root directory with respect to which the path will be made relative.
p_strPath string The path to make relative.
리턴 string

StripInvalidPathChars() 공개 정적인 메소드

Removes all invalid characters from the given path.
public static StripInvalidPathChars ( string p_strPath ) : string
p_strPath string The path to clean.
리턴 string

WriteAllBytes() 공개 정적인 메소드

Writes the given data to the specified file.
If the specified file exists, it will be overwritten. If the specified file does not exist, it is created. If the directory containing the specified file does not exist, it is created.
public static WriteAllBytes ( string p_strPath, byte p_bteData ) : void
p_strPath string The path to which to write the given data.
p_bteData byte The data to write to the file.
리턴 void

WriteAllText() 공개 정적인 메소드

Writes the given data to the specified file.
If the specified file exists, it will be overwritten. If the specified file does not exist, it is created. If the directory containing the specified file does not exist, it is created.
public static WriteAllText ( string p_strPath, string p_strData ) : void
p_strPath string The path to which to write the given text.
p_strData string The text to write to the file.
리턴 void