diff --git a/support/3rd_party/include/utils/path.hpp b/support/3rd_party/include/utils/path.hpp index 747a618a..8e10e9a8 100644 --- a/support/3rd_party/include/utils/path.hpp +++ b/support/3rd_party/include/utils/path.hpp @@ -218,7 +218,9 @@ get_parent_api_path(std::wstring_view path) -> std::wstring; [[nodiscard]] auto resolve(std::wstring_view path) -> std::wstring; #endif // !defined(_WIN32) -[[nodiscard]] auto strip_to_file_name(std::string_view path) -> std::string; +[[nodiscard]] auto strip_to_file_name(std::string path) -> std::string; + +[[nodiscard]] auto strip_to_file_name(std::wstring path) -> std::wstring; [[nodiscard]] auto unmake_file_uri(std::string_view uri) -> std::string; diff --git a/support/3rd_party/src/utils/path.cpp b/support/3rd_party/src/utils/path.cpp index f394611f..dc0c325b 100644 --- a/support/3rd_party/src/utils/path.cpp +++ b/support/3rd_party/src/utils/path.cpp @@ -178,9 +178,14 @@ auto resolve(std::wstring_view path) -> std::wstring { auto strip_to_file_name(std::string path) -> std::string { #if defined(_WIN32) return ::PathFindFileName(path.c_str()); -#else +#else // !defined(_WIN32) return utils::string::contains(path, "/") ? basename(path.data()) : path; -#endif +#endif // defined(_WIN32) +} + +auto strip_to_file_name(std::wstring path) -> std::wstring { + return utils::string::to_utf8( + strip_to_file_name(utils::string::to_utf8(path))); } auto unmake_file_uri(std::string_view uri) -> std::string {