Meta Information Retrieval¶
nxLibGetJsonMeta¶
-
const char *nxLibGetJsonMeta(int32_t *result, const char *itemPath, int32_t numLevels, int32_t prettyPrint, int32_t numberPrecision, int32_t allowScientificFormat)¶
Retrieves an item value or an entire subtree in JSON representation including item metadata (protection, extended type, internal flags). This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.
itemPath – The path of the item to access.
numLevels – The depth of the returned subtree. Nodes in lower levels will be omitted.
prettyPrint – Specify
true
here to format the resulting string with line breaks and tabs.numberPrecision – The floating point precision of the returned numbers.
allowScientificFormat – Specifies whether to allow scientific notation.
- Returns
A JSON string representing the item value or subtree including each item’s metadata. Please refer to the string type description for information about usage restrictions applying to the returned pointer.
nxLibGetType¶
-
int32_t nxLibGetType(int32_t *result, const char *itemPath)¶
Retrieves the item type of a tree item.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.
itemPath – The path of the item to access.
- Returns
The type identifier of the basic type of the item.
- Returns
NxLibItemTypeInvalid – An error occurred, refer to
result
for further information.NxLibItemTypeNull – The item is of type Null.
NxLibItemTypeNumber – The item is a Number. This can be an integer or floating point value.
NxLibItemTypeString – The item is a String.
NxLibItemTypeBool – The item is a Boolean value.
NxLibItemTypeArray – The item is an Array. The number of array elements can be queried with
nxLibGetCount()
. The array can be empty.NxLibItemTypeObject – The item is an Object. The number of children can be queried with
nxLibGetCount()
. The object can be empty.
nxLibGetCount¶
-
int32_t nxLibGetCount(int32_t *result, const char *itemPath)¶
Retrieves the number of subitems of an Object or the number of elements of an Array item. In case of a Binary item its data size in bytes is returned.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.
itemPath – The path of the item to access.
- Returns
The number of subitems.
nxLibGetName¶
-
const char *nxLibGetName(int32_t *result, const char *itemPath)¶
Retrieves the name of an item. This function is intended to be used to enumerate subitems of an Object, which can be accessed by the index notation (see here ).
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.
itemPath – The path of the item to access.
- Returns
The string name of the item, without its path. Please refer to the string type description for information about usage restrictions applying to the returned pointer.
nxLibGetBinaryInfo¶
-
void nxLibGetBinaryInfo(int32_t *result, const char *itemPath, int32_t *width, int32_t *height, int32_t *channelCount, int32_t *bytesPerElement, int32_t *isFloat, double *timestamp)¶
Retrieves meta data of a Binary item.
Note
The entire size of the binary blob is
width
*height
*channelCount
*bytesPerElement
bytes. For example a 24bit RGB image of VGA resolution would havewidth
=640
,height
=480
,channelCount
=3
,bytesPerElement
=1
andisFloat
=NXLIBFALSE
.- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.NxLibItemTypeNotCompatible
- The item type you tried to read is of another type than you specified or the item you tried to write cannot be overwritten with the type you specified because its structure is locked.
itemPath – The path of the item to access.
width – The width of the array (consecutive elements in memory).
height – The height of the array (number of rows of
width
*channelCount
elements)channelCount – Number of channels for a single item.
bytesPerElement – Size in bytes of a single channel value of an item.
isFloat – Specifies whether the element data type is a floating point type.
timestamp – The current timestamp of the binary blob queried. This pointer can be set to
nullptr
when the timestamp should not be retrieved. The returned value should only be relied upon if the function returnsNxLibOperationSucceeded
.