From 57952505e522be868a5a8270d8670163b55ebade Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Tue, 5 May 2020 22:52:14 +0100 Subject: Update fmt to 6.2.0 (#4718) * Update fmt to 6.2.0 --- src/StringUtils.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index 428578c03..0013762a2 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -23,21 +23,29 @@ typedef std::map AStringMap; /** Output the formatted text into the string. Returns a_Dst. */ -extern AString & Printf(AString & a_Dst, const char * format, fmt::ArgList args); -FMT_VARIADIC(AString &, Printf, AString &, const char *) +extern AString & vPrintf(AString & a_Dst, const char * format, fmt::printf_args args); +template +AString & Printf(AString & a_Dst, const char * a_Format, const Args & ... args) +{ + return vPrintf(a_Dst, a_Format, fmt::make_printf_args(args...)); +} /** Output the formatted text into string Returns the formatted string by value. */ -extern AString Printf(const char * format, fmt::ArgList args); -FMT_VARIADIC(AString, Printf, const char *) +extern AString vPrintf(const char * format, fmt::printf_args args); +template +AString Printf(const char * a_Format, const Args & ... args) +{ + return vPrintf(a_Format, fmt::make_printf_args(args...)); +} /** Add the formated string to the existing data in the string. Returns a_Dst. */ +extern AString & vAppendPrintf(AString & a_Dst, const char * a_Format, fmt::printf_args args); template -extern AString & AppendPrintf(AString & a_Dst, const char * format, const Args & ... args) +extern AString & AppendPrintf(AString & a_Dst, const char * a_Format, const Args & ... a_Args) { - a_Dst += Printf(format, args...); - return a_Dst; + return vAppendPrintf(a_Dst, a_Format, fmt::make_printf_args(a_Args...)); } /** Split the string at any of the listed delimiters. -- cgit v1.2.3