diff options
author | Richard Hughes <richard@hughsie.com> | 2014-03-13 13:03:58 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-03-13 14:02:32 +0000 |
commit | a4f0fa55a790b07f62e2dac0c98fe9755f95e239 (patch) | |
tree | 9a5fc56f3bbebb735d0097df29dae39491ff4f6d /libappstream-glib/as-image.h | |
parent | 5701b1d5be00cda2e98d6c9df858e86db86b93a8 (diff) | |
download | appstream-glib-a4f0fa55a790b07f62e2dac0c98fe9755f95e239.tar.gz |
Add functions to parse from and to insert a GNode
This allows us to trivially serialize objects to XML and back.
NOTE: as this uses a DOM parser, it's certainly not quick. Use something manual
like expat or GMarkupParser to do this more efficiently and with less memory.
Diffstat (limited to 'libappstream-glib/as-image.h')
-rw-r--r-- | libappstream-glib/as-image.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libappstream-glib/as-image.h b/libappstream-glib/as-image.h index 0c1f870..2e90c73 100644 --- a/libappstream-glib/as-image.h +++ b/libappstream-glib/as-image.h @@ -60,14 +60,17 @@ typedef enum { GType as_image_get_type (void); AsImage *as_image_new (void); +/* helpers */ AsImageKind as_image_kind_from_string (const gchar *kind); const gchar *as_image_kind_to_string (AsImageKind kind); +/* getters */ const gchar *as_image_get_url (AsImage *image); guint as_image_get_width (AsImage *image); guint as_image_get_height (AsImage *image); AsImageKind as_image_get_kind (AsImage *image); +/* setters */ void as_image_set_url (AsImage *image, const gchar *url, gsize url_len); @@ -78,6 +81,13 @@ void as_image_set_height (AsImage *image, void as_image_set_kind (AsImage *image, AsImageKind kind); +/* object methods */ +GNode *as_image_node_insert (AsImage *image, + GNode *parent); +gboolean as_image_node_parse (AsImage *image, + GNode *node, + GError **error); + G_END_DECLS #endif /* AS_IMAGE_H */ |