Merge pull request #5 from Thog/fix/loader-file-type

Add missing FileType declarations in GuessFromExtension and GetFileTypeString
This commit is contained in:
bunnei 2018-01-14 13:19:30 -05:00 committed by GitHub
commit 1e9e598ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,10 @@ FileType GuessFromExtension(const std::string& extension_) {
if (extension == ".elf" || extension == ".axf") if (extension == ".elf" || extension == ".axf")
return FileType::ELF; return FileType::ELF;
else if (extension == ".nro")
return FileType::NRO;
else if (extension == ".nso")
return FileType::NSO;
return FileType::Unknown; return FileType::Unknown;
} }
@ -61,6 +65,10 @@ const char* GetFileTypeString(FileType type) {
switch (type) { switch (type) {
case FileType::ELF: case FileType::ELF:
return "ELF"; return "ELF";
case FileType::NRO:
return "NRO";
case FileType::NSO:
return "NSO";
case FileType::Error: case FileType::Error:
case FileType::Unknown: case FileType::Unknown:
break; break;