From 09d26d43b5262f480fd55eab9980eff06a71edbb Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 26 Jun 2023 01:42:18 +1000 Subject: 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 --- source/core/StarString.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/core/StarString.hpp') 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, -- cgit v1.2.3