diff --git a/deps/ox/src/ox/std/bstring.hpp b/deps/ox/src/ox/std/bstring.hpp index 1ad7c4ac..f670f69c 100644 --- a/deps/ox/src/ox/std/bstring.hpp +++ b/deps/ox/src/ox/std/bstring.hpp @@ -37,6 +37,12 @@ class BString { constexpr BString &operator+=(int64_t i) noexcept; + constexpr BString operator+(const char *str) const noexcept; + + constexpr BString operator+(char *str) const noexcept; + + constexpr BString operator+(int64_t i) const noexcept; + constexpr bool operator==(const BString &other) const noexcept; constexpr bool operator!=(const BString &other) noexcept; @@ -123,6 +129,26 @@ constexpr BString &BString::operator+=(int64_t i) noexcept { return this->operator+=(str); } +template +constexpr BString BString::operator+(const char *str) const noexcept { + auto out = *this; + std::size_t strLen = ox_strlen(str) + 1; + oxIgnoreError(out.append(str, strLen)); + return out; +} + +template +constexpr BString BString::operator+(char *str) const noexcept { + return *this + static_cast(str); +} + +template +constexpr BString BString::operator+(int64_t i) const noexcept { + char str[65] = {}; + ox_itoa(i, str); + return this->operator+(str); +} + template constexpr bool BString::operator==(const BString &other) const noexcept { bool retval = true;