AsYAMLData 3 APPSTREAM Library
AsYAMLData

## Functions

AsYAMLData * | as_yamldata_new ()
void | as_yamldata_initialize ()
GPtrArray * | as_yamldata_parse_collection_data ()
gchar * | as_yamldata_serialize_to_collection ()
const gchar * | as_yamldata_get_locale ()
void | as_yamldata_set_locale ()
void | as_yamldata_set_check_valid ()

## Types and Values

#define | AS_TYPE_YAMLDATA
struct | AsYAMLDataClass
| AsYAMLData

## Object Hierarchy

        GObject
        ╰── AsYAMLData

## Description

## Functions

### as_yamldata_new ()

    AsYAMLData *
    as_yamldata_new (void);

as_yamldata_new

### as_yamldata_initialize ()

    void
    as_yamldata_initialize (AsYAMLData *ydt,
                            AsFormatVersion format_version,
                            const gchar *locale,
                            const gchar *origin,
                            const gchar *media_baseurl,
                            const gchar *arch,
                            gint priority);

Initialize the YAML handler.

#### Parameters

ydt | An instance of AsYAMLData |

as_yamldata_initialize

### as_yamldata_parse_collection_data ()

    GPtrArray *
    as_yamldata_parse_collection_data (AsYAMLData *ydt,
                                       const gchar *data,
                                       GError **error);

Read an array of AsComponent from AppStream YAML metadata.

#### Parameters

ydt | An instance of AsYAMLData |
data | YAML metadata to parse |

#### Returns

An array of AsComponent or `NULL`.

[transfer container][element-type AsComponent]

as_yamldata_parse_collection_data

### as_yamldata_serialize_to_collection ()

    gchar *
    as_yamldata_serialize_to_collection (AsYAMLData *ydt,
                                         GPtrArray *cpts,
                                         gboolean write_header,
                                         gboolean add_timestamp,
                                         GError **error);

as_yamldata_serialize_to_collection

### as_yamldata_get_locale ()

    const gchar *
    as_yamldata_get_locale (AsYAMLData *ydt);

Gets the current active locale for parsing DEP-11 metadata., or "ALL" if all locales are read.

#### Parameters

ydt | a AsYAMLData instance. |

#### Returns

Locale used for metadata parsing.

as_yamldata_get_locale

### as_yamldata_set_locale ()

    void
    as_yamldata_set_locale (AsYAMLData *ydt,
                            const gchar *locale);

Sets the locale which should be read when processing DEP-11 metadata. All other locales are ignored, which increases parsing speed and reduces memory usage. If you set the locale to "ALL", all locales will be read.

#### Parameters

ydt | a AsYAMLData instance. |
locale | the locale. |

as_yamldata_set_locale

### as_yamldata_set_check_valid ()

    void
    as_yamldata_set_check_valid (AsYAMLData *ydt,
                                 gboolean check);

Set whether we should perform basic validity checks on the component before serializing it to YAML.

#### Parameters

check | `TRUE` if check should be enabled. |

as_yamldata_set_check_valid

## Types and Values

### AS_TYPE_YAMLDATA

    #define AS_TYPE_YAMLDATA (as_yamldata_get_type ())

AS_TYPE_YAMLDATA

### struct AsYAMLDataClass

    struct AsYAMLDataClass {
    	GObjectClass		parent_class;
    };

AsYAMLDataClass

### AsYAMLData

    typedef struct _AsYAMLData AsYAMLData;

AsYAMLData