summaryrefslogtreecommitdiffstats
path: root/src/core/String.cpp
diff options
context:
space:
mode:
authorThomas Herzog <thomas.herzog@mail.com>2018-05-15 23:00:02 +0200
committerGitHub <noreply@github.com>2018-05-15 23:00:02 +0200
commit1d4ca1575fcbe344a66e0448110ada1e16e435ee (patch)
tree8ac6d239f0d036057892caca2ae342faa37b54ee /src/core/String.cpp
parentd8becfbe903d11294edfa9cda19dc91274605073 (diff)
parent1a32997a0f877b1411bdf39c53f52b491285026c (diff)
downloadredot-cpp-1d4ca1575fcbe344a66e0448110ada1e16e435ee.tar.gz
Merge pull request #133 from timower/master
Fix const for String operators.
Diffstat (limited to 'src/core/String.cpp')
-rw-r--r--src/core/String.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/String.cpp b/src/core/String.cpp
index 737c040..f85fa04 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);
@@ -138,20 +138,20 @@ void String::operator+=(const wchar_t c) {
// @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);
}