Top | ![]() |
![]() |
![]() |
![]() |
AsStore * | as_store_new () |
GQuark | as_store_error_quark () |
guint | as_store_get_size () |
gboolean | as_store_from_file () |
gboolean | as_store_from_xml () |
gboolean | as_store_load () |
GPtrArray * | as_store_get_apps () |
GPtrArray * | as_store_get_apps_by_metadata () |
AsApp * | as_store_get_app_by_id () |
AsApp * | as_store_get_app_by_pkgname () |
void | as_store_add_app () |
void | as_store_remove_app () |
GString * | as_store_to_xml () |
gboolean | as_store_to_file () |
const gchar * | as_store_get_origin () |
void | as_store_set_origin () |
gdouble | as_store_get_api_version () |
void | as_store_set_api_version () |
This store contains both an array of AsApp's but also a pair of hashes to quickly retrieve an application from the ID or package name.
Applications can also be removed, and the whole store can be loaded and saved to a compressed XML file.
See also: AsApp
guint
as_store_get_size (AsStore *store
);
Gets the size of the store after deduplication and prioritization has taken place.
Since 0.1.0
gboolean as_store_from_file (AsStore *store
,GFile *file
,const gchar *icon_root
,GCancellable *cancellable
,GError **error
);
Parses an AppStream XML file and adds any valid applications to the store.
If the root node does not have a 'origin' attribute, then the method
as_store_set_origin()
should be called *before* this function if cached
icons are required.
store |
a AsStore instance. |
|
file |
a GFile. |
|
icon_root |
the icon path, or |
|
cancellable |
a GCancellable. |
|
error |
A GError or |
Since 0.1.0
gboolean as_store_from_xml (AsStore *store
,const gchar *data
,gssize data_len
,const gchar *icon_root
,GError **error
);
Parses AppStream XML file and adds any valid applications to the store.
If the root node does not have a 'origin' attribute, then the method
as_store_set_origin()
should be called *before* this function if cached
icons are required.
store |
a AsStore instance. |
|
data |
XML data |
|
data_len |
Length of |
|
icon_root |
the icon path, or |
|
error |
A GError or |
Since 0.1.1
gboolean as_store_load (AsStore *store
,AsStoreLoadFlags flags
,GCancellable *cancellable
,GError **error
);
Loads the store from the default locations.
Since 0.1.2
GPtrArray *
as_store_get_apps (AsStore *store
);
Gets an array of all the valid applications in the store.
Since 0.1.0
GPtrArray * as_store_get_apps_by_metadata (AsStore *store
,const gchar *key
,const gchar *value
);
Gets an array of all the applications that match a specific metadata element.
Since 0.1.4
AsApp * as_store_get_app_by_id (AsStore *store
,const gchar *id
);
Finds an application in the store by ID.
Since 0.1.0
AsApp * as_store_get_app_by_pkgname (AsStore *store
,const gchar *pkgname
);
Finds an application in the store by package name.
Since 0.1.0
void as_store_add_app (AsStore *store
,AsApp *app
);
Adds an application to the store. If a lower priority application has already been added then this new application will replace it.
Additionally only applications where the kind is known will be added.
Since 0.1.0
void as_store_remove_app (AsStore *store
,AsApp *app
);
Removes an application from the store if it exists.
Since 0.1.0
GString * as_store_to_xml (AsStore *store
,AsNodeToXmlFlags flags
);
Outputs an XML representation of all the applications in the store.
Since 0.1.0
gboolean as_store_to_file (AsStore *store
,GFile *file
,AsNodeToXmlFlags flags
,GCancellable *cancellable
,GError **error
);
Outputs a compressed XML file of all the applications in the store.
store |
a AsStore instance. |
|
file |
file |
|
flags |
the AsNodeToXmlFlags, e.g. |
|
cancellable |
A GCancellable, or |
|
error |
A GError or |
Since 0.1.0
const gchar *
as_store_get_origin (AsStore *store
);
Gets the metadata origin, which is used to locate icons.
Since 0.1.1
void as_store_set_origin (AsStore *store
,const gchar *origin
);
Sets the metadata origin, which is used to locate icons.
Since 0.1.1
gdouble
as_store_get_api_version (AsStore *store
);
Gets the AppStream API version.
Since 0.1.1
“changed”
signalvoid user_function (AsStore *device, gpointer user_data)
Flags: Run Last
Since 0.1.2