mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:27:45 +00:00
AK: Add a `is_one_of()' to StringView
This copies the similar API from String.
This commit is contained in:
parent
f4b7a688b1
commit
f0e59f2dac
1 changed files with 10 additions and 0 deletions
|
@ -180,7 +180,17 @@ public:
|
||||||
const char* begin() { return m_characters; }
|
const char* begin() { return m_characters; }
|
||||||
const char* end() { return m_characters + m_length; }
|
const char* end() { return m_characters + m_length; }
|
||||||
|
|
||||||
|
template<typename T, typename... Rest>
|
||||||
|
bool is_one_of(const T& string, Rest... rest) const
|
||||||
|
{
|
||||||
|
if (*this == string)
|
||||||
|
return true;
|
||||||
|
return is_one_of(rest...);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool is_one_of() const { return false; }
|
||||||
|
|
||||||
friend class String;
|
friend class String;
|
||||||
const StringImpl* m_impl { nullptr };
|
const StringImpl* m_impl { nullptr };
|
||||||
const char* m_characters { nullptr };
|
const char* m_characters { nullptr };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue