[libgee] Add Collection.*_iterator
- From: Maciej Marcin Piechotka <mpiechotka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgee] Add Collection.*_iterator
- Date: Sun, 18 Aug 2013 19:26:25 +0000 (UTC)
commit 099b027bcaa4c9e7b8d2d20ba66c785c81de4e51
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Fri Aug 2 09:50:02 2013 +0200
Add Collection.*_iterator
gee/collection.vala | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gee/collection.vala b/gee/collection.vala
index f3c5a2d..3f15008 100644
--- a/gee/collection.vala
+++ b/gee/collection.vala
@@ -245,6 +245,31 @@ public interface Gee.Collection<G> : Iterable<G> {
return changed;
}
+ [CCode (ordering = 16)]
+ public virtual bool add_all_iterator (Iterator<G> iter) {
+ bool changed = false;
+ iter.foreach ((val) => {
+ changed |= add (val);
+ return true;
+ });
+ return changed;
+ }
+
+ [CCode (ordering = 17)]
+ public virtual bool contains_all_iterator (Iterator<G> iter) {
+ return iter.foreach ((val) => {return contains (val);});
+ }
+
+ [CCode (ordering = 18)]
+ public virtual bool remove_all_iterator (Iterator<G> iter) {
+ bool changed = false;
+ return iter.foreach ((val) => {
+ changed |= remove (val);
+ return true;
+ });
+ return changed;
+ }
+
private static bool[] to_bool_array (Collection<bool> coll) {
bool[] array = new bool[coll.size];
int index = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]