Skip to content

Commit

Permalink
Merge pull request #63136 from akien-mga/3.x-gdnative-string-num-uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Jul 18, 2022
2 parents 33b5709 + 4455b6c commit 7e9f55c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/gdnative/gdnative/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,21 @@ godot_string GDAPI godot_string_num_int64(int64_t p_num, godot_int p_base) {

godot_string GDAPI godot_string_num_int64_capitalized(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex) {
godot_string result;
memnew_placement(&result, String(String::num_int64(p_num, p_base, true)));
memnew_placement(&result, String(String::num_int64(p_num, p_base, p_capitalize_hex)));

return result;
}

godot_string GDAPI godot_string_num_uint64(uint64_t p_num, godot_int p_base) {
godot_string result;
memnew_placement(&result, String(String::num_uint64(p_num, p_base)));

return result;
}

godot_string GDAPI godot_string_num_uint64_capitalized(uint64_t p_num, godot_int p_base, godot_bool p_capitalize_hex) {
godot_string result;
memnew_placement(&result, String(String::num_uint64(p_num, p_base, p_capitalize_hex)));

return result;
}
Expand Down
17 changes: 17 additions & 0 deletions modules/gdnative/gdnative_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,23 @@
["const godot_string *", "p_self"],
["const godot_array *", "p_parts"]
]
},
{
"name": "godot_string_num_uint64",
"return_type": "godot_string",
"arguments": [
["uint64_t", "p_num"],
["godot_int", "p_base"]
]
},
{
"name": "godot_string_num_uint64_capitalized",
"return_type": "godot_string",
"arguments": [
["uint64_t", "p_num"],
["godot_int", "p_base"],
["godot_bool", "p_capitalize_hex"]
]
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions modules/gdnative/include/gdnative/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ godot_string GDAPI godot_string_md5(const uint8_t *p_md5);
godot_string GDAPI godot_string_num(double p_num);
godot_string GDAPI godot_string_num_int64(int64_t p_num, godot_int p_base);
godot_string GDAPI godot_string_num_int64_capitalized(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex);
godot_string GDAPI godot_string_num_uint64(uint64_t p_num, godot_int p_base);
godot_string GDAPI godot_string_num_uint64_capitalized(uint64_t p_num, godot_int p_base, godot_bool p_capitalize_hex);
godot_string GDAPI godot_string_num_real(double p_num);
godot_string GDAPI godot_string_num_scientific(double p_num);
godot_string GDAPI godot_string_num_with_decimals(double p_num, godot_int p_decimals);
Expand Down

0 comments on commit 7e9f55c

Please sign in to comment.