mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Make std::filesystem::path formatter utf-8 compatible.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
parent
232e21d51f
commit
b59d8c3a23
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user