-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIStorageFileOperations.cs
74 lines (65 loc) · 2.65 KB
/
IStorageFileOperations.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace MemStorage
{
/// <summary>
/// Contains methods to be implemented to handle storage files opertaions.
/// </summary>
interface IStorageFileOperations
{
/// <summary>
/// Creates the main directory to keep all other applications storage files inside.
/// </summary>
void CreateMainPath();
/// <summary>
/// Write to a storage file.
/// </summary>
/// <param name="fileName"></param>
/// <param name="content"></param>
void WriteToFile(string fileName, string content, StorageFileHandler.StorageType storageType);
/// <summary>
/// Overwrites a storage file.
/// </summary>
/// <param name="fileName"></param>
/// <param name="content"></param>
void OverWriteFile(string fileName, string content, StorageFileHandler.StorageType storageType);
/// <summary>
/// Checks whether a storage area is empty or not
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
bool IsEmpty(string path, StorageFileHandler.StorageType storageType);
/// <summary>
/// Returns the number of items stored in the storage file
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
int Count(string path, StorageFileHandler.StorageType storageType);
/// <summary>
/// Deletes all storage file belonging to a specific application.
/// </summary>
/// <param name="path"></param>
void DeleteAllFiles(string path, StorageFileHandler.StorageType storageType);
/// <summary>
/// Checks whether a storage file exists.
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
bool FileExists(string fileName);
/// <summary>
/// Checks whether a storage directory exists.
/// </summary>
/// <param name="dirName"></param>
/// <returns></returns>
bool DirectoryExists(string dirName, StorageFileHandler.StorageType storageType);
/// <summary>
/// Deletes a storage file
/// </summary>
/// <param name="fileName"></param>
void DeleteFile(string fileName, StorageFileHandler.StorageType storageType);
/// <summary>
/// Reads and returns the content of a storage file.
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
string ReadFile(string fileName, StorageFileHandler.StorageType storageType);
}
}