Iterates over all members of object and calls func on
each one of them.
It is safe to change the value of a member of the oobject from within the iterator function, but it is not safe to add or remove members from the object.
The order in which the object members are iterated is the insertion order.
the function to be called on each member
Convenience function that retrieves the array
stored in member_name of object. It is an error to specify a
member_name which does not exist or which holds a non-null, non-array
value.
If member_name contains null, then this function will return NULL.
See also: Json.Object.get_member, Json.Object.has_member
the name of the member
the array inside the object's member
Convenience function that retrieves the boolean value
stored in member_name of object. It is an error to specify a
member_name which does not exist or which holds a non-scalar,
non-null value.
See also: Json.Object.get_boolean_member_with_default, Json.Object.get_member, Json.Object.has_member
the name of the member
the boolean value of the object's member
Convenience function that retrieves the boolean value
stored in member_name of object.
If member_name does not exist, does not contain a scalar value,
or contains null, then default_value is returned instead. If
member_name contains a non-boolean, non-null scalar value, then
whatever json_node_get_boolean() would return is returned.
the name of the object member
the value to return if member_name is not valid
the boolean value of the object's member, or the given default
Convenience function that retrieves the floating point value
stored in member_name of object. It is an error to specify a
member_name which does not exist or which holds a non-scalar,
non-null value.
See also: Json.Object.get_double_member_with_default, Json.Object.get_member, Json.Object.has_member
the name of the member
the floating point value of the object's member
Convenience function that retrieves the floating point value
stored in member_name of object.
If member_name does not exist, does not contain a scalar value,
or contains null, then default_value is returned instead. If
member_name contains a non-double, non-null scalar value, then
whatever json_node_get_double() would return is returned.
the name of the object member
the value to return if member_name is not valid
the floating point value of the object's member, or the given default
Convenience function that retrieves the integer value
stored in member_name of object. It is an error to specify a
member_name which does not exist or which holds a non-scalar,
non-null value.
See also: Json.Object.get_int_member_with_default, Json.Object.get_member, Json.Object.has_member
the name of the object member
the integer value of the object's member
Convenience function that retrieves the integer value
stored in member_name of object.
If member_name does not exist, does not contain a scalar value,
or contains null, then default_value is returned instead. If
member_name contains a non-integer, non-null scalar value, then whatever
json_node_get_int() would return is returned.
the name of the object member
the value to return if member_name is not valid
the integer value of the object's member, or the given default
Retrieves all the names of the members of an object.
You can obtain the value for each member by iterating the returned list and calling Json.Object.get_member.
the member names of the object
Convenience function that checks whether the value
stored in member_name of object is null. It is an error to
specify a member_name which does not exist.
See also: Json.Object.get_member, Json.Object.has_member
the name of the member
TRUE if the value is null
Convenience function that retrieves the object
stored in member_name of object. It is an error to specify a member_name
which does not exist or which holds a non-null, non-object value.
If member_name contains null, then this function will return NULL.
See also: Json.Object.get_member, Json.Object.has_member
the name of the member
the object inside the object's member
Retrieves the number of members of a JSON object.
the number of members
Convenience function that retrieves the string value
stored in member_name of object. It is an error to specify a
member_name that does not exist or which holds a non-scalar,
non-null value.
See also: Json.Object.get_string_member_with_default, Json.Object.get_member, Json.Object.has_member
the name of the member
the string value of the object's member
Convenience function that retrieves the string value
stored in member_name of object.
If member_name does not exist, does not contain a scalar value,
or contains null, then default_value is returned instead. If
member_name contains a non-string, non-null scalar value, then
null is returned.
the name of the object member
the value to return if member_name is not valid
the string value of the object's member, or the given default
Checks whether object has a member named member_name.
the name of a JSON object member
TRUE if the JSON object has the requested member
Calculate a hash value for the given key (a JSON object).
The hash is calculated over the object and all its members, recursively. If the object is immutable, this is a fast operation; otherwise, it scales proportionally with the number of members in the object.
hash value for key
Checks whether the given object has been marked as immutable by calling Json.Object.seal on it.
TRUE if the object is immutable
Removes member_name from object, freeing its allocated resources.
the name of the member to remove
Seals the object, making it immutable to further changes.
This function will recursively seal all members of the object too.
If the object is already immutable, this is a no-op.
Convenience function for setting an object member with an array value.
See also: Json.Object.set_member, Json.Node.take_array
Convenience function for setting an object member with a boolean value.
See also: Json.Object.set_member, Json.Node.init_boolean
the name of the member
the value of the member
Convenience function for setting an object member with a floating point value.
See also: Json.Object.set_member, Json.Node.init_double
the name of the member
the value of the member
Convenience function for setting an object member with an integer value.
See also: Json.Object.set_member, Json.Node.init_int
the name of the member
the value of the member
Sets the value of a member inside an object.
If the object does not have a member with the given name, a new member is created.
If the object already has a member with the given name, the current value is overwritten with the new.
Convenience function for setting an object member with a null value.
See also: Json.Object.set_member, Json.Node.init_null
the name of the member
Convenience function for setting an object member with an object value.
See also: Json.Object.set_member, Json.Node.take_object
Convenience function for setting an object member with a string value.
See also: Json.Object.set_member, Json.Node.init_string
the name of the member
the value of the member
Releases a reference on the given object.
If the reference count reaches zero, the object is destroyed and all its resources are freed.
Staticnew
Json.Object is the representation of the object type inside JSON.
A Json.Object contains Json.Node "members", which may contain fundamental types, arrays or other objects; each member of an object is accessed using a unique string, or "name".
Since objects can be arbitrarily big, copying them can be expensive; for this reason they are reference counted. You can control the lifetime of a Json.Object using Json.Object.ref and Json.Object.unref.
To add or overwrite a member with a given name, use Json.Object.set_member.
To extract a member with a given name, use Json.Object.get_member.
To retrieve the list of members, use Json.Object.get_members.
To retrieve the size of the object (that is, the number of members it has), use Json.Object.get_size.