ValueArray


Object Hierarchy:

GLib.ValueArray GLib.ValueArray GLib.ValueArray

Description:

[ CCode ( copy_function = "g_value_array_copy" , free_function = "g_value_array_free" , type_id = "G_TYPE_VALUE_ARRAY" ) ]
[ Compact ]
[ Version ( deprecated = true , deprecated_since = "2.32" ) ]
public class ValueArray

Warning: ValueArray is deprecated since 2.32.

A ValueArray contains an array of Value elements.

Example: Value arrays:

private inline Value create_string_value (string str) {
Value val = Value (typeof (string));
val.set_string (str);
return val;
}

public static int main (string[] args) {
ValueArray array = new ValueArray (10);

array.append (create_string_value ("BB"));
array.append (create_string_value ("DD"));
array.prepend (create_string_value ("AA"));

// Output: ``Len: 3``
print ("Len: %u\n", array.n_values);

array.insert (2, create_string_value ("CC"));
array.remove (3);


// Output:
// ``AA``
// ``BB``
// ``CC``
foreach (Value val in array.values) {
print ("%s\n", val.get_string ());
}

return 0;
}

valac --pkg gobject-2.0 GLib.ValueArray.vala

Namespace: GLib
Package: gobject-2.0

Content:

Creation methods:

Methods:

Fields:




2022 vala-language.org