aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/StringUtil.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-02 22:26:46 +0100
committerMax Kellermann <max@duempel.org>2015-03-03 11:29:31 +0100
commit820debf45a3bc5567fc16a4f982bdf41df7d7ef2 (patch)
treec5a83325ebabf0079609c8976c89f59a08909685 /src/util/StringUtil.hxx
parentc19292c036ecc8791ad985968638baa76b7f0d3c (diff)
downloadmpd-820debf45a3bc5567fc16a4f982bdf41df7d7ef2.tar.gz
mpd-820debf45a3bc5567fc16a4f982bdf41df7d7ef2.tar.xz
mpd-820debf45a3bc5567fc16a4f982bdf41df7d7ef2.zip
util/StringUtil: add FindStringSuffix()
Diffstat (limited to 'src/util/StringUtil.hxx')
-rw-r--r--src/util/StringUtil.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/StringUtil.hxx b/src/util/StringUtil.hxx
index 9f2dab935..4f44ab94a 100644
--- a/src/util/StringUtil.hxx
+++ b/src/util/StringUtil.hxx
@@ -91,6 +91,14 @@ bool
StringEndsWith(const char *haystack, const char *needle);
/**
+ * Check if the given string ends with the specified suffix. If yes,
+ * returns the position of the suffix, and nullptr otherwise.
+ */
+gcc_pure
+const char *
+FindStringSuffix(const char *p, const char *suffix);
+
+/**
* Copy a string. If the buffer is too small, then the string is
* truncated. This is a safer version of strncpy().
*