summaryrefslogtreecommitdiff
path: root/src/core/loader/nca.h
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-07-06 10:51:32 -0400
committerGravatar bunnei2018-07-06 10:51:32 -0400
commit77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2 (patch)
tree38ef6451732c5eecb0efdd198f3db4d33848453c /src/core/loader/nca.h
parentMerge pull request #629 from Subv/depth_test (diff)
downloadyuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.gz
yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.tar.xz
yuzu-77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.zip
Virtual Filesystem (#597)
* Add VfsFile and VfsDirectory classes * Finish abstract Vfs classes * Implement RealVfsFile (computer fs backend) * Finish RealVfsFile and RealVfsDirectory * Finished OffsetVfsFile * More changes * Fix import paths * Major refactor * Remove double const * Use experimental/filesystem or filesystem depending on compiler * Port partition_filesystem * More changes * More Overhaul * FSP_SRV fixes * Fixes and testing * Try to get filesystem to compile * Filesystem on linux * Remove std::filesystem and document/test * Compile fixes * Missing include * Bug fixes * Fixes * Rename v_file and v_dir * clang-format fix * Rename NGLOG_* to LOG_* * Most review changes * Fix TODO * Guess 'main' to be Directory by filename
Diffstat (limited to 'src/core/loader/nca.h')
-rw-r--r--src/core/loader/nca.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h
index 3b6c451d0..a5639f149 100644
--- a/src/core/loader/nca.h
+++ b/src/core/loader/nca.h
@@ -6,44 +6,37 @@
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,
38 u64& size) override;
39
40 ~AppLoader_NCA(); 34 ~AppLoader_NCA();
41 35
42private: 36private:
43 std::string filepath;
44 FileSys::ProgramMetadata metadata; 37 FileSys::ProgramMetadata metadata;
45 38
46 std::unique_ptr<Nca> nca; 39 std::unique_ptr<FileSys::NCA> nca;
47}; 40};
48 41
49} // namespace Loader 42} // namespace Loader