From f19cd44346a68a649cabfe85cc3ba7a44ceb0ca4 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:41:29 +0200 Subject: Unify TextServer built-in module and GDExtension code. --- core/string/ustring.cpp | 6 ++++++ core/string/ustring.h | 1 + 2 files changed, 7 insertions(+) (limited to 'core/string') diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 759c121f29..7cfd34b53e 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -463,6 +463,12 @@ String String::operator+(const String &p_str) const { return res; } +String String::operator+(char32_t p_char) const { + String res = *this; + res += p_char; + return res; +} + String operator+(const char *p_chr, const String &p_str) { String tmp = p_chr; tmp += p_str; diff --git a/core/string/ustring.h b/core/string/ustring.h index 1d302b65a7..5e7904d827 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -225,6 +225,7 @@ public: bool operator==(const String &p_str) const; bool operator!=(const String &p_str) const; String operator+(const String &p_str) const; + String operator+(char32_t p_char) const; String &operator+=(const String &); String &operator+=(char32_t p_char); -- cgit v1.2.3