SCA

SDO JSON Helper API

SDO JSON Helper API
API Usage Examples

Function Index

int sdoJSONLoad (SDOJSONDOC doc, char *buffer)
 Loads/creates a dataobject from a buffer containing JSON. More...
 
int sdoJSONSave (DATAOBJECT pdo, char **buffer, size_t *buffer_size)
 Serializes the supplied dataobject into the dest buffer as JSON. More...
 
SDOXML getJSONHelper (SDOFACTORY df)
 Returns 0 (only provided for SDO API consistency/compatibilty).
 
SDOXMLDOC JSONDocAlloc (SDOXML pjh, DATAOBJECT pdo, char *rootURI, char *rootName)
 Creates a JSON document from a dataobject using the specified root element details. More...
 

Function Details

int sdoJSONLoad ( SDOJSONDOC  doc,
char *  buffer 
)

Loads/creates a dataobject from a buffer containing JSON.

See also
sdoXMLLoad
Returns
0 if unsuccessfull, another value otherwise
int sdoJSONSave ( DATAOBJECT  pdo,
char **  buffer,
size_t *  buffer_size 
)

Serializes the supplied dataobject into the dest buffer as JSON.

Parameters
bufferpointer to a buffer containing the serialization on successfull return (set by function)
buffer_sizepointer to a size_t to contain the length in bytes of the serialization on successfull return (set by function)
Returns
0 if unsuccessfull, non-0 otherwise
SDOXMLDOC JSONDocAlloc ( SDOXML  pjh,
DATAOBJECT  pdo,
char *  rootURI,
char *  rootName 
)

Creates a JSON document from a dataobject using the specified root element details.

Parameters
pxhignored
pdodataobject from which to create JSON document; if 0, a fresh, empty dataobject is created for the document; must be 0 (other operations aren't supported)