From a2e1ac8851c8f88de3d7971267cdf2f1710c63c8 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 24 Apr 2021 15:48:46 -0500 Subject: [PATCH] [ox/std] Add std::string and QString support to fmt --- deps/ox/src/ox/std/fmt.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/deps/ox/src/ox/std/fmt.hpp b/deps/ox/src/ox/std/fmt.hpp index 8c32c9e90..db91dcfad 100644 --- a/deps/ox/src/ox/std/fmt.hpp +++ b/deps/ox/src/ox/std/fmt.hpp @@ -8,6 +8,15 @@ #pragma once +#if __has_include() +#include +#endif + +#if __has_include() +#include +#endif + +#include #include #include #include @@ -19,10 +28,27 @@ constexpr const char *stringify(const char *s) noexcept { return s; } +template +constexpr const char *stringify(const ox::BString &s) noexcept { + return s.c_str(); +} + constexpr const char *stringify(const ox::String &s) noexcept { return s.c_str(); } +#if __has_include() +constexpr const char *stringify(const std::string &s) noexcept { + return s.c_str(); +} +#endif + +#if __has_include() +constexpr const char *stringify(const QString &s) noexcept { + return s.c_str(); +} +#endif + class FmtArg { private: