MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages


const char * json_object_to_json_string (struct json_object *obj)
const char * json_object_to_json_string_ext (struct json_object *obj, int flags)
void json_object_free_printbuf (struct json_object *jso)

Detailed Description

Ordinarily, JSON-C library keeps the strings resulting from any objects it has serialized cached with the objects and only frees this memory when the object itself is garbage collected (e.g. reference count goes to zero). This is not always convenient. So, this method is provided to free any printbuf string associated with a given object. If the object has no cached printbuf string, the call is harmless.

Function Documentation

const char * json_object_to_json_string ( struct json_object obj)

Stringify object to json format. Equivalent to json_object_to_json_string_ext(obj, JSON_C_TO_STRING_SPACED)

objthe json_object instance
a string in JSON format

Definition at line 295 of file json_object.c.

const char * json_object_to_json_string_ext ( struct json_object obj,
int  flags 

Stringify object to json format

objthe json_object instance
flagsformatting options, see JSON_C_TO_STRING_PRETTY and other constants
a string in JSON format

Definition at line 277 of file json_object.c.

void json_object_free_printbuf ( struct json_object jso)

Definition at line 2288 of file json_object.c.