| AppStream-glib Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <appstream-glib.h> gchar * as_markup_convert_simple (const gchar *markup,gssize markup_len,GError **error); gboolean as_utils_is_stock_icon_name (const gchar *name); gboolean as_utils_is_spdx_license_id (const gchar *license_id); gboolean as_utils_is_spdx_license (const gchar *license); gboolean as_utils_is_environment_id (const gchar *environment_id); gboolean as_utils_is_category_id (const gchar *category_id); gboolean as_utils_is_blacklisted_id (const gchar *desktop_id); gchar ** as_utils_spdx_license_tokenize (const gchar *license); gchar * as_utils_spdx_license_detokenize (gchar **license_tokens); gboolean as_utils_check_url_exists (const gchar *url,guint timeout,GError **error); gchar * as_utils_find_icon_filename (const gchar *destdir,const gchar *search,GError **error);
These functions are used internally to libappstream-glib, and some may be useful to user-applications.
gchar * as_markup_convert_simple (const gchar *markup,gssize markup_len,GError **error);
Converts an XML description into a printable form.
|
the text to copy. |
|
the length of markup, or -1 if markup is NULL terminated. |
|
A GError or NULL
|
Returns : |
a newly allocated NULL terminated string. [transfer full]
|
Since 0.1.0
gboolean as_utils_is_stock_icon_name (const gchar *name);
Searches the known list of stock icons.
|
an icon name |
Returns : |
TRUE if the icon is a "stock icon name" and does not need to be
included in the AppStream icon tarball |
Since 0.1.3
gboolean as_utils_is_spdx_license_id (const gchar *license_id);
Searches the known list of SPDX license IDs.
|
a single SPDX license ID, e.g. "CC-BY-3.0" |
Returns : |
TRUE if the icon is a valid "SPDX license ID" |
Since 0.1.5
gboolean as_utils_is_spdx_license (const gchar *license);
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" |
Returns : |
TRUE if the icon is a valid "SPDX license" |
Since 0.2.5
gboolean as_utils_is_environment_id (const gchar *environment_id);
Searches the known list of registered environment IDs.
|
a desktop ID, e.g. "GNOME" |
Returns : |
TRUE if the environment ID is valid |
Since 0.2.4
gboolean as_utils_is_category_id (const gchar *category_id);
Searches the known list of registered category IDs.
|
a desktop ID, e.g. "AudioVideoEditing" |
Returns : |
TRUE if the category ID is valid |
Since 0.2.4
gboolean as_utils_is_blacklisted_id (const gchar *desktop_id);
Searches the known list of blacklisted desktop IDs.
|
a desktop ID, e.g. "gimp.desktop" |
Returns : |
TRUE if the desktop ID is blacklisted |
Since 0.2.2
gchar ** as_utils_spdx_license_tokenize (const gchar *license);
Tokenizes the SPDX license string (or any simarly formatted string) into parts. Any non-licence parts of the string e.g. " and " are prefexed with "#".
|
a license string, e.g. "LGPLv2+ and (QPL or GPLv2) and MIT" |
Returns : |
array of strings. [transfer full] |
Since 0.1.5
gchar * as_utils_spdx_license_detokenize (gchar **license_tokens);
De-tokenizes the SPDX licenses into a string.
|
license tokens, typically from as_utils_spdx_license_tokenize()
|
Returns : |
string. [transfer full] |
Since 0.2.5
gboolean as_utils_check_url_exists (const gchar *url,guint timeout,GError **error);
Checks to see if a URL is reachable.
|
the URL to check. |
|
the timeout in seconds. |
|
A GError or NULL
|
Returns : |
TRUE if the URL was reachable and pointed to a non-zero-length file. |
Since 0.1.5
gchar * as_utils_find_icon_filename (const gchar *destdir,const gchar *search,GError **error);
Finds an icon filename from a filesystem root.
|
the destdir. |
|
the icon search name, e.g. "microphone.svg" |
|
A GError or NULL
|
Returns : |
a newly allocated NULL terminated string. [transfer full]
|
Since 0.2.5