From c9522fb740200ccef6230cec452c48efb31e5394 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 11 May 2023 22:05:17 +0200 Subject: Removed all Printf-family functions from StringUtils. Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code. --- src/StringUtils.h | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/StringUtils.h') diff --git a/src/StringUtils.h b/src/StringUtils.h index cd232bb68..efb6a8566 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -19,33 +19,6 @@ typedef std::map AStringMap; -/** Output the formatted text into the string. -Returns a_Dst. */ -extern AString & vPrintf(AString & a_Dst, const char * a_Format, fmt::printf_args a_ArgList); -template -AString & Printf(AString & a_Dst, const char * a_Format, const Args & ... a_Args) -{ - return vPrintf(a_Dst, a_Format, fmt::make_printf_args(a_Args...)); -} - -/** Output the formatted text into string -Returns the formatted string by value. */ -extern AString vPrintf(const char * a_Format, fmt::printf_args a_ArgList); -template -AString Printf(const char * a_Format, const Args & ... a_Args) -{ - return vPrintf(a_Format, fmt::make_printf_args(a_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 a_ArgList); -template -extern AString & AppendPrintf(AString & a_Dst, const char * a_Format, const Args & ... a_Args) -{ - return vAppendPrintf(a_Dst, a_Format, fmt::make_printf_args(a_Args...)); -} - /** Split the string at any of the listed delimiters. Return the splitted strings as a stringvector. */ extern AStringVector StringSplit(const AString & str, const AString & delim); -- cgit v1.2.3