## AsDataPool AsDataPool — Collect and temporarily store metadata from different sources |

## Functions

AsDataPool * | as_data_pool_new ()
gchar ** | as_data_pool_get_watched_locations ()
gboolean | as_data_pool_update ()
GList * | as_data_pool_get_components ()
const gchar * | as_data_pool_get_locale ()
void | as_data_pool_set_locale ()
void | as_data_pool_set_data_source_directories ()

## Object Hierarchy

        GObject
        ╰── AsDataPool

## Description

This class contains a temporary pool of metadata which has been collected from different sources on the system. It can directly be used, but usually it is accessed through a AsDatabase instance. This class is used by internally by the cache builder, but might be useful for others.

See also: AsDatabase

## Functions

### as_data_pool_new ()

    AsDataPool *
    as_data_pool_new (void);

Creates a new AsDataPool.

#### Returns

a AsDataPool.

[transfer full]

### as_data_pool_get_watched_locations ()

    gchar **
    as_data_pool_get_watched_locations (AsDataPool *dpool);

Return a list of all locations which are searched for metadata.

#### Parameters

dpool | a valid AsDataPool instance |

#### Returns

A string-list of watched (absolute) filepaths.

[transfer full]

### as_data_pool_update ()

    gboolean
    as_data_pool_update (AsDataPool *dpool);

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 updates completes with `FALSE`, it might still add components to the pool.

#### Returns

`TRUE` if update completed without error.

### as_data_pool_get_components ()

    GList *
    as_data_pool_get_components (AsDataPool *dpool);

Get a list of found components.

#### Returns

a list of AsComponent instances, free with `g_list_free()`.

[element-type AsComponent][transfer container]

### as_data_pool_get_locale ()

    const gchar *
    as_data_pool_get_locale (AsDataPool *dpool);

Gets the currently used locale.

#### Parameters

dpool | a AsDataPool instance. |

#### Returns

Locale used for metadata parsing.

### as_data_pool_set_locale ()

    void
    as_data_pool_set_locale (AsDataPool *dpool,
                             const gchar *locale);

Sets the current locale which should be used when parsing metadata.

#### Parameters

dpool | a AsDataPool instance. |
locale | the locale. |

### as_data_pool_set_data_source_directories ()

    void
    as_data_pool_set_data_source_directories
                                   (AsDataPool *dpool,
                                    gchar **dirs);

Set locations for the data pool to read it's data from. This is mainly used for testing purposes. Each location should have an "xmls" and/or "yaml" subdirectory with the actual data as (compressed) AppStream XML or DEP-11 YAML in it.

#### Parameters

dirs | a zero-terminated array of data input directories. | [array zero-terminated=1]

## Types and Values