gos_json_parse_config_t Struct Reference

JSON parser configuration. More...

Data Fields

void * buffer
 
uint16_t buffer_len
 
gos_json_parse_reader_t reader
 
gos_json_token_callback_t token_callback
 Optional callback called before every token is allocated.
 
gos_json_parse_flag_t flags
 Parsing flags.
 

Detailed Description

JSON parser configuration.

This struct configures the JSON parsing context. It should be called with json_parse_context_init() to allocated a gos_json_parse_context_t context.

Examples:
network/http_server/requests/json_parser.c, utility/json_parser/parse_all_examples.c, utility/json_parser/parse_example1.c, utility/json_parser/parse_example2.c, utility/json_parser/parse_example3.c, and utility/json_parser/parse_example9.c.

Field Documentation

◆ buffer

void* gos_json_parse_config_t::buffer

Optional, buffer containing pre-read data, or processing buffer for 'reader' if NULL then a processing buffer of size 'buffer_len' is allocated with the context

Examples:
network/http_server/requests/json_parser.c, utility/json_parser/parse_all_examples.c, utility/json_parser/parse_example1.c, utility/json_parser/parse_example2.c, utility/json_parser/parse_example3.c, and utility/json_parser/parse_example9.c.

◆ buffer_len

uint16_t gos_json_parse_config_t::buffer_len

Length of buffer. This is either the length of pre-read JSON data or length of read's processing buffer.

◆ reader

gos_json_parse_reader_t gos_json_parse_config_t::reader

Optional, reader callback, continuously called by parser while there's more JSON data to be read, leave NULL if JSON data is pre-read and stored in 'buffer' member. Note: both 'buffer' and 'buffer_len' are required, they're passed as arguments to the 'reader' callback