diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-05-17 23:30:44 +0100 |
|---|---|---|
| committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-05-21 17:09:59 +0100 |
| commit | 85a4eea460afbcff36f675cd488f21b8902abc02 (patch) | |
| tree | 6fe175c9e225d025217c48e3926209ed14b14183 /src | |
| parent | b0095b9584c17cf940477b9c0366917c3205894e (diff) | |
Loader: Add a GetFileType method to get the type of a loaded file
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/loader/3dsx.h | 8 | ||||
| -rw-r--r-- | src/core/loader/elf.h | 8 | ||||
| -rw-r--r-- | src/core/loader/loader.h | 6 | ||||
| -rw-r--r-- | src/core/loader/ncch.h | 8 |
4 files changed, 30 insertions, 0 deletions
diff --git a/src/core/loader/3dsx.h b/src/core/loader/3dsx.h index 3ee6867033..90b20c61c3 100644 --- a/src/core/loader/3dsx.h +++ b/src/core/loader/3dsx.h @@ -28,6 +28,14 @@ public: static FileType IdentifyType(FileUtil::IOFile& file); /** + * Returns the type of this file + * @return FileType corresponding to the loaded file + */ + FileType GetFileType() override { + return IdentifyType(file); + } + + /** * Load the bootable file * @return ResultStatus result of function */ diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index c6a5ebe991..cb3724f9d3 100644 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h @@ -28,6 +28,14 @@ public: static FileType IdentifyType(FileUtil::IOFile& file); /** + * Returns the type of this file + * @return FileType corresponding to the loaded file + */ + FileType GetFileType() override { + return IdentifyType(file); + } + + /** * Load the bootable file * @return ResultStatus result of function */ diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 4a4bd7c770..08bab84e5f 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -132,6 +132,12 @@ public: virtual ~AppLoader() { } /** + * Returns the type of this file + * @return FileType corresponding to the loaded file + */ + virtual FileType GetFileType() = 0; + + /** * Load the application * @return ResultStatus result of function */ diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index fd852c3de2..75609ee576 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -174,6 +174,14 @@ public: static FileType IdentifyType(FileUtil::IOFile& file); /** + * Returns the type of this file + * @return FileType corresponding to the loaded file + */ + FileType GetFileType() override { + return IdentifyType(file); + } + + /** * Load the application * @return ResultStatus result of function */ |
