Top | ![]() |
![]() |
![]() |
![]() |
gboolean | (*XbNodeTransmogrifyFunc) () |
gboolean | xb_node_transmogrify () |
gchar * | xb_node_export () |
GBytes * | xb_node_get_data () |
void | xb_node_set_data () |
XbNode * | xb_node_get_root () |
XbNode * | xb_node_get_parent () |
XbNode * | xb_node_get_next () |
XbNode * | xb_node_get_child () |
GPtrArray * | xb_node_get_children () |
const gchar * | xb_node_get_element () |
const gchar * | xb_node_get_text () |
guint64 | xb_node_get_text_as_uint () |
const gchar * | xb_node_get_tail () |
const gchar * | xb_node_get_attr () |
guint64 | xb_node_get_attr_as_uint () |
guint | xb_node_get_depth () |
gboolean xb_node_transmogrify (XbNode *self
,XbNodeTransmogrifyFunc func_text
,XbNodeTransmogrifyFunc func_tail
,gpointer user_data
);
Traverses a tree starting from self
. It calls the given functions for each
node visited. This allows transmogrification of the source, for instance
converting the XML description to PangoMarkup or even something completely
different like markdown.
The traversal can be halted at any point by returning TRUE from func
.
self |
a XbNode |
|
func_text |
(allow-none): a XbBuilderNodeTraverseFunc. |
[scope call] |
func_tail |
(allow-none): a XbBuilderNodeTraverseFunc. |
[scope call] |
user_data |
user pointer to pass to |
Since: 0.1.12
gchar * xb_node_export (XbNode *self
,XbNodeExportFlags flags
,GError **error
);
Exports the node back to XML.
Since: 0.1.0
GBytes * xb_node_get_data (XbNode *self
,const gchar *key
);
Gets any data that has been set on the node using xb_node_set_data()
.
This will only work across queries to the associated silo if the silo has
its “enable-node-cache” property set to TRUE
. Otherwise a new XbNode
may be constructed for future queries which return the same element as a
result.
Since: 0.1.0
void xb_node_set_data (XbNode *self
,const gchar *key
,GBytes *data
);
Sets some data on the node which can be retrieved using xb_node_get_data()
.
This will only work across queries to the associated silo if the silo has
its “enable-node-cache” property set to TRUE
. Otherwise a new XbNode
may be constructed for future queries which return the same element as a
result.
Since: 0.1.0
XbNode *
xb_node_get_root (XbNode *self
);
Gets the root node for the node.
Since: 0.1.0
XbNode *
xb_node_get_parent (XbNode *self
);
Gets the parent node for the current node.
Since: 0.1.0
XbNode *
xb_node_get_next (XbNode *self
);
Gets the next sibling node for the current node.
Since: 0.1.0
XbNode *
xb_node_get_child (XbNode *self
);
Gets the first child node for the current node.
Since: 0.1.0
GPtrArray *
xb_node_get_children (XbNode *self
);
Gets all the children for the current node.
Since: 0.1.0
const gchar *
xb_node_get_element (XbNode *self
);
Gets the element name for a specific node.
Since: 0.1.0
const gchar *
xb_node_get_text (XbNode *self
);
Gets the text data for a specific node.
Since: 0.1.0
guint64
xb_node_get_text_as_uint (XbNode *self
);
Gets some attribute text data for a specific node.
Since: 0.1.0
const gchar *
xb_node_get_tail (XbNode *self
);
Gets the tail data for a specific node.
Since: 0.1.12
const gchar * xb_node_get_attr (XbNode *self
,const gchar *name
);
Gets some attribute text data for a specific node.
Since: 0.1.0
guint64 xb_node_get_attr_as_uint (XbNode *self
,const gchar *name
);
Gets some attribute text data for a specific node.
Since: 0.1.0