From: Gunnar Beutner Date: Thu, 7 Nov 2013 11:17:06 +0000 (+0100) Subject: Implement String::FindFirstNotOf. X-Git-Tag: v0.0.4~31^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14553139aec0cc2bca9634a5295cbf8a70d4382a;p=icinga2 Implement String::FindFirstNotOf. Refs #2710 --- diff --git a/lib/base/qstring.cpp b/lib/base/qstring.cpp index 80e08261a..c36281207 100644 --- a/lib/base/qstring.cpp +++ b/lib/base/qstring.cpp @@ -142,6 +142,16 @@ size_t String::FindFirstOf(char ch, size_t pos) const return m_Data.find_first_of(ch, pos); } +size_t String::FindFirstNotOf(const char *s, size_t pos) const +{ + return m_Data.find_first_not_of(s, pos); +} + +size_t String::FindFirstNotOf(char ch, size_t pos) const +{ + return m_Data.find_first_not_of(ch, pos); +} + String String::SubStr(size_t first, size_t len) const { return m_Data.substr(first, len); diff --git a/lib/base/qstring.h b/lib/base/qstring.h index e26717fca..9ca0e5e5f 100644 --- a/lib/base/qstring.h +++ b/lib/base/qstring.h @@ -81,6 +81,8 @@ public: size_t Find(const String& str, size_t pos = 0) const; size_t FindFirstOf(const char *s, size_t pos = 0) const; size_t FindFirstOf(char ch, size_t pos = 0) const; + size_t FindFirstNotOf(const char *s, size_t pos = 0) const; + size_t FindFirstNotOf(char ch, size_t pos = 0) const; String SubStr(size_t first, size_t len = NPos) const; void Replace(size_t first, size_t second, const String& str);