kw_clone_by_not_keys()

kw_clone_by_not_keys()#

Return a new JSON object excluding the specified keys from the input json_t *. The keys can be provided as a string, dictionary, or list. If no keys are specified, an empty JSON object is returned.

Prototype

json_t *kw_clone_by_not_keys(
    hgobj      gobj,
    json_t     *kw,     // owned
    json_t     *keys,   // owned
    BOOL       verbose
);

Parameters

Key

Type

Description

gobj

hgobj

Pointer to the GObj instance for logging and error handling.

kw

json_t *

The input JSON object to be cloned, excluding the specified keys. This parameter is owned and will be decremented.

keys

json_t *

A JSON object, list, or string specifying the keys to exclude from the cloned object. This parameter is owned and will be decremented.

verbose

BOOL

If TRUE, logs an error when a specified key is not found in the input JSON object.


Return Value

A new json_t * object with the specified keys removed. If no keys are specified, an empty JSON object is returned.

Notes

The function performs a shallow copy of the input JSON object, removing the specified keys. The input kw and keys parameters are owned and will be decremented.

Prototype

// Not applicable in JS

Prototype

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