![]() |
![]() |
![]() |
PackageKit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define PK_PACKAGE_SACK_ERROR #define PK_PACKAGE_SACK_TYPE_ERROR PkPackageSackPrivate; PkPackageSackResults; PkPackageSack; GQuark pk_package_sack_error_quark (void); PkPackageSack * pk_package_sack_new (void); void pk_package_sack_test (gpointer user_data); guint pk_package_sack_get_size (PkPackageSack *sack); PkPackage * pk_package_sack_get_index (PkPackageSack *sack, guint i); void pk_package_sack_clear (PkPackageSack *sack); gchar ** pk_package_sack_get_ids (PkPackageSack *sack); void pk_package_sack_sort_package_id (PkPackageSack *sack); void pk_package_sack_sort_info (PkPackageSack *sack); void pk_package_sack_sort_summary (PkPackageSack *sack); gboolean pk_package_sack_add_package (PkPackageSack *sack, PkPackage *package); gboolean pk_package_sack_add_package_by_id (PkPackageSack *sack, const gchar *package_id, GError **error); gboolean pk_package_sack_remove_package (PkPackageSack *sack, PkPackage *package); gboolean pk_package_sack_remove_package_by_id (PkPackageSack *sack, const gchar *package_id); PkPackage * pk_package_sack_find_by_id (PkPackageSack *sack, const gchar *package_id); guint64 pk_package_sack_get_total_bytes (PkPackageSack *sack); gboolean pk_package_sack_merge_generic_finish (PkPackageSack *sack, GAsyncResult *res, GError **error); void pk_package_sack_merge_resolve_async (PkPackageSack *sack, GCancellable *cancellable, PkProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data); void pk_package_sack_merge_details_async (PkPackageSack *sack, GCancellable *cancellable, PkProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data); void pk_package_sack_merge_update_detail_async (PkPackageSack *sack, GCancellable *cancellable, PkProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
A package sack is a set of packages that can have operations done on them in parallel. This might be adding summary text for bare package ID's, or to add package or update details.
typedef struct _PkPackageSackPrivate PkPackageSackPrivate;
Private PkPackageSack data
PkPackageSack * pk_package_sack_new (void);
Returns : |
a new PkPackageSack object. |
guint pk_package_sack_get_size (PkPackageSack *sack);
Gets the number of packages in the sack
|
a valid PkPackageSack instance |
Returns : |
the number of packages in the sack |
PkPackage * pk_package_sack_get_index (PkPackageSack *sack, guint i);
Gets a packages from the sack
|
a valid PkPackageSack instance |
|
the instance to get |
Returns : |
a PkPackage instance
|
void pk_package_sack_clear (PkPackageSack *sack);
Empty all the packages from the sack
|
a valid PkPackageSack instance |
gchar ** pk_package_sack_get_ids (PkPackageSack *sack);
Returns all the Package IDs in the sack
|
a valid PkPackageSack instance |
Returns : |
the number of packages in the sack, free with g_strfreev()
|
void pk_package_sack_sort_package_id (PkPackageSack *sack);
Sorts by Package ID
|
a valid PkPackageSack instance |
void pk_package_sack_sort_info (PkPackageSack *sack);
Sorts by PkInfoEnum
|
a valid PkPackageSack instance |
void pk_package_sack_sort_summary (PkPackageSack *sack);
Sorts by summary
|
a valid PkPackageSack instance |
gboolean pk_package_sack_add_package (PkPackageSack *sack, PkPackage *package);
Adds a package to the sack.
|
a valid PkPackageSack instance |
|
a valid PkPackage instance |
Returns : |
TRUE if the package was added to the sack
|
gboolean pk_package_sack_add_package_by_id (PkPackageSack *sack, const gchar *package_id, GError **error);
Adds a package reference to the sack.
|
a valid PkPackageSack instance |
|
a package_id descriptor |
|
a GError to put the error code and message in, or NULL
|
Returns : |
TRUE if the package was added to the sack
|
gboolean pk_package_sack_remove_package (PkPackageSack *sack, PkPackage *package);
Removes a package reference from the sack. The pointers have to match exactly.
|
a valid PkPackageSack instance |
|
a valid PkPackage instance |
Returns : |
TRUE if the package was removed from the sack
|
gboolean pk_package_sack_remove_package_by_id (PkPackageSack *sack, const gchar *package_id);
Removes a package reference from the sack. As soon as one package is removed the search is stopped.
|
a valid PkPackageSack instance |
|
a package_id descriptor |
Returns : |
TRUE if the package was removed from the sack
|
PkPackage * pk_package_sack_find_by_id (PkPackageSack *sack, const gchar *package_id);
Finds a package in a sack from reference. As soon as one package is found the search is stopped.
|
a valid PkPackageSack instance |
|
a package_id descriptor |
Returns : |
the PkPackage object, or NULL if unfound. Free with g_object_unref()
|
guint64 pk_package_sack_get_total_bytes (PkPackageSack *sack);
Gets the total size of the package sack in bytes.
|
a valid PkPackageSack instance |
Returns : |
the size in bytes |
gboolean pk_package_sack_merge_generic_finish (PkPackageSack *sack, GAsyncResult *res, GError **error);
Gets the result from the asynchronous function.
|
a valid PkPackageSack instance |
|
the GAsyncResult |
|
A GError or NULL
|
Returns : |
TRUE for success
|
void pk_package_sack_merge_resolve_async (PkPackageSack *sack, GCancellable *cancellable, PkProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
Merges in details about packages using resolve.
|
a valid PkPackageSack instance |
|
a GCancellable or NULL
|
|
the function to run when the progress changes |
|
data to pass to progress_callback
|
|
the function to run on completion |
|
the data to pass to callback
|
void pk_package_sack_merge_details_async (PkPackageSack *sack, GCancellable *cancellable, PkProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
Merges in details about packages.
|
a valid PkPackageSack instance |
|
a GCancellable or NULL
|
|
the function to run when the progress changes |
|
data to pass to progress_callback
|
|
the function to run on completion |
|
the data to pass to callback
|
void pk_package_sack_merge_update_detail_async (PkPackageSack *sack, GCancellable *cancellable, PkProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
Merges in update details about packages.
|
a valid PkPackageSack instance |
|
a GCancellable or NULL
|
|
the function to run when the progress changes |
|
data to pass to progress_callback
|
|
the function to run on completion |
|
the data to pass to callback
|