-
Notifications
You must be signed in to change notification settings - Fork 5
/
SubFileSystem.hpp
38 lines (30 loc) · 1.19 KB
/
SubFileSystem.hpp
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
#ifndef ___INANITY_SUB_FILE_SYSTEM_HPP___
#define ___INANITY_SUB_FILE_SYSTEM_HPP___
#include "FileSystem.hpp"
BEGIN_INANITY
/// Filesystem which is a subfolder of a given filesystem.
class SubFileSystem : public FileSystem
{
private:
ptr<FileSystem> fileSystem;
String path;
String GetName(const String& fileName) const;
public:
SubFileSystem(ptr<FileSystem> fileSystem, const String& userPath);
// FileSystem methods.
ptr<File> LoadFile(const String& fileName);
ptr<File> TryLoadFile(const String& fileName);
ptr<InputStream> LoadStream(const String& fileName);
void SaveFile(ptr<File> file, const String& fileName);
ptr<OutputStream> SaveStream(const String& fileName);
time_t GetFileMTime(const String& fileName);
// void GetFileNames(std::vector<String>& fileNames) const;
void GetDirectoryEntries(const String& directoryName, std::vector<String>& entries) const;
void GetAllDirectoryEntries(const String& directoryName, std::vector<String>& entries) const;
void MakeDirectory(const String& directoryName);
void DeleteEntry(const String& entryName);
EntryType GetEntryType(const String& entryName) const;
ptr<FileSystem> GetSubFileSystem(const String& folderName);
};
END_INANITY
#endif