XesamGQuery

XesamGQuery — Structured representation of a query

Synopsis

                    XesamGQueryPrivate;
                    XesamGQuery;
const gchar*        xesam_g_query_get_xml               (XesamGQuery *query);
XesamGQuery*        xesam_g_query_new_from_text         (const gchar *search_text);
XesamGQuery*        xesam_g_query_new_from_textf        (const gchar *format,
                                                         ...);
XesamGQuery*        xesam_g_query_new_from_xml          (const gchar *query_xml);
XesamGQuery*        xesam_g_query_new_steal_xml         (gchar *query_xml);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----XesamGQuery

Description

In Xesam terminology a 'query' is formatted string prepared for the search engine. A 'search' is the opaque representation of a query that has been accepted and is executing on the search engine.

XesamGQuery is available since 1.0

Details

XesamGQueryPrivate

typedef struct _XesamGQueryPrivate XesamGQueryPrivate;


XesamGQuery

typedef struct _XesamGQuery XesamGQuery;


xesam_g_query_get_xml ()

const gchar*        xesam_g_query_get_xml               (XesamGQuery *query);

Get an XML representation of a query. The XML will be cached until the query is changed. The query string should not be freed or modified.

query :

Query object to get XML representation for

Returns :

A string encoding the query in the XESAM Query Language

xesam_g_query_new_from_text ()

XesamGQuery*        xesam_g_query_new_from_text         (const gchar *search_text);

Create a new query based on a user supplied string conforming to the XESAM User Search Language Spec.

In contrast to xesam_g_query_new_from_textf this method is safe to use on user supplied input.

search_text :

A string in the XESAM User Search Langauge

Returns :

A newly allocated query object

xesam_g_query_new_from_textf ()

XesamGQuery*        xesam_g_query_new_from_textf        (const gchar *format,
                                                         ...);

Create a new query based on a printf-style argument. The formatted result must conform to the XESAM User Search Language Spec.

WARNING: Be cautious if you use this method on user supplied input. Any formatting characters should be escaped.

format :

A string in the XESAM User Search Language. The string may contain printf-like escapes.

... :

Values for the format string

Returns :

A newly allocated query object

xesam_g_query_new_from_xml ()

XesamGQuery*        xesam_g_query_new_from_xml          (const gchar *query_xml);

Create a new query containing the raw xml supplied in the constructor. The xml should conform to the XESAM Query Language specification, although this will not be checked on construction time.

query_xml :

A string encoded in the XESAM Query Languge

Returns :

A newly allocated query object

xesam_g_query_new_steal_xml ()

XesamGQuery*        xesam_g_query_new_steal_xml         (gchar *query_xml);

Create a new query containing the raw xml supplied in the constructor. The xml should conform to the XESAM Query Language specification, although this will not be checked on construction time.

The query object will assume ownership of query_xml.

This method is especially handy in conjunction with a XesamGXmlQueryBuilder to avoid the extra string duplication of the XML query returned by xesam_g_xml_query_builder_get_xml(). If not using xesam_g_xml_query_builder_get_query() directly.

query_xml :

A string encoded in the XESAM Query Languge

Returns :

A newly allocated query object