PeanutButter
Loading...
Searching...
No Matches
PeanutButter.FileSystem.LocalFileSystem Class Reference

More...

Inheritance diagram for PeanutButter.FileSystem.LocalFileSystem:
PeanutButter.FileSystem.IFileSystem

Public Member Functions

 LocalFileSystem ()
 Starts a local filesystem in the current working folder.
 LocalFileSystem (string start)
 Starts a local filesystem in the provided starting folder.
IEnumerable< string > List (string searchPattern="*")
 List any items within the root of the current filesystem, with an optional search pattern.
Parameters
searchPattern
Returns

IEnumerable< string > ListFiles (string searchPattern="*")
 List files within the root of the current filesystem, with an optional search pattern.
Parameters
searchPattern
Returns

IEnumerable< string > ListFolders (string searchPattern="*")
 List directories within the root of the current filesystem, with an optional search pattern.
Parameters
searchPattern
Returns

IEnumerable< string > ListRecursive (string searchPattern="*")
 List any any items recursively from the root of the current filesystem downward, with an optional search pattern.
Parameters
searchPattern
Returns

IEnumerable< string > ListFilesRecursive (string searchPattern="*")
 List files items recursively from the root of the current filesystem downward, with an optional search pattern.
Parameters
searchPattern
Returns

IEnumerable< string > ListFoldersRecursive (string searchPattern="*")
 List folders items recursively from the root of the current filesystem downward, with an optional search pattern.
Parameters
searchPattern
Returns

string GetCurrentDirectory ()
 Retrieves the current working directory within the filesystem.
Returns

void SetCurrentDirectory (string path)
 Set the current working directory within the filesystem.
Parameters
path

void Delete (string path)
 Delete a folder or file within the filesystem.
Parameters
path

void DeleteRecursive (string path)
 Recursively delete a folder (or nuke a file)
Parameters
path

void Copy (string sourcePath)
 Copy the file at the provided sourcePath into the current folder.
Parameters
sourcePath

void Copy (string sourcePath, string targetPath)
 Copy the file at the source path to the target path.
Parameters
sourcePath
targetPath

Stream OpenReader (string path)
 Open a stream-reader to the provided file path.
Parameters
path
Returns

Stream OpenWriter (string path)
 Open a stream-writer to the provided file path.
Parameters
path
Returns

Stream Open (string targetPath)
 Open a target path with all options (read-write) without destroying it.
Parameters
targetPath
Returns

void Move (string source, string target, bool overwrite=false)
 Move a file or.
Parameters
source
target
overwrite

string GetFullPathFor (string relativePath)
 Provides the full local path for the provided relative path.
Parameters
relativePath
Returns

bool FileExists (string path)
 Test if a file exists.
Parameters
path
Returns

bool FolderExists (string path)
 Test if a folder exists.
Parameters
path
Returns

Detailed Description

Constructor & Destructor Documentation

◆ LocalFileSystem()

PeanutButter.FileSystem.LocalFileSystem.LocalFileSystem ( string start)

Starts a local filesystem in the provided starting folder.

Parameters
start

Member Function Documentation

◆ Copy() [1/2]

void PeanutButter.FileSystem.LocalFileSystem.Copy ( string sourcePath)

Copy the file at the provided sourcePath into the current folder.

Parameters
sourcePath

Implements PeanutButter.FileSystem.IFileSystem.

◆ Copy() [2/2]

void PeanutButter.FileSystem.LocalFileSystem.Copy ( string sourcePath,
string targetPath )

Copy the file at the source path to the target path.

Parameters
sourcePath
targetPath

Implements PeanutButter.FileSystem.IFileSystem.

◆ Delete()

void PeanutButter.FileSystem.LocalFileSystem.Delete ( string path)

Delete a folder or file within the filesystem.

Parameters
path

Implements PeanutButter.FileSystem.IFileSystem.

◆ DeleteRecursive()

void PeanutButter.FileSystem.LocalFileSystem.DeleteRecursive ( string path)

Recursively delete a folder (or nuke a file)

Parameters
path

Implements PeanutButter.FileSystem.IFileSystem.

◆ FileExists()

bool PeanutButter.FileSystem.LocalFileSystem.FileExists ( string path)

Test if a file exists.

Parameters
path
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ FolderExists()

bool PeanutButter.FileSystem.LocalFileSystem.FolderExists ( string path)

Test if a folder exists.

Parameters
path
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ GetCurrentDirectory()

string PeanutButter.FileSystem.LocalFileSystem.GetCurrentDirectory ( )

Retrieves the current working directory within the filesystem.

Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ GetFullPathFor()

string PeanutButter.FileSystem.LocalFileSystem.GetFullPathFor ( string relativePath)

Provides the full local path for the provided relative path.

Parameters
relativePath
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ List()

IEnumerable< string > PeanutButter.FileSystem.LocalFileSystem.List ( string searchPattern = "*")

List any items within the root of the current filesystem, with an optional search pattern.

Parameters
searchPattern
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ ListFiles()

IEnumerable< string > PeanutButter.FileSystem.LocalFileSystem.ListFiles ( string searchPattern = "*")

List files within the root of the current filesystem, with an optional search pattern.

Parameters
searchPattern
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ ListFilesRecursive()

IEnumerable< string > PeanutButter.FileSystem.LocalFileSystem.ListFilesRecursive ( string searchPattern = "*")

List files items recursively from the root of the current filesystem downward, with an optional search pattern.

Parameters
searchPattern
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ ListFolders()

IEnumerable< string > PeanutButter.FileSystem.LocalFileSystem.ListFolders ( string searchPattern = "*")

List directories within the root of the current filesystem, with an optional search pattern.

Parameters
searchPattern
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ ListFoldersRecursive()

IEnumerable< string > PeanutButter.FileSystem.LocalFileSystem.ListFoldersRecursive ( string searchPattern = "*")

List folders items recursively from the root of the current filesystem downward, with an optional search pattern.

Parameters
searchPattern
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ ListRecursive()

IEnumerable< string > PeanutButter.FileSystem.LocalFileSystem.ListRecursive ( string searchPattern = "*")

List any any items recursively from the root of the current filesystem downward, with an optional search pattern.

Parameters
searchPattern
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ Move()

void PeanutButter.FileSystem.LocalFileSystem.Move ( string source,
string target,
bool overwrite = false )

Move a file or.

Parameters
source
target
overwrite

Implements PeanutButter.FileSystem.IFileSystem.

◆ Open()

Stream PeanutButter.FileSystem.LocalFileSystem.Open ( string targetPath)

Open a target path with all options (read-write) without destroying it.

Parameters
targetPath
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ OpenReader()

Stream PeanutButter.FileSystem.LocalFileSystem.OpenReader ( string path)

Open a stream-reader to the provided file path.

Parameters
path
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ OpenWriter()

Stream PeanutButter.FileSystem.LocalFileSystem.OpenWriter ( string path)

Open a stream-writer to the provided file path.

Parameters
path
Returns

Implements PeanutButter.FileSystem.IFileSystem.

◆ SetCurrentDirectory()

void PeanutButter.FileSystem.LocalFileSystem.SetCurrentDirectory ( string path)

Set the current working directory within the filesystem.

Parameters
path

Implements PeanutButter.FileSystem.IFileSystem.


The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.FileSystem/LocalFilesystem.cs