summaryrefslogtreecommitdiff
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot2015-01-06 21:30:40 +0000
committerGravatar Emmanuel Gil Peyrot2015-01-15 21:21:26 +0000
commitb5237e885df72f6c37532fc8af9573966e7b07e5 (patch)
treefdfd4da299cc2779f35fcc30e770b85b9e710166 /src/core/loader/loader.h
parentLoader: Initialize the default NCCH values in the class declaration, not in t... (diff)
downloadyuzu-b5237e885df72f6c37532fc8af9573966e7b07e5.tar.gz
yuzu-b5237e885df72f6c37532fc8af9573966e7b07e5.tar.xz
yuzu-b5237e885df72f6c37532fc8af9573966e7b07e5.zip
Loader: Keep a reference to the file and pass it to the correct AppLoader, instead of loading it multiple times.
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r--src/core/loader/loader.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index ec5534d41..b4fc8636d 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -7,6 +7,7 @@
7#include <vector> 7#include <vector>
8 8
9#include "common/common.h" 9#include "common/common.h"
10#include "common/file_util.h"
10 11
11//////////////////////////////////////////////////////////////////////////////////////////////////// 12////////////////////////////////////////////////////////////////////////////////////////////////////
12// Loader namespace 13// Loader namespace
@@ -40,7 +41,7 @@ enum class ResultStatus {
40/// Interface for loading an application 41/// Interface for loading an application
41class AppLoader : NonCopyable { 42class AppLoader : NonCopyable {
42public: 43public:
43 AppLoader() { } 44 AppLoader(std::unique_ptr<FileUtil::IOFile>&& file) : file(std::move(file)) { }
44 virtual ~AppLoader() { } 45 virtual ~AppLoader() { }
45 46
46 /** 47 /**
@@ -93,6 +94,10 @@ public:
93 virtual ResultStatus ReadRomFS(std::vector<u8>& buffer) const { 94 virtual ResultStatus ReadRomFS(std::vector<u8>& buffer) const {
94 return ResultStatus::ErrorNotImplemented; 95 return ResultStatus::ErrorNotImplemented;
95 } 96 }
97
98protected:
99 std::unique_ptr<FileUtil::IOFile> file;
100 bool is_loaded = false;
96}; 101};
97 102
98/** 103/**