Added Char16String.

This commit is contained in:
Relintai 2023-10-23 16:06:35 +02:00
parent e0d3ab5ea5
commit 96864fbabb
2 changed files with 24 additions and 0 deletions

View File

@ -56,6 +56,18 @@ public:
const char *get_data() const; 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 { class String {
pandemonium_string _pandemonium_string; pandemonium_string _pandemonium_string;

View File

@ -54,6 +54,18 @@ const char *pandemonium::CharString::get_data() const {
return pandemonium::api->pandemonium_char_string_get_data(&_char_string); 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) { String String::num(double p_num, int p_decimals) {
return String(pandemonium::api->pandemonium_string_num_with_decimals(p_num, p_decimals)); return String(pandemonium::api->pandemonium_string_num_with_decimals(p_num, p_decimals));
} }