C# Class CSharpUtils.VirtualFileSystem.FileSystem

Inheritance: IDisposable
Show file Open project: soywiz/csharputils Class Usage Examples

Public Methods

Method Description
AbsoluteNormalizePath ( String Path, String CurrentWorkingPath = "" ) : String
CombinePath ( String BasePath, String PathToCombine ) : String
ComparablePath ( String Path ) : String
Copy ( string SrcFile, string DstFile, bool Overwrite = false ) : void
CopyFile ( FileSystem SourceFileSystem, String SourcePath, FileSystem DestFileSystem, String DestPath ) : void

CopyTree ( FileSystem SourceFileSystem, String SourcePath, FileSystem DestFileSystem, String DestPath, bool>.Func ActionValidate = null, Action ActionProgress = null, byte Buffer = null ) : void

CreateDirectory ( String Path, int Mode = 0777, bool ThrowErrorIfNotExists = true ) : void

CreateSymLink ( String Pointer, String Pointee ) : void

DeleteDirectory ( String Path ) : void

DeleteFile ( String Path ) : void

Dispose ( ) : void
Exists ( string FileName ) : bool

FileSystemFromPath ( String Path, bool AllowAccessingParent = false ) : FileSystemFromPath
FindFiles ( String Path ) : IEnumerable

FindFiles ( String Path, Regex Regex ) : IEnumerable

FindFiles ( String Path, Wildcard Wildcard ) : IEnumerable

FindMountedFiles ( String NewPath ) : IEnumerable

GetFileInfo ( String Path ) : FileSystemEntry

GetFileTime ( String Path ) : FileSystemEntry.FileTime

Mount ( String Path, FileSystem FileSystemToMount, String FileSystemToMountPath = "/" ) : void
MoveFile ( String ExistingFileName, String NewFileName, bool ReplaceExisiting ) : void

OpenFile ( String FileName, FileMode FileMode ) : FileSystemFileStream

OpenFileCreate ( String FileName ) : FileSystemFileStream

OpenFileCreateScope ( String FileName, Action Action ) : void

OpenFileRW ( String FileName ) : FileSystemFileStream

OpenFileRWScope ( String FileName, Action Action ) : void

OpenFileRead ( String FileName ) : FileSystemFileStream

OpenFileReadScope ( String FileName, Action Action ) : void

OpenFileScope ( String FileName, FileMode FileMode, Action Action ) : void

ReadAllBytes ( string FileName ) : byte[]

ReplaceFileWithStream ( String Path, Stream NewStream, long>.Action Progress = null ) : void
SetFileTime ( String Path, FileSystemEntry FileTime ) : void

Shutdown ( ) : void
TryInitialize ( ) : void
UnMount ( String Path ) : void
WriteAllBytes ( string FileName, byte Buffer ) : void

Protected Methods

Method Description
Access ( String Path, FileSystem &NewFileSystem, String &NewPath ) : void
FilterFileSystemEntry ( FileSystemEntry FileSystemEntry ) : FileSystemEntry

ImplCreateDirectory ( String Path, int Mode = 0777 ) : void

ImplCreateSymLink ( String Pointer, String Pointee ) : void

ImplDeleteDirectory ( String Path ) : void

ImplDeleteFile ( String Path ) : void

ImplFindFiles ( String Path ) : IEnumerable

ImplGetFileInfo ( String Path ) : FileSystemEntry

ImplMoveFile ( String ExistingFileName, String NewFileName, bool ReplaceExisiting ) : void

ImplOpenFile ( String FileName, FileMode FileMode ) : FileSystemFileStream

ImplSetFileTime ( String Path, FileSystemEntry FileTime ) : void

Method Details

AbsoluteNormalizePath() static public method

static public AbsoluteNormalizePath ( String Path, String CurrentWorkingPath = "" ) : String
Path String
CurrentWorkingPath String
return String

Access() protected method

protected Access ( String Path, FileSystem &NewFileSystem, String &NewPath ) : void
Path String
NewFileSystem FileSystem
NewPath String
return void

CombinePath() static public method

static public CombinePath ( String BasePath, String PathToCombine ) : String
BasePath String
PathToCombine String
return String

ComparablePath() public method

public ComparablePath ( String Path ) : String
Path String
return String

Copy() public method

public Copy ( string SrcFile, string DstFile, bool Overwrite = false ) : void
SrcFile string
DstFile string
Overwrite bool
return void

CopyFile() static public method

static public CopyFile ( FileSystem SourceFileSystem, String SourcePath, FileSystem DestFileSystem, String DestPath ) : void
SourceFileSystem FileSystem
SourcePath String
DestFileSystem FileSystem
DestPath String
return void

CopyTree() static public method

static public CopyTree ( FileSystem SourceFileSystem, String SourcePath, FileSystem DestFileSystem, String DestPath, bool>.Func ActionValidate = null, Action ActionProgress = null, byte Buffer = null ) : void
SourceFileSystem FileSystem
SourcePath String
DestFileSystem FileSystem
DestPath String
ActionValidate bool>.Func
ActionProgress Action
Buffer byte
return void

CreateDirectory() public method

public CreateDirectory ( String Path, int Mode = 0777, bool ThrowErrorIfNotExists = true ) : void
Path String
Mode int
ThrowErrorIfNotExists bool
return void

CreateSymLink() public method

public CreateSymLink ( String Pointer, String Pointee ) : void
Pointer String
Pointee String
return void

DeleteDirectory() public method

public DeleteDirectory ( String Path ) : void
Path String
return void

DeleteFile() public method

public DeleteFile ( String Path ) : void
Path String
return void

Dispose() public method

public Dispose ( ) : void
return void

Exists() public method

public Exists ( string FileName ) : bool
FileName string
return bool

FileSystemFromPath() public method

public FileSystemFromPath ( String Path, bool AllowAccessingParent = false ) : FileSystemFromPath
Path String
AllowAccessingParent bool
return FileSystemFromPath

FilterFileSystemEntry() protected method

protected FilterFileSystemEntry ( FileSystemEntry FileSystemEntry ) : FileSystemEntry
FileSystemEntry FileSystemEntry
return FileSystemEntry

FindFiles() public method

public FindFiles ( String Path ) : IEnumerable
Path String
return IEnumerable

FindFiles() public method

public FindFiles ( String Path, Regex Regex ) : IEnumerable
Path String
Regex System.Text.RegularExpressions.Regex
return IEnumerable

FindFiles() public method

public FindFiles ( String Path, Wildcard Wildcard ) : IEnumerable
Path String
Wildcard Wildcard
return IEnumerable

FindMountedFiles() public method

public FindMountedFiles ( String NewPath ) : IEnumerable
NewPath String
return IEnumerable

GetFileInfo() public method

public GetFileInfo ( String Path ) : FileSystemEntry
Path String
return FileSystemEntry

GetFileTime() public method

public GetFileTime ( String Path ) : FileSystemEntry.FileTime
Path String
return FileSystemEntry.FileTime

ImplCreateDirectory() abstract protected method

abstract protected ImplCreateDirectory ( String Path, int Mode = 0777 ) : void
Path String
Mode int
return void

ImplCreateSymLink() abstract protected method

abstract protected ImplCreateSymLink ( String Pointer, String Pointee ) : void
Pointer String
Pointee String
return void

ImplDeleteDirectory() abstract protected method

abstract protected ImplDeleteDirectory ( String Path ) : void
Path String
return void

ImplDeleteFile() abstract protected method

abstract protected ImplDeleteFile ( String Path ) : void
Path String
return void

ImplFindFiles() abstract protected method

abstract protected ImplFindFiles ( String Path ) : IEnumerable
Path String
return IEnumerable

ImplGetFileInfo() abstract protected method

abstract protected ImplGetFileInfo ( String Path ) : FileSystemEntry
Path String
return FileSystemEntry

ImplMoveFile() abstract protected method

abstract protected ImplMoveFile ( String ExistingFileName, String NewFileName, bool ReplaceExisiting ) : void
ExistingFileName String
NewFileName String
ReplaceExisiting bool
return void

ImplOpenFile() abstract protected method

abstract protected ImplOpenFile ( String FileName, FileMode FileMode ) : FileSystemFileStream
FileName String
FileMode FileMode
return FileSystemFileStream

ImplSetFileTime() abstract protected method

abstract protected ImplSetFileTime ( String Path, FileSystemEntry FileTime ) : void
Path String
FileTime FileSystemEntry
return void

Mount() public method

public Mount ( String Path, FileSystem FileSystemToMount, String FileSystemToMountPath = "/" ) : void
Path String
FileSystemToMount FileSystem
FileSystemToMountPath String
return void

MoveFile() public method

public MoveFile ( String ExistingFileName, String NewFileName, bool ReplaceExisiting ) : void
ExistingFileName String
NewFileName String
ReplaceExisiting bool
return void

OpenFile() public method

public OpenFile ( String FileName, FileMode FileMode ) : FileSystemFileStream
FileName String
FileMode FileMode
return FileSystemFileStream

OpenFileCreate() public method

public OpenFileCreate ( String FileName ) : FileSystemFileStream
FileName String
return FileSystemFileStream

OpenFileCreateScope() public method

public OpenFileCreateScope ( String FileName, Action Action ) : void
FileName String
Action Action
return void

OpenFileRW() public method

public OpenFileRW ( String FileName ) : FileSystemFileStream
FileName String
return FileSystemFileStream

OpenFileRWScope() public method

public OpenFileRWScope ( String FileName, Action Action ) : void
FileName String
Action Action
return void

OpenFileRead() public method

public OpenFileRead ( String FileName ) : FileSystemFileStream
FileName String
return FileSystemFileStream

OpenFileReadScope() public method

public OpenFileReadScope ( String FileName, Action Action ) : void
FileName String
Action Action
return void

OpenFileScope() public method

public OpenFileScope ( String FileName, FileMode FileMode, Action Action ) : void
FileName String
FileMode FileMode
Action Action
return void

ReadAllBytes() public method

public ReadAllBytes ( string FileName ) : byte[]
FileName string
return byte[]

ReplaceFileWithStream() public method

public ReplaceFileWithStream ( String Path, Stream NewStream, long>.Action Progress = null ) : void
Path String
NewStream Stream
Progress long>.Action
return void

SetFileTime() public method

public SetFileTime ( String Path, FileSystemEntry FileTime ) : void
Path String
FileTime FileSystemEntry
return void

Shutdown() public method

public Shutdown ( ) : void
return void

TryInitialize() public method

public TryInitialize ( ) : void
return void

UnMount() public method

public UnMount ( String Path ) : void
Path String
return void

WriteAllBytes() public method

public WriteAllBytes ( string FileName, byte Buffer ) : void
FileName string
Buffer byte
return void