AsDatabase

AsDatabase — Read-only access to the Appstream component database

Synopsis

#include <appstream.h>

struct              AsDatabase;
struct              AsDatabaseClass;
AsDatabase *        as_database_new                     (void);
AsDatabase *        as_database_construct               (GType object_type);
void                as_database_set_database_path       (AsDatabase *self,
                                                         const gchar *value);
gboolean            as_database_open                    (AsDatabase *self);
const gchar *       as_database_get_database_path       (AsDatabase *self);
gboolean            as_database_db_exists               (AsDatabase *self);
GPtrArray *         as_database_get_all_components      (AsDatabase *self);
GPtrArray *         as_database_find_components         (AsDatabase *self,
                                                         AsSearchQuery *query);
GPtrArray *         as_database_find_components_by_str  (AsDatabase *self,
                                                         const gchar *search_str,
                                                         const gchar *categories_str);

Object Hierarchy

  GObject
   +----AsDatabase

Properties

  "database-path"            gchar*                : Read / Write

Description

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.

See also: AsComponent, AsSearchQuery

Details

struct AsDatabase

struct AsDatabase;


struct AsDatabaseClass

struct AsDatabaseClass {
	GObjectClass parent_class;
	gboolean (*open) (AsDatabase* self);
};


as_database_new ()

AsDatabase *        as_database_new                     (void);

Creates a new AsDatabase.

Returns :

an AsDatabase. [transfer full]

as_database_construct ()

AsDatabase *        as_database_construct               (GType object_type);


as_database_set_database_path ()

void                as_database_set_database_path       (AsDatabase *self,
                                                         const gchar *value);


as_database_open ()

gboolean            as_database_open                    (AsDatabase *self);


as_database_get_database_path ()

const gchar *       as_database_get_database_path       (AsDatabase *self);


as_database_db_exists ()

gboolean            as_database_db_exists               (AsDatabase *self);

Returns :

TRUE if the application database exists

as_database_get_all_components ()

GPtrArray *         as_database_get_all_components      (AsDatabase *self);

Dump a list of all components found in the database.

self a valid AsDatabase instance

Returns :

an array of AsComponent objects. [element-type AsComponent][transfer full]

as_database_find_components ()

GPtrArray *         as_database_find_components         (AsDatabase *self,
                                                         AsSearchQuery *query);

Find components in the Appstream database.

self a valid AsDatabase instance query a AsSearchQuery

Returns :

an array of AsComponent objects which have been found. [element-type AsComponent][transfer full]

as_database_find_components_by_str ()

GPtrArray *         as_database_find_components_by_str  (AsDatabase *self,
                                                         const gchar *search_str,
                                                         const gchar *categories_str);

Find components in the Appstream database by searching for a simple string.

self a valid AsDatabase instance search_str the string to search for categories_str: (allow-none): a comma-separated list of category names, or NULL to search in all categories

Returns :

an array of AsComponent objects which have been found. [element-type AsComponent][transfer full]

Property Details

The "database-path" property

  "database-path"            gchar*                : Read / Write

database-path.

Default value: NULL