|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <fixed_string.hpp>
Public Member Functions | |
| const char * | c_str () const |
| Get a pointer to the null-terminated string. | |
| FixedString () | |
| Default constructor — empty string. | |
| size_t | length () const |
| Get the length of the string (up to N-1). | |
| bool | operator!= (const char *s) const |
| FixedString & | operator= (const char *s) |
| Assign from a C string. Truncates if longer than capacity. | |
| bool | operator== (const char *s) const |
| Compare with a C string. | |
Static Public Member Functions | |
| static constexpr size_t | capacity () |
| Maximum number of characters (excluding null terminator). | |
Public Attributes | |
| char | data [N] |
Fixed-capacity null-terminated string.
Wraps a char[N] buffer with safe assignment and query methods. Memory layout is identical to char[N], so the type is C-ABI compatible and can be passed across the runtime boundary by value.
Usage:
|
inline |
Default constructor — empty string.
|
inline |
Get a pointer to the null-terminated string.
|
inlinestaticconstexpr |
Maximum number of characters (excluding null terminator).
|
inline |
Get the length of the string (up to N-1).
|
inline |
Assign from a C string. Truncates if longer than capacity.
Compare with a C string.
| char nros::FixedString< N >::data[N] |