Commit f13f6648 authored by Max Kellermann's avatar Max Kellermann

fs/Charset: pass std::string_view to PathToUTF8()

parent 0a4c5edc
...@@ -92,13 +92,8 @@ FixSeparators(const PathTraitsUTF8::string_view _s) ...@@ -92,13 +92,8 @@ FixSeparators(const PathTraitsUTF8::string_view _s)
} }
PathTraitsUTF8::string PathTraitsUTF8::string
PathToUTF8(PathTraitsFS::const_pointer path_fs) PathToUTF8(PathTraitsFS::string_view path_fs)
{ {
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(path_fs != nullptr);
#endif
#ifdef _WIN32 #ifdef _WIN32
const auto buffer = WideCharToMultiByte(CP_UTF8, path_fs); const auto buffer = WideCharToMultiByte(CP_UTF8, path_fs);
return FixSeparators(buffer); return FixSeparators(buffer);
......
...@@ -44,9 +44,8 @@ DeinitFSCharset() noexcept; ...@@ -44,9 +44,8 @@ DeinitFSCharset() noexcept;
* *
* Throws std::runtime_error on error. * Throws std::runtime_error on error.
*/ */
gcc_nonnull_all
PathTraitsUTF8::string PathTraitsUTF8::string
PathToUTF8(PathTraitsFS::const_pointer path_fs); PathToUTF8(PathTraitsFS::string_view path_fs);
/** /**
* Convert the path from UTF-8. * Convert the path from UTF-8.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment