Commit ff59fc06 authored by George Kiagiadakis's avatar George Kiagiadakis

lib: properties: add update() and copy_from_dict() API

parent 7608ae37
......@@ -143,6 +143,12 @@ wp_properties_new_copy_dict (const struct spa_dict * dict)
return self;
}
WpProperties *
wp_properties_copy (WpProperties * other)
{
return wp_properties_new_copy_dict (wp_properties_peek_dict (other));
}
static void
wp_properties_free (WpProperties * self)
{
......@@ -162,6 +168,16 @@ wp_properties_unref (WpProperties * self)
g_rc_box_release_full (self, (GDestroyNotify) wp_properties_free);
}
gint
wp_properties_update_from_dict (WpProperties * self,
const struct spa_dict * dict)
{
g_return_val_if_fail (self != NULL, -EINVAL);
g_return_val_if_fail (!(self->flags & FLAG_IS_DICT), -EINVAL);
return pw_properties_update (self->props, dict);
}
const gchar *
wp_properties_get (WpProperties * self, const gchar * key)
{
......
......@@ -33,9 +33,14 @@ WpProperties * wp_properties_new_copy (const struct pw_properties * props);
WpProperties * wp_properties_new_wrap_dict (const struct spa_dict * dict);
WpProperties * wp_properties_new_copy_dict (const struct spa_dict * dict);
WpProperties * wp_properties_copy (WpProperties * other);
WpProperties * wp_properties_ref (WpProperties * self);
void wp_properties_unref (WpProperties * self);
gint wp_properties_update_from_dict (WpProperties * self,
const struct spa_dict * dict);
const gchar * wp_properties_get (WpProperties * self, const gchar * key);
gint wp_properties_set (WpProperties * self, const gchar * key,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment