Diffusion C API  6.10.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
diffusion-json.h File Reference

JSON datatype associated functions. More...

Functions

bool to_diffusion_json_string (const DIFFUSION_VALUE_T *value, char **json_string, DIFFUSION_API_ERROR *error)
 Get a stringified representation of the JSON diffusion value. More...
 
bool write_diffusion_json_value (const char *json, const BUF_T *buf)
 Write a JSON value into a BUF_T for an update. More...
 

Detailed Description

JSON datatype associated functions.

Function Documentation

bool to_diffusion_json_string ( const DIFFUSION_VALUE_T value,
char **  json_string,
DIFFUSION_API_ERROR error 
)

Get a stringified representation of the JSON diffusion value.

Parameters
valuethe diffusion value
json_stringpointer to a pointer where the stringifed JSON data will be stored
errorerror populated if an error occurs. Can be NULL.
Returns
true if the value is successfully read and the json_string pointer value is set to a pointer containing the stringified representation of the JSON diffusion value. False otherwise.
bool write_diffusion_json_value ( const char *  json,
const BUF_T *  buf 
)

Write a JSON value into a BUF_T for an update.

Parameters
jsonvalue to be written into the BUF_T
bufBUF_T to write the JSON value into
Returns
true if the value was successfully written into the BUF_T. False will be returned if the provided JSON string is invalid JSON, or json or buf is NULL.