[gcr] gcr: Add function to get the elements of a union collection



commit fb973d9c553412cb66f6ec9be005d4cdab67eb0e
Author: Stef Walter <stefw collabora co uk>
Date:   Wed Oct 19 12:13:03 2011 +0200

    gcr: Add function to get the elements of a union collection

 gcr/gcr-union-collection.c |   16 ++++++++++++++++
 gcr/gcr-union-collection.h |    2 ++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gcr/gcr-union-collection.c b/gcr/gcr-union-collection.c
index 459fbcc..ce7e465 100644
--- a/gcr/gcr-union-collection.c
+++ b/gcr/gcr-union-collection.c
@@ -338,3 +338,19 @@ gcr_union_collection_size (GcrUnionCollection *self)
 	g_return_val_if_fail (GCR_IS_UNION_COLLECTION (self), FALSE);
 	return g_hash_table_size (self->pv->collections);
 }
+
+/**
+ * gcr_union_collection_elements:
+ * @self: the union collection
+ *
+ * Get the collections that have been added to this union.
+ *
+ * Returns: (element-type Gcr.Collection) (transfer container): collections
+ *          added to the union
+ */
+GList *
+gcr_union_collection_elements (GcrUnionCollection *self)
+{
+	g_return_val_if_fail (GCR_IS_UNION_COLLECTION (self), NULL);
+	return g_hash_table_get_values (self->pv->collections);
+}
diff --git a/gcr/gcr-union-collection.h b/gcr/gcr-union-collection.h
index 4628799..15c207f 100644
--- a/gcr/gcr-union-collection.h
+++ b/gcr/gcr-union-collection.h
@@ -71,6 +71,8 @@ gboolean            gcr_union_collection_have                    (GcrUnionCollec
 
 guint               gcr_union_collection_size                    (GcrUnionCollection *self);
 
+GList *             gcr_union_collection_elements                (GcrUnionCollection *self);
+
 G_END_DECLS
 
 #endif /* __GCR_UNION_COLLECTION_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]