summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileSearch.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2019-06-28 19:42:34 +0200
committerGitHub <noreply@github.com>2019-06-28 19:42:34 +0200
commit58c78a495d783de3cb6928abd0c7810777decfc7 (patch)
treed2bb4b10b0c4cc42b101d9a91e53d14c727c7bfd /Source/Core/Common/FileSearch.cpp
parent6fd435fdffdbde75807186cb92b34ee3f2b5718b (diff)
parentc0a6fa5dcc5a1335ee9eeb940bdfc6934ed01656 (diff)
Merge pull request #8213 from JosJuice/filesystem-u8string
Work around C++20 std::filesystem changes related to u8string
Diffstat (limited to 'Source/Core/Common/FileSearch.cpp')
-rw-r--r--Source/Core/Common/FileSearch.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp
index b37e0cc5cd..6b28b93b4c 100644
--- a/Source/Core/Common/FileSearch.cpp
+++ b/Source/Core/Common/FileSearch.cpp
@@ -7,6 +7,7 @@
#include "Common/CommonPaths.h"
#include "Common/FileSearch.h"
+#include "Common/StringUtil.h"
#ifdef _MSC_VER
#include <Windows.h>
@@ -74,7 +75,7 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie
std::vector<fs::path> native_exts;
for (const auto& ext : exts)
- native_exts.push_back(fs::u8path(ext));
+ native_exts.push_back(StringToPath(ext));
// N.B. This avoids doing any copies
auto ext_matches = [&native_exts](const fs::path& path) {
@@ -93,11 +94,11 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie
auto add_filtered = [&](const fs::directory_entry& entry) {
auto& path = entry.path();
if (accept_all || (ext_matches(path) && !fs::is_directory(path)))
- result.emplace_back(path.u8string());
+ result.emplace_back(PathToString(path));
};
for (const auto& directory : directories)
{
- const fs::path directory_path = fs::u8path(directory);
+ const fs::path directory_path = StringToPath(directory);
if (fs::is_directory(directory_path)) // Can't create iterators for non-existant directories
{
if (recursive)