AsMetadata 3 APPSTREAM Library
AsMetadata Parser for AppStream metadata

## Functions

AsMetadata * | as_metadata_new ()
GQuark | as_metadata_error_quark ()
AsComponent * | as_metadata_parse_file ()
AsComponent * | as_metadata_parse_data ()
void | as_metadata_set_locale ()
const gchar * | as_metadata_get_locale ()

## Types and Values

enum | AsMetadataError
#define | AS_METADATA_ERROR

## Object Hierarchy

        GObject
        ╰── AsMetadata

## Includes

    #include <appstream.h>

## Description

This object parses AppStream metadata, including AppStream upstream metadata, which is defined by upstream projects. It returns an AsComponent of the data.

See also: AsComponent, AsDatabase

## Functions

### as_metadata_new ()

    AsMetadata *
    as_metadata_new (void);

Creates a new AsMetadata.

#### Returns

a AsMetadata.

[transfer full]

as_metadata_new

### as_metadata_error_quark ()

    GQuark
    as_metadata_error_quark (void);

#### Returns

An error quark.

as_metadata_error_quark

### as_metadata_parse_file ()

    AsComponent *
    as_metadata_parse_file (AsMetadata *metad,
                            GFile *infile,
                            GError **error);

Parses an AppStream upstream metadata file.

#### Parameters

metad | A valid AsMetadata instance |
infile | GFile for the upstream metadata |
error | A GError or `NULL`. |

#### Returns

the AsComponent of this file, or NULL on error.

[transfer full]

as_metadata_parse_file

### as_metadata_parse_data ()

    AsComponent *
    as_metadata_parse_data (AsMetadata *metad,
                            const gchar *data,
                            GError **error);

Parses AppStream upstream metadata.

#### Parameters

metad | A valid AsMetadata instance |
data | XML data describing a component |
error | A GError or `NULL`. |

#### Returns

the AsComponent of this data, or NULL on error.

[transfer full]

as_metadata_parse_data

### as_metadata_set_locale ()

    void
    as_metadata_set_locale (AsMetadata *metad,
                            const gchar *locale);

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

#### Parameters

metad | a AsMetadata instance. |
locale | the locale. |

as_metadata_set_locale

### as_metadata_get_locale ()

    const gchar *
    as_metadata_get_locale (AsMetadata *metad);

Gets the currently used locale.

#### Parameters

metad | a AsMetadata instance. |

#### Returns

Locale used for metadata parsing.

as_metadata_get_locale

## Types and Values

### enum AsMetadataError

The error type.

#### Members

AS_METADATA_ERROR_FAILED | Generic failure |
AS_METADATA_ERROR_LAST |  |

AsMetadataError

### AS_METADATA_ERROR

    #define AS_METADATA_ERROR				as_metadata_error_quark ()

AS_METADATA_ERROR