API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IJSONTREE_PATHSET()

Brew Release
Brew MP 1.0.2
Description
The function provides a generic mechanism to set any nested JSON value using the path string format described in IJSONTree_PathGet.
If the path segment values are not present, then they are created and the leaf node is set with the given JSValue. If path node is present, then it is replaced with the given JSValue and the old value is deleted and its memory freed.
Please refer to ArraySet and ObjectSet for more details on how Set() behaves.
Params
me
[]:
pointer to the IJSONTree Interface object
pjvRoot
[]:
root object to start from - must be an array or object
cpszPath
[]:
path in the format described above
pjv
[]:
JSValue to be set
Interface
Prototype
  •    int IJSONTree_PathSet(IJSONTree *me, JSValue *pjvRoot, const char *cpszPath,
                             JSValue* pjv);
    
Return
  • AEE_SUCCESS : on success IJSONTree_EBADTYPE : pjvRoot is neither an array nor an object AEE_ENOMEMORY : if out of memory