[ CCode ( cname = "g_sequence_insert_before" ) ]
public SequenceIter<G> insert_before (owned G data)
Inserts a new item just before the item pointed to by iter
.
Example: Insert before:
public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
seq.append ("Lorem");
seq.append ("ipsum");
seq.append ("sit");
seq.append ("amet");
SequenceIter<string> iter = seq.get_iter_at_pos (2);
iter.insert_before ("dolor");
// Output:
// ``Lorem``
// ``ipsum``
// ``dolor``
// ``sit``
// ``amet``
seq.foreach ((item) => {
print ("%s\n", item);
});
return 0;
}
valac --pkg glib-2.0 GLib.SequenceIter.insert_before.vala
data |
the data for the new item |
iter |
an iterator pointing to the new item |