ValueArray
A GValueArray
is a container structure to hold an array of generic values.
The prime purpose of a GValueArray
is for it to be used as an object property that holds an array of values. A GValueArray
wraps an array of GValue
elements in order for it to be used as a boxed type through G_TYPE_VALUE_ARRAY
.
GValueArray
is deprecated in favour of GArray
since GLib 2.32. It is possible to create a GArray
that behaves like a GValueArray
by using the size of GValue
as the element size, and by setting method@GObject.Value.unset as the clear function using func@GLib.Array.set_clear_func, 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);
Constructors
Functions
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.
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.