Commit b59d8c3a authored by Vladislav Shchapov's avatar Vladislav Shchapov Committed by Victor Zverovich

Make std::filesystem::path formatter utf-8 compatible.

Signed-off-by: default avatarVladislav Shchapov <vladislav@shchapov.ru>
parent 232e21d5
...@@ -28,6 +28,16 @@ void write_escaped_path(basic_memory_buffer<Char>& quoted, ...@@ -28,6 +28,16 @@ void write_escaped_path(basic_memory_buffer<Char>& quoted,
const std::filesystem::path& p) { const std::filesystem::path& p) {
write_escaped_string<Char>(std::back_inserter(quoted), p.string<Char>()); write_escaped_string<Char>(std::back_inserter(quoted), p.string<Char>());
} }
# ifdef _WIN32
template <>
void write_escaped_path<char>(basic_memory_buffer<char>& quoted,
const std::filesystem::path& p) {
auto s = p.u8string();
write_escaped_string<char>(
std::back_inserter(quoted),
string_view(reinterpret_cast<const char*>(s.c_str()), s.size()));
}
# endif
template <> template <>
void write_escaped_path<std::filesystem::path::value_type>( void write_escaped_path<std::filesystem::path::value_type>(
basic_memory_buffer<std::filesystem::path::value_type>& quoted, basic_memory_buffer<std::filesystem::path::value_type>& quoted,
......
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