Add katze_item_set_meta_string

This commit is contained in:
Christian Dywan 2009-07-06 18:28:28 +01:00
parent 82e0a66de7
commit 5d674f9779
2 changed files with 27 additions and 0 deletions

View file

@ -493,6 +493,28 @@ katze_item_get_meta_string (KatzeItem* item,
return g_hash_table_lookup (item->metadata, key); return g_hash_table_lookup (item->metadata, key);
} }
/**
* katze_item_set_meta_string:
* @item: a #KatzeItem
* @key: the name of a string value
* @value: the value as a string
*
* Saves the specified string value in the meta data of
* the item under the specified key.
*
* Since: 0.1.8
**/
void
katze_item_set_meta_string (KatzeItem* item,
const gchar* key,
const gchar* value)
{
g_return_if_fail (KATZE_IS_ITEM (item));
g_hash_table_insert (item->metadata, g_strdup (key), g_strdup (value));
/* TODO: Emit meta-key-changed */
}
/** /**
* katze_item_get_meta_integer: * katze_item_get_meta_integer:
* @item: a #KatzeItem * @item: a #KatzeItem

View file

@ -110,6 +110,11 @@ const gchar*
katze_item_get_meta_string (KatzeItem* item, katze_item_get_meta_string (KatzeItem* item,
const gchar* key); const gchar* key);
void
katze_item_set_meta_string (KatzeItem* item,
const gchar* key,
const gchar* value);
gint64 gint64
katze_item_get_meta_integer (KatzeItem* item, katze_item_get_meta_integer (KatzeItem* item,
const gchar* key); const gchar* key);