mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
AK: Add FlyString::is_one_of for variadic string comparison
This commit is contained in:
parent
3aa485aa09
commit
d6cf9f5329
2 changed files with 22 additions and 0 deletions
|
@ -58,6 +58,12 @@ public:
|
|||
// Compare this FlyString against another string with ASCII caseless matching.
|
||||
[[nodiscard]] bool equals_ignoring_ascii_case(FlyString const&) const;
|
||||
|
||||
template<typename... Ts>
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts... strings) const
|
||||
{
|
||||
return (... || this->operator==(forward<Ts>(strings)));
|
||||
}
|
||||
|
||||
private:
|
||||
// This will hold either the pointer to the Detail::StringData it represents or the raw bytes of
|
||||
// an inlined short string.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue