Top |
Functions
RBExtDBKey * | rb_ext_db_key_copy () |
void | rb_ext_db_key_free () |
RBExtDBKey * | rb_ext_db_key_create_lookup () |
RBExtDBKey * | rb_ext_db_key_create_storage () |
gboolean | rb_ext_db_key_is_lookup () |
void | rb_ext_db_key_add_field () |
char ** | rb_ext_db_key_get_field_names () |
const char * | rb_ext_db_key_get_field () |
char ** | rb_ext_db_key_get_field_values () |
gboolean | rb_ext_db_key_field_matches () |
void | rb_ext_db_key_add_info () |
char ** | rb_ext_db_key_get_info_names () |
const char * | rb_ext_db_key_get_info () |
gboolean | rb_ext_db_key_matches () |
gboolean | (*RBExtDBKeyLookupCallback) () |
void | rb_ext_db_key_lookups () |
TDB_DATA | rb_ext_db_key_to_store_key () |
Description
An external metadata key consists of one or more required fields (such as the album name for album art lookups), zero or more optional fields (such as the artist name), and zero or more informational fields (such as the musicbrainz album ID).
Functions
rb_ext_db_key_create_lookup ()
RBExtDBKey * rb_ext_db_key_create_lookup (const char *field
,const char *value
);
Creates a new metadata lookup key with a single field.
Use rb_ext_db_key_add_field
to add more.
rb_ext_db_key_create_storage ()
RBExtDBKey * rb_ext_db_key_create_storage (const char *field
,const char *value
);
Creates a new metadata storage key with a single field.
Use rb_ext_db_key_add_field
to add more.
rb_ext_db_key_is_lookup ()
gboolean
rb_ext_db_key_is_lookup (RBExtDBKey *key
);
Returns TRUE
if the key is a lookup key
rb_ext_db_key_add_field ()
void rb_ext_db_key_add_field (RBExtDBKey *key
,const char *field
,const char *value
);
Adds a field to the key, or an additional value to an existing field.
rb_ext_db_key_get_field_names ()
char **
rb_ext_db_key_get_field_names (RBExtDBKey *key
);
Returns a NULL-terminated array containing the names of the fields present in the key.
rb_ext_db_key_get_field ()
const char * rb_ext_db_key_get_field (RBExtDBKey *key
,const char *field
);
Extracts the value for a single-valued field.
rb_ext_db_key_get_field_values ()
char ** rb_ext_db_key_get_field_values (RBExtDBKey *key
,const char *field
);
Extracts the values for the specified field.
rb_ext_db_key_field_matches ()
gboolean rb_ext_db_key_field_matches (RBExtDBKey *key
,const char *field
,const char *value
);
Checks whether a specified field in key
matches a value.
This can be used to match keys against other types of data.
To match keys against each other, use rb_ext_db_key_matches
.
rb_ext_db_key_add_info ()
void rb_ext_db_key_add_info (RBExtDBKey *key
,const char *name
,const char *value
);
Adds an information field to the key.
rb_ext_db_key_get_info_names ()
char **
rb_ext_db_key_get_info_names (RBExtDBKey *key
);
Returns a NULL-terminated array containing the names of the info fields * present in the key.
rb_ext_db_key_get_info ()
const char * rb_ext_db_key_get_info (RBExtDBKey *key
,const char *name
);
Extracts the value for the specified info field.
rb_ext_db_key_matches ()
gboolean rb_ext_db_key_matches (RBExtDBKey *a
,RBExtDBKey *b
);
Checks whether the fields specified in a
match b
.
For keys to match, they must have the same set of required fields,
and the values for all must match. Optional fields must have the
same values if present in both. Informational fields are ignored.
RBExtDBKeyLookupCallback ()
gboolean (*RBExtDBKeyLookupCallback) (TDB_DATA data
,RBExtDBKey *key
,gpointer user_data
);
rb_ext_db_key_lookups ()
void rb_ext_db_key_lookups (RBExtDBKey *key
,RBExtDBKeyLookupCallback callback
,gpointer user_data
);
Generates the set of possible lookup keys for key
and
passes them to callback
in order. If the callback returns
FALSE
, processing will stop.
This should only be used by the metadata store itself. Metadata providers and consumers shouldn't need to do this.
Parameters
key |
||
callback |
a callback to process lookup keys. |
[scope call] |
user_data |
data to pass to |
rb_ext_db_key_to_store_key ()
TDB_DATA
rb_ext_db_key_to_store_key (RBExtDBKey *key
);
Generates the storage key for key
. This is the value that should
be used to store an item identified by this key in the store.
The storage key includes all optional fields, so keys passed to
this function should be constructed using only the optional fields
that were used to locate the item. The caller must free the data
pointer inside data
.
This should only be used by the metadata store itself. Metadata providers and consumers shouldn't need to do this.
[skip]