Merge pull request #55826 from kdiduk/gdnative-poolstringarray-join

This commit is contained in:
Rémi Verschelde 2022-07-03 01:05:03 +02:00 committed by GitHub
commit ef29a227bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View File

@ -381,6 +381,17 @@ void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self) {
self->invert(); self->invert();
} }
godot_string GDAPI godot_pool_string_array_join(godot_pool_string_array *p_self, const godot_string *p_delimiter) {
PoolVector<String> *self = (PoolVector<String> *)p_self;
String &delimiter = *(String *)p_delimiter;
godot_string str;
String *s = (String *)&str;
memnew_placement(s, String);
*s = self->join(delimiter);
return str;
}
void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data) { void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data) {
PoolVector<String> *self = (PoolVector<String> *)p_self; PoolVector<String> *self = (PoolVector<String> *)p_self;
String &s = *(String *)p_data; String &s = *(String *)p_data;

View File

@ -17,7 +17,24 @@
"major": 1, "major": 1,
"minor": 2 "minor": 2
}, },
"next": null, "next": {
"type": "CORE",
"version": {
"major": 1,
"minor": 3
},
"next": null,
"api": [
{
"name": "godot_pool_string_array_join",
"return_type": "godot_string",
"arguments": [
["godot_pool_string_array *", "p_self"],
["const godot_string *", "p_delimiter"]
]
}
]
},
"api": [ "api": [
{ {
"name": "godot_dictionary_duplicate", "name": "godot_dictionary_duplicate",

View File

@ -275,6 +275,8 @@ godot_error GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_self
void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self); void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self);
godot_string GDAPI godot_pool_string_array_join(godot_pool_string_array *p_self, const godot_string *p_delimiter);
void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data); void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data);
void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx); void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx);