Class Storage
Provides a folder of small text files that its provider keeps; OpenStorage(string) gives a folder inside it. It takes names, never paths, so whoever holds one stays inside its folder, links on the disk aside.
public sealed class Storage
- Inheritance
-
Storage
- Inherited Members
- Extension Methods
Constructors
Storage(IStorageProvider, string)
Provides a folder of small text files that its provider keeps; OpenStorage(string) gives a folder inside it. It takes names, never paths, so whoever holds one stays inside its folder, links on the disk aside.
public Storage(IStorageProvider provider, string folderPath)
Parameters
providerIStorageProviderThe provider that keeps the files.
folderPathstringThe folder's path.
Properties
FolderPath
Gets the folder's full path, for plain files beside the provider's; a provider that keeps entries, not files, has nothing there.
public string FolderPath { get; }
Property Value
Methods
Delete(string)
Deletes a file; a missing one is passed over.
public void Delete(string name)
Parameters
namestringThe file's name.
Exceptions
- ArgumentException
nameis a path, empty,.or...
GetSignature(string)
Gets a signature of a file, which changes when the file is written as a rule.
public string GetSignature(string name)
Parameters
namestringThe file's name.
Returns
- string
The signature.
Exceptions
- ArgumentException
nameis a path, empty,.or...
OpenStorage(string)
Opens a folder inside this one.
public Storage OpenStorage(string name)
Parameters
namestringThe folder's name.
Returns
- Storage
The folder's storage.
Exceptions
- ArgumentException
nameis a path, empty,.or...
Read(string)
Reads a file's text.
public string? Read(string name)
Parameters
namestringThe file's name.
Returns
Exceptions
- ArgumentException
nameis a path, empty,.or...
Write(string, string)
Writes a file's text, whole or not at all.
public void Write(string name, string content)
Parameters
Exceptions
- ArgumentException
nameis a path, empty,.or...