diff options
| author | 2018-07-07 20:24:51 -0700 | |
|---|---|---|
| committer | 2018-07-07 20:24:51 -0700 | |
| commit | 913896cbd99e414c325c9d47a987376ed6d9fffd (patch) | |
| tree | b660920a49f538f0ee00486c50a0d153d53c423d /src/core/loader/nca.h | |
| parent | Merge pull request #632 from FearlessTobi/add-discord-link (diff) | |
| download | yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.gz yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.xz yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.zip | |
Revert "Virtual Filesystem (#597)"
This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
Diffstat (limited to 'src/core/loader/nca.h')
| -rw-r--r-- | src/core/loader/nca.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h index a5639f149..3b6c451d0 100644 --- a/src/core/loader/nca.h +++ b/src/core/loader/nca.h | |||
| @@ -6,37 +6,44 @@ | |||
| 6 | 6 | ||
| 7 | #include <string> | 7 | #include <string> |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "core/file_sys/content_archive.h" | 9 | #include "core/file_sys/partition_filesystem.h" |
| 10 | #include "core/file_sys/program_metadata.h" | 10 | #include "core/file_sys/program_metadata.h" |
| 11 | #include "core/hle/kernel/kernel.h" | 11 | #include "core/hle/kernel/kernel.h" |
| 12 | #include "core/loader/loader.h" | 12 | #include "core/loader/loader.h" |
| 13 | 13 | ||
| 14 | namespace Loader { | 14 | namespace Loader { |
| 15 | 15 | ||
| 16 | class Nca; | ||
| 17 | |||
| 16 | /// Loads an NCA file | 18 | /// Loads an NCA file |
| 17 | class AppLoader_NCA final : public AppLoader { | 19 | class AppLoader_NCA final : public AppLoader { |
| 18 | public: | 20 | public: |
| 19 | explicit AppLoader_NCA(FileSys::VirtualFile file); | 21 | AppLoader_NCA(FileUtil::IOFile&& file, std::string filepath); |
| 20 | 22 | ||
| 21 | /** | 23 | /** |
| 22 | * Returns the type of the file | 24 | * Returns the type of the file |
| 23 | * @param file std::shared_ptr<VfsFile> open file | 25 | * @param file FileUtil::IOFile open file |
| 26 | * @param filepath Path of the file that we are opening. | ||
| 24 | * @return FileType found, or FileType::Error if this loader doesn't know it | 27 | * @return FileType found, or FileType::Error if this loader doesn't know it |
| 25 | */ | 28 | */ |
| 26 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 29 | static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath); |
| 27 | 30 | ||
| 28 | FileType GetFileType() override { | 31 | FileType GetFileType() override { |
| 29 | return IdentifyType(file); | 32 | return IdentifyType(file, filepath); |
| 30 | } | 33 | } |
| 31 | 34 | ||
| 32 | ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; | 35 | ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; |
| 33 | 36 | ||
| 37 | ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, | ||
| 38 | u64& size) override; | ||
| 39 | |||
| 34 | ~AppLoader_NCA(); | 40 | ~AppLoader_NCA(); |
| 35 | 41 | ||
| 36 | private: | 42 | private: |
| 43 | std::string filepath; | ||
| 37 | FileSys::ProgramMetadata metadata; | 44 | FileSys::ProgramMetadata metadata; |
| 38 | 45 | ||
| 39 | std::unique_ptr<FileSys::NCA> nca; | 46 | std::unique_ptr<Nca> nca; |
| 40 | }; | 47 | }; |
| 41 | 48 | ||
| 42 | } // namespace Loader | 49 | } // namespace Loader |