Top | ![]() |
![]() |
![]() |
![]() |
GQuark | as_pool_error_quark () |
AsPool * | as_pool_new () |
const gchar * | as_pool_get_locale () |
void | as_pool_set_locale () |
gboolean | as_pool_load () |
gboolean | as_pool_load_cache_file () |
gboolean | as_pool_save_cache_file () |
void | as_pool_clear () |
gboolean | as_pool_add_component () |
GPtrArray * | as_pool_get_components () |
GPtrArray * | as_pool_get_components_by_id () |
GPtrArray * | as_pool_get_components_by_provided_item () |
GPtrArray * | as_pool_get_components_by_kind () |
GPtrArray * | as_pool_get_components_by_categories () |
GPtrArray * | as_pool_get_components_by_launchable () |
GPtrArray * | as_pool_search () |
void | as_pool_clear_metadata_locations () |
void | as_pool_add_metadata_location () |
AsCacheFlags | as_pool_get_cache_flags () |
void | as_pool_set_cache_flags () |
AsPoolFlags | as_pool_get_flags () |
void | as_pool_set_flags () |
gboolean | as_pool_refresh_cache () |
#define | AS_TYPE_POOL |
struct | AsPoolClass |
enum | AsCacheFlags |
enum | AsPoolFlags |
enum | AsPoolError |
#define | AS_POOL_ERROR |
AsPool |
This class loads AppStream metadata from various sources and refines it with existing knowledge about the system (e.g. by setting absolute pazhs for cached icons). An AsPool will use an on-disk cache to store metadata is has read and refined to speed up the loading time when the same data is requested a second time.
You can find AppStream metadata matching farious criteria, and also add new metadata to the pool. The caching behavior can be controlled by the application using AsPool.
An AppStream cache object can also be created and read using the appstreamcli(1) utility.
See also: AsComponent
const gchar *
as_pool_get_locale (AsPool *pool
);
Gets the currently used locale.
void as_pool_set_locale (AsPool *pool
,const gchar *locale
);
Sets the current locale which should be used when parsing metadata.
gboolean as_pool_load (AsPool *pool
,GCancellable *cancellable
,GError **error
);
Builds an index of all found components in the watched locations.
The function will try to get as much data into the pool as possible, so even if
the update completes with FALSE
, it might still have added components to the pool.
The function will load from all possible data sources, preferring caches if they are up to date.
gboolean as_pool_load_cache_file (AsPool *pool
,const gchar *fname
,GError **error
);
Load AppStream metadata from a cache file.
pool |
An instance of AsPool. |
|
fname |
Filename of the cache file to load into the pool. |
|
error |
A GError or |
gboolean as_pool_save_cache_file (AsPool *pool
,const gchar *fname
,GError **error
);
Serialize AppStream metadata to a cache file.
pool |
An instance of AsPool. |
|
fname |
Filename of the cache file the pool contents should be dumped to. |
|
error |
A GError or |
gboolean as_pool_add_component (AsPool *pool
,AsComponent *cpt
,GError **error
);
Register a new component in the AppStream metadata pool.
pool |
An instance of AsPool |
|
cpt |
The AsComponent to add to the pool. |
|
error |
A GError or |
GPtrArray *
as_pool_get_components (AsPool *pool
);
Get a list of found components.
GPtrArray * as_pool_get_components_by_id (AsPool *pool
,const gchar *cid
);
Get a specific component by its ID. This function may contain multiple results if we have data describing this component from multiple scopes/origin types.
GPtrArray * as_pool_get_components_by_provided_item (AsPool *pool
,AsProvidedKind kind
,const gchar *item
);
Find components in the AppStream data pool which provide a certain item.
an array of AsComponent objects which have been found.
[transfer container][element-type AsComponent]
GPtrArray * as_pool_get_components_by_kind (AsPool *pool
,AsComponentKind kind
);
Return a list of all components in the pool which are of a certain kind.
an array of AsComponent objects which have been found.
[transfer container][element-type AsComponent]
GPtrArray * as_pool_get_components_by_categories (AsPool *pool
,gchar **categories
);
Return a list of components which are in one of the categories.
an array of AsComponent objects which have been found.
[transfer container][element-type AsComponent]
GPtrArray * as_pool_get_components_by_launchable (AsPool *pool
,AsLaunchableKind kind
,const gchar *id
);
Find components in the AppStream data pool which provide a specific launchable. See AsLaunchable for details on launchables, or refer to the AppStream specification.
an array of AsComponent objects which have been found.
[transfer container][element-type AsComponent]
Since: 0.11.4
GPtrArray * as_pool_search (AsPool *pool
,const gchar *search
);
Search for a list of components matching the search terms. The list will be ordered by match score.
Since: 0.9.7
void
as_pool_clear_metadata_locations (AsPool *pool
);
Remove all metadata locations from the list of watched locations.
void as_pool_add_metadata_location (AsPool *pool
,const gchar *directory
);
Add a location for the data pool to read data from.
If directory
contains a "xml", "xmls", "yaml" or "icons" subdirectory (or all of them),
those paths will be added to the search paths instead.
AsCacheFlags
as_pool_get_cache_flags (AsPool *pool
);
Get the AsCacheFlags for this data pool.
void as_pool_set_cache_flags (AsPool *pool
,AsCacheFlags flags
);
Set the AsCacheFlags for this data pool.
AsPoolFlags
as_pool_get_flags (AsPool *pool
);
Get the AsPoolFlags for this data pool.
void as_pool_set_flags (AsPool *pool
,AsPoolFlags flags
);
Set the AsPoolFlags for this data pool.
gboolean as_pool_refresh_cache (AsPool *pool
,gboolean force
,GError **error
);
Update the AppStream cache. There is normally no need to call this function manually, because cache updates are handled transparently in the background.
A metadata pool error.