From 18a9676d958a861a24fbebbaceb1c6863394ab3c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 21 Jun 2024 08:02:12 -0700 Subject: [PATCH] Add an experimental path --- include/fmt/std.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/fmt/std.h b/include/fmt/std.h index cd908dc9..01a61cee 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -158,6 +158,22 @@ template struct formatter { specs); } }; + +class path : public std::filesystem::path { + public: + auto display_string() const -> std::string { + const std::filesystem::path& base = *this; + return fmt::format(FMT_STRING("{}"), base); + } + auto system_string() const -> std::string { return string(); } + + auto generic_display_string() const -> std::string { + const std::filesystem::path& base = *this; + return fmt::format(FMT_STRING("{:g}"), base); + } + auto generic_system_string() const -> std::string { return generic_string(); } +}; + FMT_END_NAMESPACE #endif // FMT_CPP_LIB_FILESYSTEM