Tracker Indexer Reference Manual | ||||
---|---|---|---|---|
Metadata ObjectMetadata Object — Object used to exchange metadata information between the modules and Tracker indexer |
#include <libtracker-module/tracker-module-metadata.h> typedef TrackerModuleMetadata; TrackerModuleMetadata* tracker_module_metadata_new (void); void tracker_module_metadata_clear_field (TrackerModuleMetadata *metadata, const gchar *field_name); gboolean tracker_module_metadata_add_take_string (TrackerModuleMetadata *metadata, const gchar *field_name, gchar *value); void tracker_module_metadata_add_string (TrackerModuleMetadata *metadata, const gchar *field_name, const gchar *value); void tracker_module_metadata_add_int (TrackerModuleMetadata *metadata, const gchar *field_name, gint value); void tracker_module_metadata_add_uint (TrackerModuleMetadata *metadata, const gchar *field_name, guint value); void tracker_module_metadata_add_double (TrackerModuleMetadata *metadata, const gchar *field_name, gdouble value); void tracker_module_metadata_add_float (TrackerModuleMetadata *metadata, const gchar *field_name, gfloat value); void tracker_module_metadata_add_date (TrackerModuleMetadata *metadata, const gchar *field_name, time_t value);
TrackerModuleMetadata is used by the modules to provide metadata information to Tracker indexer. Conceptually it's a hash table, where you can pile up metadata. Depending on the metadata type, it could store single (Email:Subject for example) or multiple values (like Email:CC)
typedef struct TrackerModuleMetadata TrackerModuleMetadata; /* dummy typedef */
Metadata object
TrackerModuleMetadata* tracker_module_metadata_new (void);
Creates a new TrackerModuleMetadata
Returns : | A newly created TrackerModuleMetadata |
void tracker_module_metadata_clear_field (TrackerModuleMetadata *metadata, const gchar *field_name);
metadata : |
|
field_name : |
gboolean tracker_module_metadata_add_take_string (TrackerModuleMetadata *metadata, const gchar *field_name, gchar *value);
Adds a new metadata element as a string into metadata
.
For ontology fields that can take several values, this
function will allow adding several elements to the same
field name.
If the function returns TRUE, metadata
will take
ownership on value
, else you are responsible of
freeing it.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |
Returns : | TRUE if the value was added successfully. |
void tracker_module_metadata_add_string (TrackerModuleMetadata *metadata, const gchar *field_name, const gchar *value);
Adds a new metadata element as a string into metadata
.
see tracker_module_metadata_add_take_string()
.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |
void tracker_module_metadata_add_int (TrackerModuleMetadata *metadata, const gchar *field_name, gint value);
Adds a new metadata element as a integer into metadata
.
see tracker_module_metadata_add_take_string()
.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |
void tracker_module_metadata_add_uint (TrackerModuleMetadata *metadata, const gchar *field_name, guint value);
Adds a new metadata element as an unsigned integer into metadata
.
see tracker_module_metadata_add_take_string()
.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |
void tracker_module_metadata_add_double (TrackerModuleMetadata *metadata, const gchar *field_name, gdouble value);
Adds a new metadata element as a double into metadata
.
see tracker_module_metadata_add_take_string()
.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |
void tracker_module_metadata_add_float (TrackerModuleMetadata *metadata, const gchar *field_name, gfloat value);
Adds a new metadata element as a float into metadata
.
see tracker_module_metadata_add_take_string()
.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |
void tracker_module_metadata_add_date (TrackerModuleMetadata *metadata, const gchar *field_name, time_t value);
Adds a new metadata element as a time_t into metadata
.
see tracker_module_metadata_add_take_string()
.
metadata : |
A TrackerModuleMetadata |
field_name : |
Field name for the metadata to insert |
value : |
Value for the metadata |