diff options
Diffstat (limited to '')
-rw-r--r-- | src/common/fs/path_util.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index 2874ea738..59301e7ed 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h @@ -289,7 +289,11 @@ enum class DirectorySeparator { // Splits the path on '/' or '\' and put the components into a vector // i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } -[[nodiscard]] std::vector<std::string> SplitPathComponents(std::string_view filename); +[[nodiscard]] std::vector<std::string_view> SplitPathComponents(std::string_view filename); + +// Splits the path on '/' or '\' and put the components into a vector +// i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } +[[nodiscard]] std::vector<std::string> SplitPathComponentsCopy(std::string_view filename); // Removes trailing slash, makes all '\\' into '/', and removes duplicate '/'. Makes '/' into '\\' // depending if directory_separator is BackwardSlash or PlatformDefault and running on windows @@ -298,7 +302,7 @@ enum class DirectorySeparator { DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash); // Gets all of the text up to the last '/' or '\' in the path. -[[nodiscard]] std::string_view GetParentPath(std::string_view path); +[[nodiscard]] std::string GetParentPath(std::string_view path); // Gets all of the text after the first '/' or '\' in the path. [[nodiscard]] std::string_view GetPathWithoutTop(std::string_view path); |