Conveniently adds the given boolean value into an array.
See also: [methodJson
.Array.add_element], [methodJson
.Node.set_boolean]
the boolean value to add
Conveniently adds the given floating point value into an array.
See also: [methodJson
.Array.add_element], [methodJson
.Node.set_double]
the floating point value to add
Conveniently adds the given integer value into an array.
See also: [methodJson
.Array.add_element], [methodJson
.Node.set_int]
the integer value to add
Conveniently adds a null
element into an array
See also: [methodJson
.Array.add_element], JSON_NODE_NULL
Conveniently adds the given string value into an array.
See also: [methodJson
.Array.add_element], [methodJson
.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 boolean value of the element at the given position inside an array.
See also: [methodJson
.Array.get_element], [methodJson
.Node.get_boolean]
the index of the element to retrieve
Conveniently retrieves the floating point value of the element at the given position inside an array.
See also: [methodJson
.Array.get_element], [methodJson
.Node.get_double]
the index of the element to retrieve
Conveniently retrieves the integer value of the element at the given position inside an array.
See also: [methodJson
.Array.get_element], [methodJson
.Node.get_int]
the index of the element to retrieve
Retrieves the length of the given array
Conveniently checks whether the element at the given position inside the
array contains a null
value.
See also: [methodJson
.Array.get_element], [methodJson
.Node.is_null]
the index of the element to retrieve
Conveniently retrieves the string value of the element at the given position inside an array.
See also: [methodJson
.Array.get_element], [methodJson
.Node.get_string]
the index of the element to retrieve
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.
Check whether the given array
has been marked as immutable by calling
[methodJson
.Array.seal] on it.
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.
JsonArray
is the representation of the array type inside JSON.A
JsonArray
contains [structJson
.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
JsonArray
using [methodJson
.Array.ref] and [methodJson
.Array.unref].To append an element, use [method
Json
.Array.add_element].To extract an element at a given index, use [method
Json
.Array.get_element].To retrieve the entire array in list form, use [method
Json
.Array.get_elements].To retrieve the length of the array, use [method
Json
.Array.get_length].