BadScript 2
Loading...
Searching...
No Matches
BadScript2.IO.IFileSystem Interface Reference

Defines the interface for a file system. More...

Inheritance diagram for BadScript2.IO.IFileSystem:
BadScript2.IO.BadSystemFileSystem BadScript2.IO.OpenKM.BadOpenKmFileSystem BadScript2.IO.Virtual.BadVirtualFileSystem

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.
 

Detailed Description

Defines the interface for a file system.

Definition at line 6 of file IFileSystem.cs.

Member Function Documentation

◆ Copy()

void BadScript2.IO.IFileSystem.Copy ( string  src,
string  dst,
bool  overwrite = true 
)

Copies a file or directory to a new location.

Parameters
srcSource path
dstDestination path
overwriteShould file entries be overwritten?

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ CreateDirectory()

void BadScript2.IO.IFileSystem.CreateDirectory ( string  path,
bool  recursive = false 
)

Creates a new directory.

Parameters
pathThe path to the directory
recursiveIf 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.

◆ DeleteDirectory()

void BadScript2.IO.IFileSystem.DeleteDirectory ( string  path,
bool  recursive 
)

Deletes a directory.

Parameters
pathThe path to the directory
recursiveIf true, all subdirectories will be deleted

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ DeleteFile()

void BadScript2.IO.IFileSystem.DeleteFile ( string  path)

Deletes a file.

Parameters
pathThe path to the directory

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ Exists()

bool BadScript2.IO.IFileSystem.Exists ( string  path)

Returns true if the given path is a file or directory.

Parameters
pathThe path to check
Returns
true if the given path is a file or directory

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ GetCurrentDirectory()

string BadScript2.IO.IFileSystem.GetCurrentDirectory ( )

Returns the Current Directory.

Returns
The Current Directory

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ GetDirectories()

IEnumerable< string > BadScript2.IO.IFileSystem.GetDirectories ( string  path,
bool  recursive 
)

Returns all directories in the given directory.

Parameters
pathThe path to the directory
recursiveTrue if the search should be recursive
Returns
Enumeration of all directories in the given directory that match the specified extension

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ GetFiles()

IEnumerable< string > BadScript2.IO.IFileSystem.GetFiles ( string  path,
string  extension,
bool  recursive 
)

Returns all files in the given directory that match the specified extension.

Parameters
pathThe path to the directory
extensionThe extension to match
recursiveTrue if the search should be recursive
Returns
Enumeration of all files in the given directory that match the specified extension

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ GetFullPath()

string BadScript2.IO.IFileSystem.GetFullPath ( string  path)

Returns the full path of the given path.

Parameters
pathPath
Returns
Full Path

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ GetStartupDirectory()

string BadScript2.IO.IFileSystem.GetStartupDirectory ( )

The Startup Directory of the Application.

Returns
The Startup Directory of the Application

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ IsDirectory()

bool BadScript2.IO.IFileSystem.IsDirectory ( string  path)

Returns true if the given path is a directory.

Parameters
pathThe path to check
Returns
true if the given path is a directory

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ IsFile()

bool BadScript2.IO.IFileSystem.IsFile ( string  path)

Returns true if the given path is a file.

Parameters
pathThe path to check
Returns
true if the given path is a file

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ Move()

void BadScript2.IO.IFileSystem.Move ( string  src,
string  dst,
bool  overwrite = true 
)

Moves a file or directory to a new location.

Parameters
srcSource path
dstDestination path
overwriteShould file entries be overwritten?

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ OpenRead()

Stream BadScript2.IO.IFileSystem.OpenRead ( string  path)

Opens a file for reading.

Parameters
pathThe path to the file
Returns
File Stream

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ OpenWrite()

Stream BadScript2.IO.IFileSystem.OpenWrite ( string  path,
BadWriteMode  mode 
)

Opens a file for writing.

Parameters
pathThe path to the file
modeThe Write Mode
Returns
File Stream

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.

◆ SetCurrentDirectory()

void BadScript2.IO.IFileSystem.SetCurrentDirectory ( string  path)

Sets the current Directory.

Parameters
paththe new current directory

Implemented in BadScript2.IO.OpenKM.BadOpenKmFileSystem, BadScript2.IO.BadSystemFileSystem, and BadScript2.IO.Virtual.BadVirtualFileSystem.


The documentation for this interface was generated from the following file: