AppStream.Metadata.parse_desktop_data

### Method

# AppStream Metadataparse_desktop_data

#### Declaration [src]

    gboolean
    as_metadata_parse_desktop_data (
      AsMetadata* metad,
      const gchar* cid,
      const gchar* data,
      gssize data_len,
      GError** error
    )

#### Description [src]

Parses XDG Desktop Entry metadata and adds it to the list of parsed entities.

Please note that not every desktop-entry file will result in a valid component being generated, even if parsing succeeds without error (The desktiop-entry file may be valid but not generate a component on purpose).

#### Parameters

`cid`

  Type: `const gchar*`

  The component-id the new `AsComponent` should have.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`data`

  Type: `const gchar*`

  Metadata describing one or more software components.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`data_len`

  Type: `gssize`

  The data length, or -1 if unknown and null-terminated.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

`TRUE` if the file was parsed without error.