Conveniently adds an array element into an array.
If value is NULL, a null element will be added instead.
See also: Json.Array.add_element, Json.Node.take_array
Conveniently adds the given boolean value into an array.
See also: Json.Array.add_element, Json.Node.set_boolean
the boolean value to add
Conveniently adds the given floating point value into an array.
See also: Json.Array.add_element, Json.Node.set_double
the floating point value to add
Conveniently adds the given integer value into an array.
See also: Json.Array.add_element, Json.Node.set_int
the integer value to add
Conveniently adds a null element into an array
See also: Json.Array.add_element, JSON_NODE_NULL
Conveniently adds an object into an array.
If value is NULL, a null element will be added instead.
See also: Json.Array.add_element, Json.Node.take_object
Conveniently adds the given string value into an array.
See also: Json.Array.add_element, Json.Node.set_string
the string value to add
Iterates over all elements of an array, and calls a function on each one of them.
It is safe to change the value of an element of the array while iterating over it, but it is not safe to add or remove elements from the array.
the function to be called on each element
Conveniently retrieves the array at the given position inside an array.
See also: Json.Array.get_element, Json.Node.get_array
the index of the element to retrieve
the array
Conveniently retrieves the boolean value of the element at the given position inside an array.
See also: Json.Array.get_element, Json.Node.get_boolean
the index of the element to retrieve
the boolean value
Conveniently retrieves the floating point value of the element at the given position inside an array.
See also: Json.Array.get_element, Json.Node.get_double
the index of the element to retrieve
the floating point value
Conveniently retrieves the integer value of the element at the given position inside an array.
See also: Json.Array.get_element, Json.Node.get_int
the index of the element to retrieve
the integer value
Retrieves the length of the given array
the length of the array
Conveniently checks whether the element at the given position inside the
array contains a null value.
See also: Json.Array.get_element, Json.Node.is_null
the index of the element to retrieve
TRUE if the element is null
Conveniently retrieves the object at the given position inside an array.
See also: Json.Array.get_element, Json.Node.get_object
the index of the element to retrieve
the object
Conveniently retrieves the string value of the element at the given position inside an array.
See also: Json.Array.get_element, Json.Node.get_string
the index of the element to retrieve
the string value
Calculates a hash value for the given key.
The hash is calculated over the array and all its elements, recursively.
If the array is immutable, this is a fast operation; otherwise, it scales proportionally with the length of the array.
hash value for the key
Check whether the given array has been marked as immutable by calling
Json.Array.seal on it.
true if the array is immutable
Removes the element at the given position inside an array.
This function will release the reference held on the element.
the position of the element to be removed
Seals the given array, making it immutable to further changes.
This function will recursively seal all elements in the array too.
If the array is already immutable, this is a no-op.
Releases a reference on the given array.
If the reference count reaches zero, the array is destroyed and all its allocated resources are freed.
StaticnewStaticsized_
Json.Array is the representation of the array type inside JSON.
A Json.Array contains Json.Node elements, which may contain fundamental types, other arrays or objects.
Since arrays can be arbitrarily big, copying them can be expensive; for this reason, they are reference counted. You can control the lifetime of a Json.Array using Json.Array.ref and Json.Array.unref.
To append an element, use Json.Array.add_element.
To extract an element at a given index, use Json.Array.get_element.
To retrieve the entire array in list form, use Json.Array.get_elements.
To retrieve the length of the array, use Json.Array.get_length.