mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Common: Cleanup AssetReader extension filter.
This commit is contained in:
1 parent
74a652491c
commit
774b0e07e0
4 files changed
+5
-5
No files matched your search
@@ -532,7 +532,7 @@ std::string GetFileExtension(const std::string & fn) {
|
||||
if (pos == std::string::npos) {
|
||||
return "";
|
||||
}
|
||||
std::string ext = fn.substr(pos + 1);
|
||||
std::string ext = fn.substr(pos);
|
||||
for (size_t i = 0; i < ext.size(); i++) {
|
||||
ext[i] = tolower(ext[i]);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ std::vector<File::FileInfo> ApplyFilter(std::vector<File::FileInfo> files, const
|
||||
auto pred = [&](const File::FileInfo &info) {
|
||||
if (info.isDirectory || !filter)
|
||||
return false;
|
||||
std::string ext = "." + File::GetFileExtension(info.fullName);
|
||||
std::string ext = File::GetFileExtension(info.fullName);
|
||||
return filters.find(ext) == filters.end();
|
||||
};
|
||||
files.erase(std::remove_if(files.begin(), files.end(), pred), files.end());
|
||||
|
||||
@@ -74,7 +74,7 @@ bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector<File::Fil
|
||||
if (filter) {
|
||||
while (*filter) {
|
||||
if (*filter == ':') {
|
||||
filters.insert(tmp);
|
||||
filters.insert("." + tmp);
|
||||
tmp = "";
|
||||
} else {
|
||||
tmp.push_back(*filter);
|
||||
@@ -83,7 +83,7 @@ bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector<File::Fil
|
||||
}
|
||||
}
|
||||
if (tmp.size())
|
||||
filters.insert(tmp);
|
||||
filters.insert("." + tmp);
|
||||
|
||||
// We just loop through the whole ZIP file and deduce what files are in this directory, and what subdirectories there are.
|
||||
std::set<std::string> files;
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader) {
|
||||
return IdentifiedFileType::ERROR_IDENTIFYING;
|
||||
}
|
||||
|
||||
std::string extension = "." + File::GetFileExtension(fileLoader->GetPath());
|
||||
std::string extension = File::GetFileExtension(fileLoader->GetPath());
|
||||
if (extension == ".iso") {
|
||||
// may be a psx iso, they have 2352 byte sectors. You never know what some people try to open
|
||||
if ((fileLoader->FileSize() % 2352) == 0) {
|
||||
|
||||
Reference in new issue
Block a user