summaryrefslogtreecommitdiff
path: root/src/core/file_sys/filesystem.h
diff options
context:
space:
mode:
authorGravatar Subv2018-02-19 00:32:00 -0500
committerGravatar Subv2018-03-01 19:03:52 -0500
commitd140c8ecf7514e925340cbd3340991c8df0d0c15 (patch)
treed0a91ded4bde7eb1d73f9e6617871d8ff37f08bd /src/core/file_sys/filesystem.h
parentResultCode: Mark any error code that isn't 0 as an error. (diff)
downloadyuzu-d140c8ecf7514e925340cbd3340991c8df0d0c15.tar.gz
yuzu-d140c8ecf7514e925340cbd3340991c8df0d0c15.tar.xz
yuzu-d140c8ecf7514e925340cbd3340991c8df0d0c15.zip
Filesystem: Added a SaveData Factory and associated Disk_FileSystem.
Diffstat (limited to 'src/core/file_sys/filesystem.h')
-rw-r--r--src/core/file_sys/filesystem.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/core/file_sys/filesystem.h b/src/core/file_sys/filesystem.h
index 02705506b..df4e66a0b 100644
--- a/src/core/file_sys/filesystem.h
+++ b/src/core/file_sys/filesystem.h
@@ -27,11 +27,14 @@ enum LowPathType : u32 {
27 Wchar = 4, 27 Wchar = 4,
28}; 28};
29 29
30union Mode { 30enum EntryType : u32 {
31 u32 hex; 31 Directory = 0,
32 BitField<0, 1, u32> read_flag; 32 File = 1,
33 BitField<1, 1, u32> write_flag; 33};
34 BitField<2, 1, u32> create_flag; 34
35enum class Mode : u32 {
36 Read = 1,
37 Write = 2,
35}; 38};
36 39
37class Path { 40class Path {
@@ -86,7 +89,7 @@ public:
86 * @param size The size of the new file, filled with zeroes 89 * @param size The size of the new file, filled with zeroes
87 * @return Result of the operation 90 * @return Result of the operation
88 */ 91 */
89 virtual ResultCode CreateFile(const Path& path, u64 size) const = 0; 92 virtual ResultCode CreateFile(const std::string& path, u64 size) const = 0;
90 93
91 /** 94 /**
92 * Delete a file specified by its path 95 * Delete a file specified by its path
@@ -138,8 +141,8 @@ public:
138 * @param mode Mode to open the file with 141 * @param mode Mode to open the file with
139 * @return Opened file, or error code 142 * @return Opened file, or error code
140 */ 143 */
141 virtual ResultVal<std::unique_ptr<StorageBackend>> OpenFile(const Path& path, 144 virtual ResultVal<std::unique_ptr<StorageBackend>> OpenFile(const std::string& path,
142 const Mode& mode) const = 0; 145 Mode mode) const = 0;
143 146
144 /** 147 /**
145 * Open a directory specified by its path 148 * Open a directory specified by its path
@@ -153,6 +156,12 @@ public:
153 * @return The number of free bytes in the archive 156 * @return The number of free bytes in the archive
154 */ 157 */
155 virtual u64 GetFreeSpaceSize() const = 0; 158 virtual u64 GetFreeSpaceSize() const = 0;
159
160 /**
161 * Get the type of the specified path
162 * @return The type of the specified path or error code
163 */
164 virtual ResultVal<EntryType> GetEntryType(const std::string& path) const = 0;
156}; 165};
157 166
158class FileSystemFactory : NonCopyable { 167class FileSystemFactory : NonCopyable {