XesamGHit

XesamGHit — A single hit mapping the metadata requested from the search engine

Synopsis

                    XesamGHitPrivate;
                    XesamGHit;
const GValue*       xesam_g_hit_get_field               (XesamGHit *hit,
                                                         const gchar *field_name);
const gchar*        xesam_g_hit_get_string              (XesamGHit *hit,
                                                         const gchar *field_name);
const GValue*       xesam_g_hit_get_field_by_id         (XesamGHit *hit,
                                                         guint field_id);
guint               xesam_g_hit_get_id                  (XesamGHit *hit);
gchar**             xesam_g_hit_get_field_names         (XesamGHit *hit);
const GPtrArray*    xesam_g_hit_get_data                (XesamGHit *hit);

Object Hierarchy

  GObject
   +----XesamGHit

Description

The XesamGHit class conveniently maps the fields specified in the originating session's "hit-fields" property.

XesamGHit is available since 1.0

Details

XesamGHitPrivate

typedef struct _XesamGHitPrivate XesamGHitPrivate;


XesamGHit

typedef struct _XesamGHit XesamGHit;


xesam_g_hit_get_field ()

const GValue*       xesam_g_hit_get_field               (XesamGHit *hit,
                                                         const gchar *field_name);

Get the value of a field by name look up. This method has the overhead of a hash table look up. For even faster access use xesam_g_hit_get_field_by_id().

Alternatively use xesam_g_hit_get_field_by_id() if you know the array index of the field in the session's hit-fields property.

If you know the data type of the field beforehand you can use the convenience method xesam_g_hit_get_string() to access the field value.

hit :

The hit object on which to look up a field value

field_name :

The fully qualified name of the field as set through the session property "hit-fields".

Returns :

The value of a named field. If the field is not known NULL is returned.

xesam_g_hit_get_string ()

const gchar*        xesam_g_hit_get_string              (XesamGHit *hit,
                                                         const gchar *field_name);

Look up the value of a field containing a string. For generic field value look ups use xesam_g_hit_get_field().

hit :

The hit to look up a string valued field on

field_name :

Returns :

The string value of the field. The memory allocated by the string is private to the hit and should not be freed.

xesam_g_hit_get_field_by_id ()

const GValue*       xesam_g_hit_get_field_by_id         (XesamGHit *hit,
                                                         guint field_id);

Look up a field value based on the offset of the field name in the sessions "hit-fields" property.

To look up a field by name use xesam_g_hit_get_field().

hit :

The hit object on which to look up a field value

field_id :

The offset the field in the session property "hit-fields".

Returns :

The value of a field given by its offset in the session's hit-fields property.

xesam_g_hit_get_id ()

guint               xesam_g_hit_get_id                  (XesamGHit *hit);

The Hit id is the offset of the hit within the scope of all results returned by a XesamGSearch.

hit :

The hit to get the id for

Returns :

The hit id. This is defined as the offset of the hit relative to the total number of hits retrieved from the server.

xesam_g_hit_get_field_names ()

gchar**             xesam_g_hit_get_field_names         (XesamGHit *hit);

Return a NULL terminated array listing the field names used in this Hit. You must free the array with g_strfreev().

hit :

The hit object for which to list the field names

Returns :

A NULL terminated array of strings

xesam_g_hit_get_data ()

const GPtrArray*    xesam_g_hit_get_data                (XesamGHit *hit);

Get raw access to the hits field data. The data in the returned array map to the fields specified in "hit-fields" property.

hit :

The hit object for which to return the data list for

Returns :

A pointer array containing the raw hit data. This array should not be modified.