diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-06 14:53:14 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-10 16:43:44 +0100 |
commit | 3f1a3952d707bce7851652ce54701ca14334f314 (patch) | |
tree | 04c79ff9887f0074813276cdf989e6814901e943 /src/core/file_sys/ivfc_archive.h | |
parent | FS: Get rid of completely useless Archive class (diff) | |
download | yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.gz yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.bz2 yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.lz yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.xz yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.zst yuzu-3f1a3952d707bce7851652ce54701ca14334f314.zip |
Diffstat (limited to 'src/core/file_sys/ivfc_archive.h')
-rw-r--r-- | src/core/file_sys/ivfc_archive.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 6f4cc86df..1aff9e0a4 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -4,6 +4,7 @@ #pragma once +#include <memory> #include <vector> #include "common/common_types.h" @@ -23,7 +24,9 @@ namespace FileSys { */ class IVFCArchive : public ArchiveBackend { public: - IVFCArchive(); + IVFCArchive(std::shared_ptr<const std::vector<u8>> data); + + std::string GetName() const override; std::unique_ptr<FileBackend> OpenFile(const Path& path, const Mode mode) const override; bool DeleteFile(const Path& path) const override; @@ -33,16 +36,14 @@ public: bool CreateDirectory(const Path& path) const override; bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override; - ResultCode Format(const Path& path) const override; protected: - friend class IVFCFile; - std::vector<u8> raw_data; + std::shared_ptr<const std::vector<u8>> data; }; class IVFCFile : public FileBackend { public: - IVFCFile(const IVFCArchive* archive) : archive(archive) {} + IVFCFile(std::shared_ptr<const std::vector<u8>> data) : data(data) {} bool Open() override { return true; } size_t Read(const u64 offset, const u32 length, u8* buffer) const override; @@ -53,7 +54,7 @@ public: void Flush() const override { } private: - const IVFCArchive* archive; + std::shared_ptr<const std::vector<u8>> data; }; class IVFCDirectory : public DirectoryBackend { |