ValueArray

class ValueArray(pointer: <Error class: unknown class><<Error class: unknown class>>)

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

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gobjectValueArrayPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var nValues: <Error class: unknown class>

number of values contained in the array

Link copied to clipboard

array of values

Functions

Link copied to clipboard
fun append(value: Value? = null): ValueArray

Insert a copy of @value as last element of @value_array. If @value is null, an uninitialized value is appended.

Link copied to clipboard

Construct an exact copy of a #GValueArray by duplicating all its contents.

Link copied to clipboard
fun free()

Free a #GValueArray including its contents.

Link copied to clipboard
fun getNth(index: <Error class: unknown class>): Value

Return a pointer to the value at @index_ contained in @value_array.

Link copied to clipboard
fun insert(index: <Error class: unknown class>, value: Value? = null): ValueArray

Insert a copy of @value at specified position into @value_array. If @value is null, an uninitialized value is inserted.

Link copied to clipboard
fun prepend(value: Value? = null): ValueArray

Insert a copy of @value as first element of @value_array. If @value is null, an uninitialized value is prepended.

Link copied to clipboard
fun remove(index: <Error class: unknown class>): ValueArray

Remove the value at position @index_ from @value_array.

Link copied to clipboard
fun sort(compareFunc: <Error class: unknown class>): ValueArray

Sort @value_array using @compare_func to compare the elements according to the semantics of #GCompareDataFunc.

Link copied to clipboard
open override fun toString(): String