ValueArray

class ValueArray(val gobjectValueArrayPointer: <Error class: unknown class><<Error class: unknown class>>)(source)

⚠️ Deprecated ⚠️

This is deprecated since version 2.32.

Use GArray instead, if possible for the given use case, as described above.

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(nPrealloced: <Error class: unknown class>)

This is deprecated since version 2.32.

constructor()

Allocate a new ValueArray.

constructor(scope: <Error class: unknown class>)

Allocate a new ValueArray using the provided AutofreeScope.

constructor(nValues: <Error class: unknown class>, values: Value?)

Allocate a new ValueArray.

constructor(nValues: <Error class: unknown class>, values: Value?, scope: <Error class: unknown class>)

Allocate a new ValueArray using the provided AutofreeScope.

constructor(gobjectValueArrayPointer: <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

This is deprecated since version 2.32.

Link copied to clipboard

This is deprecated since version 2.32.

Link copied to clipboard
fun free()

This is deprecated since version 2.32.

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

This is deprecated since version 2.32.

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

This is deprecated since version 2.32.

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

This is deprecated since version 2.32.

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

This is deprecated since version 2.32.

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

This is deprecated since version 2.32.

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