diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2018-07-06 16:51:32 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-07-06 16:51:32 +0200 |
commit | 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2 (patch) | |
tree | 38ef6451732c5eecb0efdd198f3db4d33848453c /src/core/file_sys/partition_filesystem.h | |
parent | Merge pull request #629 from Subv/depth_test (diff) | |
download | yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.gz yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.bz2 yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.lz yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.xz yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.zst yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.zip |
Diffstat (limited to 'src/core/file_sys/partition_filesystem.h')
-rw-r--r-- | src/core/file_sys/partition_filesystem.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/core/file_sys/partition_filesystem.h b/src/core/file_sys/partition_filesystem.h index 9c5810cf1..9656b40bf 100644 --- a/src/core/file_sys/partition_filesystem.h +++ b/src/core/file_sys/partition_filesystem.h @@ -10,6 +10,7 @@ #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" +#include "core/file_sys/vfs.h" namespace Loader { enum class ResultStatus; @@ -21,19 +22,19 @@ namespace FileSys { * Helper which implements an interface to parse PFS/HFS filesystems. * Data can either be loaded from a file path or data with an offset into it. */ -class PartitionFilesystem { +class PartitionFilesystem : public ReadOnlyVfsDirectory { public: - Loader::ResultStatus Load(const std::string& file_path, size_t offset = 0); - Loader::ResultStatus Load(const std::vector<u8>& file_data, size_t offset = 0); + explicit PartitionFilesystem(std::shared_ptr<VfsFile> file); + Loader::ResultStatus GetStatus() const; - u32 GetNumEntries() const; - u64 GetEntryOffset(u32 index) const; - u64 GetEntrySize(u32 index) const; - std::string GetEntryName(u32 index) const; - u64 GetFileOffset(const std::string& name) const; - u64 GetFileSize(const std::string& name) const; + std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; + std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; + std::string GetName() const override; + std::shared_ptr<VfsDirectory> GetParentDirectory() const override; + void PrintDebugInfo() const; - void Print() const; +protected: + bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override; private: struct Header { @@ -72,16 +73,14 @@ private: #pragma pack(pop) - struct FileEntry { - FSEntry fs_entry; - std::string name; - }; + Loader::ResultStatus status; Header pfs_header; bool is_hfs; size_t content_offset; - std::vector<FileEntry> pfs_entries; + std::vector<VirtualFile> pfs_files; + std::vector<VirtualDir> pfs_dirs; }; } // namespace FileSys |