diff options
-rw-r--r-- | include/fud_string.hpp | 4 | ||||
-rw-r--r-- | source/fud_string.cpp | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/fud_string.hpp b/include/fud_string.hpp index f7e4813..97b7036 100644 --- a/include/fud_string.hpp +++ b/include/fud_string.hpp @@ -117,6 +117,10 @@ class String { [[nodiscard]] String append(const String& rhs) const; + const utf8* begin() const; + + const utf8* end() const; + private: using BufType = Array<utf8, SSO_BUF_SIZE>; union { diff --git a/source/fud_string.cpp b/source/fud_string.cpp index 57bf1e0..74742e1 100644 --- a/source/fud_string.cpp +++ b/source/fud_string.cpp @@ -287,6 +287,16 @@ String String::append(const String& rhs) const return output; } +const utf8* String::begin() const +{ + return data(); +} + +const utf8* String::end() const +{ + return data() + size(); +} + bool StringView::nullTerminated() const { return m_data != nullptr && m_data[m_length] == '\0'; |