2
0
Brian Fiete 1 жил өмнө
parent
commit
8f0ba26dd1

+ 1 - 1
BeefRT/rt/Internal.cpp

@@ -680,7 +680,7 @@ void TestFailed(const Beefy::StringView& error, int stackOffset)
 {
 {
 	if (gClientPipe != NULL)
 	if (gClientPipe != NULL)
 	{
 	{
-		Beefy::String errorString = error;
+		Beefy::StringSimple errorString = error;
 
 
 		if (gTestBreakOnFailure)
 		if (gTestBreakOnFailure)
 		{
 		{

+ 2 - 2
BeefRT/rt/Object.cpp

@@ -7,7 +7,7 @@ Beefy::String bf::System::Object::GetTypeName()
 	String* strObj = BFRTCALLBACKS.String_Alloc();
 	String* strObj = BFRTCALLBACKS.String_Alloc();
 	Type* type = _GetType();
 	Type* type = _GetType();
 	BFRTCALLBACKS.Type_GetFullName(type, strObj);
 	BFRTCALLBACKS.Type_GetFullName(type, strObj);
-	Beefy::String str = strObj->ToStringView();
+	Beefy::StringSimple str = strObj->ToStringView();
 	BFRTCALLBACKS.Object_Delete(strObj);
 	BFRTCALLBACKS.Object_Delete(strObj);
 	return str;
 	return str;
 }
 }
@@ -16,7 +16,7 @@ Beefy::String bf::System::Type::GetFullName()
 {
 {
 	String* strObj = BFRTCALLBACKS.String_Alloc();
 	String* strObj = BFRTCALLBACKS.String_Alloc();
 	BFRTCALLBACKS.Type_GetFullName(this, strObj);
 	BFRTCALLBACKS.Type_GetFullName(this, strObj);
-	Beefy::String str = strObj->ToStringView();
+	Beefy::StringSimple str = strObj->ToStringView();
 	BFRTCALLBACKS.Object_Delete(strObj);
 	BFRTCALLBACKS.Object_Delete(strObj);
 	return str;
 	return str;
 }
 }

+ 9 - 0
BeefySysLib/util/String.h

@@ -1241,6 +1241,15 @@ public:
 		((char*)mPtr)[this->mLength] = 0;
 		((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()
 	~StringSimple()
 	{
 	{
 		delete this->mPtr;
 		delete this->mPtr;