Enum yajl_option

Enum Documentation

enum yajl_option

Configuration parameters for the parser. These should be passed to yajl_config() followed by any option specific argument(s). In general, all boolean configuration parameters default to off.

Values:

enumerator yajl_allow_comments

Ignore javascript style comments present in the input. These are not standard in JSON but can be enabled with this. Turning on the yajl_allow_json5 option enables this option automatically.

yajl_config() argument type: int (boolean)

Example:

yajl_config(h, yajl_allow_comments, 1); // turn comment support on

enumerator yajl_dont_validate_strings

When set the parser will verify that all strings in JSON input are valid UTF8, and will emit a parse error if this is not so. When set, this option makes parsing slightly more expensive (~7% depending on the processor and compiler in use)

yajl_config() argument type: int (boolean)

Example:

yajl_config(h, yajl_dont_validate_strings, 1); // disable utf8 checking

enumerator yajl_allow_trailing_garbage

By default, upon calls to yajl_complete_parse(), yajl will ensure the entire input text was consumed and will raise an error otherwise. Turning this flag on causes YAJL to disable the garbage check. This can be useful when parsing JSON out of an input stream that contains more than a single JSON document.

yajl_config() argument type: int (boolean)

Example:

yajl_config(h, yajl_allow_trailing_garbage, 1); // non-JSON follows

enumerator yajl_allow_multiple_values

Allow multiple values to be parsed by a single handle. The entire text must be valid JSON, and values can be separated by any kind of whitespace. This flag will change the behavior of the parser, and cause it to continue parsing after a value is parsed, rather than transitioning into a complete state. This option can be useful when parsing multiple values from an input stream.

yajl_config() argument type: int (boolean)

Example:

yajl_config(h, yajl_allow_multiple_values, 1); // multi-doc stream

enumerator yajl_allow_partial_values

When yajl_complete_parse() is called the parser will check that the top level value was completely consumed. If called whilst in the middle of parsing a value, yajl will enter an error state (premature EOF). Setting this flag suppresses that check and the corresponding error.

yajl_config() argument type: int (boolean)

Example:

yajl_config(h, yajl_allow_partial_values, 1); // might stop early

enumerator yajl_allow_json5

The JSON5 standard allows additional formats for numbers, strings and object keys which are not permitted by the JSON standard. Setting this flag tells yajl to accept JSON5 standard input. This flag also enables yajl_allow_comments since comments are part of the JSON5 standard. In the EPICS build this option is enabled by default, it must be turned off to disable JSON5.

yajl_config() argument type: int (boolean)

Example:

yajl_config(h, yajl_allow_json5, 1); // We accept JSON5!