move_range
Description:
[ CCode ( cname = "g_sequence_move_range" ) ]
public void move_range (SequenceIter<G> begin, SequenceIter<G> end)
public void move_range (SequenceIter<G> begin, SequenceIter<G> end)
Inserts the (begin
, end
) range at the destination pointed to by dest
.
The begin
and end
iters must point into the same sequence. It is allowed for dest
to point to a
different sequence than the one pointed into by begin
and end
.
If dest
is null, the range indicated by begin
and end
is removed from
the sequence. If dest
points to a place within the (begin
, end
) range, the range does not move.
Example: Move a range:
public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
// Sorted data:
seq.append ("1. Lorem");
seq.append ("3. dolor");
seq.append ("4. sit");
seq.append ("2. ipsum");
seq.append ("5. amet");
SequenceIter<string> begin = seq.get_iter_at_pos (1);
SequenceIter<string> end = seq.get_iter_at_pos (3);
SequenceIter<string> dest = seq.get_iter_at_pos (4);
dest.move_range (begin, end);
// Output:
// ``1. Lorem``
// ``2. ipsum``
// ``3. dolor``
// ``4. sit``
// ``5. amet``
seq.foreach ((item) => {
print ("%s\n", item);
});
return 0;
}
valac --pkg glib-2.0 GLib.SequenceIter.move_range.vala
Parameters:
begin | |
end | |
dest |