Top | ![]() |
![]() |
![]() |
![]() |
gchar * | as_markup_convert_simple () |
gchar * | as_markup_convert () |
gchar ** | as_markup_strsplit_words () |
GQuark | as_utils_error_quark () |
gboolean | as_utils_is_stock_icon_name () |
gboolean | as_utils_is_spdx_license_id () |
gboolean | as_utils_is_spdx_license () |
gboolean | as_utils_is_environment_id () |
gboolean | as_utils_is_category_id () |
gboolean | as_utils_is_blacklisted_id () |
gchar ** | as_utils_spdx_license_tokenize () |
gchar * | as_utils_spdx_license_detokenize () |
gboolean | as_utils_check_url_exists () |
gchar * | as_utils_find_icon_filename () |
gchar * | as_utils_find_icon_filename_full () |
gchar * | as_utils_get_string_overlap () |
gboolean | as_utils_install_filename () |
gboolean | as_utils_search_token_valid () |
gchar ** | as_utils_search_tokenize () |
gint | as_utils_vercmp () |
enum | AsUtilsError |
#define | AS_UTILS_ERROR |
enum | AsUtilsFindIconFlag |
enum | AsUtilsLocation |
enum | AsMarkupConvertFormat |
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.
markup |
the text to copy. |
|
markup_len |
the length of |
|
error |
A GError or |
Since 0.1.0
gchar * as_markup_convert (const gchar *markup
,gssize markup_len
,AsMarkupConvertFormat format
,GError **error
);
Converts an XML description into a printable form.
markup |
the text to copy. |
|
markup_len |
the length of |
|
format |
the AsMarkupConvertFormat, e.g. |
|
error |
A GError or |
Since 0.3.5
gchar ** as_markup_strsplit_words (const gchar *text
,guint line_len
);
Splits up a long line into an array of smaller strings, each being no longer
than line_len
. Words are not split.
Since 0.3.5
gboolean
as_utils_is_stock_icon_name (const gchar *name
);
Searches the known list of stock icons.
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.
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.
Since 0.2.5
gboolean
as_utils_is_environment_id (const gchar *environment_id
);
Searches the known list of registered environment IDs.
Since 0.2.4
gboolean
as_utils_is_category_id (const gchar *category_id
);
Searches the known list of registered category IDs.
Since 0.2.4
gboolean
as_utils_is_blacklisted_id (const gchar *desktop_id
);
Searches the known list of blacklisted desktop IDs.
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 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.
Since 0.1.5
gchar *
as_utils_spdx_license_detokenize (gchar **license_tokens
);
De-tokenizes the SPDX licenses into a string.
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.
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.
destdir |
the destdir. |
|
search |
the icon search name, e.g. "microphone.svg" |
|
error |
A GError or |
Since 0.2.5
gchar * as_utils_find_icon_filename_full (const gchar *destdir
,const gchar *search
,AsUtilsFindIconFlag flags
,GError **error
);
Finds an icon filename from a filesystem root.
destdir |
the destdir. |
|
search |
the icon search name, e.g. "microphone.svg" |
|
flags |
A AsUtilsFindIconFlag bitfield |
|
error |
A GError or |
Since 0.3.1
gchar * as_utils_get_string_overlap (const gchar *s1
,const gchar *s2
);
Return a prefix and sufffix that is common to both strings.
Since 0.3.1
gboolean as_utils_install_filename (AsUtilsLocation location
,const gchar *filename
,const gchar *origin
,const gchar *destdir
,GError **error
);
Installs an AppData, MetaInfo, AppStream XML or AppStream Icon metadata file.
location |
the AsUtilsLocation, e.g. |
|
filename |
the full path of the file to install |
|
origin |
the origin to use for the installation, or |
|
destdir |
the destdir to use, or |
|
error |
A GError or |
Since 0.3.4
gboolean
as_utils_search_token_valid (const gchar *token
);
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.
Since 0.3.4
gchar **
as_utils_search_tokenize (const gchar *search
);
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.
Since 0.3.4