Improved StringName constructors.

This commit is contained in:
Relintai 2023-05-31 14:16:18 +02:00
parent ed876f00e2
commit d320ee5c36
3 changed files with 31 additions and 6 deletions

View File

@ -70,13 +70,22 @@ pandemonium_bool GDAPI pandemonium_string_name_operator_less(const pandemonium_s
return *self < *other;
}
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest, const pandemonium_string *p_name) {
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest) {
StringName *dest = (StringName *)r_dest;
memnew_placement(dest, StringName);
}
void GDAPI pandemonium_string_name_new_data_string(pandemonium_string_name *r_dest, const pandemonium_string *p_name) {
StringName *dest = (StringName *)r_dest;
const String *name = (const String *)p_name;
memnew_placement(dest, StringName(*name));
}
void GDAPI pandemonium_string_name_new_data_char(pandemonium_string_name *r_dest, const char *p_name) {
StringName *dest = (StringName *)r_dest;
memnew_placement(dest, StringName(p_name));
}
void GDAPI pandemonium_string_name_new_data(pandemonium_string_name *r_dest, const char *p_name) {
void GDAPI pandemonium_string_name_new_datac(pandemonium_string_name *r_dest, const pandemonium_char_type *p_name) {
StringName *dest = (StringName *)r_dest;
memnew_placement(dest, StringName(p_name));
}

View File

@ -4613,19 +4613,34 @@
{
"name": "pandemonium_string_name_new",
"return_type": "void",
"arguments": [
["pandemonium_string_name *", "r_dest"]
]
},
{
"name": "pandemonium_string_name_new_data_string",
"return_type": "void",
"arguments": [
["pandemonium_string_name *", "r_dest"],
["const pandemonium_string *", "p_name"]
]
},
{
"name": "pandemonium_string_name_new_data",
"name": "pandemonium_string_name_new_data_char",
"return_type": "void",
"arguments": [
["pandemonium_string_name *", "r_dest"],
["const char *", "p_name"]
]
},
{
"name": "pandemonium_string_name_new_datac",
"return_type": "void",
"arguments": [
["pandemonium_string_name *", "r_dest"],
["const pandemonium_char_type *", "p_name"]
]
},
{
"name": "pandemonium_string_name_destroy",
"return_type": "void",

View File

@ -66,9 +66,10 @@ const void GDAPI *pandemonium_string_name_get_data_unique_pointer(const pandemon
pandemonium_bool GDAPI pandemonium_string_name_operator_equal(const pandemonium_string_name *p_self, const pandemonium_string_name *p_other);
pandemonium_bool GDAPI pandemonium_string_name_operator_less(const pandemonium_string_name *p_self, const pandemonium_string_name *p_other);
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest, const pandemonium_string *p_name);
void GDAPI pandemonium_string_name_new_data(pandemonium_string_name *r_dest, const char *p_name);
//static variant
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest);
void GDAPI pandemonium_string_name_new_data_string(pandemonium_string_name *r_dest, const pandemonium_string *p_name);
void GDAPI pandemonium_string_name_new_data_char(pandemonium_string_name *r_dest, const char *p_name);
void GDAPI pandemonium_string_name_new_datac(pandemonium_string_name *r_dest, const pandemonium_char_type *p_name);
void GDAPI pandemonium_string_name_destroy(pandemonium_string_name *p_self);