1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

AK: Prepare Utf32View for use within templated LibGfx contexts

Forward declare its iterator and add a peek() method analagous to
Utf8CodePointIterator::peek().
This commit is contained in:
Timothy Flynn 2023-02-20 14:04:42 -05:00 committed by Andreas Kling
parent 0f20586346
commit 832e9b8302
3 changed files with 23 additions and 0 deletions

View file

@ -43,6 +43,9 @@ public:
return *m_ptr;
}
// NOTE: This returns {} if the peek is at or past EOF.
Optional<u32> peek(size_t offset = 0) const;
constexpr int code_point_length_in_bytes() const { return sizeof(u32); }
bool done() const { return !m_length; }