From 5f6598f9e91521c7932215debdbf0eac8607ad07 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 16 Mar 2020 21:03:21 +0100 Subject: StringUtil: Add PathToFileName function --- Source/Core/Common/StringUtil.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/Core/Common/StringUtil.cpp') 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) { -- cgit v1.2.3