diff options
Diffstat (limited to 'src/util/StringUtil.hxx')
-rw-r--r-- | src/util/StringUtil.hxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/StringUtil.hxx b/src/util/StringUtil.hxx index abed3b45b..9beda5441 100644 --- a/src/util/StringUtil.hxx +++ b/src/util/StringUtil.hxx @@ -39,6 +39,28 @@ StripLeft(char *p) return const_cast<char *>(StripLeft((const char *)p)); } +gcc_pure +const char * +StripLeft(const char *p, const char *end); + +/** + * Determine the string's end as if it was stripped on the right side. + */ +gcc_pure +const char * +StripRight(const char *p, const char *end); + +/** + * Determine the string's end as if it was stripped on the right side. + */ +gcc_pure +static inline char * +StripRight(char *p, char *end) +{ + return const_cast<char *>(StripRight((const char *)p, + (const char *)end)); +} + /** * Determine the string's length as if it was stripped on the right * side. |