diff options
| author | karroffel <therzog@mail.de> | 2018-01-11 17:57:52 +0100 |
|---|---|---|
| committer | karroffel <therzog@mail.de> | 2018-01-11 17:58:06 +0100 |
| commit | 5dac1b588788d856204278a07d16b70306bfe313 (patch) | |
| tree | 0a01dc8d63a34bb722c1558a96911181298ea8bf /include/core | |
| parent | bde1ce384fa0e9244ee5fb67c81fceb4c96e1f1d (diff) | |
| download | redot-cpp-5dac1b588788d856204278a07d16b70306bfe313.tar.gz | |
caller-defined entry methods and string API update
Diffstat (limited to 'include/core')
| -rw-r--r-- | include/core/Godot.hpp | 7 | ||||
| -rw-r--r-- | include/core/GodotGlobal.hpp | 3 | ||||
| -rw-r--r-- | include/core/String.hpp | 17 |
3 files changed, 19 insertions, 8 deletions
diff --git a/include/core/Godot.hpp b/include/core/Godot.hpp index 0aed17b..c210f86 100644 --- a/include/core/Godot.hpp +++ b/include/core/Godot.hpp @@ -38,13 +38,6 @@ public: - - -#define GDNATIVE_INIT(arg) void gdnative_init(arg) -#define GDNATIVE_TERMINATE(arg) void gdnative_terminate(arg) - -#define NATIVESCRIPT_INIT() void nativescript_init() - #define GODOT_CLASS(Name) \ public: inline static const char *___get_type_name() { return static_cast<const char *>(#Name); } \ private: diff --git a/include/core/GodotGlobal.hpp b/include/core/GodotGlobal.hpp index 5263e9d..7d28dba 100644 --- a/include/core/GodotGlobal.hpp +++ b/include/core/GodotGlobal.hpp @@ -17,6 +17,9 @@ public: static void print_warning(const String& description, const String& function, const String& file, int line); static void print_error(const String& description, const String& function, const String& file, int line); + static void gdnative_init(godot_gdnative_init_options *o); + static void gdnative_terminate(godot_gdnative_terminate_options *o); + static void nativescript_init(void *handle); }; diff --git a/include/core/String.hpp b/include/core/String.hpp index 7788195..f03c997 100644 --- a/include/core/String.hpp +++ b/include/core/String.hpp @@ -10,6 +10,20 @@ class Variant; class PoolByteArray; class PoolRealArray; class PoolStringArray; +class String; + +class CharString { + + friend class String; + + godot_char_string _char_string; + +public: + ~CharString(); + + int length() const; + const char *get_data() const; +}; class String { godot_string _godot_string; @@ -42,7 +56,8 @@ public: int length() const; const wchar_t *unicode_str() const; char *alloc_c_string() const; - void get_c_string(char *p_dest, int *p_size) const; + CharString utf8() const; + CharString ascii(bool p_extended = false) const; int64_t find(String p_what) const; int64_t find_from(String p_what, int64_t p_from) const; |
