summaryrefslogtreecommitdiff
path: root/src/core/loader/nca.h
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-07-18 21:07:11 -0400
committerGravatar bunnei2018-07-18 18:07:11 -0700
commit29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef (patch)
tree3202e2ce55ab6387a4ca366a509eccdd963434c3 /src/core/loader/nca.h
parentMerge pull request #683 from DarkLordZach/touch (diff)
downloadyuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.gz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.xz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.zip
Virtual Filesystem 2: Electric Boogaloo (#676)
* Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
Diffstat (limited to 'src/core/loader/nca.h')
-rw-r--r--src/core/loader/nca.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h
index 3b6c451d0..52c95953a 100644
--- a/src/core/loader/nca.h
+++ b/src/core/loader/nca.h
@@ -6,44 +6,39 @@
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/partition_filesystem.h" 9#include "core/file_sys/content_archive.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
14namespace Loader { 14namespace Loader {
15 15
16class Nca;
17
18/// Loads an NCA file 16/// Loads an NCA file
19class AppLoader_NCA final : public AppLoader { 17class AppLoader_NCA final : public AppLoader {
20public: 18public:
21 AppLoader_NCA(FileUtil::IOFile&& file, std::string filepath); 19 explicit AppLoader_NCA(FileSys::VirtualFile file);
22 20
23 /** 21 /**
24 * Returns the type of the file 22 * Returns the type of the file
25 * @param file FileUtil::IOFile open file 23 * @param file std::shared_ptr<VfsFile> open file
26 * @param filepath Path of the file that we are opening.
27 * @return FileType found, or FileType::Error if this loader doesn't know it 24 * @return FileType found, or FileType::Error if this loader doesn't know it
28 */ 25 */
29 static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath); 26 static FileType IdentifyType(const FileSys::VirtualFile& file);
30 27
31 FileType GetFileType() override { 28 FileType GetFileType() override {
32 return IdentifyType(file, filepath); 29 return IdentifyType(file);
33 } 30 }
34 31
35 ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; 32 ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
36 33
37 ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, 34 ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override;
38 u64& size) override;
39 35
40 ~AppLoader_NCA(); 36 ~AppLoader_NCA();
41 37
42private: 38private:
43 std::string filepath;
44 FileSys::ProgramMetadata metadata; 39 FileSys::ProgramMetadata metadata;
45 40
46 std::unique_ptr<Nca> nca; 41 std::unique_ptr<FileSys::NCA> nca;
47}; 42};
48 43
49} // namespace Loader 44} // namespace Loader