Metadata
Object Hierarchy:
AppStream.Metadata
AppStream.Metadata
AppStream.Metadata
GLib.Object
GLib.Object
GLib.Object->AppStream.Metadata
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 ()
public string component_to_metainfo (FormatKind format) throws Error
public string components_to_collection (FormatKind format) throws Error
Serialize all
Component instances into AppStream collection metadata.
public unowned string get_architecture ()
public unowned Component ? get_component ()
Gets the Component
which has been parsed from the XML.
public unowned GenericArray <Component > 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 bool get_update_existing ()
public bool get_write_header ()
public bool parse (string data, FormatKind format) throws Error
Parses any AppStream metadata into one or more
Component instances.
public bool parse_bytes (Bytes bytes, FormatKind format) throws Error
Parses any AppStream metadata into one or more
Component instances.
public bool parse_desktop_data (string data, string cid) 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 save_collection (string fname, FormatKind format) throws Error
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
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref