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

Functions

struct json_objectjson_object_new_string (const char *s)
 
struct json_objectjson_object_new_string_len (const char *s, int len)
 
const char * json_object_get_string (struct json_object *obj)
 
int json_object_get_string_len (struct json_object *obj)
 

Detailed Description

Function Documentation

struct json_object * json_object_new_string ( const char *  s)

Create a new empty json_object of type json_type_string

A copy of the string is made and the memory is managed by the json_object

Parameters
sthe string
Returns
a json_object of type json_type_string

Definition at line 727 of file json_object.c.

struct json_object * json_object_new_string_len ( const char *  s,
int  len 
)

Definition at line 738 of file json_object.c.

const char * json_object_get_string ( struct json_object obj)

Get the string value of a json_object

If the passed object is not of type json_type_string then the JSON representation of the object is returned.

The returned string memory is managed by the json_object and will be freed when the reference count of the json_object drops to zero.

Parameters
objthe json_object instance
Returns
a string

Definition at line 751 of file json_object.c.

int json_object_get_string_len ( struct json_object obj)

Get the string length of a json_object

If the passed object is not of type json_type_string then zero will be returned.

Parameters
objthe json_object instance
Returns
int

Definition at line 762 of file json_object.c.