summaryrefslogtreecommitdiff
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot2015-01-06 23:10:13 +0000
committerGravatar Emmanuel Gil Peyrot2015-01-15 22:23:08 +0100
commit82ec17db7df53ed1c376d1cdaa9a6587719a546d (patch)
tree3c2236849146037fbba2fb75ea8a50f53b847a17 /src/core/loader/loader.h
parentLoader: Don’t assume the file hasn’t been read before. (diff)
downloadyuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.gz
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.xz
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.zip
Loader: Guess filetype from the magic, or fallback to the extension.
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r--src/core/loader/loader.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index b4fc8636d..7456b019b 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -38,6 +38,10 @@ enum class ResultStatus {
38 ErrorMemoryAllocationFailed, 38 ErrorMemoryAllocationFailed,
39}; 39};
40 40
41static u32 MakeMagic(char a, char b, char c, char d) {
42 return a | b << 8 | c << 16 | d << 24;
43}
44
41/// Interface for loading an application 45/// Interface for loading an application
42class AppLoader : NonCopyable { 46class AppLoader : NonCopyable {
43public: 47public:
@@ -101,13 +105,6 @@ protected:
101}; 105};
102 106
103/** 107/**
104 * Identifies the type of a bootable file
105 * @param filename String filename of bootable file
106 * @return FileType of file
107 */
108FileType IdentifyFile(const std::string &filename);
109
110/**
111 * Identifies and loads a bootable file 108 * Identifies and loads a bootable file
112 * @param filename String filename of bootable file 109 * @param filename String filename of bootable file
113 * @return ResultStatus result of function 110 * @return ResultStatus result of function