diff options
author | Bastiaan Olij <mux213@gmail.com> | 2021-09-01 13:11:10 +1000 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2021-09-27 23:08:10 +1000 |
commit | 46c63af715cf42a6e27feb48a3e7ed6d6dd9458c (patch) | |
tree | 14b3049fc155209d617b89fb3e45b95269519f9f /src/variant/char_string.cpp | |
parent | 3a5bd210921ac668949e20c494976660a986ea4a (diff) | |
download | redot-cpp-46c63af715cf42a6e27feb48a3e7ed6d6dd9458c.tar.gz |
Re-introduce build-in type code for core types
Diffstat (limited to 'src/variant/char_string.cpp')
-rw-r--r-- | src/variant/char_string.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/variant/char_string.cpp b/src/variant/char_string.cpp index 19c99b4..72f4a6c 100644 --- a/src/variant/char_string.cpp +++ b/src/variant/char_string.cpp @@ -192,6 +192,14 @@ bool String::operator!=(const char32_t *p_str) const { return *this != String(p_str); } +const char32_t &String::operator[](int p_index) const { + return *internal::interface->string_operator_index_const((GDNativeStringPtr) this, p_index); +} + +char32_t &String::operator[](int p_index) { + return *internal::interface->string_operator_index((GDNativeStringPtr) this, p_index); +} + bool operator==(const char *p_chr, const String &p_str) { return p_str == String(p_chr); } |