mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-07 10:10:08 +03:00
updated core to new GDNative interface
This commit is contained in:
@@ -33,8 +33,7 @@ String::String(const wchar_t c)
|
||||
|
||||
String::String(const String& other)
|
||||
{
|
||||
godot_string_new(&_godot_string);
|
||||
godot_string_copy_string(&_godot_string, &other._godot_string);
|
||||
godot_string_new_copy(&_godot_string, &other._godot_string);
|
||||
}
|
||||
|
||||
String::~String()
|
||||
@@ -68,7 +67,8 @@ int String::length() const
|
||||
|
||||
void String::operator =(const String &s)
|
||||
{
|
||||
godot_string_copy_string(&_godot_string, &s._godot_string);
|
||||
godot_string_destroy(&_godot_string);
|
||||
godot_string_new_copy(&_godot_string, &s._godot_string);
|
||||
}
|
||||
|
||||
bool String::operator ==(const String &s)
|
||||
@@ -83,15 +83,15 @@ bool String::operator !=(const String &s)
|
||||
|
||||
String String::operator +(const String &s)
|
||||
{
|
||||
String new_string;
|
||||
godot_string_operator_plus(&new_string._godot_string, &_godot_string, &s._godot_string);
|
||||
String new_string = *this;
|
||||
godot_string_operator_plus(&new_string._godot_string, &s._godot_string);
|
||||
|
||||
return new_string;
|
||||
}
|
||||
|
||||
void String::operator +=(const String &s)
|
||||
{
|
||||
godot_string_operator_plus(&_godot_string, &_godot_string, &s._godot_string);
|
||||
godot_string_operator_plus(&_godot_string, &s._godot_string);
|
||||
}
|
||||
|
||||
void String::operator +=(const wchar_t c)
|
||||
|
||||
Reference in New Issue
Block a user