Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GDNative] Add missing join method for PoolStringArray class #55826

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/gdnative/gdnative/pool_arrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,17 @@ void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self) {
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) {
PoolVector<String> *self = (PoolVector<String> *)p_self;
String &s = *(String *)p_data;
Expand Down
19 changes: 18 additions & 1 deletion modules/gdnative/gdnative_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@
"major": 1,
"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": [
{
"name": "godot_dictionary_duplicate",
Expand Down
2 changes: 2 additions & 0 deletions modules/gdnative/include/gdnative/pool_arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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_remove(godot_pool_string_array *p_self, const godot_int p_idx);
Expand Down