Loader: Keep a reference to the file and pass it to the correct AppLoader, instead of loading it multiple times.
This commit is contained in:
parent
2d63df90a9
commit
b5237e885d
8 changed files with 130 additions and 190 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue