Method

AppStreamComponentload_from_bytes

Declaration [src]

gboolean
as_component_load_from_bytes (
  AsComponent* cpt,
  AsContext* context,
  AsFormatKind format,
  GBytes* bytes,
  GError** error
)

Description [src]

Load metadata for this component from an XML string. You normally do not want to use this method directly and instead use the more convenient API of AsMetadata to create and update components.

If this function returns TRUE, a valid component is returned unless the selected format was AS_FORMAT_KIND_DESKTOP_ENTRY, in which case a component ID will have to be set explicitly by the caller in order to make the component valid.

Available since:0.14.0

Parameters

context AsContext
 

An AsContext instance.

 The data is owned by the caller of the function.
format AsFormatKind
 

The format of the data to load, e.g. AS_FORMAT_KIND_XML.

bytes GBytes
 

The data to load.

 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE on success.