Top | ![]() |
![]() |
![]() |
![]() |
AsDatabase * | as_database_new () |
GQuark | as_database_error_quark () |
gboolean | as_database_open () |
const gchar * | as_database_get_location () |
void | as_database_set_location () |
GPtrArray * | as_database_find_components () |
GPtrArray * | as_database_get_all_components () |
AsComponent * | as_database_get_component_by_id () |
GPtrArray * | as_database_get_components_by_provided_item () |
GPtrArray * | as_database_get_components_by_kind () |
#define | AS_TYPE_DATABASE |
struct | AsDatabaseClass |
enum | AsDatabaseError |
#define | AS_DATABASE_ERROR |
AsDatabase |
This object provides access to the Appstream Xapian database of available software components. You can search for components using various criteria, as well as getting some information about the data provided by this AppStream database.
By default, the global software component cache is used as datasource, unless a different database
is explicitly defined via as_database_set_location
().
A new cache can be created using the appstreamcli(1) utility.
See also: AsComponent, AsDataPool
gboolean as_database_open (AsDatabase *db
,GError **error
);
Open the current AppStream metadata cache for reading.
const gchar *
as_database_get_location (AsDatabase *db
);
Get the current path of the AppStream database we use.
void as_database_set_location (AsDatabase *db
,const gchar *dir
);
Set the location of the AppStream database we use.
GPtrArray * as_database_find_components (AsDatabase *db
,const gchar *term
,const gchar *cats_str
,GError **error
);
Find components in the AppStream database, which match a given term. You can limit the search to a specific set of categories by setting the categories string to a semicolon-separated list of lower-cased category names.
db |
An instance of AsDatabase. |
|
term |
a search-term to look for. |
[nullable] |
cats_str |
A semicolon-delimited list of lower-cased category names, e.g. "science;development". |
[nullable] |
error |
A GError or |
an array of AsComponent objects which have been found.
[element-type AsComponent][transfer full]
GPtrArray * as_database_get_all_components (AsDatabase *db
,GError **error
);
Dump a list of all software components found in the database.
AsComponent * as_database_get_component_by_id (AsDatabase *db
,const gchar *cid
,GError **error
);
Get a component by its AppStream-ID.
db |
An instance of AsDatabase. |
|
cid |
the ID of the component, e.g. "org.kde.gwenview.desktop" |
|
error |
A GError or |
GPtrArray * as_database_get_components_by_provided_item (AsDatabase *db
,AsProvidedKind kind
,const gchar *item
,GError **error
);
Find components in the Appstream database.
db |
An instance of AsDatabase. |
|
kind |
an AsProvidesKind |
|
item |
the name of the provided item. |
|
error |
A GError or |
an array of AsComponent objects which have been found, NULL on error.
[element-type AsComponent][transfer full]
GPtrArray * as_database_get_components_by_kind (AsDatabase *db
,AsComponentKind kind
,GError **error
);
Return a list of all components in the database which match a certain kind.
an array of AsComponent objects which have been found, NULL
on error.
[element-type AsComponent][transfer full]