the string.
Converts the enumerated value to an text representation.
the #AsAgreementKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsArtifactKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsBundleKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsChecksumKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsColorKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsColorSchemeKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsComponentKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsComponentScope.
Format age
as a human-readable string in the given rating system
. This is
the way to present system-specific strings in a UI.
an #AsContentRatingSystem
a CSM age to format
Determine the most appropriate #AsContentRatingSystem for the given locale
.
Content rating systems are selected by territory. If no content rating system
seems suitable, %AS_CONTENT_RATING_SYSTEM_IARC is returned.
a locale, in the format described in man 3 setlocale
Get the CSM ages corresponding to the entries returned by
as_content_rating_system_get_formatted_ages() for this system
.
an #AsContentRatingSystem
Get an array of all the possible return values of
as_content_rating_system_format_age() for the given system
. The array is
sorted with youngest CSM age first.
an #AsContentRatingSystem
Get a human-readable string to identify system
. %NULL will be returned for
%AS_CONTENT_RATING_SYSTEM_UNKNOWN.
an #AsContentRatingSystem
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsContentRatingValue.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsControlKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsDisplayLengthKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsDisplaySideKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsFormatKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsFormatKind.
Get the version of the AppStream library that is currently used as a string.
Returns the component-ID of the current distribution based on contents
of the /etc/os-release
file.
This function is a shorthand for %as_distro_details_get_cid
Get a web URL to the license text and more license information for an SPDX license identifier.
The SPDX license ID.
Replaces the string find
with the string replace
in a #GString up to
limit
times. If the number of instances of find
in the #GString is
less than limit,
all instances are replaced. If limit
is 0
,
all instances of find
are replaced.
a #GString
the string to find in string
the string to insert in place of find
the maximum instances of find
to replace with replace,
or 0
for no limit
Searches the known list of SPDX license exception IDs.
a single SPDX license exception ID, e.g. "GCC-exception-3.1"
Checks the licence string to check it being a valid licence. NOTE: SPDX licenses can't typically contain brackets.
a SPDX license string, e.g. "CC-BY-3.0 and GFDL-1.3"
Searches the known list of SPDX license IDs.
a single SPDX license ID, e.g. "GPL-3.0"
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsIssueKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsIssueSeverity.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsLaunchableKind.
Check if the given license is for free-as-in-freedom software. A free software license is either approved by the Free Software Foundation or the Open Source Initiative.
This function does not yet handle complex license expressions with AND and OR. If the expression contains any of these, it will still simply check if all mentioned licenses are Free licenses. Currently, any license exception recognized by SPDX is assumed to not impact the free-ness status of a software component.
Please note that this function does not give any legal advice. Please read the license texts to learn more about the individual licenses and their conditions.
The SPDX license string to test.
Check if the metadata license is suitable for mixing with other metadata and redistributing the bundled result (this means we prefer permissive licenses here, to not require people shipping catalog metadata to perform a full license review).
This method checks against a hardcoded list of permissive licenses commonly used to license metadata under.
The SPDX license string to test.
Tests license ID against the vetted list of licenses that can be used for metainfo metadata. This function will not work for license expressions, if you need to test an SPDX license expression for compliance, please use %as_license_is_metadata_license insread.
a single SPDX license ID, e.g. "FSFAP"
Converts a non-SPDX license into an SPDX format string where possible.
a not-quite SPDX license string, e.g. "GPLv3+"
Splits up a long line into an array of smaller strings, each being no longer
than line_len
. Words are not split.
the text to split.
the maximum length of the output line
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsMergeKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a localized text representation, using the plural forms (e.g. "Libraries" instead of "Library").
This can be useful when displaying provided items in GUI dialogs.
the #AsProvidedKind.
Converts the enumerated value to a text representation.
the #AsProvidedKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation. The enum is converted into a two-letter identifier ("eq", "ge", etc.) for use in the XML representation.
the #AsRelationCompare.
Converts the enumerated value to an text representation. The enum is converted into an identifier consisting of two mathematical comparison operators ("==", ">=", etc.) for use in the YAML representation and user interfaces.
the #AsRelationCompare.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsRelationKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsRelationKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsReleaseKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsReleaseUrlKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsScreenshotKind.
De-tokenizes the SPDX licenses into a string.
license tokens, typically from as_spdx_license_tokenize()
Tokenizes the SPDX license string (or any simarly formatted string)
into parts. Any license parts of the string e.g. "LGPL-2.0+" are prefexed
with ""
, the conjunctive replaced with "&", the disjunctive replaced
with "|" and the WITH operator for license exceptions replaced with "^".
Brackets are added as indervidual tokens and other strings are
appended into single tokens where possible.
a license string, e.g. "LGPLv2+ and (QPL or GPLv2) and MIT"
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsSuggestedKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to a text representation.
the #AsTranslationKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the %AsUrgencyKind.
Builds an identifier string unique to the individual dataset using the supplied information.
Scope of the metadata as #AsComponentScope e.g. %AS_COMPONENT_SCOPE_SYSTEM
Bundling system providing this data, e.g. 'package' or 'flatpak'
Origin string, e.g. 'os' or 'gnome-apps-nightly'
AppStream component ID, e.g. 'org.freedesktop.appstream.cli'
Branch, e.g. '3-20' or 'master'
Compare alpha and numeric segments of two versions. The version compare algorithm is also used by RPM.
Checks two component data IDs for equality allowing globs to match.
a data ID
another data ID
Get the component-id part of the data-id.
The data-id.
Converts a data-id to a hash value.
This function implements the widely used DJB hash on the ID subset of the data-id string.
It can be passed to g_hash_table_new() as the hash_func parameter, when using non-NULL strings or unique_ids as keys in a GHashTable.
a data ID
Checks two data IDs for equality allowing globs to match, whilst also allowing clients to whitelist sections that have to match.
a data ID
another data ID
a #AsDataIdMatchFlags bitfield, e.g. %AS_DATA_ID_MATCH_FLAG_ID
Checks if a data ID is valid i.e. has the correct number of sections.
a component data ID
Guess the #AsComponentScope that applies to a given path.
The filename to test.
Installs an AppStream MetaInfo, AppStream Metadata Collection or AppStream Icon tarball file to the right place on the filesystem. Please note that this function does almost no validation and may guess missing values such as icon sizes and origin names. Ensure your metadata is good before installing it.
the #AsMetadataLocation, e.g. %AS_METADATA_LOCATION_CACHE
the full path of the file to install
the origin to use for the installation, or %NULL
the destdir to use, or %NULL
Searches the known list of desktop environments AppStream knows about.
a desktop environment id.
Test if the given string is a valid platform triplet recognized by AppStream.
a platform triplet.
Searches the known list of TLDs we allow for AppStream IDs. This excludes internationalized names.
a top-level domain without dot, e.g. "de", "org", "name"
Calculates if one locale is compatible with another. When doing the calculation the locale and language code is taken into account if possible.
a locale string, or %NULL
a locale string, or %NULL
Compare alpha and numeric segments of two software versions,
considering flags
.
First version number
Second version number
Flags, e.g. %AS_VERCMP_FLAG_NONE
Compare alpha and numeric segments of two software versions.
First version number
Second version number
Get the version of the AppStream library that is currently used at runtime as a string.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsVideoCodecKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsVideoContainerKind.
Converts the text representation to an enumerated value.