mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Add a comparison operator for Utf32View
This commit is contained in:
committed by
Andreas Kling
parent
cf9693169c
commit
0703ba118b
@@ -27,6 +27,14 @@ Optional<u32> Utf32CodePointIterator::peek(size_t offset) const
|
|||||||
return *new_iterator;
|
return *new_iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Utf32View::operator==(Utf32View const& other) const
|
||||||
|
{
|
||||||
|
ReadonlySpan<u32> code_points { m_code_points, m_length };
|
||||||
|
ReadonlySpan<u32> other_code_points { other.m_code_points, other.m_length };
|
||||||
|
|
||||||
|
return code_points == other_code_points;
|
||||||
|
}
|
||||||
|
|
||||||
ErrorOr<void> Formatter<Utf32View>::format(FormatBuilder& builder, Utf32View const& string)
|
ErrorOr<void> Formatter<Utf32View>::format(FormatBuilder& builder, Utf32View const& string)
|
||||||
{
|
{
|
||||||
return builder.builder().try_append(string);
|
return builder.builder().try_append(string);
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ public:
|
|||||||
return substring_view(offset, length() - offset);
|
return substring_view(offset, length() - offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(Utf32View const& other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
u32 const* begin_ptr() const
|
u32 const* begin_ptr() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user