aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-06 21:30:40 +0000
committerGravatar Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-15 21:21:26 +0000
commitb5237e885df72f6c37532fc8af9573966e7b07e5 (patch)
treefdfd4da299cc2779f35fcc30e770b85b9e710166 /src/core/loader/loader.h
parent2d63df90a9d64d3961be07ef0a959bc48b42c73b (diff)
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 ec5534d4..b4fc8636 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -7,6 +7,7 @@
#include <vector>
#include "common/common.h"
+#include "common/file_util.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Loader namespace
@@ -40,7 +41,7 @@ enum class ResultStatus {
/// Interface for loading an application
class AppLoader : NonCopyable {
public:
- AppLoader() { }
+ AppLoader(std::unique_ptr<FileUtil::IOFile>&& file) : file(std::move(file)) { }
virtual ~AppLoader() { }
/**
@@ -93,6 +94,10 @@ public:
virtual ResultStatus ReadRomFS(std::vector<u8>& buffer) const {
return ResultStatus::ErrorNotImplemented;
}
+
+protected:
+ std::unique_ptr<FileUtil::IOFile> file;
+ bool is_loaded = false;
};
/**