Allocate and initialize a new #GValueArray, optionally preserve space for n_prealloced elements. New arrays always contain 0 elements, regardless of the value of n_prealloced.
Insert a copy of value as last element of value_array. If value is null, an uninitialized value is appended.
Construct an exact copy of a #GValueArray by duplicating all its contents.
Return a pointer to the value at index_ containd in value_array.
Insert a copy of value at specified position into value_array. If value is null, an uninitialized value is inserted.
Insert a copy of value as first element of value_array. If value is null, an uninitialized value is prepended.
Remove the value at position index_ from value_array.
Sort value_array using compare_func to compare the elements according to the semantics of #GCompareDataFunc.
Pointer to the C boxed value
Get the GType of this boxed type.
Boxed GType property.
Convenience method to return this cast to a type. For use in D with statements.
Make a copy of the wrapped C boxed data.
Copy a C boxed value using g_boxed_copy.
Free a C boxed value using g_boxed_free.
Deprecated: Use glib.array.Array instead, if possible for the given use case, as described above.
A gobject.value_array.ValueArray is a container structure to hold an array of generic values.
The prime purpose of a gobject.value_array.ValueArray is for it to be used as an object property that holds an array of values. A gobject.value_array.ValueArray wraps an array of gobject.value.Value elements in order for it to be used as a boxed type through G_TYPE_VALUE_ARRAY.
gobject.value_array.ValueArray is deprecated in favour of glib.array.Array since GLib 2.32. It is possible to create a glib.array.Array that behaves like a gobject.value_array.ValueArray by using the size of gobject.value.Value as the element size, and by setting gobject.value.Value.unset as the clear function using glib.array.Array.setClearFunc, for instance, the following code:
GValueArray *array = g_value_array_new (10);
can be replaced by:
GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10); g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);