diff options
| author | Timothy Werquin <timothy@werquin.com> | 2018-05-15 22:23:03 +0200 |
|---|---|---|
| committer | Timothy Werquin <timothy@werquin.com> | 2018-05-15 22:23:03 +0200 |
| commit | 1803ca43fa912183554857a5da45e695fe8e9645 (patch) | |
| tree | 3dd3ffe63834aeede96cf7c7ebb43e62f21a6bf2 /src/core/String.cpp | |
| parent | d8becfbe903d11294edfa9cda19dc91274605073 (diff) | |
| download | redot-cpp-1803ca43fa912183554857a5da45e695fe8e9645.tar.gz | |
Fix String const operators.
Added const to various operators.
Diffstat (limited to 'src/core/String.cpp')
| -rw-r--r-- | src/core/String.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/String.cpp b/src/core/String.cpp index 737c040..7cbc090 100644 --- a/src/core/String.cpp +++ b/src/core/String.cpp @@ -115,15 +115,15 @@ void String::operator=(const String &s) { godot::api->godot_string_new_copy(&_godot_string, &s._godot_string); } -bool String::operator==(const String &s) { +bool String::operator==(const String &s) const { return godot::api->godot_string_operator_equal(&_godot_string, &s._godot_string); } -bool String::operator!=(const String &s) { +bool String::operator!=(const String &s) const { return !(*this == s); } -String String::operator+(const String &s) { +String String::operator+(const String &s) const { String new_string = *this; new_string._godot_string = godot::api->godot_string_operator_plus(&new_string._godot_string, &s._godot_string); @@ -134,24 +134,24 @@ void String::operator+=(const String &s) { _godot_string = godot::api->godot_string_operator_plus(&_godot_string, &s._godot_string); } -void String::operator+=(const wchar_t c) { +void String::operator+=(const wchar_t c) const { // @Todo } -bool String::operator<(const String &s) { +bool String::operator<(const String &s) const { return godot::api->godot_string_operator_less(&_godot_string, &s._godot_string); } -bool String::operator<=(const String &s) { +bool String::operator<=(const String &s) const { return godot::api->godot_string_operator_less(&_godot_string, &s._godot_string) || (*this == s); } -bool String::operator>(const String &s) { +bool String::operator>(const String &s) const { return !(*this <= s); } -bool String::operator>=(const String &s) { +bool String::operator>=(const String &s) const { return !(*this < s); } |
