kw_clone_by_path()
#
Return a new JSON object containing only the keys specified in paths
. If paths
is empty, the original JSON object is returned. This function does not perform a deep copy.
Prototype
json_t *kw_clone_by_path(
hgobj gobj,
json_t *kw, // owned
const char **paths
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A handle to the GObj context. |
|
|
The JSON object to be cloned. This parameter is owned and will be decremented. |
|
|
An array of key paths specifying which keys to include in the cloned JSON object. |
Return Value
A new JSON object containing only the specified keys. If paths
is empty, the original JSON object is returned.
Notes
This function does not perform a deep copy. The returned JSON object contains references to the original values.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples