summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-11-06 09:37:07 +0100
committerMax Kellermann <max@duempel.org>2015-11-06 09:37:07 +0100
commitc880099deb41c09ea7844daa27a42dac4142c0cd (patch)
tree571482d1e6e7efc95ab7d443f246232188d3c23f /src/util
parent42f5ecd4a116c96d30bf407859dadaa9a053ea39 (diff)
util/StringCompare: add StringIsEmpty()
Diffstat (limited to 'src/util')
-rw-r--r--src/util/StringCompare.hxx6
-rw-r--r--src/util/WStringCompare.hxx6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/util/StringCompare.hxx b/src/util/StringCompare.hxx
index 2c23b312f..a29892bc9 100644
--- a/src/util/StringCompare.hxx
+++ b/src/util/StringCompare.hxx
@@ -36,6 +36,12 @@
#include "WStringCompare.hxx"
#endif
+static inline bool
+StringIsEmpty(const char *string)
+{
+ return *string == 0;
+}
+
gcc_pure
bool
StringStartsWith(const char *haystack, const char *needle);
diff --git a/src/util/WStringCompare.hxx b/src/util/WStringCompare.hxx
index 3547076ca..bddd62120 100644
--- a/src/util/WStringCompare.hxx
+++ b/src/util/WStringCompare.hxx
@@ -34,6 +34,12 @@
#include <wchar.h>
+static inline bool
+StringIsEmpty(const wchar_t *string)
+{
+ return *string == 0;
+}
+
gcc_pure
bool
StringStartsWith(const wchar_t *haystack, const wchar_t *needle);