diff options
author | archshift <gh@archshift.com> | 2015-08-31 18:28:37 -0700 |
---|---|---|
committer | archshift <gh@archshift.com> | 2015-09-30 21:04:47 -0700 |
commit | bba12520c432a5b5975a76f014ed3c80e3411bb6 (patch) | |
tree | 01d39ed607550bc36b025958b8b860f5cb36870d /src/core/loader/loader.h | |
parent | b3af7aad9e37ee49feb9ff4e34ed4314f7ed644b (diff) |
Expose loader helper functions for identifying files.
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r-- | src/core/loader/loader.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index a37d3348c..8de95dacf 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -33,6 +33,34 @@ enum class FileType { THREEDSX, //3DSX }; +/** + * Identifies the type of a bootable file based on the magic value in its header. + * @param file open file + * @return FileType of file + */ +FileType IdentifyFile(FileUtil::IOFile& file); + +/** + * Identifies the type of a bootable file based on the magic value in its header. + * @param file_name path to file + * @return FileType of file. Note: this will return FileType::Unknown if it is unable to determine + * a filetype, and will never return FileType::Error. + */ +FileType IdentifyFile(const std::string& file_name); + +/** + * Guess the type of a bootable file from its extension + * @param extension String extension of bootable file + * @return FileType of file. Note: this will return FileType::Unknown if it is unable to determine + * a filetype, and will never return FileType::Error. + */ +FileType GuessFromExtension(const std::string& extension_); + +/** + * Convert a FileType into a string which can be displayed to the user. + */ +const char* GetFileTypeString(FileType type); + /// Return type for functions in Loader namespace enum class ResultStatus { Success, |