-
Notifications
You must be signed in to change notification settings - Fork 122
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
Inconsistent APIs between String and U16String #764
Comments
Thank you for the report! It looks like a resize function is missing. There's a Make a declaration similar to this one, but using rosidl/rosidl_runtime_c/include/rosidl_runtime_c/u16string_functions.h Lines 156 to 167 in d66b6db
Implement it similar to this function, but using rosidl/rosidl_runtime_c/src/u16string_functions.c Lines 167 to 188 in d66b6db
Take the expectations on U16String_resize from the test below, and put them into into rosidl/rosidl_runtime_c/test/test_u16string_functions.cpp Lines 73 to 147 in d66b6db
|
Bug report
rosidl_runtime_c__U16String__resize
exists, however, there is norosidl_runtime_c__String__resize
.Required Info:
Expected behavior
Consistent APIs between String and U16String
Actual behavior
Inconsistent APIs between String and U16String
Feature request
Make APIs consistent?
Feature description
Sometimes a
char *
is not directly available, e.g., from a deserialization library. This means that it is not possible to useassignn
without allocating an intermediate buffer. Having a resize function for both String and U16String would solve this problem.Implementation considerations
The workaround I will use is to use
rcutils_get_default_allocator
to update the internals of the string manually.The text was updated successfully, but these errors were encountered: