the string.
Converts the enumerated value to an text representation.
the #AsIdKind.
Repairs .inf file data and opens it as a keyfile.
Important: The group and keynames are all forced to lower case as INF files are specified as case insensitive and GKeyFile is case sensitive. Any backslashes or spaces in the key name are also converted to '_'.
a #GKeyFile
the .inf file date to parse
#AsInfLoadFlags, e.g. %AS_INF_LOAD_FLAG_NONE
Repairs an .inf file and opens it as a keyfile.
a #GKeyFile
the .inf file to open
#AsInfLoadFlags, e.g. %AS_INF_LOAD_FLAG_NONE
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the AsKudoKind
.
Converts an XML description into a printable form.
the text to copy.
the #AsMarkupConvertFormat, e.g. %AS_MARKUP_CONVERT_FORMAT_MARKDOWN
Converts an XML description into a printable form.
the text to copy.
the #AsMarkupConvertFormat, e.g. %AS_MARKUP_CONVERT_FORMAT_MARKDOWN
the #AsMarkupConvertFlag, e.g. %AS_MARKUP_CONVERT_FLAG_IGNORE_ERRORS
Converts an XML description into a printable form.
the text to copy.
Imports text and converts to AppStream markup.
the text to import.
the #AsMarkupConvertFormat, e.g. %AS_MARKUP_CONVERT_FORMAT_SIMPLE
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
Validates some markup.
the text to validate
Gets the node tag enum.
Inserts a hash table of data into the DOM.
a parent #AsNode.
the tag name, e.g. "id".
the key to use as the attribute in the XML, e.g. "key".
the hash table with the key as the key to use in the XML.
any %AsNodeInsertFlags.
Inserts a localized key into the DOM.
a parent #AsNode.
the tag name, e.g. "id".
the hash table of data, with the locale as the key.
any %AsNodeInsertFlags.
Converts a node and it's children to XML.
a #AsNode.
the AsNodeToXmlFlags, e.g. %AS_NODE_TO_XML_FLAG_NONE.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsSizeKind.
Converts the text representation to an enumerated value.
the string.
Converts the text representation to an enumerated value also converting legacy key names.
the string.
the #AsTagFlags e.g. %AS_TAG_FLAG_USE_FALLBACKS
Converts the enumerated value to an text representation.
the %AsTag value.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the #AsUrgencyKind.
Converts the text representation to an enumerated value.
the string.
Converts the enumerated value to an text representation.
the AsUrlKind
.
Fixes a string to be a valid AppStream ID.
This function replaces any invalid chars with an underscore.
a string to build the AppStream ID from
Checks to see if a string is a valid AppStream ID. A valid AppStream ID only contains alphanumeric chars, dots and dashes.
a string
Finds an icon filename from a filesystem root.
the destdir.
the icon search name, e.g. "microphone.svg"
Finds an icon filename from a filesystem root.
the destdir.
the icon search name, e.g. "microphone.svg"
A #AsUtilsFindIconFlag bitfield
Returns a GUID for some data. This uses a hash and so even small
differences in the data
will produce radically different return values.
The implementation is taken from RFC4122, Section 4.1.3; specifically using a type-5 SHA-1 hash.
A namespace ID, e.g. "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
data to hash
length of data
Returns a GUID for a given string. This uses a hash and so even small
differences in the str
will produce radically different return values.
The implementation is taken from RFC4122, Section 4.1.3; specifically using a type-5 SHA-1 hash with a DNS namespace. The same result can be obtained with this simple python program:
#!/usr/bin/python import uuid print uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
A source string to use as a key
Checks the source string is a valid string GUID descriptor.
string to check
Installs an AppData, MetaInfo, AppStream XML or AppStream Icon metadata file.
the #AsUtilsLocation, e.g. %AS_UTILS_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 blacklisted desktop IDs.
a desktop ID, e.g. "gimp.desktop"
Searches the known list of registered category IDs.
a desktop ID, e.g. "AudioVideoEditing"
Searches the known list of registered environment IDs.
a desktop ID, e.g. "GNOME"
Checks the licence string to check it being a valid licence. NOTE: SPDX licences 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. "CC-BY-3.0"
Searches the known list of stock icons.
an icon name
Converts a non-SPDX license into an SPDX format string where possible.
a not-quite SPDX license string, e.g. "GPLv3+"
Checks the search token if it is valid. Valid tokens are at least 3 chars in length, not common words like "and", and do not contain markup.
the search token
Splits up a string into tokens and returns tokens that are suitable for searching. This includes taking out common words and casefolding the returned search tokens.
the search string
De-tokenizes the SPDX licenses into a string.
license tokens, typically from as_utils_spdx_license_tokenize()
Tokenizes the SPDX license string (or any simarly formatted string)
into parts. Any licence parts of the string e.g. "LGPL-2.0+" are prefexed
with ""
, the conjunctive replaced with "&" and the disjunctive 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"
Builds a valid unique ID using available data.
a #AsAppScope e.g. %AS_APP_SCOPE_SYSTEM
System, e.g. 'package' or 'flatpak'
Origin, e.g. 'fedora' or 'gnome-apps-nightly'
#AsAppKind, e.g. %AS_APP_KIND_DESKTOP
AppStream ID, e.g. 'gimp.desktop'
Branch, e.g. '3-20' or 'master'
Checks two unique IDs for equality allowing globs to match.
a unique ID
another unique ID
Converts a unique-id to a hash value.
This function implements the widely used DJB hash on the ID subset of the unique-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 unique ID
Checks two unique IDs for equality allowing globs to match, whilst also allowing clients to whitelist sections that have to match.
a unique ID
another unique ID
a #AsUniqueIdMatchFlags bitfield, e.g. %AS_UNIQUE_ID_MATCH_FLAG_ID
Checks if a unique ID is valid i.e. has the correct number of sections.
a unique ID
Compares version numbers for sorting.
the release version, e.g. 1.2.3
the release version, e.g. 1.2.3.1
Compares version numbers for sorting.
the release version, e.g. 1.2.3
the release version, e.g. 1.2.3.1
some #AsVersionCompareFlag
Returns a dotted decimal version string from a 16 bit number.
A uint16le version number
flags used for formatting, e.g. %AS_VERSION_PARSE_FLAG_USE_TRIPLET
Returns a dotted decimal version string from a 32 bit number.
A uint32le version number
flags used for formatting, e.g. %AS_VERSION_PARSE_FLAG_USE_TRIPLET
Returns a dotted decimal version string from a version string. The supported formats are:
Anything with a '.' or that doesn't match [0-9] or 0x[a-f,0-9] is considered a string and returned without modification.
A version number
Converts the text representation to an enumerated value.