diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-08-06 23:21:37 -0400 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-08 21:18:45 -0400 |
commit | 2b6128fe0b8788318a4bbe1fc55ea14aed2981e4 (patch) | |
tree | 39a8c25dbea98e2f8b5761f408d62cf1669f89bc /src/common/file_util.cpp | |
parent | dad2ae1ee01b42bb6bb8a903c856712fc2bffa37 (diff) |
file_util: Use enum instead of bool for specifing path behavior
Diffstat (limited to 'src/common/file_util.cpp')
-rw-r--r-- | src/common/file_util.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 190cac6d9d..3ce590062a 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -884,12 +884,12 @@ std::string_view RemoveTrailingSlash(std::string_view path) { return path; } -std::string SanitizePath(std::string_view path_, bool with_platform_slashes) { +std::string SanitizePath(std::string_view path_, DirectorySeparator directory_separator) { std::string path(path_); - char type1 = '\\'; - char type2 = '/'; + char type1 = directory_separator == DirectorySeparator::BackwardSlash ? '/' : '\\'; + char type2 = directory_separator == DirectorySeparator::BackwardSlash ? '\\' : '/'; - if (with_platform_slashes) { + if (directory_separator == DirectorySeparator::PlatformDefault) { #ifdef _WIN32 type1 = '/'; type2 = '\\'; |