aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/archive_backend.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-02-10 18:27:16 -0500
committerbunnei <bunneidev@gmail.com>2015-02-10 18:27:16 -0500
commit27e6e6b3cb2ee1ab3a996c2b4be1d9a3c4e6b75d (patch)
treefd8b0290d4a0353c11c0e168200b20b5a89e297c /src/core/file_sys/archive_backend.h
parent67db6aa4ce1f57f7d99406c8924ed41e74d36dbe (diff)
parent0d2b6dd6566b6718c806181c1f1c3bcdcede86ae (diff)
Merge pull request #540 from yuriks/multi-archives
FS: Allow multiple instances of the same archive type to be open at once
Diffstat (limited to 'src/core/file_sys/archive_backend.h')
-rw-r--r--src/core/file_sys/archive_backend.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index 390178f67..43a106549 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -181,20 +181,6 @@ public:
}
/**
- * Tries to open the archive of this type with the specified path
- * @param path Path to the archive
- * @return ResultCode of the operation
- */
- virtual ResultCode Open(const Path& path) = 0;
-
- /**
- * Deletes the archive contents and then re-creates the base folder
- * @param path Path to the archive
- * @return ResultCode of the operation, 0 on success
- */
- virtual ResultCode Format(const Path& path) const = 0;
-
- /**
* Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)
*/
virtual std::string GetName() const = 0;
@@ -260,4 +246,29 @@ public:
virtual std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const = 0;
};
+class ArchiveFactory : NonCopyable {
+public:
+ virtual ~ArchiveFactory() {
+ }
+
+ /**
+ * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)
+ */
+ virtual std::string GetName() const = 0;
+
+ /**
+ * Tries to open the archive of this type with the specified path
+ * @param path Path to the archive
+ * @return An ArchiveBackend corresponding operating specified archive path.
+ */
+ virtual ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path) = 0;
+
+ /**
+ * Deletes the archive contents and then re-creates the base folder
+ * @param path Path to the archive
+ * @return ResultCode of the operation, 0 on success
+ */
+ virtual ResultCode Format(const Path& path) = 0;
+};
+
} // namespace FileSys