ValueArray

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 g_value_unset() as the clear function using g_array_set_clear_func(), for instance, the following code:

can be replaced by:

Constructors

this
this(GValueArray* gValueArray)

Sets our main struct and passes it to the parent class

this
this(uint nPrealloced)

Warning g_value_array_new has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_sized_new() instead. 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.

Members

Functions

append
ValueArray append(Value value)

Warning g_value_array_append has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_append_val() instead. Insert a copy of value as last element of value_array. If value is NULL, an uninitialized value is appended.

copy
ValueArray copy()

Warning g_value_array_copy has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_ref() instead. Construct an exact copy of a GValueArray by duplicating all its contents.

free
void free()

Warning g_value_array_free has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_unref() instead. Free a GValueArray including its contents.

getNth
Value getNth(uint index)

Warning g_value_array_get_nth has been deprecated since version 2.32 and should not be used in newly-written code. Use g_array_index() instead. Return a pointer to the value at index_ containd in value_array.

getStruct
void* getStruct()

the main Gtk struct as a void*

getValueArrayStruct
GValueArray* getValueArrayStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
insert
ValueArray insert(uint index, Value value)

Warning g_value_array_insert has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_insert_val() instead. Insert a copy of value at specified position into value_array. If value is NULL, an uninitialized value is inserted.

prepend
ValueArray prepend(Value value)

Warning g_value_array_prepend has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_prepend_val() instead. Insert a copy of value as first element of value_array. If value is NULL, an uninitialized value is prepended.

remove
ValueArray remove(uint index)

Warning g_value_array_remove has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_remove_index() instead. Remove the value at position index_ from value_array.

sort
ValueArray sort(GCompareFunc compareFunc)

Warning g_value_array_sort has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_sort(). Sort value_array using compare_func to compare the elements according to the semantics of GCompareFunc. The current implementation uses the same sorting algorithm as standard C qsort() function.

sortWithData
ValueArray sortWithData(GCompareDataFunc compareFunc, void* userData)

Warning g_value_array_sort_with_data has been deprecated since version 2.32 and should not be used in newly-written code. Use GArray and g_array_sort_with_data(). Sort value_array using compare_func to compare the elements according to the semantics of GCompareDataFunc. The current implementation uses the same sorting algorithm as standard C qsort() function. Rename to: g_value_array_sort

Variables

gValueArray
GValueArray* gValueArray;

the main Gtk struct

Meta