diff options
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index a752ab0e10..c498e261fd 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -335,6 +335,23 @@ bool SplitPath(std::string_view full_path, std::string* path, std::string* filen return true; } +void UnifyPathSeparators(std::string& path) +{ +#ifdef _WIN32 + for (char& c : path) + { + if (c == '\\') + c = '/'; + } +#endif +} + +std::string WithUnifiedPathSeparators(std::string path) +{ + UnifyPathSeparators(path); + return path; +} + std::string PathToFileName(std::string_view path) { std::string file_name, extension; |
