Top |
Description
Simplifies the use of string:GValue maps with respect to copying of the values inserted into the map. Except for rb_string_value_map_peek, the caller retains ownership of values passed in, and assumes ownership of all values returned.
Functions
rb_string_value_map_new ()
RBStringValueMap *
rb_string_value_map_new (void
);
Creates a new RBStringValueMap
rb_string_value_map_set ()
void rb_string_value_map_set (RBStringValueMap *map
,const char *key
,const GValue *value
);
Inserts a value into the map. The value is copied.
rb_string_value_map_get ()
gboolean rb_string_value_map_get (RBStringValueMap *map
,const char *key
,GValue *out
);
Locates and copies the value associated with the key.
rb_string_value_map_peek ()
const GValue * rb_string_value_map_peek (RBStringValueMap *map
,const char *key
);
Locates the value associated with the key. This returns the GValue stored in the map, so it cannot be modified.
rb_string_value_map_remove ()
gboolean rb_string_value_map_remove (RBStringValueMap *map
,const char *key
);
Removes a value from the map.
rb_string_value_map_size ()
guint
rb_string_value_map_size (RBStringValueMap *map
);
Returns the number of entries in the map.
rb_string_value_map_steal_hashtable ()
GHashTable *
rb_string_value_map_steal_hashtable (RBStringValueMap *map
);
Extracts and returns the underlying hash table from the map, and creates a new empty map.