diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/file_sys/partition_filesystem.cpp | 11 | ||||
| -rw-r--r-- | src/core/file_sys/partition_filesystem.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp index a5259a593..932409d79 100644 --- a/src/core/file_sys/partition_filesystem.cpp +++ b/src/core/file_sys/partition_filesystem.cpp | |||
| @@ -65,6 +65,9 @@ PartitionFilesystem::PartitionFilesystem(std::shared_ptr<VfsFile> file) { | |||
| 65 | std::string name( | 65 | std::string name( |
| 66 | reinterpret_cast<const char*>(&file_data[strtab_offset + entry.strtab_offset])); | 66 | reinterpret_cast<const char*>(&file_data[strtab_offset + entry.strtab_offset])); |
| 67 | 67 | ||
| 68 | offsets[name] = content_offset + entry.offset; | ||
| 69 | sizes[name] = entry.size; | ||
| 70 | |||
| 68 | pfs_files.emplace_back(std::make_shared<OffsetVfsFile>( | 71 | pfs_files.emplace_back(std::make_shared<OffsetVfsFile>( |
| 69 | file, entry.size, content_offset + entry.offset, std::move(name))); | 72 | file, entry.size, content_offset + entry.offset, std::move(name))); |
| 70 | } | 73 | } |
| @@ -78,6 +81,14 @@ Loader::ResultStatus PartitionFilesystem::GetStatus() const { | |||
| 78 | return status; | 81 | return status; |
| 79 | } | 82 | } |
| 80 | 83 | ||
| 84 | std::map<std::string, u64> PartitionFilesystem::GetFileOffsets() const { | ||
| 85 | return offsets; | ||
| 86 | } | ||
| 87 | |||
| 88 | std::map<std::string, u64> PartitionFilesystem::GetFileSizes() const { | ||
| 89 | return sizes; | ||
| 90 | } | ||
| 91 | |||
| 81 | std::vector<std::shared_ptr<VfsFile>> PartitionFilesystem::GetFiles() const { | 92 | std::vector<std::shared_ptr<VfsFile>> PartitionFilesystem::GetFiles() const { |
| 82 | return pfs_files; | 93 | return pfs_files; |
| 83 | } | 94 | } |
diff --git a/src/core/file_sys/partition_filesystem.h b/src/core/file_sys/partition_filesystem.h index 248fdfdeb..279193b19 100644 --- a/src/core/file_sys/partition_filesystem.h +++ b/src/core/file_sys/partition_filesystem.h | |||
| @@ -29,6 +29,9 @@ public: | |||
| 29 | 29 | ||
| 30 | Loader::ResultStatus GetStatus() const; | 30 | Loader::ResultStatus GetStatus() const; |
| 31 | 31 | ||
| 32 | std::map<std::string, u64> GetFileOffsets() const; | ||
| 33 | std::map<std::string, u64> GetFileSizes() const; | ||
| 34 | |||
| 32 | std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; | 35 | std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; |
| 33 | std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; | 36 | std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; |
| 34 | std::string GetName() const override; | 37 | std::string GetName() const override; |
| @@ -80,6 +83,9 @@ private: | |||
| 80 | bool is_hfs = false; | 83 | bool is_hfs = false; |
| 81 | std::size_t content_offset = 0; | 84 | std::size_t content_offset = 0; |
| 82 | 85 | ||
| 86 | std::map<std::string, u64> offsets; | ||
| 87 | std::map<std::string, u64> sizes; | ||
| 88 | |||
| 83 | std::vector<VirtualFile> pfs_files; | 89 | std::vector<VirtualFile> pfs_files; |
| 84 | }; | 90 | }; |
| 85 | 91 | ||