zif-store-array

## zif-store-array zif-store-array — Container for one or more stores |

## Synopsis

    gboolean            zif_store_array_add_local           (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);
    gboolean            zif_store_array_add_remote          (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);
    gboolean            zif_store_array_add_remote_enabled  (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);
    gboolean            zif_store_array_add_store           (GPtrArray *store_array,
                                                             ZifStore *store);
    gboolean            zif_store_array_add_stores          (GPtrArray *store_array,
                                                             GPtrArray *stores);
    gboolean            zif_store_array_clean               (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);
    ZifStore *          zif_store_array_find_by_id          (GPtrArray *store_array,
                                                             const gchar *id);
    ZifPackage *        zif_store_array_find_package        (GPtrArray *store_array,
                                                             const gchar *package_id,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_get_categories      (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_get_packages        (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_get_updates         (GPtrArray *store_array,
                                                             ZifStore *store_local,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_new                 (void);
    gboolean            zif_store_array_refresh             (GPtrArray *store_array,
                                                             gboolean force,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_resolve             (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_resolve_full        (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifStoreResolveFlags flags,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_search_category     (GPtrArray *store_array,
                                                             gchar **group_id,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_search_details      (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_search_file         (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_search_group        (GPtrArray *store_array,
                                                             gchar **group_enum,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_search_name         (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_what_conflicts      (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_what_obsoletes      (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_what_provides       (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);
    GPtrArray *         zif_store_array_what_requires       (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);

## Description

A GPtrArray is the container where ZifStore's are kept. Global operations can be done on the array and not the indervidual stores.

IMPORTANT: any errors that happen on the ZifStores are fatal unless you're using `zif_state_set_error_handler()`.

## Details

### zif_store_array_add_local ()

    gboolean            zif_store_array_add_local           (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);

Convenience function to add local store to the GPtrArray.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_add_remote ()

    gboolean            zif_store_array_add_remote          (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);

Convenience function to add remote stores to the GPtrArray.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_add_remote_enabled ()

    gboolean            zif_store_array_add_remote_enabled  (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);

Convenience function to add enabled remote stores to the GPtrArray.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_add_store ()

    gboolean            zif_store_array_add_store           (GPtrArray *store_array,
                                                             ZifStore *store);

Add a single ZifStore to the GPtrArray if it does not already exist.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`store` : | A ZifStore to add
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_add_stores ()

    gboolean            zif_store_array_add_stores          (GPtrArray *store_array,
                                                             GPtrArray *stores);

Add an array of ZifStore's to the GPtrArray.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`stores` : | An a rray of ZifStore's to add
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_clean ()

    gboolean            zif_store_array_clean               (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);

Cleans the ZifStoreRemote objects by deleting cache.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_find_by_id ()

    ZifStore *          zif_store_array_find_by_id          (GPtrArray *store_array,
                                                             const gchar *id);

Finds a single ZifStore in the GPtrArray.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`id` : | The ID of the ZifStore, e.g. 'fedora-debuginfo'
Returns : | a `ZifStore` for success, `NULL` otherwise. [transfer none]

Since 0.3.4

### zif_store_array_find_package ()

    ZifPackage *        zif_store_array_find_package        (GPtrArray *store_array,
                                                             const gchar *package_id,
                                                             ZifState *state,
                                                             GError **error);

Find a single package in the GPtrArray.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`package_id` : | A PackageId which defines the package
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | A single ZifPackage or `NULL`. [transfer full]

Since 0.1.0

### zif_store_array_get_categories ()

    GPtrArray *         zif_store_array_get_categories      (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);

Return a list of custom categories from all repos.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifCategory's. [element-type ZifCategory][transfer container]

Since 0.1.0

### zif_store_array_get_packages ()

    GPtrArray *         zif_store_array_get_packages        (GPtrArray *store_array,
                                                             ZifState *state,
                                                             GError **error);

Return all packages in the GPtrArray's.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_get_updates ()

    GPtrArray *         zif_store_array_get_updates         (GPtrArray *store_array,
                                                             ZifStore *store_local,
                                                             ZifState *state,
                                                             GError **error);

Gets the list of packages that can be updated to newer versions.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`store_local` : | The ZifStoreLocal to use for the installed packages
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of the *new* ZifPackage's, not the existing installed packages that are going to be updated. Note: this is a convenience function which makes a few assumptions. [element-type ZifPackage][transfer container]

Since 0.2.1

### zif_store_array_new ()

    GPtrArray *         zif_store_array_new                 (void);

Returns : | A new GPtrArray instance. [element-type ZifStore][transfer container]

Since 0.1.0

### zif_store_array_refresh ()

    gboolean            zif_store_array_refresh             (GPtrArray *store_array,
                                                             gboolean force,
                                                             ZifState *state,
                                                             GError **error);

Refreshes the ZifStoreRemote objects by downloading new data

`store_array` : | An array of ZifStores. [element-type ZifStore]
`force` : | if the data should be re-downloaded if it's still valid
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_store_array_resolve ()

    GPtrArray *         zif_store_array_resolve             (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);

Finds packages matching the package name exactly.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`search` : | The search terms, e.g. "gnome-power-manager". [array zero-terminated=1][element-type utf8]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_resolve_full ()

    GPtrArray *         zif_store_array_resolve_full        (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifStoreResolveFlags flags,
                                                             ZifState *state,
                                                             GError **error);

Finds packages matching the package in a certain way, for instance matching the name, the name.arch or even the name-version depending on the flags used..

`store_array` : | An array of ZifStores. [element-type ZifStore]
`search` : | The search terms, e.g. "gnome-power-manager". [array zero-terminated=1][element-type utf8]
`flags` : | A bitfield of `ZifStoreResolveFlags`, e.g. `ZIF_STORE_RESOLVE_FLAG_USE_NAME_ARCH`
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.2.4

### zif_store_array_search_category ()

    GPtrArray *         zif_store_array_search_category     (GPtrArray *store_array,
                                                             gchar **group_id,
                                                             ZifState *state,
                                                             GError **error);

Find packages that belong in a specific category.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`group_id` : | A group id, e.g. "gnome-system-tools"
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_search_details ()

    GPtrArray *         zif_store_array_search_details      (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);

Find packages that match some detail about the package.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`search` : | The search terms, e.g. "trouble". [array zero-terminated=1][element-type utf8]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_search_file ()

    GPtrArray *         zif_store_array_search_file         (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);

Find packages that provide the specified file.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`search` : | The search terms, e.g. "/usr/bin/gnome-power-manager". [array zero-terminated=1][element-type utf8]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_search_group ()

    GPtrArray *         zif_store_array_search_group        (GPtrArray *store_array,
                                                             gchar **group_enum,
                                                             ZifState *state,
                                                             GError **error);

Find packages that belong in a specific group.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`group_enum` : | The group enumerated values, e.g. "games"
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_search_name ()

    GPtrArray *         zif_store_array_search_name         (GPtrArray *store_array,
                                                             gchar **search,
                                                             ZifState *state,
                                                             GError **error);

Find packages that match the package name in some part.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`search` : | The search terms, e.g. "power". [array zero-terminated=1][element-type utf8]
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.0

### zif_store_array_what_conflicts ()

    GPtrArray *         zif_store_array_what_conflicts      (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);

Find packages that conflict with a specific string.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`depends` : | A ZifDepend to search for
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.3

### zif_store_array_what_obsoletes ()

    GPtrArray *         zif_store_array_what_obsoletes      (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);

Find packages that conflict with a specific string.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`depends` : | A ZifDepend to search for
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.3

### zif_store_array_what_provides ()

    GPtrArray *         zif_store_array_what_provides       (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);

Find packages that provide a specific string.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`depends` : | A ZifDepend to search for
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.3

### zif_store_array_what_requires ()

    GPtrArray *         zif_store_array_what_requires       (GPtrArray *store_array,
                                                             GPtrArray *depends,
                                                             ZifState *state,
                                                             GError **error);

Find packages that require a specific string.

`store_array` : | An array of ZifStores. [element-type ZifStore]
`depends` : | A ZifDepend to search for
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | An array of ZifPackage's. [element-type ZifPackage][transfer container]

Since 0.1.3