ZifStore

ZifStore — A store is an abstract collection of packages

Synopsis

#define             ZIF_STORE_ERROR
                    ZifStore;
                    ZifStorePrivate;
                    ZifStoreClass;
enum                ZifStoreError;
GQuark              zif_store_error_quark               (void);
ZifStore *          zif_store_new                       (void);
gboolean            zif_store_load                      (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);
gboolean            zif_store_clean                     (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);
gboolean            zif_store_refresh                   (ZifStore *store,
                                                         gboolean force,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_search_name               (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_search_category           (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_search_details            (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_search_group              (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_search_file               (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_resolve                   (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_what_provides             (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_get_packages              (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_get_updates               (ZifStore *store,
                                                         GPtrArray *packages,
                                                         ZifState *state,
                                                         GError **error);
ZifPackage *        zif_store_find_package              (ZifStore *store,
                                                         const gchar *package_id,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_store_get_categories            (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_store_get_id                    (ZifStore *store);
void                zif_store_print                     (ZifStore *store);

Object Hierarchy

  GObject
   +----ZifStore
         +----ZifStoreLocal
         +----ZifStoreRemote

Description

ZifStoreLocal and ZifStoreRemote both implement ZifStore.

Details

ZIF_STORE_ERROR

#define ZIF_STORE_ERROR		(zif_store_error_quark ())


ZifStore

typedef struct _ZifStore ZifStore;


ZifStorePrivate

typedef struct _ZifStorePrivate ZifStorePrivate;


ZifStoreClass

typedef struct {
	GObjectClass parent_class;
	/* vtable */
	gboolean	 (*load)		(ZifStore		*store,
						 ZifState		*state,
						 GError			**error);
	gboolean	 (*clean)		(ZifStore		*store,
						 ZifState		*state,
						 GError			**error);
	gboolean	 (*refresh)		(ZifStore		*store,
						 gboolean		 force,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*search_name)		(ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*search_category) (ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*search_details) (ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*search_group) (ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*search_file)		(ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*resolve)		(ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*what_provides) (ZifStore		*store,
						 gchar			**search,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*get_packages) (ZifStore		*store,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*get_updates)		(ZifStore		*store,
						 GPtrArray		*packages,
						 ZifState		*state,
						 GError			**error);
	ZifPackage *(*find_package) (ZifStore		*store,
						 const gchar		*package_id,
						 ZifState		*state,
						 GError			**error);
	GPtrArray *(*get_categories) (ZifStore		*store,
						 ZifState		*state,
						 GError			**error);
	const gchar *(*get_id)		(ZifStore		*store);
	void		 (*print)		(ZifStore		*store);
} ZifStoreClass;


enum ZifStoreError

typedef enum {
	ZIF_STORE_ERROR_FAILED,
	ZIF_STORE_ERROR_FAILED_AS_OFFLINE,
	ZIF_STORE_ERROR_FAILED_TO_FIND,
	ZIF_STORE_ERROR_ARRAY_IS_EMPTY,
	ZIF_STORE_ERROR_NO_SUPPORT,
	ZIF_STORE_ERROR_NOT_LOCKED,
	ZIF_STORE_ERROR_MULTIPLE_MATCHES,
	ZIF_STORE_ERROR_LAST
} ZifStoreError;


zif_store_error_quark ()

GQuark              zif_store_error_quark               (void);

Returns :

Our personal error quark.

Since 0.1.0


zif_store_new ()

ZifStore *          zif_store_new                       (void);

Returns :

A new ZifStore class instance.

Since 0.1.0


zif_store_load ()

gboolean            zif_store_load                      (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);

Loads the ZifStore object.

store :

the ZifStore object

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

TRUE for success, FALSE for failure

Since 0.1.0


zif_store_clean ()

gboolean            zif_store_clean                     (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);

Cleans the ZifStore objects by deleting cache.

store :

the ZifStore object

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

TRUE for success, FALSE for failure

Since 0.1.0


zif_store_refresh ()

gboolean            zif_store_refresh                   (ZifStore *store,
                                                         gboolean force,
                                                         ZifState *state,
                                                         GError **error);

refresh the ZifStore objects by downloading new data if required.

store :

the ZifStore object

force :

if the data should be re-downloaded if it's still valid

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

TRUE for success, FALSE for failure

Since 0.1.0


zif_store_search_name ()

GPtrArray *         zif_store_search_name               (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Find packages that match the package name in some part.

store :

the ZifStore object

search :

the search term, e.g. "power"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_search_category ()

GPtrArray *         zif_store_search_category           (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Return packages in a specific category.

store :

the ZifStore object

search :

the search term, e.g. "gnome/games"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_search_details ()

GPtrArray *         zif_store_search_details            (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Find packages that match some detail about the package.

store :

the ZifStore object

search :

the search term, e.g. "trouble"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_search_group ()

GPtrArray *         zif_store_search_group              (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Find packages that belong in a specific group.

store :

the ZifStore object

search :

the search term, e.g. "games"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_search_file ()

GPtrArray *         zif_store_search_file               (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Find packages that provide the specified file.

store :

the ZifStore object

search :

the search term, e.g. "/usr/bin/gnome-power-manager"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_resolve ()

GPtrArray *         zif_store_resolve                   (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Finds packages matching the package name exactly.

store :

the ZifStore object

search :

the search term, e.g. "gnome-power-manager"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_what_provides ()

GPtrArray *         zif_store_what_provides             (ZifStore *store,
                                                         gchar **search,
                                                         ZifState *state,
                                                         GError **error);

Find packages that provide a specific string.

store :

the ZifStore object

search :

the search term, e.g. "gstreamer(codec-mp3)"

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_get_packages ()

GPtrArray *         zif_store_get_packages              (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);

Return all packages in the ZifStore's.

store :

the ZifStore object

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_get_updates ()

GPtrArray *         zif_store_get_updates               (ZifStore *store,
                                                         GPtrArray *packages,
                                                         ZifState *state,
                                                         GError **error);

Return a list of packages that are updatable.

store :

the ZifStore object

packages :

an array of ZifPackage's

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifPackage's

Since 0.1.0


zif_store_find_package ()

ZifPackage *        zif_store_find_package              (ZifStore *store,
                                                         const gchar *package_id,
                                                         ZifState *state,
                                                         GError **error);

Find a single package in the ZifStore.

store :

the ZifStore object

package_id :

the package ID which defines the package

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

A single ZifPackage or NULL

Since 0.1.0


zif_store_get_categories ()

GPtrArray *         zif_store_get_categories            (ZifStore *store,
                                                         ZifState *state,
                                                         GError **error);

Return a list of custom categories.

store :

the ZifStore object

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

an array of ZifCategory's

Since 0.1.0


zif_store_get_id ()

const gchar *       zif_store_get_id                    (ZifStore *store);

Gets the id for the object.

store :

the ZifStore object

Returns :

A text ID, or NULL

Since 0.1.0


zif_store_print ()

void                zif_store_print                     (ZifStore *store);

Prints all the objects in the store.

store :

the ZifStore object

Since 0.1.0