diff --git a/src/util/StringAPI.hxx b/src/util/StringAPI.hxx index b94a4566f..febaabbc7 100644 --- a/src/util/StringAPI.hxx +++ b/src/util/StringAPI.hxx @@ -94,6 +94,13 @@ StringFindLast(char *haystack, char needle) noexcept return strrchr(haystack, needle); } +gcc_pure gcc_nonnull_all +static inline const char * +StringFindAny(const char *haystack, const char *accept) noexcept +{ + return strpbrk(haystack, accept); +} + static inline char * StringToken(char *str, const char *delim) noexcept { diff --git a/src/util/WStringAPI.hxx b/src/util/WStringAPI.hxx index 6e3aa204d..efe8205ea 100644 --- a/src/util/WStringAPI.hxx +++ b/src/util/WStringAPI.hxx @@ -90,6 +90,13 @@ StringFindLast(wchar_t *haystack, wchar_t needle) noexcept return wcsrchr(haystack, needle); } +gcc_pure gcc_nonnull_all +static inline const wchar_t * +StringFindAny(const wchar_t *haystack, const wchar_t *accept) noexcept +{ + return wcspbrk(haystack, accept); +} + gcc_nonnull_all static inline void UnsafeCopyString(wchar_t *dest, const wchar_t *src) noexcept