Table of Contents

Interface IFileManager

Namespace
Whim
Assembly
Whim.dll
Manages files and directories for Whim.
public interface IFileManager

Properties

LogsDir

The path to the Whim logs directory.
string LogsDir { get; }

Property Value

string

SavedStateDir

The path to the saved state directory.
string SavedStateDir { get; }

Property Value

string

WhimDir

The path to the Whim directory.
string WhimDir { get; }

Property Value

string

Methods

DeleteFile(string)

Deletes the file at the given filePath.
void DeleteFile(string filePath)

Parameters

filePath string

EnsureDirExists(string)

Ensures the given dir exists. If it does not, it is created.
void EnsureDirExists(string dir)

Parameters

dir string
The directory to ensure exists.

FileExists(string)

Checks whether the given filePath exists.
bool FileExists(string filePath)

Parameters

filePath string
The file path to check.

Returns

bool
Whether the file exists.

GetWhimFileDir(string)

Gets a file path in the Whim directory.
string GetWhimFileDir(string fileName)

Parameters

fileName string
The file name.

Returns

string
The file path.

GetWhimFileLogsDir(string)

Gets a file path in the Whim logs directory.
string GetWhimFileLogsDir(string fileName)

Parameters

fileName string
The file name.

Returns

string
The file path inside the logs directory.

OpenRead(string)

Opens an existing file for reading.
Stream OpenRead(string filePath)

Parameters

filePath string
The file path.

Returns

Stream
The file stream.

ReadAllText(string)

Opens a text file, reads all the text in the file, and then closes the file.
string ReadAllText(string filePath)

Parameters

filePath string
The file path.

Returns

string
A string containing all the text in the file.

WriteAllText(string, string)

WRites the given contents to the given filePath.
void WriteAllText(string filePath, string contents)

Parameters

filePath string
The file path.
contents string
The contents to write.