gcr: Add function to get the elements of a union collection
authorStef Walter <stefw@collabora.co.uk>
Wed, 19 Oct 2011 10:13:03 +0000 (12:13 +0200)
committerStef Walter <stefw@collabora.co.uk>
Wed, 19 Oct 2011 10:13:03 +0000 (12:13 +0200)
gcr/gcr-union-collection.c
gcr/gcr-union-collection.h

index 459fbcc..ce7e465 100644 (file)
@@ -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);
+}
index 4628799..15c207f 100644 (file)
@@ -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__ */