summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-node.h
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-05-23 15:21:56 +0100
committerRichard Hughes <richard@hughsie.com>2014-05-23 15:24:40 +0100
commit517e0fb9dfd1fddd57ee62b9bb64efb0d29a0834 (patch)
treec1d9956b66054def7dff52cc0daa61a5064b2ef9 /libappstream-glib/as-node.h
parentec594f5ddd47b4472cb2aadcc9754552a87efc0c (diff)
downloadappstream-glib-517e0fb9dfd1fddd57ee62b9bb64efb0d29a0834.tar.gz
Add as_node_get_comment()
Comments are stored as internal attributes to avoid growing the size of AsNodeData beyond 32 bits, although there is a performance penalty for this. As comments are not often encountered in documents (and not at all in the AppStream metadata fast path) this is probably okay. By default comments are not loaded from the document, use %AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS when loading to enable this.
Diffstat (limited to 'libappstream-glib/as-node.h')
-rw-r--r--libappstream-glib/as-node.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.h b/libappstream-glib/as-node.h
index 693905d..fa45356 100644
--- a/libappstream-glib/as-node.h
+++ b/libappstream-glib/as-node.h
@@ -58,12 +58,14 @@ typedef enum {
* AsNodeFromXmlFlags:
* @AS_NODE_FROM_XML_FLAG_NONE: No extra flags to use
* @AS_NODE_FROM_XML_FLAG_LITERAL_TEXT: Treat the text as an exact string
+ * @AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS: Retain comments in the XML file
*
* The flags for converting from XML.
**/
typedef enum {
AS_NODE_FROM_XML_FLAG_NONE = 0, /* Since: 0.1.0 */
AS_NODE_FROM_XML_FLAG_LITERAL_TEXT = 1, /* Since: 0.1.3 */
+ AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS = 2, /* Since: 0.1.6 */
/*< private >*/
AS_NODE_FROM_XML_FLAG_LAST
} AsNodeFromXmlFlags;
@@ -108,6 +110,7 @@ void as_node_unref (GNode *node);
const gchar *as_node_get_name (const GNode *node);
const gchar *as_node_get_data (const GNode *node);
+const gchar *as_node_get_comment (const GNode *node);
AsTag as_node_get_tag (const GNode *node);
const gchar *as_node_get_attribute (const GNode *node,
const gchar *key);