asJson

Navigation:  NxLib API > C++ Interface > NxLibItem >

asJson

Previous pageReturn to chapter overviewNext page

Try to read this tree item and return its JSON representation.

Signatures

Variants throwing exceptions on API errors:

std::string asJson(bool prettyPrint = false, int numberPrecision = 18, bool scientificNumberFormat = true) const

Variants returning API errors as int* parameter:

std::string asJson(int* returnCode, bool prettyPrint = false, int numberPrecision = 18, bool scientificNumberFormat = true) const

Parameters

returnCode

The error code returned when accessing the item.

prettyPrint

When true the JSON string will be formatted with line breaks and tabs

numberPrecision

Specifies the accuracy of numbers.

scientificNumberFormat

Specifies if the scientific exponential notation should be used.

Return Value

The item value as JSON string if the item exists. This might also be an entire subtree in JSON representation!