Top | ![]() |
![]() |
![]() |
![]() |
#define | AS_TYPE_METADATA |
AsMetadata * | as_metadata_new () |
GQuark | as_metadata_error_quark () |
void | as_metadata_parse_file () |
void | as_metadata_parse_xml () |
void | as_metadata_parse_yaml () |
AsComponent * | as_metadata_get_component () |
GPtrArray * | as_metadata_get_components () |
void | as_metadata_clear_components () |
void | as_metadata_add_component () |
gchar * | as_metadata_component_to_upstream_xml () |
gchar * | as_metadata_components_to_distro_xml () |
void | as_metadata_save_upstream_xml () |
void | as_metadata_save_distro_xml () |
void | as_metadata_set_locale () |
const gchar * | as_metadata_get_locale () |
const gchar * | as_metadata_get_origin () |
void | as_metadata_set_origin () |
void | as_metadata_set_parser_mode () |
AsParserMode | as_metadata_get_parser_mode () |
struct | AsMetadataClass |
enum | AsParserMode |
enum | AsMetadataError |
#define | AS_METADATA_ERROR |
AsMetadata |
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
void as_metadata_parse_file (AsMetadata *metad
,GFile *file
,GError **error
);
Parses an AppStream upstream metadata file.
metad |
A valid AsMetadata instance |
|
file |
GFile for the upstream metadata |
|
error |
A GError or |
void as_metadata_parse_xml (AsMetadata *metad
,const gchar *data
,GError **error
);
Parses AppStream XML metadata.
metad |
A valid AsMetadata instance |
|
data |
XML data describing one or more software components. |
void as_metadata_parse_yaml (AsMetadata *metad
,const gchar *data
,GError **error
);
Parses AppStream YAML metadata.
metad |
A valid AsMetadata instance |
|
data |
YAML data describing one or more software components. |
|
error |
A GError or |
AsComponent *
as_metadata_get_component (AsMetadata *metad
);
Gets the AsComponent which has been parsed from the XML. If the AppStream XML contained multiple components, return the first component that has been parsed.
void as_metadata_add_component (AsMetadata *metad
,AsComponent *cpt
);
Add an AsComponent to the list of components. This can be used to add multiple components in order to produce a distro-XML AppStream metadata file.
gchar *
as_metadata_component_to_upstream_xml (AsMetadata *metad
);
Convert an AsComponent to upstream XML. (The amount of localization included in the metadata depends on how the AsComponent was initially loaded)
The first AsComponent added to the internal list will be transformed.
In case no component is present, NULL
is returned.
gchar *
as_metadata_components_to_distro_xml (AsMetadata *metad
);
Serialize all AsComponent instances into AppStream
distro-XML data.
NULL
is returned if there is nothing to serialize.
void as_metadata_save_upstream_xml (AsMetadata *metad
,const gchar *fname
,GError **error
);
Serialize AsComponent instance to XML and save it to file. An existing file at the same location will be overridden.
void as_metadata_save_distro_xml (AsMetadata *metad
,const gchar *fname
,GError **error
);
Serialize all AsComponent instances to XML and save the data to a file. An existing file at the same location will be overridden.
void as_metadata_set_locale (AsMetadata *metad
,const gchar *locale
);
Sets the locale which should be read when processing 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.
const gchar *
as_metadata_get_locale (AsMetadata *metad
);
Gets the current active locale for parsing metadata, or "ALL" if all locales are read.
void as_metadata_set_origin (AsMetadata *metad
,const gchar *origin
);
Set the origin of AppStream distro metadata
void as_metadata_set_parser_mode (AsMetadata *metad
,AsParserMode mode
);
Sets the current metadata parsing mode.
AsParserMode
as_metadata_get_parser_mode (AsMetadata *metad
);
Gets the current parser mode