Json.ObjectIter¶
Methods¶
| init(object) | |
| init_ordered(object) | |
| next() | |
| next_ordered() | 
Details¶
- 
class Json.ObjectIter¶
- An iterator used to iterate over the members of a - Json.Object. This must be allocated on the stack and initialised using- Json.ObjectIter.init(). The order in which members are returned by the iterator is undefined. The iterator is invalidated if its- Json.Objectis modified during iteration.- All the fields in the - Json.ObjectIterstructure are private and should never be accessed directly.- New in version 1.2. - 
init(object)¶
- Parameters: - object ( - Json.Object) – the- Json.Objectto iterate over- Initialise the self 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. } - New in version 1.2. 
 - 
init_ordered(object)¶
- Parameters: - object ( - Json.Object) – the- Json.Objectto iterate over- Initialise the self 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: - Json.ObjectIter.init()- New in version 1.6. 
 - 
next()¶
- Returns: - Trueif member_name and member_node are valid;- Falseif the end of the object has been reached- member_name: - return location for the member name, or - Noneto ignore- member_node: - return location for the member value, or - Noneto ignore- Return type: - ( - bool, member_name:- str, member_node:- Json.Node)- Advance self and retrieve the next member in the object. If the end of the object is reached, - Falseis returned and member_name and member_node are set to invalid values. After that point, the self is invalid.- The order in which members are returned by the iterator is undefined. The iterator is invalidated if its - Json.Objectis modified during iteration.- You must use this function with a - Json.ObjectIterinitialized with- Json.ObjectIter.init(); using this function with an iterator initialized with- Json.ObjectIter.init_ordered() yields undefined behavior.- See also: - Json.ObjectIter.next_ordered()- New in version 1.2. 
 - 
next_ordered()¶
- Returns: - Trueif member_name and member_node are valid;- Falseif the end of the object has been reached- member_name: - return location for the member name, or - Noneto ignore- member_node: - return location for the member value, or - Noneto ignore- Return type: - ( - bool, member_name:- str, member_node:- Json.Node)- Advance self and retrieve the next member in the object. If the end of the object is reached, - Falseis returned and member_name and member_node are set to invalid values. After that point, the self is invalid.- The order in which members are returned by the iterator is the same order in which the members were added to the - Json.Object. The iterator is invalidated if its- Json.Objectis modified during iteration.- You must use this function with a - Json.ObjectIterinitialized with- Json.ObjectIter.init_ordered(); using this function with an iterator initialized with- Json.ObjectIter.init() yields undefined behavior.- See also: - Json.ObjectIter.next()- New in version 1.6. 
 
-