godot-cpp
godot-cpp copied to clipboard
Added functionality for allow_empty param in String::split_ints and split_floats
Removed the allow_empty param of the split_ints and split_floats functions in String.hpp and String.cpp as this param was unused.
This argument is part of the API: https://docs.godotengine.org/en/stable/classes/class_string.html#class-string-method-split-floats It should not be removed. The problem is that it should be functional.
I was under the impression that the work-around left the parameter useless. Is making it functional using the Godot C API what you have in mind?
Yes, I opened an issue to track this: https://github.com/godotengine/godot-cpp/issues/498
Got it. Thanks!
Let me know if any changes are needed. Also in the original code
PoolIntArray String::split_ints(String divisor, bool /*allow_empty*/) const { godot_array arr = godot::api->godot_string_split_floats(&_godot_string, &divisor._godot_string); return Array(arr); }
split_ints also uses the godot_string_split_floats function. I'm not sure if it was intended or overlooked. Anyways I've changed it to use godot_string_split_ints function. I hope that's right.
Looks good to me. The commits should be squashed into one though. Not sure if @Zylann has something else to add.
Is this still relevant? It seems like String
is no longer a part of godot-cpp, only CharString.
String
is "part" of godot-cpp, but is generated code. So such changes should be done to Godot itself I guess