libpressio 0.93.0
Loading...
Searching...
No Matches
Functions
pressio_options_json.h File Reference

JSON serialization and deserialization for options structures. More...

Go to the source code of this file.

Functions

struct pressio_optionspressio_options_new_json (struct pressio *library, const char *json)
 
char * pressio_options_to_json (struct pressio *library, struct pressio_options const *options)
 

Detailed Description

JSON serialization and deserialization for options structures.

Function Documentation

◆ pressio_options_new_json()

struct pressio_options * pressio_options_new_json ( struct pressio library,
const char *  json 
)

Converts JSON to a pressio_options structure. Intended for serialization and deserialization and the format is unstable. boolean entries in the JSON are not supported.

Parameters
[in]libraryoptional argument, if the parse fails, the error message is stored in the library object
[in]jsonc-style string containing json to be deserialized to a pressio_options type
Returns
a pressio_options that needs to be freed with pressio_options_free

◆ pressio_options_to_json()

char * pressio_options_to_json ( struct pressio library,
struct pressio_options const *  options 
)

Converts pressio_options to JSON structure. Intended for serialization and deserialization and the format is unstable. Entries of type pressio_option_userptr_type are omitted.

Parameters
[in]libraryoptional argument, if the parse fails, the error message is stored in the library object
[in]optionsthe options structure to serialize
Returns
a string that needs to be freed with free()