diff options
| author | JosJuice <josjuice@gmail.com> | 2020-03-16 21:03:21 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2020-03-16 21:03:34 +0100 |
| commit | 5f6598f9e91521c7932215debdbf0eac8607ad07 (patch) | |
| tree | 5a9a9131aec5214cdca875e55b69289dc95852c0 /Source/Core/Common/StringUtil.cpp | |
| parent | c86832849a768bae73b0966d0d6560b5b9ce300a (diff) | |
StringUtil: Add PathToFileName function
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 3afb09873f..c44f3fa7b1 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -322,6 +322,13 @@ bool SplitPath(std::string_view full_path, std::string* path, std::string* filen return true; } +std::string PathToFileName(std::string_view path) +{ + std::string file_name, extension; + SplitPath(path, nullptr, &file_name, &extension); + return file_name + extension; +} + void BuildCompleteFilename(std::string& complete_filename, std::string_view path, std::string_view filename) { |
