GLib.Variant.new_fixed_array
function new_fixed_array(element_type: GLib.VariantType, elements: void, n_elements: Number(gsize), element_size: Number(gsize)): GLib.Variant { // Gjs wrapper for g_variant_new_fixed_array() }
Provides access to the serialised data for an array of fixed-sized items.
@value must be an array with fixed-sized elements. Numeric types are fixed-size as are tuples containing only other fixed-sized types.
element_size must be the size of a single element in the array. For example, if calling this function for an array of 32-bit integers, you might say sizeof(gint32). This value isn't used except for the purpose of a double-check that the form of the serialised data matches the caller's expectation.
n_elements, which must be non-null is set equal to the number of items in the array.
Since 2.32
- element_type
the GLib.VariantType of each element
- elements
a pointer to the fixed array of contiguous elements
- n_elements
the number of elements
- element_size
the size of each element
- Returns
a floating reference to a new array GLib.Variant instance