Top |
GQuark | as_utils_error_quark () |
gchar ** | as_markup_strsplit_words () |
gchar * | as_markup_convert_simple () |
gboolean | as_utils_locale_is_compatible () |
gboolean | as_utils_is_category_name () |
gboolean | as_utils_is_tld () |
gboolean | as_utils_is_desktop_environment () |
void | as_utils_sort_components_into_categories () |
gchar * | as_utils_build_data_id () |
gboolean | as_utils_data_id_valid () |
gchar * | as_utils_data_id_get_cid () |
gboolean | as_utils_data_id_match () |
gboolean | as_utils_data_id_equal () |
guint | as_utils_data_id_hash () |
guint | as_gstring_replace () |
guint | as_gstring_replace2 () |
gboolean | as_utils_is_platform_triplet () |
gboolean | as_utils_install_metadata_file () |
AsComponentScope | as_utils_guess_scope_from_path () |
const gchar * | as_get_appstream_version () |
enum | AsUtilsError |
#define | AS_UTILS_ERROR |
enum | AsDataIdMatchFlags |
enum | AsMetadataLocation |
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.14.0
gboolean as_utils_locale_is_compatible (const gchar *locale1
,const gchar *locale2
);
Calculates if one locale is compatible with another. When doing the calculation the locale and language code is taken into account if possible.
Since: 0.9.5
gboolean
as_utils_is_tld (const gchar *tld
);
Searches the known list of TLDs we allow for AppStream IDs. This excludes internationalized names.
Since: 0.9.8
gboolean
as_utils_is_desktop_environment (const gchar *desktop
);
Searches the known list of desktop environments AppStream knows about.
Since: 0.10.0
void as_utils_sort_components_into_categories (GPtrArray *cpts
,GPtrArray *categories
,gboolean check_duplicates
);
Sorts all components in cpts
into the AsCategory categories listed in categories
.
gchar * as_utils_build_data_id (AsComponentScope scope
,AsBundleKind bundle_kind
,const gchar *origin
,const gchar *cid
,const gchar *branch
);
Builds an identifier string unique to the individual dataset using the supplied information.
scope |
Scope of the metadata as AsComponentScope e.g. |
|
bundle_kind |
Bundling system providing this data, e.g. 'package' or 'flatpak' |
|
origin |
Origin string, e.g. 'os' or 'gnome-apps-nightly' |
|
cid |
AppStream component ID, e.g. 'org.freedesktop.appstream.cli' |
|
branch |
Branch, e.g. '3-20' or 'master' |
Since: 0.14.0
gboolean
as_utils_data_id_valid (const gchar *data_id
);
Checks if a data ID is valid i.e. has the correct number of sections.
Since: 0.14.0
gchar *
as_utils_data_id_get_cid (const gchar *data_id
);
Get the component-id part of the data-id.
gboolean as_utils_data_id_match (const gchar *data_id1
,const gchar *data_id2
,AsDataIdMatchFlags match_flags
);
Checks two data IDs for equality allowing globs to match, whilst also allowing clients to whitelist sections that have to match.
data_id1 |
a data ID |
|
data_id2 |
another data ID |
|
match_flags |
a AsDataIdMatchFlags bitfield, e.g. |
Since: 0.14.0
gboolean as_utils_data_id_equal (const gchar *data_id1
,const gchar *data_id2
);
Checks two component data IDs for equality allowing globs to match.
Since: 0.14.0
guint
as_utils_data_id_hash (const gchar *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.
Since: 0.14.0
guint as_gstring_replace (GString *string
,const gchar *find
,const gchar *replace
);
Replaces all occurences of find
with the string replace
in a GString.
guint as_gstring_replace2 (GString *string
,const gchar *find
,const gchar *replace
,guint limit
);
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.
gboolean
as_utils_is_platform_triplet (const gchar *triplet
);
Test if the given string is a valid platform triplet recognized by AppStream.
Since: 0.14.0
gboolean as_utils_install_metadata_file (AsMetadataLocation location
,const gchar *filename
,const gchar *origin
,const gchar *destdir
,GError **error
);
Installs an AppStream MetaInfo, AppStream Metadata Catalog 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.
location |
the AsMetadataLocation, 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.14.0
AsComponentScope
as_utils_guess_scope_from_path (const gchar *path
);
Guess the AsComponentScope that applies to a given path.
Since: 0.15.0
The flags used when matching unique IDs.
No flags set |
||
Scope, e.g. a AsComponentScope |
||
Bundle kind, e.g. a AsBundleKind |
||
Origin |
||
Component AppStream ID |
||
Branch |