- Initial commit
This commit is contained in:
74
Runtime/Shared/PlatformSupport/FileSystem/IIOService.cs
Normal file
74
Runtime/Shared/PlatformSupport/FileSystem/IIOService.cs
Normal file
@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Best.HTTP.Shared.PlatformSupport.FileSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// These are the different modes that the plugin want's to use a filestream.
|
||||
/// </summary>
|
||||
public enum FileStreamModes
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new file.
|
||||
/// </summary>
|
||||
Create,
|
||||
|
||||
/// <summary>
|
||||
/// Open an existing file for reading.
|
||||
/// </summary>
|
||||
OpenRead,
|
||||
|
||||
/// <summary>
|
||||
/// Open or create a file for read and write.
|
||||
/// </summary>
|
||||
OpenReadWrite,
|
||||
|
||||
/// <summary>
|
||||
/// Open an existing file for writing to the end.
|
||||
/// </summary>
|
||||
Append
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for file-system abstraction.
|
||||
/// </summary>
|
||||
public interface IIOService
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a directory for the given path.
|
||||
/// </summary>
|
||||
void DirectoryCreate(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the directory exists for the given path.
|
||||
/// </summary>
|
||||
bool DirectoryExists(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Delete the directory.
|
||||
/// </summary>
|
||||
void DirectoryDelete(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Return with the file names for the given path.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
string[] GetFiles(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Delete the file for the given path.
|
||||
/// </summary>
|
||||
void FileDelete(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the file exists on the given path.
|
||||
/// </summary>
|
||||
bool FileExists(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Create a stream that can read and/or write a file on the given path.
|
||||
/// </summary>
|
||||
Stream CreateFileStream(string path, FileStreamModes mode);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user