Gjsify LogoGjsify Logo

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.

record

Hierarchy

  • ObjectIter

Index

Constructors

Properties

name: string

Methods

  • 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]

    Parameters

    • object: Json.Object

      the JSON object to iterate over

    Returns void

  • 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]

    Parameters

    • object: Json.Object

      the JSON object to iterate over

    Returns void

  • 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]

    Returns [boolean, string, Json.Node]

  • next_ordered(): [boolean, string, Json.Node]
  • 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]

    Returns [boolean, string, Json.Node]

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method