AsCacheBuilder 3 APPSTREAM Library
AsCacheBuilder

## Functions

GQuark | as_cache_builder_error_quark ()
AsCacheBuilder * | as_cache_builder_new ()
gboolean | as_cache_builder_setup ()
gboolean | as_cache_builder_refresh ()
void | as_cache_builder_set_data_source_directories ()

## Types and Values

#define | AS_TYPE_CACHE_BUILDER
struct | AsCacheBuilderClass
#define | AS_CACHE_BUILDER_ERROR
enum | AsCacheBuilderError
| AsCacheBuilder

## Object Hierarchy

        GObject
        ╰── AsCacheBuilder

## Description

## Functions

### as_cache_builder_error_quark ()

    GQuark
    as_cache_builder_error_quark (void);

#### Returns

An error quark.

as_cache_builder_error_quark

### as_cache_builder_new ()

    AsCacheBuilder *
    as_cache_builder_new (void);

Creates a new AsCacheBuilder.

#### Returns

a new AsCacheBuilder.

[transfer full]

as_cache_builder_new

### as_cache_builder_setup ()

    gboolean
    as_cache_builder_setup (AsCacheBuilder *builder,
                            const gchar *dbpath,
                            GError **error);

Initialize the cache builder.

#### Parameters

builder | An instance of AsCacheBuilder. |
dbpath | Path to the database directory, or `NULL` to use default. | [nullable][default NULL]

as_cache_builder_setup

### as_cache_builder_refresh ()

    gboolean
    as_cache_builder_refresh (AsCacheBuilder *builder,
                              gboolean force,
                              GError **error);

Update the AppStream Xapian cache.

#### Parameters

builder | An instance of AsCacheBuilder. |
force | Enforce refresh, even if source data has not changed. |

#### Returns

`TRUE` if the cache was updated, `FALSE` on error or if the cache update was not necessary and has been skipped.

as_cache_builder_refresh

### as_cache_builder_set_data_source_directories ()

    void
    as_cache_builder_set_data_source_directories
                                   (AsCacheBuilder *self,
                                    gchar **dirs);

Set locations for the database builder to pull 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]

as_cache_builder_set_data_source_directories

## Types and Values

### AS_TYPE_CACHE_BUILDER

    #define AS_TYPE_CACHE_BUILDER (as_cache_builder_get_type ())

AS_TYPE_CACHE_BUILDER

### struct AsCacheBuilderClass

    struct AsCacheBuilderClass {
    	GObjectClass parent_class;
    };

AsCacheBuilderClass

### AS_CACHE_BUILDER_ERROR

    #define AS_CACHE_BUILDER_ERROR as_cache_builder_error_quark ()

AS_CACHE_BUILDER_ERROR

### enum AsCacheBuilderError

The error type.

#### Members

AS_CACHE_BUILDER_ERROR_FAILED | Generic failure |
AS_CACHE_BUILDER_ERROR_CACHE_INCOMPLETE | The cache was built, but we had to ignore some metadata. |
AS_CACHE_BUILDER_ERROR_TARGET_NOT_WRITABLE | We do not have write-access to the cache target location. |

AsCacheBuilderError

### AsCacheBuilder

    typedef struct _AsCacheBuilder AsCacheBuilder;

AsCacheBuilder