GenericArray


Object Hierarchy:

Object hierarchy for GenericArray

Description:

[ Compact ]
public class GenericArray<G>

Contains the public fields of a pointer array.

Example: Sort all items (with data):

public static int main (string[] args) {
GenericArray<string> array = new GenericArray<string> ();
array.add ("second entry");
array.add ("third entry");
array.add ("first entry");

bool asc = true;
array.sort_with_data ((a, b) => {
return (asc)? strcmp (a, b) : strcmp (b, a);
});

// Output:
// ``first entry``
// ``second entry``
// ``third entry``
array.foreach ((str) => {
print ("%s\n", str);
});

return 0;
}

valac --pkg glib-2.0 GLib.GenericArray.sort_with_data.vala


Namespace: GLib
Package: glib-2.0

Content:

Properties:

Creation methods:

Methods:

Fields: