diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-22 07:23:29 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-22 09:22:21 +0200 |
commit | 398444e67635c158a20301d1a32a1c45bfdd4056 (patch) | |
tree | db638ebe09199ae64b69f5911136effa9756571f /src/common/file_util.h | |
parent | Merge pull request #764 from lioncash/move (diff) | |
download | yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.tar yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.tar.gz yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.tar.bz2 yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.tar.lz yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.tar.xz yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.tar.zst yuzu-398444e67635c158a20301d1a32a1c45bfdd4056.zip |
Diffstat (limited to 'src/common/file_util.h')
-rw-r--r-- | src/common/file_util.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h index 090907c03..abfa79eae 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -9,6 +9,7 @@ #include <fstream> #include <functional> #include <string> +#include <string_view> #include <type_traits> #include <vector> #include "common/common_types.h" @@ -151,22 +152,22 @@ void SplitFilename83(const std::string& filename, std::array<char, 9>& short_nam // 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" } -std::vector<std::string> SplitPathComponents(const std::string& filename); +std::vector<std::string> SplitPathComponents(std::string_view filename); // Gets all of the text up to the last '/' or '\' in the path. -std::string GetParentPath(const std::string& path); +std::string_view GetParentPath(std::string_view path); // Gets all of the text after the first '/' or '\' in the path. -std::string GetPathWithoutTop(std::string path); +std::string_view GetPathWithoutTop(std::string_view path); // Gets the filename of the path -std::string GetFilename(std::string path); +std::string_view GetFilename(std::string_view path); // Gets the extension of the filename -std::string GetExtensionFromFilename(const std::string& name); +std::string_view GetExtensionFromFilename(std::string_view name); // Removes the final '/' or '\' if one exists -std::string RemoveTrailingSlash(const std::string& path); +std::string_view RemoveTrailingSlash(std::string_view path); // Creates a new vector containing indices [first, last) from the original. template <typename T> |