mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
AK: Add convenience substring wrappers to String to exclude a length
These overloads exist on other string classes and are used throughout the code base.
This commit is contained in:
parent
427b82065c
commit
76fd5f2756
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/trflynn89
Commit: 76fd5f2756
Pull-request: https://github.com/SerenityOS/serenity/pull/17132
Reviewed-by: https://github.com/linusg
2 changed files with 14 additions and 0 deletions
|
@ -107,9 +107,11 @@ public:
|
|||
|
||||
// Creates a substring with a deep copy of the specified data window.
|
||||
ErrorOr<String> substring_from_byte_offset(size_t start, size_t byte_count) const;
|
||||
ErrorOr<String> substring_from_byte_offset(size_t start) const;
|
||||
|
||||
// Creates a substring that strongly references the origin superstring instead of making a deep copy of the data.
|
||||
ErrorOr<String> substring_from_byte_offset_with_shared_superstring(size_t start, size_t byte_count) const;
|
||||
ErrorOr<String> substring_from_byte_offset_with_shared_superstring(size_t start) const;
|
||||
|
||||
// Returns an iterable view over the Unicode code points.
|
||||
[[nodiscard]] Utf8View code_points() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue