diff --git a/BeefRT/rt/Internal.cpp b/BeefRT/rt/Internal.cpp index ac0c0d13..87b4c078 100644 --- a/BeefRT/rt/Internal.cpp +++ b/BeefRT/rt/Internal.cpp @@ -680,7 +680,7 @@ void TestFailed(const Beefy::StringView& error, int stackOffset) { if (gClientPipe != NULL) { - Beefy::String errorString = error; + Beefy::StringSimple errorString = error; if (gTestBreakOnFailure) { diff --git a/BeefRT/rt/Object.cpp b/BeefRT/rt/Object.cpp index f8c7c002..79cc8128 100644 --- a/BeefRT/rt/Object.cpp +++ b/BeefRT/rt/Object.cpp @@ -7,7 +7,7 @@ Beefy::String bf::System::Object::GetTypeName() String* strObj = BFRTCALLBACKS.String_Alloc(); Type* type = _GetType(); BFRTCALLBACKS.Type_GetFullName(type, strObj); - Beefy::String str = strObj->ToStringView(); + Beefy::StringSimple str = strObj->ToStringView(); BFRTCALLBACKS.Object_Delete(strObj); return str; } @@ -16,7 +16,7 @@ Beefy::String bf::System::Type::GetFullName() { String* strObj = BFRTCALLBACKS.String_Alloc(); BFRTCALLBACKS.Type_GetFullName(this, strObj); - Beefy::String str = strObj->ToStringView(); + Beefy::StringSimple str = strObj->ToStringView(); BFRTCALLBACKS.Object_Delete(strObj); return str; } diff --git a/BeefySysLib/util/String.h b/BeefySysLib/util/String.h index 63be3b47..7c0cb03f 100644 --- a/BeefySysLib/util/String.h +++ b/BeefySysLib/util/String.h @@ -1241,6 +1241,15 @@ public: ((char*)mPtr)[this->mLength] = 0; } + StringSimple& operator=(const StringView& sv) + { + delete this->mPtr; + this->mPtr = new char[sv.mLength + 1]; + this->mLength = sv.mLength; + memcpy((char*)this->mPtr, sv.mPtr, this->mLength); + ((char*)this->mPtr)[this->mLength] = 0; + } + ~StringSimple() { delete this->mPtr;