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.
If member_name
contains null
, then this function will return NULL
.
See also: [methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the 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.
See also: [methodJson
.Object.get_boolean_member_with_default],
[methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the 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.
the name of the object
member
the value to return if member_name
is not valid
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.
See also: [methodJson
.Object.get_double_member_with_default],
[methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the 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.
the name of the object
member
the value to return if member_name
is not valid
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.
See also: [methodJson
.Object.get_int_member_with_default],
[methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the object 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.
the name of the object member
the value to return if member_name
is not valid
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 [methodJson
.Object.get_member].
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: [methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the member
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.
If member_name
contains null
, then this function will return NULL
.
See also: [methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the member
Retrieves the number of members of a JSON object.
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.
See also: [methodJson
.Object.get_string_member_with_default],
[methodJson
.Object.get_member], [methodJson
.Object.has_member]
the name of the 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.
the name of the object
member
the value to return if member_name
is not valid
Checks whether object
has a member named member_name
.
the name of a JSON object 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.
Checks whether the given object has been marked as immutable by calling
[methodJson
.Object.seal] on it.
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 a boolean value.
See also: [methodJson
.Object.set_member], [methodJson
.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: [methodJson
.Object.set_member], [methodJson
.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: [methodJson
.Object.set_member], [methodJson
.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: [methodJson
.Object.set_member], [methodJson
.Node.init_null]
the name of the member
Convenience function for setting an object member with a string value.
See also: [methodJson
.Object.set_member], [methodJson
.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.
JsonObject
is the representation of the object type inside JSON.A
JsonObject
contains [structJson
.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
JsonObject
using [methodJson
.Object.ref] and [methodJson
.Object.unref].To add or overwrite a member with a given name, use [method
Json
.Object.set_member].To extract a member with a given name, use [method
Json
.Object.get_member].To retrieve the list of members, use [method
Json
.Object.get_members].To retrieve the size of the object (that is, the number of members it has), use [method
Json
.Object.get_size].