mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
AK: Add some string comparison operators
Some of these are very inefficient. It's nice to have some optimization opportunities in the future though. :^)
This commit is contained in:
parent
0d2fb306af
commit
95cc4c7e74
Notes:
sideshowbarker
2024-07-19 08:06:09 +09:00
Author: https://github.com/awesomekling
Commit: 95cc4c7e74
4 changed files with 34 additions and 0 deletions
|
@ -42,6 +42,15 @@ public:
|
|||
bool operator==(const FlyString& other) const { return m_impl == other.m_impl; }
|
||||
bool operator!=(const FlyString& other) const { return m_impl != other.m_impl; }
|
||||
|
||||
bool operator==(const String&) const;
|
||||
bool operator!=(const String& string) const { return !(*this == string); }
|
||||
|
||||
bool operator==(const StringView&) const;
|
||||
bool operator!=(const StringView& string) const { return !(*this == string); }
|
||||
|
||||
bool operator==(const char*) const;
|
||||
bool operator!=(const char* string) const { return !(*this == string); }
|
||||
|
||||
const StringImpl* impl() const { return m_impl; }
|
||||
const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
|
||||
size_t length() const { return m_impl ? m_impl->length() : 0; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue