summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/partition_filesystem.h
diff options
context:
space:
mode:
authorZach Hilman <DarkLordZach@users.noreply.github.com>2018-07-19 03:07:11 +0200
committerbunnei <bunneidev@gmail.com>2018-07-19 03:07:11 +0200
commit29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef (patch)
tree3202e2ce55ab6387a4ca366a509eccdd963434c3 /src/core/file_sys/partition_filesystem.h
parentMerge pull request #683 from DarkLordZach/touch (diff)
downloadyuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.gz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.bz2
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.lz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.xz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.zst
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.zip
Diffstat (limited to 'src/core/file_sys/partition_filesystem.h')
-rw-r--r--src/core/file_sys/partition_filesystem.h29
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