[grilo] Add grl_media_serialize_extended() function.
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] Add grl_media_serialize_extended() function.
- Date: Wed, 2 Jun 2010 12:15:34 +0000 (UTC)
commit f4a89f9d61b865724d018fb9f218ead8c7f29545
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Tue Jun 1 12:06:59 2010 +0200
Add grl_media_serialize_extended() function.
This is the function that actually will perform serialization.
grl_media_serialize() is just a wrapper that makes a basic serialization (just
taking in account both source and id properties, getting rid of remaining
properties).
src/data/grl-media.c | 20 ++++++++++++++++++--
src/data/grl-media.h | 5 ++++-
2 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/src/data/grl-media.c b/src/data/grl-media.c
index b588cc0..2b22256 100644
--- a/src/data/grl-media.c
+++ b/src/data/grl-media.c
@@ -110,6 +110,22 @@ grl_media_set_rating (GrlMedia *media, gfloat rating, gfloat max)
/**
* grl_media_serialize:
* @media: a #GrlMedia
+ *
+ * Serializes a GrlMedia into a string. It does a basic serialization.
+ *
+ * See grl_media_serialize_extended() to get more serialization approaches.
+ *
+ * Returns: serialized media
+ **/
+gchar *
+grl_media_serialize (GrlMedia *media)
+{
+ return grl_media_serialize_extended (media, FALSE);
+}
+
+/**
+ * grl_media_serialize_extended:
+ * @media: a #GrlMedia
* @full: if all properties should be included in the serialization
*
* Serializes a GrlMedia into a string.
@@ -119,8 +135,8 @@ grl_media_set_rating (GrlMedia *media, gfloat rating, gfloat max)
* Returns: serialized media
**/
gchar *
-grl_media_serialize (GrlMedia *media,
- gboolean full)
+grl_media_serialize_extended (GrlMedia *media,
+ gboolean full)
{
GList *key;
GList *keylist;
diff --git a/src/data/grl-media.h b/src/data/grl-media.h
index 5c33085..a617199 100644
--- a/src/data/grl-media.h
+++ b/src/data/grl-media.h
@@ -386,7 +386,10 @@ GType grl_media_get_type (void) G_GNUC_CONST;
GrlMedia *grl_media_new (void);
-gchar *grl_media_serialize (GrlMedia *media, gboolean full);
+gchar *grl_media_serialize (GrlMedia *media);
+
+gchar *grl_media_serialize_extended (GrlMedia *media,
+ gboolean full);
GrlMedia *grl_media_unserialize (const gchar *serial);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]