From ca16dc8c1b8da86f55a790a5f8cc6913dd005fcc Mon Sep 17 00:00:00 2001 From: Naios Date: Wed, 22 Jul 2015 01:03:40 +0200 Subject: Core/Database: Enable perfect forwarding for database format calls. --- src/server/shared/Utilities/StringFormat.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/server/shared/Utilities') diff --git a/src/server/shared/Utilities/StringFormat.h b/src/server/shared/Utilities/StringFormat.h index 0e9dde471da..67e0100e7c8 100644 --- a/src/server/shared/Utilities/StringFormat.h +++ b/src/server/shared/Utilities/StringFormat.h @@ -19,7 +19,7 @@ #ifndef TRINITYCORE_STRING_FORMAT_H #define TRINITYCORE_STRING_FORMAT_H -#include +#include "format.h" namespace Trinity { @@ -29,6 +29,18 @@ namespace Trinity { return fmt::sprintf(std::forward(fmt), std::forward(args)...); } + + /// Returns true if the given char pointer is null. + inline bool IsFormatEmptyOrNull(const char* fmt) + { + return fmt == nullptr; + } + + /// Returns true if the given std::string is empty. + inline bool IsFormatEmptyOrNull(std::string const& fmt) + { + return fmt.empty(); + } } #endif -- cgit v1.2.3