Function rosidl_runtime_c__U16String__init

Function Documentation

bool rosidl_runtime_c__U16String__init(rosidl_runtime_c__U16String *str)

Initialize a rosidl_runtime_c__U16String structure.

The contents of rosidl_runtime_c__U16String are initialized to a single null character. The string initially has size 0 and capacity 1. Size represents the size of the contents of the string, while capacity represents the overall storage of the string (counting the null terminator). All strings must be null-terminated. The rosidl_runtime_c__U16String structure should be deallocated using the given function rosidl_runtime_c__U16String__fini() when it is no longer needed. Calling this function with an already initialized U16 string sequence structure will leak memory.

Parameters:

str[inout] a pointer to a U16 string structure

Returns:

true if successful, false if the passed string pointer is null or the memory allocation failed