Metadata
Object Hierarchy:
Description:
[
CCode ( type_id =
"as_metadata_get_type ()" ) ]
public class Metadata :
Object
Content:
Static methods:
Creation methods:
- public Metadata ()
Creates a new Metadata.
Methods:
- public void add_component (Component cpt)
- public void clear_components ()
Remove all previously parsed or manually added components.
- public void clear_releases ()
Remove all previously parsed releases entries.
- public string component_to_metainfo (FormatKind format) throws Error
- public string components_to_catalog (FormatKind format) throws Error
Serialize all
Component instances into AppStream catalog metadata.
- public unowned string get_architecture ()
- public unowned Component? get_component ()
Gets the Component
which has been parsed from the XML.
- public unowned ComponentBox get_components ()
- public FormatStyle get_format_style ()
Get the metadata parsing mode.
- public FormatVersion get_format_version ()
- public unowned string get_locale ()
Gets the current active locale for parsing metadata, or "ALL" if all
locales are read.
- public unowned string get_media_baseurl ()
- public unowned string get_origin ()
- public ParseFlags get_parse_flags ()
Get the metadata parse flags.
- public unowned ReleaseList? get_release_list ()
- public unowned GenericArray<ReleaseList> get_release_lists ()
- public bool get_update_existing ()
- public bool get_write_header ()
- public bool parse_bytes (Bytes bytes, FormatKind format) throws Error
Parses any AppStream metadata into one or more
Component instances.
- public bool parse_data (string data, ssize_t data_len, FormatKind format) throws Error
Parses any AppStream metadata into one or more
Component instances.
- public bool parse_desktop_data (string cid, string data, ssize_t data_len) throws Error
Parses XDG Desktop Entry metadata and adds it to the list of parsed
entities.
- public bool parse_file (File file, FormatKind format) throws Error
Parses an AppStream upstream metadata file.
- public bool parse_releases_bytes (Bytes bytes) throws Error
Parses any AppStream release metadata into
Release objects.
- public bool parse_releases_file (File file) throws Error
Parses any AppStream release metadata into
Release objects using the provided file.
- public string releases_to_data (ReleaseList releases) throws Error
Convert a releases of an
ReleaseList entity into a release metadata XML representation.
- public bool save_catalog (string fname, FormatKind format) throws Error
Serialize all
Component instances to XML or YAML metadata and save the data to a file.
- public bool save_metainfo (string fname, FormatKind format) throws Error
Serialize Component
instance to XML and save it to file.
- public void set_architecture (string arch)
Set the architecture the components in this metadata belong to.
- public void set_format_style (FormatStyle mode)
Sets the current metadata parsing mode.
- public void set_format_version (FormatVersion version)
Set the current AppStream format version that we should generate data
for or be able to read.
- public void set_locale (string locale)
Sets the locale which should be read when processing metadata.
- public void set_media_baseurl (string url)
Set the base URL for all media links referenced in the metadata, or
null if every component has absolute URLs.
- public void set_origin (string origin)
Set the origin of AppStream distro metadata
- public void set_parse_flags (ParseFlags flags)
Sets the current metadata parse flags.
- public void set_update_existing (bool update)
If set to true, the parser will not
create new components but instead update existing components in the pool with new metadata.
- public void set_write_header (bool wheader)
If set to true, tehe metadata writer
will omit writing a DEP-11 header document when in YAML mode, and will not write a root components node when writing XML data.
Inherited Members:
All known members inherited from class GLib.Object