diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-26 01:42:18 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-26 01:42:18 +1000 |
commit | 09d26d43b5262f480fd55eab9980eff06a71edbb (patch) | |
tree | 1e53765861cd966d204782aeefd15b1a67b3266f /source/core/StarString.hpp | |
parent | 13a74602bd4c46149da9949d448387a40b8ebd1c (diff) |
Add string view variant of Star::String and use it
it's 1:30 AM AGAIN !! !!!!!
This might have broken the inventory icons of custom hats a little, need to look into that
Diffstat (limited to 'source/core/StarString.hpp')
-rw-r--r-- | source/core/StarString.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/core/StarString.hpp b/source/core/StarString.hpp index 0f30fd2..ddc7926 100644 --- a/source/core/StarString.hpp +++ b/source/core/StarString.hpp @@ -12,6 +12,7 @@ namespace Star { STAR_CLASS(StringList); STAR_CLASS(String); +STAR_CLASS(StringView); STAR_EXCEPTION(StringException, StarException); @@ -268,6 +269,13 @@ public: friend std::ostream& operator<<(std::ostream& os, String const& s); friend std::istream& operator>>(std::istream& is, String& s); + // String view functions + String(StringView s); + String(std::string_view s); + + String& operator+=(StringView s); + String& operator+=(std::string_view s); + private: int compare(size_t selfOffset, size_t selfLen, |