ZIF Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define ZIF_GROUPS_ERROR struct ZifGroups; struct ZifGroupsClass; enum ZifGroupsError; GQuark zif_groups_error_quark (void
); ZifGroups * zif_groups_new (void
); gboolean zif_groups_set_mapping_file (ZifGroups *groups
,const gchar *mapping_file
,GError **error
); gboolean zif_groups_load (ZifGroups *groups
,ZifState *state
,GError **error
); GPtrArray * zif_groups_get_groups (ZifGroups *groups
,ZifState *state
,GError **error
); GPtrArray * zif_groups_get_categories (ZifGroups *groups
,ZifState *state
,GError **error
); GPtrArray * zif_groups_get_cats_for_group (ZifGroups *groups
,const gchar *group_enum
,ZifState *state
,GError **error
); const gchar * zif_groups_get_group_for_cat (ZifGroups *groups
,const gchar *cat
,ZifState *state
,GError **error
);
In Zif, we have a few groups that are enumerated, and categories that are
not enumerated and are custom to the vendor. The mapping from categories
to groups (and vice versa) is done with a mapping file which has to be
set using zif_groups_set_mapping_file()
before any queries are done.
In zif parlance, a group is a single string, e.g. "education" and a category is two strings, a parent and chld that are joined with a delimiter, e.g. "apps;education".
struct ZifGroupsClass { GObjectClass parent_class; /* Padding for future expansion */ void (*_zif_reserved1) (void); void (*_zif_reserved2) (void); void (*_zif_reserved3) (void); void (*_zif_reserved4) (void); };
GQuark zif_groups_error_quark (void
);
Returns : |
An error quark. |
Since 0.1.0
ZifGroups * zif_groups_new (void
);
Returns : |
A new ZifGroups instance. |
Since 0.1.0
gboolean zif_groups_set_mapping_file (ZifGroups *groups
,const gchar *mapping_file
,GError **error
);
This sets up the file that is used to map categories to group enums.
|
A ZifGroups |
|
Mapping filename from categories to groups |
|
A GError, or NULL
|
Returns : |
TRUE for success, FALSE otherwise |
Since 0.1.0
gboolean zif_groups_load (ZifGroups *groups
,ZifState *state
,GError **error
);
Loads the mapping file from disk into memory.
|
A ZifGroups |
|
A ZifState to use for progress reporting |
|
A GError, or NULL
|
Returns : |
TRUE for success, FALSE otherwise |
Since 0.3.1
GPtrArray * zif_groups_get_groups (ZifGroups *groups
,ZifState *state
,GError **error
);
Gets the groups supported by the packaging system.
|
A ZifGroups |
|
A ZifState to use for progress reporting |
|
A GError, or NULL
|
Returns : |
An array of the string groups that are supported. [element-type utf8][transfer container] |
Since 0.3.1
GPtrArray * zif_groups_get_categories (ZifGroups *groups
,ZifState *state
,GError **error
);
Gets the categories supported by the packaging system.
|
A ZifGroups |
|
A ZifState to use for progress reporting |
|
A GError, or NULL
|
Returns : |
An array of category list as strings. [element-type utf8][transfer container] |
Since 0.3.1
GPtrArray * zif_groups_get_cats_for_group (ZifGroups *groups
,const gchar *group_enum
,ZifState *state
,GError **error
);
Gets all the categories that map to to this group enumeration.
|
A ZifGroups |
|
A group enumeration, e.g. "education" |
|
A ZifState to use for progress reporting |
|
A GError, or NULL
|
Returns : |
An array of category list as strings. [element-type utf8][transfer container] |
Since 0.3.1
const gchar * zif_groups_get_group_for_cat (ZifGroups *groups
,const gchar *cat
,ZifState *state
,GError **error
);
Returns the group enumerated type for the category.
|
A ZifGroups |
|
Category name, e.g. "games/action" |
|
A ZifState to use for progress reporting |
|
A GError, or NULL
|
Returns : |
A specific group name or NULL
|
Since 0.3.1