rcutils
master
C API providing common utilities and data structures.
|
Go to the documentation of this file.
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_
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.
struct rcutils_string_map_impl_t * impl
Definition: string_map.h:34
rcutils_string_map_t rcutils_get_zero_initialized_string_map()
Return an empty string map struct.
bool rcutils_string_map_key_exists(const rcutils_string_map_t *string_map, const char *key)
Get whether or not a key exists.
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.
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.
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.
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_ret_t rcutils_string_map_unset(rcutils_string_map_t *string_map, const char *key)
Unset a key value pair in the map.
#define RCUTILS_PUBLIC_TYPE
Definition: visibility_control.h:29
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.
Definition: string_map.h:32
int rcutils_ret_t
Definition: rcutils_ret.h:23
const char * rcutils_string_map_get(const rcutils_string_map_t *string_map, const char *key)
Get value given a key.
#define RCUTILS_WARN_UNUSED
Definition: macros.h:24
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.
struct rcutils_string_map_t rcutils_string_map_t
Encapsulation of an allocator.
Definition: allocator.h:45
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.
#define RCUTILS_PUBLIC
Definition: visibility_control.h:23
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.
rcutils_ret_t rcutils_string_map_fini(rcutils_string_map_t *string_map)
Finalize the previously initialized string map struct.
rcutils_ret_t rcutils_string_map_clear(rcutils_string_map_t *string_map)
Remove all key value pairs from the map.
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.