kw_get_bool()

kw_get_bool()#

Get the value of a key as a boolean from a JSON object. Works with json_t *.

Prototype

PUBLIC BOOL kw_get_bool(
    json_t      *kw,
    const char  *key,
    BOOL        default_value
);
        

Parameters

Key

Type

Description

kw

json_t *

The JSON object to query.

key

const char *

The key whose value will be retrieved as a boolean.

default_value

BOOL

The default value to return if the key does not exist or is not a boolean.


Return Value

Returns the boolean value of the key, or default_value if the key does not exist or is not a boolean.

Prototype

// Not applicable in JS

Prototype

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