Common/FileSearch: Refactor DoFileSearch

This commit is contained in:
Sintendo
2026-01-24 16:50:10 +01:00
parent 3221e982d3
commit f2e1c71803
19 changed files with 87 additions and 48 deletions
+4 -4
View File
@@ -28,12 +28,12 @@ namespace UICommon
{
static constexpr u32 CACHE_REVISION = 26; // Last changed in PR 10084
std::vector<std::string> FindAllGamePaths(const std::vector<std::string>& directories_to_scan,
std::vector<std::string> FindAllGamePaths(std::span<const std::string_view> directories_to_scan,
bool recursive_scan)
{
static const std::vector<std::string> search_extensions = {
".gcm", ".tgc", ".bin", ".iso", ".ciso", ".gcz", ".wbfs",
".wia", ".rvz", ".nfs", ".wad", ".dol", ".elf", ".json"};
constexpr auto search_extensions =
std::to_array<std::string_view>({".gcm", ".tgc", ".bin", ".iso", ".ciso", ".gcz", ".wbfs",
".wia", ".rvz", ".nfs", ".wad", ".dol", ".elf", ".json"});
// TODO: We could process paths iteratively as they are found
return Common::DoFileSearch(directories_to_scan, search_extensions, recursive_scan);