Diffusion C API 6.12.0
Loading...
Searching...
No Matches
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.
bool write_diffusion_json_value (const char *json, const BUF_T *buf)
 Write a JSON value into a BUF_T for an update.

Detailed Description

JSON datatype associated functions.

Function Documentation

◆ to_diffusion_json_string()

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 stringified 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.

◆ write_diffusion_json_value()

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.