diff options
| author | 2017-09-24 11:08:31 -0400 | |
|---|---|---|
| committer | 2017-09-30 14:32:53 -0400 | |
| commit | 6bafd3f4f754e093fe0f99ebf2e1136d3398981a (patch) | |
| tree | d6021353217bfc01416a3b0f737389f103af9640 /src/core/loader/nso.h | |
| parent | externals: Add lz4. (diff) | |
| download | yuzu-6bafd3f4f754e093fe0f99ebf2e1136d3398981a.tar.gz yuzu-6bafd3f4f754e093fe0f99ebf2e1136d3398981a.tar.xz yuzu-6bafd3f4f754e093fe0f99ebf2e1136d3398981a.zip | |
loader: Add support for loading an NSO.
Diffstat (limited to 'src/core/loader/nso.h')
| -rw-r--r-- | src/core/loader/nso.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h new file mode 100644 index 000000000..39a9bd3d9 --- /dev/null +++ b/src/core/loader/nso.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <string> | ||
| 8 | #include "common/common_types.h" | ||
| 9 | #include "common/file_util.h" | ||
| 10 | #include "core/loader/loader.h" | ||
| 11 | |||
| 12 | namespace Loader { | ||
| 13 | |||
| 14 | /// Loads an NSO file | ||
| 15 | class AppLoader_NSO final : public AppLoader { | ||
| 16 | public: | ||
| 17 | AppLoader_NSO(FileUtil::IOFile&& file, std::string filename, std::string filepath) | ||
| 18 | : AppLoader(std::move(file)), filename(std::move(filename)), filepath(std::move(filepath)) {} | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Returns the type of the file | ||
| 22 | * @param file FileUtil::IOFile open file | ||
| 23 | * @return FileType found, or FileType::Error if this loader doesn't know it | ||
| 24 | */ | ||
| 25 | static FileType IdentifyType(FileUtil::IOFile& file); | ||
| 26 | |||
| 27 | FileType GetFileType() override { | ||
| 28 | return IdentifyType(file); | ||
| 29 | } | ||
| 30 | |||
| 31 | ResultStatus Load() override; | ||
| 32 | |||
| 33 | private: | ||
| 34 | std::string filename; | ||
| 35 | std::string filepath; | ||
| 36 | }; | ||
| 37 | |||
| 38 | } // namespace Loader | ||