summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/archive_backend.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-12-28 19:51:44 +0100
committerSubv <subv2112@gmail.com>2016-03-20 20:30:01 +0100
commitd26c6b3212ed36970410814593ee5ec082b1d95a (patch)
tree3b03822761cbec083ea57719b0c8a9df530c4899 /src/core/file_sys/archive_backend.h
parentHLE/FS: Don't return an error when deleting the ExtSaveData if it does not exist. (diff)
downloadyuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.tar
yuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.tar.gz
yuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.tar.bz2
yuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.tar.lz
yuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.tar.xz
yuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.tar.zst
yuzu-d26c6b3212ed36970410814593ee5ec082b1d95a.zip
Diffstat (limited to 'src/core/file_sys/archive_backend.h')
-rw-r--r--src/core/file_sys/archive_backend.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index 60108b4b0..800ac1541 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -62,6 +62,14 @@ private:
std::u16string u16str;
};
+struct ArchiveFormatInfo {
+ u32 total_size; ///< The pre-defined size of the archive, as specified in the Create or Format call
+ u32 number_directories; ///< The pre-defined number of directories in the archive, as specified in the Create or Format call
+ u32 number_files; ///< The pre-defined number of files in the archive, as specified in the Create or Format call
+ u8 duplicate_data; ///< Whether the archive should duplicate the data, as specified in the Create or Format call
+};
+static_assert(std::is_pod<ArchiveFormatInfo>::value, "ArchiveFormatInfo is not POD");
+
class ArchiveBackend : NonCopyable {
public:
virtual ~ArchiveBackend() {
@@ -159,9 +167,17 @@ public:
/**
* Deletes the archive contents and then re-creates the base folder
* @param path Path to the archive
+ * @param format_info Format information for the new archive
* @return ResultCode of the operation, 0 on success
*/
- virtual ResultCode Format(const Path& path) = 0;
+ virtual ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) = 0;
+
+ /*
+ * Retrieves the format info about the archive with the specified path
+ * @param path Path to the archive
+ * @return Format information about the archive or error code
+ */
+ virtual ResultVal<ArchiveFormatInfo> GetFormatInfo(const Path& path) const = 0;
};
} // namespace FileSys