aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Utilities')
-rw-r--r--src/server/shared/Utilities/StringFormat.h14
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