mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add a is_null() method to Utf{8,32}View
Both of these can be null as well as empty, and there's a difference.
This commit is contained in:
parent
2961982277
commit
55fa51b4e2
Notes:
sideshowbarker
2024-07-18 08:47:38 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/55fa51b4e22 Pull-request: https://github.com/SerenityOS/serenity/pull/8847 Reviewed-by: https://github.com/MaxWipfli Reviewed-by: https://github.com/linusg ✅ Reviewed-by: https://github.com/trflynn89
2 changed files with 2 additions and 0 deletions
|
@ -83,6 +83,7 @@ public:
|
|||
|
||||
const u32* code_points() const { return m_code_points; }
|
||||
bool is_empty() const { return m_length == 0; }
|
||||
bool is_null() const { return !m_code_points; }
|
||||
size_t length() const { return m_length; }
|
||||
|
||||
size_t iterator_offset(const Utf32CodePointIterator& it) const
|
||||
|
|
|
@ -74,6 +74,7 @@ public:
|
|||
Utf8View unicode_substring_view(size_t code_point_offset) const { return unicode_substring_view(code_point_offset, length() - code_point_offset); }
|
||||
|
||||
bool is_empty() const { return m_string.is_empty(); }
|
||||
bool is_null() const { return m_string.is_null(); }
|
||||
bool starts_with(const Utf8View&) const;
|
||||
bool contains(u32) const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue