15 #ifndef RCUTILS__TYPES__STRING_MAP_H_ 16 #define RCUTILS__TYPES__STRING_MAP_H_ 30 struct rcutils_string_map_impl_t;
34 struct rcutils_string_map_impl_t *
impl;
98 size_t initial_capacity,
439 #endif // RCUTILS__TYPES__STRING_MAP_H_ const char * rcutils_string_map_get(const rcutils_string_map_t *string_map, const char *key)
Get value given a key.
rcutils_ret_t rcutils_string_map_fini(rcutils_string_map_t *string_map)
Finalize the previously initialized string map struct.
const char * rcutils_string_map_getn(const rcutils_string_map_t *string_map, const char *key, size_t key_length)
Get value given a key and key length.
const char * rcutils_string_map_get_next_key(const rcutils_string_map_t *string_map, const char *key)
Get the next key in the map, unless NULL is given, then get the first key.
rcutils_ret_t rcutils_string_map_set_no_resize(rcutils_string_map_t *string_map, const char *key, const char *value)
Set a key value pair in the map but only if the map has enough capacity.
bool rcutils_string_map_key_exists(const rcutils_string_map_t *string_map, const char *key)
Get whether or not a key exists.
int rcutils_ret_t
Definition: rcutils_ret.h:23
rcutils_ret_t rcutils_string_map_init(rcutils_string_map_t *string_map, size_t initial_capacity, rcutils_allocator_t allocator)
Initialize a rcutils_string_map_t, allocating space for given capacity.
#define RCUTILS_PUBLIC_TYPE
Definition: visibility_control.h:51
rcutils_ret_t rcutils_string_map_unset(rcutils_string_map_t *string_map, const char *key)
Unset a key value pair in the map.
bool rcutils_string_map_key_existsn(const rcutils_string_map_t *string_map, const char *key, size_t key_length)
Get whether or not a key of known length exists.
rcutils_ret_t rcutils_string_map_reserve(rcutils_string_map_t *string_map, size_t capacity)
Reserve a given amount of capacity in the map.
rcutils_string_map_t rcutils_get_zero_initialized_string_map()
Return an empty string map struct.
rcutils_ret_t rcutils_string_map_copy(const rcutils_string_map_t *src_string_map, rcutils_string_map_t *dst_string_map)
Copy all the key value pairs from one map into another, overwritting and resizing if needed...
rcutils_ret_t rcutils_string_map_clear(rcutils_string_map_t *string_map)
Remove all key value pairs from the map.
Encapsulation of an allocator.
Definition: allocator.h:45
rcutils_ret_t rcutils_string_map_get_capacity(const rcutils_string_map_t *string_map, size_t *capacity)
Get the current capacity of the string map.
#define RCUTILS_WARN_UNUSED
Definition: macros.h:24
#define RCUTILS_PUBLIC
Definition: visibility_control.h:48
rcutils_ret_t rcutils_string_map_set(rcutils_string_map_t *string_map, const char *key, const char *value)
Set a key value pair in the map, increasing capacity if necessary.
Definition: string_map.h:32
struct rcutils_string_map_t rcutils_string_map_t
rcutils_ret_t rcutils_string_map_get_size(const rcutils_string_map_t *string_map, size_t *size)
Get the current size of the string map.
struct rcutils_string_map_impl_t * impl
Definition: string_map.h:34