diff options
author | Naios <naios-dev@live.de> | 2015-07-22 01:03:40 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2015-07-22 01:56:06 +0200 |
commit | ca16dc8c1b8da86f55a790a5f8cc6913dd005fcc (patch) | |
tree | 1880f2afe728cd1e5a9abad25790273b4f26dc4e /src/server/shared/Utilities | |
parent | 026ceb85b9e0e870d95cea42895e867198c156dd (diff) |
Core/Database: Enable perfect forwarding for database format calls.
Diffstat (limited to 'src/server/shared/Utilities')
-rw-r--r-- | src/server/shared/Utilities/StringFormat.h | 14 |
1 files changed, 13 insertions, 1 deletions
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 <format.h> +#include "format.h" namespace Trinity { @@ -29,6 +29,18 @@ namespace Trinity { return fmt::sprintf(std::forward<Format>(fmt), std::forward<Args>(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 |