mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
AK: Add a case insensitive of is_one_of to String[View]
This commit is contained in:
parent
e154c2c2ca
commit
820e03e8d4
2 changed files with 24 additions and 0 deletions
|
@ -279,6 +279,18 @@ public:
|
|||
return (... || this->operator==(forward<Ts>(strings)));
|
||||
}
|
||||
|
||||
template<typename... Ts>
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of_ignoring_case(Ts&&... strings) const
|
||||
{
|
||||
return (... ||
|
||||
[this, &strings]() -> bool {
|
||||
if constexpr (requires(Ts a) { a.view()->StringView; })
|
||||
return this->equals_ignoring_case(forward<Ts>(strings.view()));
|
||||
else
|
||||
return this->equals_ignoring_case(forward<Ts>(strings));
|
||||
}());
|
||||
}
|
||||
|
||||
private:
|
||||
friend class String;
|
||||
const char* m_characters { nullptr };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue