renamed FILETYPE_CTR_DIRECTORY to FILETYPE_DIRECTORY_CXI
This commit is contained in:
parent
8a95dd3f11
commit
e0cfd6b0b8
2 changed files with 10 additions and 12 deletions
|
@ -29,7 +29,8 @@
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool LoadDirectory(std::string &filename) {
|
/// Loads an extracted CXI from a directory
|
||||||
|
bool LoadDirectory_CXI(std::string &filename) {
|
||||||
std::string full_path = filename;
|
std::string full_path = filename;
|
||||||
std::string path, file, extension;
|
std::string path, file, extension;
|
||||||
SplitPath(ReplaceAll(full_path, "\\", "/"), &path, &file, &extension);
|
SplitPath(ReplaceAll(full_path, "\\", "/"), &path, &file, &extension);
|
||||||
|
@ -40,11 +41,11 @@ bool LoadDirectory(std::string &filename) {
|
||||||
System::g_ctr_file_system.Mount("fs:", fs);
|
System::g_ctr_file_system.Mount("fs:", fs);
|
||||||
|
|
||||||
std::string final_name = "fs:/" + file + extension;
|
std::string final_name = "fs:/" + file + extension;
|
||||||
//File::IOFile f(filename, "rb");
|
File::IOFile f(filename, "rb");
|
||||||
|
|
||||||
//if (f.IsOpen()) {
|
if (f.IsOpen()) {
|
||||||
// TODO(ShizZy): read here to memory....
|
// TODO(ShizZy): read here to memory....
|
||||||
//}
|
}
|
||||||
ERROR_LOG(TIME, "Unimplemented function!");
|
ERROR_LOG(TIME, "Unimplemented function!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +72,7 @@ FileType IdentifyFile(std::string &filename) {
|
||||||
|
|
||||||
if (File::IsDirectory(filename)) {
|
if (File::IsDirectory(filename)) {
|
||||||
if (IsBootableDirectory()) {
|
if (IsBootableDirectory()) {
|
||||||
return FILETYPE_CTR_DIRECTORY;
|
return FILETYPE_DIRECTORY_CXI;
|
||||||
} else {
|
} else {
|
||||||
return FILETYPE_NORMAL_DIRECTORY;
|
return FILETYPE_NORMAL_DIRECTORY;
|
||||||
}
|
}
|
||||||
|
@ -98,11 +99,8 @@ bool LoadFile(std::string &filename, std::string *error_string) {
|
||||||
// Note that this can modify filename!
|
// Note that this can modify filename!
|
||||||
switch (IdentifyFile(filename)) {
|
switch (IdentifyFile(filename)) {
|
||||||
|
|
||||||
case FILETYPE_CTR_DIRECTORY:
|
case FILETYPE_DIRECTORY_CXI:
|
||||||
{
|
return LoadDirectory_CXI(filename);
|
||||||
INFO_LOG(LOADER,"File is a BIN !");
|
|
||||||
return LoadDirectory(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
case FILETYPE_ERROR:
|
case FILETYPE_ERROR:
|
||||||
ERROR_LOG(LOADER, "Could not read file");
|
ERROR_LOG(LOADER, "Could not read file");
|
||||||
|
|
|
@ -39,7 +39,7 @@ enum FileType {
|
||||||
FILETYPE_CTR_CXI,
|
FILETYPE_CTR_CXI,
|
||||||
FILETYPE_CTR_ELF,
|
FILETYPE_CTR_ELF,
|
||||||
|
|
||||||
FILETYPE_CTR_DIRECTORY,
|
FILETYPE_DIRECTORY_CXI,
|
||||||
|
|
||||||
FILETYPE_UNKNOWN_BIN,
|
FILETYPE_UNKNOWN_BIN,
|
||||||
FILETYPE_UNKNOWN_ELF,
|
FILETYPE_UNKNOWN_ELF,
|
||||||
|
|
Loading…
Reference in a new issue