foreach_range


Description:

[ CCode ( cname = "g_sequence_foreach_range" ) ]
public void foreach_range (SequenceIter<G> end, Func<G> func)

Calls func for each item in the range (begin, end) passing user_data to the function.

func must not modify the sequence itself.

Example: Foreach, range:

public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
seq.append ("Lorem");
seq.append ("ipsum");
seq.append ("dolor");
seq.append ("sit");
seq.append ("amet");

SequenceIter<string> start = seq.get_iter_at_pos (2);
SequenceIter<string> end = seq.get_end_iter ();

// Output:
// ``dolor``
// ``sit``
// ``amet``
start.foreach_range (end, (item) => {
print ("%s\n", item);
});

return 0;
}

valac --pkg glib-2.0 GLib.SequenceIter.foreach_range.vala

Parameters:

end

a SequenceIter

func

a ThreadPoolFunc

begin

a SequenceIter

user_data

user data passed to func