jn2bool()

jn2bool()#

Convert a JSON value to a boolean. Works with json_t *.

Prototype

PUBLIC BOOL jn2bool(
    json_t      *jn,
    BOOL        default_value
);
        

Parameters

Key

Type

Description

jn

json_t *

The JSON value to convert.

default_value

BOOL

The default value to return if the JSON value cannot be converted to a boolean.


Return Value

Returns the boolean value, or default_value if the conversion fails.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples