From 08b961351de69b46347fd81832d14ab4537af925 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 15 Oct 2017 21:20:25 -0700 Subject: [PATCH] ircd::fmt: Add more string types for the %s specifier here for now. --- ircd/fmt.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ircd/fmt.cc b/ircd/fmt.cc index f44df3018..fab54bc0b 100644 --- a/ircd/fmt.cc +++ b/ircd/fmt.cc @@ -89,9 +89,12 @@ struct string_specifier static const std::tuple < const char *, - ircd::string_view, + std::string, std::string_view, - std::string + ircd::string_view, + ircd::json::string, + ircd::json::object, + ircd::json::array > types; @@ -769,7 +772,10 @@ fmt::generate_string(char *&out, const auto &ptr(get<0>(val)); const auto &type(get<1>(val)); - if(type == typeid(ircd::string_view)) + if(type == typeid(ircd::string_view) || + type == typeid(ircd::json::string) || + type == typeid(ircd::json::object) || + type == typeid(ircd::json::array)) { const auto &str(*static_cast(ptr)); return karma::generate(out, gen, str);