diff --git a/deps/ox/src/ox/std/string.cpp b/deps/ox/src/ox/std/string.cpp index 1ead6fb4..a3a07a4c 100644 --- a/deps/ox/src/ox/std/string.cpp +++ b/deps/ox/src/ox/std/string.cpp @@ -60,6 +60,15 @@ String &String::operator=(char *str) noexcept { return *this = static_cast(str); } +String &String::operator=(char c) noexcept { + char str[] = {c, 0}; + return this->operator=(str); +} + +String &String::operator=(int i) noexcept { + return this->operator=(static_cast(i)); +} + String &String::operator=(int64_t i) noexcept { char str[65] = {}; ox_itoa(i, str); @@ -89,6 +98,15 @@ String &String::operator+=(char *str) noexcept { return *this += static_cast(str); } +String &String::operator+=(char c) noexcept { + char str[] = {c, 0}; + return this->operator+=(str); +} + +String &String::operator+=(int i) noexcept { + return this->operator+=(static_cast(i)); +} + String &String::operator+=(int64_t i) noexcept { char str[65] = {}; ox_itoa(i, str); @@ -115,6 +133,15 @@ String String::operator+(char *str) const noexcept { return *this + static_cast(str); } +String String::operator+(char c) const noexcept { + char str[] = {c, 0}; + return *this + str; +} + +String String::operator+(int i) const noexcept { + return this->operator+(static_cast(i)); +} + String String::operator+(int64_t i) const noexcept { char str[65] = {}; ox_itoa(i, str); diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index cf63298a..236c3802 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -40,6 +40,10 @@ class String { String &operator=(char *str) noexcept; + String &operator=(char c) noexcept; + + String &operator=(int i) noexcept; + String &operator=(int64_t i) noexcept; String &operator=(const String &src) noexcept; @@ -50,6 +54,10 @@ class String { String &operator+=(char *str) noexcept; + String &operator+=(char c) noexcept; + + String &operator+=(int i) noexcept; + String &operator+=(int64_t i) noexcept; String &operator+=(const String &src) noexcept; @@ -58,6 +66,10 @@ class String { String operator+(char *str) const noexcept; + String operator+(char c) const noexcept; + + String operator+(int i) const noexcept; + String operator+(int64_t i) const noexcept; String operator+(const String &src) const noexcept;