![]() |
BadScript 2
|
Defines the interface for a file system. More...
Public Member Functions | |
string | GetStartupDirectory () |
The Startup Directory of the Application. | |
bool | Exists (string path) |
Returns true if the given path is a file or directory. | |
bool | IsFile (string path) |
Returns true if the given path is a file. | |
bool | IsDirectory (string path) |
Returns true if the given path is a directory. | |
IEnumerable< string > | GetFiles (string path, string extension, bool recursive) |
Returns all files in the given directory that match the specified extension. | |
IEnumerable< string > | GetDirectories (string path, bool recursive) |
Returns all directories in the given directory. | |
void | CreateDirectory (string path, bool recursive=false) |
Creates a new directory. | |
void | DeleteDirectory (string path, bool recursive) |
Deletes a directory. | |
void | DeleteFile (string path) |
Deletes a file. | |
string | GetFullPath (string path) |
Returns the full path of the given path. | |
Stream | OpenRead (string path) |
Opens a file for reading. | |
Stream | OpenWrite (string path, BadWriteMode mode) |
Opens a file for writing. | |
string | GetCurrentDirectory () |
Returns the Current Directory. | |
void | SetCurrentDirectory (string path) |
Sets the current Directory. | |
void | Copy (string src, string dst, bool overwrite=true) |
Copies a file or directory to a new location. | |
void | Move (string src, string dst, bool overwrite=true) |
Moves a file or directory to a new location. | |
Defines the interface for a file system.
Definition at line 6 of file IFileSystem.cs.
void BadScript2.IO.IFileSystem.Copy | ( | string | src, |
string | dst, | ||
bool | overwrite = true |
||
) |
Copies a file or directory to a new location.
src | Source path |
dst | Destination path |
overwrite | Should file entries be overwritten? |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
void BadScript2.IO.IFileSystem.CreateDirectory | ( | string | path, |
bool | recursive = false |
||
) |
Creates a new directory.
path | The path to the directory |
recursive | If true, all parent directories will be created if they do not exist |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
void BadScript2.IO.IFileSystem.DeleteDirectory | ( | string | path, |
bool | recursive | ||
) |
Deletes a directory.
path | The path to the directory |
recursive | If true, all subdirectories will be deleted |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
void BadScript2.IO.IFileSystem.DeleteFile | ( | string | path | ) |
Deletes a file.
path | The path to the directory |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
bool BadScript2.IO.IFileSystem.Exists | ( | string | path | ) |
Returns true if the given path is a file or directory.
path | The path to check |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
string BadScript2.IO.IFileSystem.GetCurrentDirectory | ( | ) |
Returns the Current Directory.
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
IEnumerable< string > BadScript2.IO.IFileSystem.GetDirectories | ( | string | path, |
bool | recursive | ||
) |
Returns all directories in the given directory.
path | The path to the directory |
recursive | True if the search should be recursive |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
IEnumerable< string > BadScript2.IO.IFileSystem.GetFiles | ( | string | path, |
string | extension, | ||
bool | recursive | ||
) |
Returns all files in the given directory that match the specified extension.
path | The path to the directory |
extension | The extension to match |
recursive | True if the search should be recursive |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
string BadScript2.IO.IFileSystem.GetFullPath | ( | string | path | ) |
Returns the full path of the given path.
path | Path |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
string BadScript2.IO.IFileSystem.GetStartupDirectory | ( | ) |
The Startup Directory of the Application.
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
bool BadScript2.IO.IFileSystem.IsDirectory | ( | string | path | ) |
Returns true if the given path is a directory.
path | The path to check |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
bool BadScript2.IO.IFileSystem.IsFile | ( | string | path | ) |
Returns true if the given path is a file.
path | The path to check |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
void BadScript2.IO.IFileSystem.Move | ( | string | src, |
string | dst, | ||
bool | overwrite = true |
||
) |
Moves a file or directory to a new location.
src | Source path |
dst | Destination path |
overwrite | Should file entries be overwritten? |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
Stream BadScript2.IO.IFileSystem.OpenRead | ( | string | path | ) |
Opens a file for reading.
path | The path to the file |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
Stream BadScript2.IO.IFileSystem.OpenWrite | ( | string | path, |
BadWriteMode | mode | ||
) |
Opens a file for writing.
path | The path to the file |
mode | The Write Mode |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.
void BadScript2.IO.IFileSystem.SetCurrentDirectory | ( | string | path | ) |
Sets the current Directory.
path | the new current directory |
Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.