AsXMLData 3 APPSTREAM Library
AsXMLData AppStream data XML serialization.

## Functions

AsXMLData * | as_xmldata_new ()
void | as_xmldata_initialize ()
AsComponent * | as_xmldata_parse_upstream_data ()
GPtrArray * | as_xmldata_parse_distro_data ()
gboolean | as_xmldata_update_cpt_with_upstream_data ()
gchar * | as_xmldata_serialize_to_upstream ()
gchar * | as_xmldata_serialize_to_distro ()
void | as_xmldata_set_parser_mode ()
void | as_xmldata_parse_component_node ()

## Types and Values

#define | AS_TYPE_XMLDATA
struct | AsXMLDataClass
| AsXMLData

## Object Hierarchy

        GObject
        ╰── AsXMLData

## Includes

    #include <appstream.h>

## Description

Private class to serialize AppStream data into its XML representation and deserialize the data again. This class is used by AsMetadata to read AppStream XML.

See also: AsComponent, AsMetadata

## Functions

### as_xmldata_new ()

    AsXMLData *
    as_xmldata_new (void);

as_xmldata_new

### as_xmldata_initialize ()

    void
    as_xmldata_initialize (AsXMLData *xdt,
                           const gchar *locale,
                           const gchar *origin,
                           const gchar *media_baseurl,
                           const gchar *arch,
                           gint priority);

Initialize the XML handler.

#### Parameters

xdt | An instance of AsXMLData |

as_xmldata_initialize

### as_xmldata_parse_upstream_data ()

    AsComponent *
    as_xmldata_parse_upstream_data (AsXMLData *xdt,
                                    const gchar *data,
                                    GError **error);

Parse AppStream upstream metadata.

#### Parameters

xdt | An instance of AsXMLData |
data | XML representing upstream metadata. |
error | A GError |

#### Returns

An AsComponent, deserialized from the XML.

[transfer full]

as_xmldata_parse_upstream_data

### as_xmldata_parse_distro_data ()

    GPtrArray *
    as_xmldata_parse_distro_data (AsXMLData *xdt,
                                  const gchar *data,
                                  GError **error);

Parse AppStream upstream metadata.

#### Parameters

xdt | An instance of AsXMLData |
data | XML representing distro metadata. |
error | A GError |

#### Returns

An array of AsComponent, deserialized from the XML.

[transfer full][element-type AsComponent]

as_xmldata_parse_distro_data

### as_xmldata_update_cpt_with_upstream_data ()

    gboolean
    as_xmldata_update_cpt_with_upstream_data
                                   (AsXMLData *xdt,
                                    const gchar *data,
                                    AsComponent *cpt,
                                    GError **error);

Parse AppStream upstream metadata.

#### Parameters

xdt | An instance of AsXMLData |
data | XML representing upstream metadata. |
cpt | Component that should be updated. |
error | A GError |

as_xmldata_update_cpt_with_upstream_data

### as_xmldata_serialize_to_upstream ()

    gchar *
    as_xmldata_serialize_to_upstream (AsXMLData *xdt,
                                      AsComponent *cpt);

Serialize an AsComponent to upstream XML.

#### Parameters

xdt | An instance of AsXMLData |
cpt | The component to serialize. |

#### Returns

XML metadata.

as_xmldata_serialize_to_upstream

### as_xmldata_serialize_to_distro ()

    gchar *
    as_xmldata_serialize_to_distro (AsXMLData *xdt,
                                    GPtrArray *cpts,
                                    gboolean write_header);

Serialize an AsComponent to distro XML.

#### Parameters

xdt | An instance of AsXMLData |

#### Returns

XML metadata.

as_xmldata_serialize_to_distro

### as_xmldata_set_parser_mode ()

    void
    as_xmldata_set_parser_mode (AsXMLData *xdt,
                                AsParserMode mode);

as_xmldata_set_parser_mode

### as_xmldata_parse_component_node ()

    void
    as_xmldata_parse_component_node (AsXMLData *metad,
                                     xmlNode *node,
                                     AsComponent *cpt,
                                     GError **error);

as_xmldata_parse_component_node

## Types and Values

### AS_TYPE_XMLDATA

    #define AS_TYPE_XMLDATA (as_xmldata_get_type ())

AS_TYPE_XMLDATA

### struct AsXMLDataClass

    struct AsXMLDataClass {
    	GObjectClass		parent_class;
    };

AsXMLDataClass

### AsXMLData

    typedef struct _AsXMLData AsXMLData;

AsXMLData