Skip to content
rogerz edited this page Mar 29, 2012 · 1 revision

json_object_deep_update()

behavior is similar to json_object_update() except that if the value is object, do json_object_deep_update() recursively.

flags

#define JSON_SKIP_NEW_KEYS  0x01

Don't create new keys.

#define JSON_SKIP_OLD_KEYS  0x02

Don't overwrite old keys, but old keys whose value is object and new value is also object still get updated

#define JSON_SAME_TYPE_ONLY 0x04

Don't overwrite old keys if type changed. Type is divided to boolean, string and number

#define JSON_EXTEND_ARRAY   0x08 

If both values are array, extend the origin one instead of replacement

#define JSON_DEEP_IN_ARRAY  0x10

If both values are array, have same size, update the object element one by one using json_object_deep_update() and array element one by one using json_array_deep_update(), otherwise the original element is kept.

json_array_deep_update()

It applies only for array having same size. The behavior is described as above.

Clone this wiki locally