sort_changed_iter


Description:

[ Version ( deprecated_since = "vala-0.26" , replacement = "SequenceIter.sort_changed_iter" ) ]
public static void sort_changed_iter (SequenceIter<G> iter, SequenceIterCompareFunc<G> iter_cmp)

Warning: sort_changed_iter is deprecated since vala-0.26. Use SequenceIter.sort_changed_iter.

Example: Moves the data pointed to a new position as indicated by cmp_func (iter-based):

public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
// Sorted data:
seq.append ("1. Lorem");
seq.append ("2. ipsum");
seq.append ("4. sit");
seq.append ("5. amet");


seq.append ("3. dolor");
SequenceIter<string> iter = seq.get_end_iter ().prev ();
Sequence<string>.sort_changed_iter (iter, (a, b) => {
return strcmp (a.get (), b.get ());
});

// 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.Sequence.sort_changed_iter.vala