diff --git a/include/core/ustring.h b/include/core/ustring.h index 67be4d6..9807f46 100644 --- a/include/core/ustring.h +++ b/include/core/ustring.h @@ -56,6 +56,18 @@ public: const char *get_data() const; }; +class Char16String { + friend class String; + + pandemonium_char_16_string _char_string; + +public: + ~Char16String(); + + int length() const; + const char16_t *get_data() const; +}; + class String { pandemonium_string _pandemonium_string; diff --git a/src/core/ustring.cpp b/src/core/ustring.cpp index f7d7d5b..d22b24a 100644 --- a/src/core/ustring.cpp +++ b/src/core/ustring.cpp @@ -54,6 +54,18 @@ const char *pandemonium::CharString::get_data() const { return pandemonium::api->pandemonium_char_string_get_data(&_char_string); } +pandemonium::Char16String::~Char16String() { + pandemonium::api->pandemonium_char_16_string_destroy(&_char_string); +} + +int pandemonium::Char16String::length() const { + return pandemonium::api->pandemonium_char_16_string_length(&_char_string); +} + +const char16_t *pandemonium::Char16String::get_data() const { + return pandemonium::api->pandemonium_char_16_string_get_data(&_char_string); +} + String String::num(double p_num, int p_decimals) { return String(pandemonium::api->pandemonium_string_num_with_decimals(p_num, p_decimals)); }