aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/StringView.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-10-16 08:59:47 +0200
committerMax Kellermann <max@duempel.org>2015-10-16 08:59:47 +0200
commit27a40a984364a1ed2619028babd854a4397a881b (patch)
treee4d87b1a4e902db75d77660dd4ab5e010933ff0e /src/util/StringView.hxx
parentc7b0e9b05b509d23a662189db421ae2b2e36525a (diff)
downloadmpd-27a40a984364a1ed2619028babd854a4397a881b.tar.gz
mpd-27a40a984364a1ed2619028babd854a4397a881b.tar.xz
mpd-27a40a984364a1ed2619028babd854a4397a881b.zip
util/StringView: add methods StripLeft(), StripRight()
Diffstat (limited to 'src/util/StringView.hxx')
-rw-r--r--src/util/StringView.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/StringView.hxx b/src/util/StringView.hxx
index fbae9a7cc..dd6c4dc77 100644
--- a/src/util/StringView.hxx
+++ b/src/util/StringView.hxx
@@ -103,6 +103,16 @@ struct StringView : ConstBuffer<char> {
bool EqualsLiteralIgnoreCase(const char (&other)[n]) const {
return EqualsIgnoreCase({other, n - 1});
}
+
+ /**
+ * Skip all whitespace at the beginning.
+ */
+ void StripLeft();
+
+ /**
+ * Skip all whitespace at the end.
+ */
+ void StripRight();
};
#endif