summaryrefslogtreecommitdiffstats
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-01-20 18:55:28 +0100
committerbunnei <bunneidev@gmail.com>2015-01-20 18:55:28 +0100
commit205170fa623efdd5eafb0c957d728babe4836f45 (patch)
tree26dd9e4c7ae9cc7a3bb09f42c942c4e47c9cc06f /src/core/loader/loader.h
parentMerge pull request #496 from lioncash/warn (diff)
parentLoader: Clean up the ELF AppLoader. (diff)
downloadyuzu-205170fa623efdd5eafb0c957d728babe4836f45.tar
yuzu-205170fa623efdd5eafb0c957d728babe4836f45.tar.gz
yuzu-205170fa623efdd5eafb0c957d728babe4836f45.tar.bz2
yuzu-205170fa623efdd5eafb0c957d728babe4836f45.tar.lz
yuzu-205170fa623efdd5eafb0c957d728babe4836f45.tar.xz
yuzu-205170fa623efdd5eafb0c957d728babe4836f45.tar.zst
yuzu-205170fa623efdd5eafb0c957d728babe4836f45.zip
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r--src/core/loader/loader.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index ec5534d41..7456b019b 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
@@ -37,10 +38,14 @@ enum class ResultStatus {
ErrorMemoryAllocationFailed,
};
+static u32 MakeMagic(char a, char b, char c, char d) {
+ return a | b << 8 | c << 16 | d << 24;
+}
+
/// Interface for loading an application
class AppLoader : NonCopyable {
public:
- AppLoader() { }
+ AppLoader(std::unique_ptr<FileUtil::IOFile>&& file) : file(std::move(file)) { }
virtual ~AppLoader() { }
/**
@@ -93,14 +98,11 @@ public:
virtual ResultStatus ReadRomFS(std::vector<u8>& buffer) const {
return ResultStatus::ErrorNotImplemented;
}
-};
-/**
- * Identifies the type of a bootable file
- * @param filename String filename of bootable file
- * @return FileType of file
- */
-FileType IdentifyFile(const std::string &filename);
+protected:
+ std::unique_ptr<FileUtil::IOFile> file;
+ bool is_loaded = false;
+};
/**
* Identifies and loads a bootable file