Node.setValue

void setValue(gobject.value.Value value)

Sets a scalar value inside the given node.

The contents of the given [gobject.value.Value] are copied into the [json.node.Node].

The following [gobject.value.Value] types have a direct mapping to JSON types:

  • G_TYPE_INT64
  • G_TYPE_DOUBLE
  • G_TYPE_BOOLEAN
  • G_TYPE_STRING

JSON-GLib will also automatically promote the following [gobject.value.Value] types:

  • G_TYPE_INT to G_TYPE_INT64
  • G_TYPE_FLOAT to G_TYPE_DOUBLE

It is an error to call this on an immutable node, or on a node which is not a value node.

Parameters

valuethe value to set