C# Class AssemblyCSharp.FileHelper

显示文件 Open project: wooga/ps_social_jam

Private Properties

Property Type Description
CompareHashes bool

Public Methods

Method Description
CopyStream ( Stream inputStream, Stream outputStream, string seed = null ) : byte[]
CreateEmptyFile ( string filename ) : void
CreateNonExistentDirectory ( string path ) : void
CreateParentDirectoryForFile ( string path ) : void
CreateTmpName ( string path ) : string
DeleteDirectory ( string path ) : void
DeleteDirectorySilently ( string path ) : void
DeleteFile ( string filePath ) : void
DeleteFileSilently ( string filePath ) : void
DirectoryCopy ( string sourceDirName, string destDirName ) : void
GetFingerprint ( byte hash, int length = 8 ) : string
GetMD5OfFile ( string filename, string seed = null ) : byte[]
GetMD5OfString ( string value, string seed = null ) : byte[]
PathExists ( string path ) : bool
ReadAllText ( string path, string defaultValue = null ) : string
TryReadHashProtectedTextFile ( string filename, string manifest, string seed ) : string
VerifyExpandedArchive ( string baseDirectory, Predicate shouldCheck = null, string manifestName = "manifest.txt" ) : bool
WriteAllTextAtomic ( string filePath, string value, bool deleteOnError ) : void
WriteAllTextAtomicWithManifest ( string filename, string value, string manifest, string seed, bool deleteOnError ) : void
WriteFileAtomic ( string filePath, byte contents, bool deleteOnError ) : void

Private Methods

Method Description
CompareHashes ( byte a1, byte a2 ) : bool

Method Details

CopyStream() public static method

public static CopyStream ( Stream inputStream, Stream outputStream, string seed = null ) : byte[]
inputStream Stream
outputStream Stream
seed string
return byte[]

CreateEmptyFile() public static method

public static CreateEmptyFile ( string filename ) : void
filename string
return void

CreateNonExistentDirectory() public static method

public static CreateNonExistentDirectory ( string path ) : void
path string
return void

CreateParentDirectoryForFile() public static method

public static CreateParentDirectoryForFile ( string path ) : void
path string
return void

CreateTmpName() public static method

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

DeleteDirectory() public static method

public static DeleteDirectory ( string path ) : void
path string
return void

DeleteDirectorySilently() public static method

public static DeleteDirectorySilently ( string path ) : void
path string
return void

DeleteFile() public static method

public static DeleteFile ( string filePath ) : void
filePath string
return void

DeleteFileSilently() public static method

public static DeleteFileSilently ( string filePath ) : void
filePath string
return void

DirectoryCopy() public static method

public static DirectoryCopy ( string sourceDirName, string destDirName ) : void
sourceDirName string
destDirName string
return void

GetFingerprint() public static method

public static GetFingerprint ( byte hash, int length = 8 ) : string
hash byte
length int
return string

GetMD5OfFile() public static method

public static GetMD5OfFile ( string filename, string seed = null ) : byte[]
filename string
seed string
return byte[]

GetMD5OfString() public static method

public static GetMD5OfString ( string value, string seed = null ) : byte[]
value string
seed string
return byte[]

PathExists() public static method

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

ReadAllText() public static method

public static ReadAllText ( string path, string defaultValue = null ) : string
path string
defaultValue string
return string

TryReadHashProtectedTextFile() public static method

public static TryReadHashProtectedTextFile ( string filename, string manifest, string seed ) : string
filename string
manifest string
seed string
return string

VerifyExpandedArchive() public static method

public static VerifyExpandedArchive ( string baseDirectory, Predicate shouldCheck = null, string manifestName = "manifest.txt" ) : bool
baseDirectory string
shouldCheck Predicate
manifestName string
return bool

WriteAllTextAtomic() public static method

public static WriteAllTextAtomic ( string filePath, string value, bool deleteOnError ) : void
filePath string
value string
deleteOnError bool
return void

WriteAllTextAtomicWithManifest() public static method

public static WriteAllTextAtomicWithManifest ( string filename, string value, string manifest, string seed, bool deleteOnError ) : void
filename string
value string
manifest string
seed string
deleteOnError bool
return void

WriteFileAtomic() public static method

public static WriteFileAtomic ( string filePath, byte contents, bool deleteOnError ) : void
filePath string
contents byte
deleteOnError bool
return void