diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index 951f4b6db..3dbb5d936 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -86,6 +86,14 @@ class BasicString { bool operator!=(const BasicString &other) const noexcept; + bool operator<(const BasicString &other) const noexcept; + + bool operator>(const BasicString &other) const noexcept; + + bool operator<=(const BasicString &other) const noexcept; + + bool operator>=(const BasicString &other) const noexcept; + char operator[](std::size_t i) const noexcept; char &operator[](std::size_t i) noexcept; @@ -350,6 +358,26 @@ bool BasicString::operator!=(const BasicString &other) const no return !operator==(other); } +template +bool BasicString::operator<(const BasicString &other) const noexcept { + return ox_strcmp(c_str(), other.c_str()) < 0; +} + +template +bool BasicString::operator>(const BasicString &other) const noexcept { + return ox_strcmp(c_str(), other.c_str()) > 0; +} + +template +bool BasicString::operator<=(const BasicString &other) const noexcept { + return ox_strcmp(c_str(), other.c_str()) < 1; +} + +template +bool BasicString::operator>=(const BasicString &other) const noexcept { + return ox_strcmp(c_str(), other.c_str()) > -1; +} + template char BasicString::operator[](std::size_t i) const noexcept { return m_buff[i];