AsRelease: AppStream-glib Reference Manual

## AsRelease AsRelease — Object representing a single upstream release |

## Stability Level

Stable, unless otherwise indicated

## Functions

AsRelease * | as_release_new ()
gint | as_release_vercmp ()
const gchar * | as_release_get_version ()
const gchar * | as_release_get_filename ()
guint64 | as_release_get_timestamp ()
const gchar * | as_release_get_description ()
GPtrArray * | as_release_get_locations ()
const gchar * | as_release_get_location_default ()
AsChecksum * | as_release_get_checksum_by_fn ()
AsChecksum * | as_release_get_checksum_by_target ()
GPtrArray * | as_release_get_checksums ()
void | as_release_set_version ()
void | as_release_set_filename ()
void | as_release_set_timestamp ()
void | as_release_set_description ()
void | as_release_add_location ()
void | as_release_add_checksum ()

## Object Hierarchy

        GObject
        ╰── AsRelease

## Includes

    #include <appstream-glib.h>

## Description

This object represents a single upstream release, typically a minor update. Releases can contain a localized description of paragraph and list elements and also have a version number and timestamp.

Releases can be automatically generated by parsing upstream ChangeLogs or .spec files, or can be populated using AppData files.

See also: AsApp

## Functions

### as_release_new ()

    AsRelease *
    as_release_new (void);

Creates a new AsRelease.

#### Returns

a AsRelease.

[transfer full]

Since: 0.1.0

### as_release_vercmp ()

    gint
    as_release_vercmp (AsRelease *rel1,
                       AsRelease *rel2);

Compares two release.

#### Parameters

rel1 | a AsRelease instance. |
rel2 | a AsRelease instance. |

#### Returns

-1 if rel1 > rel2, +1 if rel1 < rel2, 0 otherwise

Since: 0.4.2

### as_release_get_version ()

    const gchar *
    as_release_get_version (AsRelease *release);

Gets the release version.

#### Parameters

release | a AsRelease instance. |

#### Returns

string, or `NULL` for not set or invalid

Since: 0.1.0

### as_release_get_filename ()

    const gchar *
    as_release_get_filename (AsRelease *release);

### as_release_get_timestamp ()

    guint64
    as_release_get_timestamp (AsRelease *release);

Gets the release timestamp.

#### Parameters

release | a AsRelease instance. |

#### Returns

timestamp, or 0 for unset

Since: 0.1.0

### as_release_get_description ()

    const gchar *
    as_release_get_description (AsRelease *release,
                                const gchar *locale);

Gets the release description markup for a given locale.

#### Parameters

release | a AsRelease instance. |
locale | the locale, or `NULL`. e.g. "en_GB" |

#### Returns

markup, or `NULL` for not set or invalid

Since: 0.1.0

### as_release_get_locations ()

    GPtrArray *
    as_release_get_locations (AsRelease *release);

Gets the release locations, typically URLs.

#### Parameters

release | a AsRelease instance. |

#### Returns

list of locations.

[transfer none][element-type utf8]

Since: 0.3.5

### as_release_get_location_default ()

    const gchar *
    as_release_get_location_default (AsRelease *release);

Gets the default release location, typically a URL.

#### Parameters

release | a AsRelease instance. |

#### Returns

string, or `NULL` for not set or invalid

Since: 0.3.5

### as_release_get_checksum_by_fn ()

    AsChecksum *
    as_release_get_checksum_by_fn (AsRelease *release,
                                   const gchar *fn);

Gets the checksum for a release.

#### Parameters

release | a AsRelease instance |
fn | a file basename |

#### Returns

an AsChecksum, or `NULL` for not found.

[transfer none]

Since: 0.4.2

### as_release_get_checksum_by_target ()

    AsChecksum *
    as_release_get_checksum_by_target (AsRelease *release,
                                       AsChecksumTarget target);

Gets the checksum for a release.

#### Parameters

release | a AsRelease instance |
target | a AsChecksumTarget, e.g. `AS_CHECKSUM_TARGET_CONTAINER` |

#### Returns

an AsChecksum, or `NULL` for not found.

[transfer none]

Since: 0.4.2

### as_release_get_checksums ()

    GPtrArray *
    as_release_get_checksums (AsRelease *release);

Gets the release checksums.

#### Parameters

release | a AsRelease instance. |

#### Returns

list of checksums.

[transfer none][element-type AsChecksum]

Since: 0.4.2

### as_release_set_version ()

    void
    as_release_set_version (AsRelease *release,
                            const gchar *version);

Sets the release version.

#### Parameters

release | a AsRelease instance. |
version | the version string. |

Since: 0.1.0

### as_release_set_filename ()

    void
    as_release_set_filename (AsRelease *release,
                             const gchar *filename);

### as_release_set_timestamp ()

    void
    as_release_set_timestamp (AsRelease *release,
                              guint64 timestamp);

Sets the release timestamp.

#### Parameters

release | a AsRelease instance. |
timestamp | the timestamp value. |

Since: 0.1.0

### as_release_set_description ()

    void
    as_release_set_description (AsRelease *release,
                                const gchar *locale,
                                const gchar *description);

Sets the description release markup.

#### Parameters

release | a AsRelease instance. |
locale | the locale, or `NULL`. e.g. "en_GB" |
description | the description markup. |

Since: 0.1.0

### as_release_add_location ()

    void
    as_release_add_location (AsRelease *release,
                             const gchar *location);

Adds a release location.

#### Parameters

release | a AsRelease instance. |
location | the location string. |

Since: 0.3.5

### as_release_add_checksum ()

    void
    as_release_add_checksum (AsRelease *release,
                             AsChecksum *checksum);

Adds a release checksum.

#### Parameters

release | a AsRelease instance. |
checksum | a AsChecksum instance. |

Since: 0.4.2

## Types and Values