diff --git a/AK/Utf32View.cpp b/AK/Utf32View.cpp index ebb4bbd1f7a..a482aa54f1f 100644 --- a/AK/Utf32View.cpp +++ b/AK/Utf32View.cpp @@ -27,6 +27,14 @@ Optional Utf32CodePointIterator::peek(size_t offset) const return *new_iterator; } +bool Utf32View::operator==(Utf32View const& other) const +{ + ReadonlySpan code_points { m_code_points, m_length }; + ReadonlySpan other_code_points { other.m_code_points, other.m_length }; + + return code_points == other_code_points; +} + ErrorOr Formatter::format(FormatBuilder& builder, Utf32View const& string) { return builder.builder().try_append(string); diff --git a/AK/Utf32View.h b/AK/Utf32View.h index 3a522471b1e..b030d64b1fa 100644 --- a/AK/Utf32View.h +++ b/AK/Utf32View.h @@ -119,6 +119,8 @@ public: return substring_view(offset, length() - offset); } + bool operator==(Utf32View const& other) const; + private: u32 const* begin_ptr() const {