xb-node-query

xb-node-query

Functions

Description

Functions

xb_node_query ()

GPtrArray *
xb_node_query (XbNode *self,
               const gchar *xpath,
               guint limit,
               GError **error);

Searches the silo using an XPath query, returning up to limit results.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

xpath

an XPath, e.g. id[abe.desktop]

 

limit

maximum number of results to return, or 0 for "all"

 

error

the GError, or NULL

 

Returns

results, or NULL if unfound.

[transfer container][element-type XbNode]

Since: 0.1.0


xb_node_query_full ()

GPtrArray *
xb_node_query_full (XbNode *self,
                    XbQuery *query,
                    GError **error);

Searches the silo using a prepared query. To search using a query with bound values, use xb_node_query_with_context().

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

query

an XbQuery

 

error

the GError, or NULL

 

Returns

results, or NULL if unfound.

[transfer container][element-type XbNode]

Since: 0.1.4


xb_node_query_with_context ()

GPtrArray *
xb_node_query_with_context (XbNode *self,
                            XbQuery *query,
                            XbQueryContext *context,
                            GError **error);

Searches the silo using a prepared query, substituting values from the bindings in context for bound opcodes as needed.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

query

an XbQuery

 

context

context including values bound to opcodes of type XB_OPCODE_KIND_BOUND_INTEGER or XB_OPCODE_KIND_BOUND_TEXT, or NULL if the query doesn’t need any context.

[nullable][transfer none]

error

the GError, or NULL

 

Returns

results, or NULL if unfound.

[transfer container][element-type XbNode]

Since: 0.3.0


xb_node_query_first ()

XbNode *
xb_node_query_first (XbNode *self,
                     const gchar *xpath,
                     GError **error);

Searches the node using an XPath query, returning up to one result.

Please note: Only a tiny subset of XPath 1.0 is supported.

Parameters

self

a XbNode

 

xpath

An XPath, e.g. /components/component[@type=desktop]/id[abe.desktop]

 

error

the GError, or NULL

 

Returns

a XbNode, or NULL if unfound.

[transfer full]

Since: 0.1.0


xb_node_query_first_full ()

XbNode *
xb_node_query_first_full (XbNode *self,
                          XbQuery *query,
                          GError **error);

Searches the silo using a prepared query, returning up to one result. To search using a query with bound values, use xb_node_query_first_with_context().

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

query

an XbQuery

 

error

the GError, or NULL

 

Returns

a XbNode, or NULL if unfound.

[transfer full]

Since: 0.1.11


xb_node_query_first_with_context ()

XbNode *
xb_node_query_first_with_context (XbNode *self,
                                  XbQuery *query,
                                  XbQueryContext *context,
                                  GError **error);

Searches the silo using a prepared query, returning up to one result.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

query

an XbQuery

 

context

context including values bound to opcodes of type XB_OPCODE_KIND_BOUND_INTEGER or XB_OPCODE_KIND_BOUND_TEXT, or NULL if the query doesn’t need any context.

[nullable][transfer none]

error

the GError, or NULL

 

Returns

a XbNode, or NULL if unfound.

[transfer full]

Since: 0.3.0


xb_node_query_text ()

const gchar *
xb_node_query_text (XbNode *self,
                    const gchar *xpath,
                    GError **error);

Searches the node using an XPath query, returning up to one result.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

xpath

An XPath, e.g. /components/component[@type=desktop]/id[abe.desktop]

 

error

the GError, or NULL

 

Returns

a string, or NULL if unfound.

[transfer none]

Since: 0.1.0


xb_node_query_text_as_uint ()

guint64
xb_node_query_text_as_uint (XbNode *self,
                            const gchar *xpath,
                            GError **error);

Searches the node using an XPath query, returning up to one result.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

xpath

An XPath, e.g. /components/component[@type=desktop]/id[abe.desktop]

 

error

the GError, or NULL

 

Returns

a guint64, or G_MAXUINT64 if unfound

Since: 0.1.0


xb_node_query_attr ()

const gchar *
xb_node_query_attr (XbNode *self,
                    const gchar *xpath,
                    const gchar *name,
                    GError **error);

Searches the node using an XPath query, returning up to one result.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

xpath

An XPath, e.g. /components/component[@type=desktop]/id[abe.desktop]

 

name

an attribute name, e.g. type

 

error

the GError, or NULL

 

Returns

a string, or NULL if unfound.

[transfer none]

Since: 0.1.0


xb_node_query_attr_as_uint ()

guint64
xb_node_query_attr_as_uint (XbNode *self,
                            const gchar *xpath,
                            const gchar *name,
                            GError **error);

Searches the node using an XPath query, returning up to one result.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

xpath

An XPath, e.g. /components/component[@type=desktop]/id[abe.desktop]

 

name

an attribute name, e.g. type

 

error

the GError, or NULL

 

Returns

a guint64, or G_MAXUINT64 if unfound

Since: 0.1.0


xb_node_query_export ()

gchar *
xb_node_query_export (XbNode *self,
                      const gchar *xpath,
                      GError **error);

Searches the node using an XPath query, returning an XML string of the result and any children.

It is safe to call this function from a different thread to the one that created the XbSilo.

Please note: Only a subset of XPath is supported.

Parameters

self

a XbNode

 

xpath

An XPath, e.g. /components/component[@type=desktop]/id[abe.desktop]

 

error

the GError, or NULL

 

Returns

a string, or NULL if unfound.

[transfer none]

Since: 0.1.0