diff options
| author | Naios <naios-dev@live.de> | 2015-07-22 01:03:40 +0200 |
|---|---|---|
| committer | Naios <naios-dev@live.de> | 2015-07-22 02:18:38 +0200 |
| commit | 7f377a4f1bad53a08b1c3102a55329e2bc7335c2 (patch) | |
| tree | b5c780c2e64283be9508d21c1cd0830b6e45dcfa /src/server/shared/Utilities | |
| parent | e011ae63d5ef117e3462e538089ca58fb4777195 (diff) | |
Core/Database: Enable perfect forwarding for database format calls.
(cherry picked from commit ca16dc8c1b8da86f55a790a5f8cc6913dd005fcc)
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 |
