Function

Foundryjson_node_to_string

unstable since: 1.1

Declaration [src]

char*
foundry_json_node_to_string (
  JsonNode* node,
  gboolean pretty_print
)

Description [src]

Converts node to a string synchronously using a JsonGenerator.

If pretty_print is TRUE, the output will be formatted with 4-space indentation for readability.

Available since: 1.1

Parameters

node

Type: JsonNode

A JsonNode.

The data is owned by the caller of the function.
pretty_print

Type: gboolean

Whether to pretty print the JSON output.

Return value

Type: char*

A newly allocated string containing the JSON representation of node, or NULL on error.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.