diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-03-30 23:08:43 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-03-30 23:08:43 -0500 |
commit | cb9fa588ba8144fcdd52ba4b83d69d93fb18066f (patch) | |
tree | 214574ca68c1551ec76e7fbb9e0263793180231d /source/fud_string.cpp | |
parent | 1d357adfa19725ee69fb267a363f1fd217b1272f (diff) |
Add hash map.
Diffstat (limited to 'source/fud_string.cpp')
-rw-r--r-- | source/fud_string.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/fud_string.cpp b/source/fud_string.cpp index a2a62f4..69df7e4 100644 --- a/source/fud_string.cpp +++ b/source/fud_string.cpp @@ -389,13 +389,13 @@ FudStatus String::reserve(size_t newCapacity) return resize(newCapacity); } -[[nodiscard]] Option<utf8> String::front() +[[nodiscard]] Option<utf8> String::front() const { if (!valid() || length() < 1) { return NullOpt; } - utf8 frontChar = dataMut()[0]; + utf8 frontChar = data()[0]; if (Ascii::valid(frontChar)) { return frontChar; } @@ -403,13 +403,13 @@ FudStatus String::reserve(size_t newCapacity) return NullOpt; } -[[nodiscard]] Option<utf8> String::back() +[[nodiscard]] Option<utf8> String::back() const { if (!valid() || length() < 1) { return NullOpt; } - utf8 backChar = dataMut()[length() - 1]; + utf8 backChar = data()[length() - 1]; if (Ascii::valid(backChar)) { return backChar; } @@ -751,7 +751,7 @@ StringResult String::catenate(const String& rhs) const return StringResult::okay(std::move(output)); } -bool String::compare(const String& rhs) const +bool String::operator==(const String& rhs) const { if (!valid() || !rhs.valid()) { return false; @@ -773,6 +773,7 @@ bool String::compare(const String& rhs) const return diffResult.getOkay() == 0; } + FudStatus String::clear() { if (!valid()) { |