sort_changed
Description:
[ Version ( deprecated_since = "vala-0.26" , replacement = "SequenceIter.sort_changed" ) ]
public static void sort_changed (SequenceIter<G> iter, CompareDataFunc<G> cmp_func)
public static void sort_changed (SequenceIter<G> iter, CompareDataFunc<G> cmp_func)
Warning: sort_changed is deprecated since vala-0.26. Use SequenceIter.sort_changed.
Example: Moves the data pointed to a new position as indicated by cmp_func:
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, (a, b) => {
return strcmp (a, b);
});
// 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.vala