Top |
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.
RBStringValueMap *
rb_string_value_map_new (void
);
Creates a new RBStringValueMap
void rb_string_value_map_set (RBStringValueMap *map
,const char *key
,const GValue *value
);
Inserts a value into the map. The value is copied.
gboolean rb_string_value_map_get (RBStringValueMap *map
,const char *key
,GValue *out
);
Locates and copies the value associated with the key.
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.
gboolean rb_string_value_map_remove (RBStringValueMap *map
,const char *key
);
Removes a value from the map.
guint
rb_string_value_map_size (RBStringValueMap *map
);
Returns the number of entries in the map.
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.