Array
Object Hierarchy:
Description:
[ CCode ( ref_function = "json_array_ref" , type_id = "json_array_get_type ()" , unref_function = "json_array_unref" ) ]
[ Compact ]
public class Array
[ Compact ]
public class Array
A JSON array type.
The contents of the Array structure are private and should only be accessed by the provided API
Namespace: Json
Package: json-glib-1.0
Content:
Creation methods:
- public Array ()
Creates a new Array.
- public Array.sized (uint n_elements)
Creates a new Array with
n_elements
slots already allocated.
Methods:
- public unowned Array @ref ()
Increase by one the reference count of a Array.
- public void add_array_element (owned Array? value)
Conveniently adds an array into this.
- public void add_boolean_element (bool value)
Conveniently adds a boolean
value
into this - public void add_double_element (double value)
Conveniently adds a floating point
value
into this - public void add_element (owned Node node)
Appends
node
inside this. - public void add_int_element (int64 value)
Conveniently adds an integer
value
into this - public void add_null_element ()
Conveniently adds a null element into this
- public void add_object_element (owned Object value)
Conveniently adds an object into this.
- public void add_string_element (string value)
Conveniently adds a string
value
into this - public Node dup_element (uint index_)
Retrieves a copy of the Node containing the value of the element at
index_
inside a Array - public bool equal (Array b)
Check whether this and
b
are equal Arrays, meaning they have the same number of elements, and the values of elements in corresponding positions are equal. - public void foreach_element (ArrayForeach func)
Iterates over all elements of this and calls
func
on each one of them. - public unowned Array get_array_element (uint index_)
Conveniently retrieves the array from the element at
index_
inside this - public bool get_boolean_element (uint index_)
Conveniently retrieves the boolean value of the element at
index_
inside this - public double get_double_element (uint index_)
Conveniently retrieves the floating point value of the element at
index_
inside this - public unowned Node get_element (uint index_)
Retrieves the Node containing the value of the element at
index_
inside a Array. - public List<unowned Node> get_elements ()
Gets the elements of a Array as a list of Node instances.
- public int64 get_int_element (uint index_)
Conveniently retrieves the integer value of the element at
index_
inside this - public uint get_length ()
Retrieves the length of a Array
- public bool get_null_element (uint index_)
Conveniently retrieves whether the element at
index_
is set to null - public unowned Object get_object_element (uint index_)
Conveniently retrieves the object from the element at
index_
inside this - public unowned string get_string_element (uint index_)
Conveniently retrieves the string value of the element at
index_
inside this - public uint hash ()
Calculate a hash value for the given this (a Array).
- public bool is_immutable ()
Check whether the given this has been marked as immutable by calling seal on it.
- public void remove_element (uint index_)
Removes the Node inside this at
index_
freeing its allocated resources. - public void seal ()
Seals the Array, making it immutable to further changes.
- public void unref ()
Decreases by one the reference count of a Array.