Browse Source

Loader: Add a GetFileType method to get the type of a loaded file

nce_cpp
Emmanuel Gil Peyrot 10 years ago
parent
commit
85a4eea460
  1. 8
      src/core/loader/3dsx.h
  2. 8
      src/core/loader/elf.h
  3. 6
      src/core/loader/loader.h
  4. 8
      src/core/loader/ncch.h

8
src/core/loader/3dsx.h

@ -27,6 +27,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

8
src/core/loader/elf.h

@ -27,6 +27,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

6
src/core/loader/loader.h

@ -131,6 +131,12 @@ public:
AppLoader(FileUtil::IOFile&& file) : file(std::move(file)) { }
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

8
src/core/loader/ncch.h

@ -173,6 +173,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

Loading…
Cancel
Save