diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index 6a53f12e02..29b8624b15 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -9,6 +9,8 @@ #include "Common/FileSearch.h" #include "Common/FileUtil.h" +namespace Common +{ static std::vector FileSearchWithTest(const std::vector& directories, bool recursive, std::function callback) @@ -57,3 +59,4 @@ std::vector FindSubdirectories(const std::vector& dire return FileSearchWithTest(directories, true, [&](const File::FSTEntry& entry) { return entry.isDirectory; }); } +} // namespace Common diff --git a/Source/Core/Common/FileSearch.h b/Source/Core/Common/FileSearch.h index da29f4fb8a..dc2f7f6b62 100644 --- a/Source/Core/Common/FileSearch.h +++ b/Source/Core/Common/FileSearch.h @@ -7,8 +7,11 @@ #include #include +namespace Common +{ std::vector DoFileSearch(const std::vector& exts, const std::vector& directories, bool recursive = false); std::vector FindSubdirectories(const std::vector& directories, bool recursive); +} // namespace Common diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp index daf0d0ee11..2cf7399e3d 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp @@ -145,7 +145,7 @@ GCMemcardDirectory::GCMemcardDirectory(const std::string& directory, int slot, u hdr_file.ReadBytes(&m_hdr, BLOCK_SIZE); } - std::vector filenames = DoFileSearch({".gci"}, {m_save_directory}); + std::vector filenames = Common::DoFileSearch({".gci"}, {m_save_directory}); if (filenames.size() > 112) { diff --git a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp index 2b78a52a93..105ab0a749 100644 --- a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp @@ -187,9 +187,9 @@ void InterfaceConfigPane::LoadGUIValues() void InterfaceConfigPane::LoadThemes() { - auto sv = - DoFileSearch({""}, {File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR}, - /*recursive*/ false); + auto sv = Common::DoFileSearch( + {""}, {File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR}, + /*recursive*/ false); for (const std::string& filename : sv) { std::string name, ext; diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 58edc02c30..4141f36fc4 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1593,7 +1593,7 @@ void CFrame::GameListChanged(wxCommandEvent& event) break; case IDM_PURGE_GAME_LIST_CACHE: std::vector rFilenames = - DoFileSearch({".cache"}, {File::GetUserPath(D_CACHE_IDX)}); + Common::DoFileSearch({".cache"}, {File::GetUserPath(D_CACHE_IDX)}); for (const std::string& rFilename : rFilenames) { diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 6dbb31a854..68e18b2379 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -663,8 +663,9 @@ void CGameListCtrl::ScanForISOs() m_ISOFiles.clear(); const auto custom_titles = LoadCustomTitles(); - auto rFilenames = DoFileSearch(GetFileSearchExtensions(), SConfig::GetInstance().m_ISOFolder, - SConfig::GetInstance().m_RecursiveISOFolder); + auto rFilenames = + Common::DoFileSearch(GetFileSearchExtensions(), SConfig::GetInstance().m_ISOFolder, + SConfig::GetInstance().m_RecursiveISOFolder); if (rFilenames.size() > 0) { diff --git a/Source/Core/DolphinWX/Input/InputConfigDiag.cpp b/Source/Core/DolphinWX/Input/InputConfigDiag.cpp index 46673ac478..02dc019ca7 100644 --- a/Source/Core/DolphinWX/Input/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/Input/InputConfigDiag.cpp @@ -264,7 +264,7 @@ void InputConfigDialog::UpdateProfileComboBox() pname += PROFILES_PATH; pname += m_config.GetProfileName(); - std::vector sv = DoFileSearch({".ini"}, {pname}); + std::vector sv = Common::DoFileSearch({".ini"}, {pname}); wxArrayString strs; for (const std::string& filename : sv) diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index 7b5ccbe93e..868d789785 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -82,8 +82,8 @@ std::string VideoBackend::GetDisplayName() const static std::vector GetShaders(const std::string& sub_dir = "") { std::vector paths = - DoFileSearch({".glsl"}, {File::GetUserPath(D_SHADERS_IDX) + sub_dir, - File::GetSysDirectory() + SHADERS_DIR DIR_SEP + sub_dir}); + Common::DoFileSearch({".glsl"}, {File::GetUserPath(D_SHADERS_IDX) + sub_dir, + File::GetSysDirectory() + SHADERS_DIR DIR_SEP + sub_dir}); std::vector result; for (std::string path : paths) { diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index f503932681..f4ad7448a5 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -95,7 +95,7 @@ void HiresTexture::Update() }; std::vector filenames = - DoFileSearch(extensions, {texture_directory}, /*recursive*/ true); + Common::DoFileSearch(extensions, {texture_directory}, /*recursive*/ true); const std::string code = game_id + "_";