new_fixed_array


Description:

[ Version ( since = "2.32" ) ]
public static Variant new_fixed_array<T> (VariantType? element_type, T[] elements, size_t element_size)

Constructs a new array Variant instance, where the elements are of element_type type.

elements 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 must be the length of the elements array.

Parameters:

element_type

the VariantType of each element

elements

a pointer to the fixed array of contiguous elements

element_size

the size of each element

n_elements

the number of elements

Returns:

a floating reference to a new array Variant instance