Top |
const char * | (*RecordGetValueFunc) () |
guint | dmap_db_add () |
guint | dmap_db_add_with_id () |
guint | dmap_db_add_path () |
DMAPRecord * | dmap_db_lookup_by_id () |
guint | dmap_db_lookup_id_by_location () |
void | dmap_db_foreach () |
gulong | dmap_db_count () |
GHashTable * | dmap_db_apply_filter () |
guint dmap_db_add_with_id (DMAPDb *db
,DMAPRecord *record
,guint id
);
Add a record to the database and assign it the given ID.
guint dmap_db_add_path (DMAPDb *db
,const gchar *path
);
Create a record and add it to the database.
DMAPRecord * dmap_db_lookup_by_id (const DMAPDb *db
,guint id
);
the database record corresponding to id
. This record should
be unrefed by the calling code when no longer required.
If you are implementing a full database using this API, then you probably want to increment the reference count before returning a record pointer.
On the other hand, if you are implementing an adapter class and the records are stored elsewhere, then you will probably return a transient record. That is, once the user is done using it, the returned record should be free'd because it is a adapter copy of the real record. In this case, the reference count should not be incremented before returning a record pointer.
guint dmap_db_lookup_id_by_location (const DMAPDb *db
,const gchar *location
);
void dmap_db_foreach (const DMAPDb *db
,GHFunc func
,gpointer data
);
Apply a function to each record in a media database.
struct DMAPDbIface { GTypeInterface parent; guint (*add) (DMAPDb * db, DMAPRecord * record); guint (*add_with_id) (DMAPDb * db, DMAPRecord * record, guint id); guint (*add_path) (DMAPDb * db, const gchar * path); DMAPRecord *(*lookup_by_id) (const DMAPDb * db, guint id); guint (*lookup_id_by_location) (const DMAPDb * db, const gchar * location); void (*foreach) (const DMAPDb * db, GHFunc func, gpointer data); gint64 (*count) (const DMAPDb * db); };