Skip to content

Commit

Permalink
Remove blank ListFiles in favor of default of "" searchMask for t…
Browse files Browse the repository at this point in the history
…he other one.

Add handling to not add `""` to the list before passing to the base function.
  • Loading branch information
Malkierian committed Dec 17, 2024
1 parent 0699337 commit 640e806
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/resource/archive/ArchiveManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ bool ArchiveManager::HasFile(uint64_t hash) {
return mFileToArchive.count(hash) > 0;
}

std::shared_ptr<std::vector<std::string>> ArchiveManager::ListFiles() {
return ListFiles({}, {});
}

std::shared_ptr<std::vector<std::string>> ArchiveManager::ListFiles(const std::string& searchMask) {
std::list<std::string> includes = {};
if (searchMask.size() > 0) {
includes.push_back(searchMask);
}
return ListFiles({ searchMask }, {});
}

Expand Down
3 changes: 1 addition & 2 deletions src/resource/archive/ArchiveManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class ArchiveManager {
std::shared_ptr<File> LoadFile(uint64_t hash, std::shared_ptr<ResourceInitData> initData = nullptr);
bool HasFile(const std::string& filePath);
bool HasFile(uint64_t hash);
std::shared_ptr<std::vector<std::string>> ListFiles();
std::shared_ptr<std::vector<std::string>> ListFiles(const std::string& searchMask);
std::shared_ptr<std::vector<std::string>> ListFiles(const std::string& searchMask = "");
std::shared_ptr<std::vector<std::string>> ListFiles(const std::list<std::string>& includes,
const std::list<std::string>& excludes);
std::vector<uint32_t> GetGameVersions();
Expand Down

0 comments on commit 640e806

Please sign in to comment.