mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:37:44 +00:00
AK: Add a Utf16View::code_unit_offset_of(Utf16CodePointIterator) helper
This helper can be used to used to retrieve the code unit offset of an active Utf16CodePointIterator efficiently.
This commit is contained in:
parent
2d50c08f34
commit
44e8c05c67
2 changed files with 9 additions and 0 deletions
|
@ -93,6 +93,7 @@ public:
|
|||
|
||||
size_t code_point_offset_of(size_t code_unit_offset) const;
|
||||
size_t code_unit_offset_of(size_t code_point_offset) const;
|
||||
size_t code_unit_offset_of(Utf16CodePointIterator const&) const;
|
||||
|
||||
Utf16View substring_view(size_t code_unit_offset, size_t code_unit_length) const;
|
||||
Utf16View substring_view(size_t code_unit_offset) const { return substring_view(code_unit_offset, length_in_code_units() - code_unit_offset); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue