![]() |
![]() |
![]() |
JSON-GLib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <json-glib/json-glib.h> JsonNode * json_from_string (const char *str
,GError **error
); char * json_to_string (JsonNode *node
,gboolean pretty
);
JsonNode * json_from_string (const char *str
,GError **error
);
Parses the string in str
and returns a JsonNode representing
the JSON tree.
In case of parsing error, this function returns NULL
and sets
error
appropriately.
|
a valid UTF-8 string containing JSON data |
|
return location for a GError |
Returns : |
a JsonNode, or NULL . [transfer full]
|
Since 1.2
char * json_to_string (JsonNode *node
,gboolean pretty
);
Generates a stringified JSON representation of the contents of
the passed node
.
|
a JsonNode |
|
whether the output should be prettyfied for printing |
Returns : |
the string representation of the JsonNode. [transfer full] |
Since 1.2