nxLibSetJson

<< Click to Display Table of Contents >>

Navigation:  NxLib API > C Interface > Write Access >

nxLibSetJson

Sets an item to the given JSON value. The value might itself be an entire tree structure which will be placed under the specified node.

Signature

void nxLibSetJson (NXLIBERR* result, NXLIBSTR itemPath, NXLIBSTR value, NXLIBBOOL onlyWriteableNodes);

Parameters

result

The error code of the operation.

itemPath

The path of the item to set. When specifying a subtree, the entire subtree will be replaced by the specified value.

value

The JSON string representing the value or subtree to write.

onlyWriteableNodes

Specifies whether the function should try to write each single node into the existing tree structure instead of replacing the entire subtree. When specifying true here the function will not complain if certain nodes could not be written due to access restrictions. This can be used to restore the state of the library or the Parameters node of a camera if the tree state has previously been captured via nxLibGetJson. When this parameter is set to false, all items of the entire subtree must not be access restricted in order for the function call to succeed!

If this parameter is set and the given JSON value does not match the current structure of the node, the function will return the error code NxLibItemTypeNotCompatible. This indicates, that there was not a single node with the same structure as in the JSON string and the function could never modify any value. In this case you probably tried to apply the JSON value to the wrong path.

Return Value

none