diff options
| author | 2015-01-06 23:10:13 +0000 | |
|---|---|---|
| committer | 2015-01-15 22:23:08 +0100 | |
| commit | 82ec17db7df53ed1c376d1cdaa9a6587719a546d (patch) | |
| tree | 3c2236849146037fbba2fb75ea8a50f53b847a17 /src/core/loader/loader.h | |
| parent | Loader: Don’t assume the file hasn’t been read before. (diff) | |
| download | yuzu-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.h | 11 |
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 | ||
| 41 | static 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 |
| 42 | class AppLoader : NonCopyable { | 46 | class AppLoader : NonCopyable { |
| 43 | public: | 47 | public: |
| @@ -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 | */ | ||
| 108 | FileType 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 |