Initialises the iter
and associate it with object
.
JsonObjectIter iter;
const gchar *member_name;
JsonNode *member_node;
json_object_iter_init (&iter, some_object);
while (json_object_iter_next (&iter, &member_name, &member_node))
{
// Do something with `member_name` and `member_node`.
}
The iterator initialized with this function will iterate the members of the object in an undefined order.
See also: [methodJson
.ObjectIter.init_ordered]
Initialises the iter
and associate it with object
.
JsonObjectIter iter;
const gchar *member_name;
JsonNode *member_node;
json_object_iter_init_ordered (&iter, some_object);
while (json_object_iter_next_ordered (&iter, &member_name, &member_node))
{
// Do something with `member_name` and `member_node`.
}
See also: [methodJson
.ObjectIter.init]
Advances the iterator and retrieves the next member in the object.
If the end of the object is reached, FALSE
is returned and member_name
and member_node
are set to invalid values. After that point, the iter
is invalid.
The order in which members are returned by the iterator is undefined. The iterator is invalidated if the object is modified during iteration.
You must use this function with an iterator initialized with
[methodJson
.ObjectIter.init]; using this function with an iterator
initialized with [methodJson
.ObjectIter.init_ordered] yields undefined
behavior.
See also: [methodJson
.ObjectIter.next_ordered]
Advances the iterator and retrieves the next member in the object.
If the end of the object is reached, FALSE
is returned and member_name
and
member_node
are set to invalid values. After that point, the iter
is invalid.
The order in which members are returned by the iterator is the same order in
which the members were added to the JsonObject
. The iterator is invalidated
if its JsonObject
is modified during iteration.
You must use this function with an iterator initialized with
[methodJson
.ObjectIter.init_ordered]; using this function with an iterator
initialized with [methodJson
.ObjectIter.init] yields undefined behavior.
See also: [methodJson
.ObjectIter.next]
An iterator object used to iterate over the members of a JSON object.
JsonObjectIter
must be allocated on the stack and initialised using [methodJson
.ObjectIter.init] or [methodJson
.ObjectIter.init_ordered].The iterator is invalidated if the object is modified during iteration.
All the fields in the
JsonObjectIter
structure are private and should never be accessed directly.