![]() |
![]() |
![]() |
libleaftag Reference Manual | ![]() |
---|---|---|---|---|
LtSource; LtSource* lt_create_source (const char *uri); LtSource* lt_source_lookup (const char *uri); GList* lt_source_lookup_many (GList *uris); void lt_source_delete (LtSource *source); void lt_source_set_uri (LtSource *source, const char *new_uri); const char* lt_source_get_uri (const LtSource *source); const char* lt_source_get_filename (const LtSource *source); const char* lt_source_get_schema (const LtSource *source); void lt_source_tag (LtSource *source, GList *tags); void lt_source_tag_with_names (LtSource *source, GList *tag_names); void lt_source_untag (LtSource *source, GList *tags); void lt_source_untag_with_names (LtSource *source, GList *tag_names); GList* lt_source_get_tags (const LtSource *source); GList* lt_get_all_sources (void); GList* lt_get_sources_with_schema (const char *schema); GList* lt_get_sources_with_tags (GList *tags, const char *schema); GList* lt_get_sources_with_tag_names (GList *tag_names, const char *schema);
"tags-changed" void user_function (LtSource *source, gpointer user_data) : Run last / Action
typedef struct _LtSource LtSource;
The LtSource struct contains private data only, and should be manipulated using the functions below.
LtSource* lt_create_source (const char *uri);
Look up a source referring to a URI. If there is not already a source for this URI, it will be created.
uri : |
The URI of the item. |
Returns : | A new LtSource |
LtSource* lt_source_lookup (const char *uri);
Look up a source referring to a URI.
uri : |
The URI of the item. |
Returns : | A new LtSource referring to the URI. If this item has no existing tags, this will return NULL. |
GList* lt_source_lookup_many (GList *uris);
Look up LtSource objects for multiple URIs.
uris : |
A list of URIs to look up. |
Returns : | A list of LtSource objects. |
void lt_source_delete (LtSource *source);
Deletes a source and any associations made to tags.
source : |
The source to delete. |
void lt_source_set_uri (LtSource *source, const char *new_uri);
Set the URI for a source
source : |
An LtSource |
new_uri : |
The URI to set |
const char* lt_source_get_uri (const LtSource *source);
Get the URI for a source.
source : |
An LtSource |
Returns : | The URI of the source. |
const char* lt_source_get_filename (const LtSource *source);
Get the filename for a source. The URI schema of the source must be "file".
source : |
An LtSource |
Returns : | The filename of the source. |
const char* lt_source_get_schema (const LtSource *source);
Get the schema for a source.
source : |
An LtSource |
Returns : | The schema. |
void lt_source_tag (LtSource *source, GList *tags);
Tag a source with a set of tags. This only adds associations, preserving existing tags.
void lt_source_tag_with_names (LtSource *source, GList *tag_names);
Tag a source with a set of tags. This only adds associations, preserving existing tags.
source : |
An LtSource |
tag_names : |
A list of tag names |
void lt_source_untag (LtSource *source, GList *tags);
Remove a set of associations from a source.
void lt_source_untag_with_names (LtSource *source, GList *tag_names);
Remove a set of associations from a source.
source : |
An LtSource |
tag_names : |
A list of tag names |
GList* lt_source_get_tags (const LtSource *source);
Returns a list of tags on the specified source.
source : |
An LtSource |
Returns : | The tag objects associated with the source. |
GList* lt_get_all_sources (void);
Look up all tagged sources.
Returns : | A list of all tagged sources. |
GList* lt_get_sources_with_schema (const char *schema);
Look up tagged sources with the specified schema.
schema : |
The schema. |
Returns : | The list of tagged sources. |
GList* lt_get_sources_with_tags (GList *tags, const char *schema);
Look up all sources tagged with the specified tags. This optionally takes a schema to match against. It can be NULL.
tags : |
The list of tag objects to match against. |
schema : |
The optional schema to match against, or NULL. |
Returns : | The list of sources. |
GList* lt_get_sources_with_tag_names (GList *tag_names, const char *schema);
Look up all sources tagged with the specified tag names. This optionally takes a schema to match against. It can be NULL.
tag_names : |
The list of tag names to match against. |
schema : |
The optional schema to match against, or NULL. |
Returns : | The list of sources. |