summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-app.h
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-03-13 13:03:58 +0000
committerRichard Hughes <richard@hughsie.com>2014-03-13 14:02:32 +0000
commita4f0fa55a790b07f62e2dac0c98fe9755f95e239 (patch)
tree9a5fc56f3bbebb735d0097df29dae39491ff4f6d /libappstream-glib/as-app.h
parent5701b1d5be00cda2e98d6c9df858e86db86b93a8 (diff)
downloadappstream-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-app.h')
-rw-r--r--libappstream-glib/as-app.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/libappstream-glib/as-app.h b/libappstream-glib/as-app.h
index b734821..f5bcfc1 100644
--- a/libappstream-glib/as-app.h
+++ b/libappstream-glib/as-app.h
@@ -76,12 +76,13 @@ GType as_app_get_type (void);
AsApp *as_app_new (void);
/* helpers */
-const gchar *as_app_id_kind_to_string (AsAppIdKind kind);
-AsAppIdKind as_app_id_kind_from_string (const gchar *kind);
-const gchar *as_app_icon_kind_to_string (AsAppIconKind icon_type);
-AsAppIconKind as_app_icon_kind_from_string (const gchar *icon_type);
+const gchar *as_app_id_kind_to_string (AsAppIdKind id_kind);
+AsAppIdKind as_app_id_kind_from_string (const gchar *id_kind);
+const gchar *as_app_icon_kind_to_string (AsAppIconKind icon_kind);
+AsAppIconKind as_app_icon_kind_from_string (const gchar *icon_kind);
/* getters */
+AsAppIconKind as_app_get_icon_kind (AsApp *app);
AsAppIdKind as_app_get_id_kind (AsApp *app);
GList *as_app_get_languages (AsApp *app);
GPtrArray *as_app_get_categories (AsApp *app);
@@ -94,6 +95,7 @@ const gchar *as_app_get_icon (AsApp *app);
const gchar *as_app_get_id (AsApp *app);
const gchar *as_app_get_id_full (AsApp *app);
const gchar *as_app_get_project_group (AsApp *app);
+const gchar *as_app_get_project_license (AsApp *app);
const gchar *as_app_get_name (AsApp *app,
const gchar *locale);
const gchar *as_app_get_comment (AsApp *app,
@@ -109,7 +111,7 @@ const gchar *as_app_get_url_item (AsApp *app,
void as_app_set_id_full (AsApp *app,
const gchar *id_full);
void as_app_set_id_kind (AsApp *app,
- AsAppIdKind kind);
+ AsAppIdKind id_kind);
void as_app_set_project_group (AsApp *app,
const gchar *project_group);
void as_app_set_project_license (AsApp *app,
@@ -117,7 +119,7 @@ void as_app_set_project_license (AsApp *app,
void as_app_set_icon (AsApp *app,
const gchar *icon);
void as_app_set_icon_kind (AsApp *app,
- AsAppIconKind icon_type);
+ AsAppIconKind icon_kind);
void as_app_set_name (AsApp *app,
const gchar *locale,
const gchar *name);
@@ -154,6 +156,11 @@ void as_app_remove_metadata (AsApp *app,
const gchar *key);
/* object methods */
+GNode *as_app_node_insert (AsApp *app,
+ GNode *parent);
+gboolean as_app_node_parse (AsApp *app,
+ GNode *node,
+ GError **error);
void as_app_subsume (AsApp *app,
AsApp *donor);