diff options
| author | Karroffel <therzog@mail.de> | 2017-03-03 04:35:40 +0100 |
|---|---|---|
| committer | Karroffel <therzog@mail.de> | 2017-03-03 04:35:40 +0100 |
| commit | 3b6da9ca761945b444107cb77d3f0418db20b4b0 (patch) | |
| tree | 194abf88b27975e4c03dc69e4a4cfaf8a9e69235 /include | |
| parent | 1d61c9df9370484227806a67533ac258c392d83e (diff) | |
| download | redot-cpp-3b6da9ca761945b444107cb77d3f0418db20b4b0.tar.gz | |
Extended String interface
Diffstat (limited to 'include')
| -rw-r--r-- | include/godot/core/String.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/godot/core/String.h b/include/godot/core/String.h index 081788e..c644dec 100644 --- a/include/godot/core/String.h +++ b/include/godot/core/String.h @@ -23,6 +23,19 @@ public: godot_string_new_data(&_godot_string, contents, strlen(contents)); } + String(const wchar_t *contents) + { + // @Todo + // godot_string_new_data(&_godot_string, contents, strlen(contents)); + godot_string_new(&_godot_string); + } + + String(const wchar_t c) + { + // @Todo + godot_string_new(&_godot_string); + } + String(const String& other) { godot_string_new(&_godot_string); @@ -35,12 +48,22 @@ public: } + String substr(int p_from,int p_chars) const + { + return String(); // @Todo + } + wchar_t &operator [](const int idx) { return *godot_string_operator_index(&_godot_string, idx); } + wchar_t operator [](const int idx) const + { + return *godot_string_operator_index((godot_string *) &_godot_string, idx); + } + int length() const { int len = 0; @@ -66,6 +89,17 @@ public: return new_string; } + void operator +=(const String &s) + { + // @Todo + godot_string_operator_plus(&_godot_string, &_godot_string, &s._godot_string); + } + + void operator +=(const wchar_t c) + { + // @Todo + } + bool operator <(const String &s) { return godot_string_operator_less(&_godot_string, &s._godot_string); |
