util/StringView: add methods StripLeft(), StripRight()

This commit is contained in:
Max Kellermann
2015-10-16 08:59:47 +02:00
parent c7b0e9b05b
commit 27a40a9843
3 changed files with 56 additions and 1 deletions

View File

@@ -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