Functions

create and release

JSON_New

group JSONXOP_New

register a new object

Return
a numeric identifier of the JSON object on success
Parameters
  • ignoreErr: [optional, default 0] set to ignore runtime errors

Functions

variable JSON_New(variable ignoreErr = defaultValue)

JSON_Release

group JSONXOP_Release

Release a JSON id from memory.

Return
0 on success, NaN otherwise
Parameters
  • jsonID: numeric identifier of the main object
  • ignoreErr: [optional, default 0] set to ignore runtime errors

Functions

variable JSON_Release(variable jsonID, variable ignoreErr = defaultValue)

parse and dump

JSON_Parse

group JSONXOP_Parse

Parse a JSON string with the XOP.

Return
a numeric identifier of the JSON object on success
Parameters
  • jsonStr: string representation of the JSON object
  • ignoreErr: [optional, default 0] set to ignore runtime errors

Functions

variable JSON_Parse(string jsonStr, variable ignoreErr = defaultValue)

JSON_Dump

group JSONXOP_Dump

Dump a JSON id to its string representation.

Parameters
  • jsonID: numeric identifier of the main object
  • indent: [optional, default 0] number of white spaces for pretty output indentation.

Functions

string JSON_Dump(variable jsonID, variable indent = defaultValue, variable ignoreErr = defaultValue)

Return
a string representation of the JSON object
Parameters
  • ignoreErr: [optional, default 0] set to ignore runtime errors

structured types

JSON_AddTree

group JSONXOP_AddTree

Functions

variable JSON_AddTreeObject(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Recursively add new objects to the tree.

Non-existing path elements are recursively created.

See
JSON_AddTreeArray JSON_OBJECT
Return
0 on success
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddTreeArray(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Recursively add a new array to the tree.

Non-existing path elements are created as objects.

See
JSON_AddTreeObject JSON_ARRAY
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable static JSON_AddTree(variable jsonID, string jsonPath, variable type, variable ignoreErr)

JSON_AddValue

group JSONXOP_AddValue

Functions

variable JSON_AddString(variable jsonID, string jsonPath, string value, variable ignoreErr = defaultValue)

Add a string entity to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: string value to add
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddVariable(variable jsonID, string jsonPath, variable value, variable significance = defaultValue, variable ignoreErr = defaultValue)

Add a numeric entity to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: numeric value to add
  • significance: [optional] number of digits after the decimal sign
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddNull(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Add a null entity to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddBoolean(variable jsonID, string jsonPath, variable value, variable ignoreErr = defaultValue)

Add a numeric value as boolean to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: boolean value to add
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddWave(variable jsonID, string jsonPath, wave wv, variable ignoreErr = defaultValue)

Add a WAVE as array entity to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • wv: WAVE reference to the wave to add
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddInt64(variable jsonID, string jsonPath, int64 value, variable ignoreErr = defaultValue)

Add a 64bit integer to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: int64 value to add
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddUInt64(variable jsonID, string jsonPath, uint64 value, variable ignoreErr = defaultValue)

Add an unsigned 64bit integer to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: uint64 value to add
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable static AddValueI64(variable jsonID, string jsonPath, wave w, variable ignoreErr)
variable JSON_AddObjects(variable jsonID, string jsonPath, variable objCount = defaultValue, variable ignoreErr = defaultValue)

Add a specified number of objects to a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • objCount: [optional, default 1] number of objects
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_AddJSON(variable jsonID, string jsonPath, variable jsonID2, variable ignoreErr = defaultValue)

Merge a JSON object to another object.

Parameters
  • jsonID: numeric identifier of the main object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • jsonID2: numeric identifier of the merged object
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetString(variable jsonID, string jsonPath, string value, variable ignoreErr = defaultValue)

Replace with a string entity at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: new string value
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetVariable(variable jsonID, string jsonPath, variable value, variable significance = defaultValue, variable ignoreErr = defaultValue)

Replace with a numeric entity at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: new numeric value
  • significance: [optional] number of digits after the decimal sign
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetNull(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Replace with a null entity at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetBoolean(variable jsonID, string jsonPath, variable value, variable ignoreErr = defaultValue)

Replace with a boolean value at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: new boolean value
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetWave(variable jsonID, string jsonPath, wave wv, variable ignoreErr = defaultValue)

Replace with a WAVE as array entity at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • wv: WAVE reference to the new wave
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetInt64(variable jsonID, string jsonPath, int64 value, variable ignoreErr = defaultValue)

Replace with a 64bit integer at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: new int64 value
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetUInt64(variable jsonID, string jsonPath, uint64 value, variable ignoreErr = defaultValue)

Replace with an unsigned 64bit integer at the given location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • value: new uint64 value
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable static SetValueI64(variable jsonID, string jsonPath, wave w, variable ignoreErr)
variable JSON_SetObjects(variable jsonID, string jsonPath, variable objCount = defaultValue, variable ignoreErr = defaultValue)

Replace with a specified number of objects at the giveln location in a JSON object.

Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • objCount: [optional, default 1] number of objects
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_SetJSON(variable jsonID, string jsonPath, variable jsonID2, variable ignoreErr = defaultValue)

Replace an entity with the given JSON object at the specified location in the main object.

Parameters
  • jsonID: numeric identifier of the main object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • jsonID2: numeric identifier of the merged object
  • ignoreErr: [optional, default 0] set to ignore runtime errors

JSON_GetValue

group JSONXOP_GetValue

Functions

string JSON_GetString(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Get a text entity as string variable from a JSON object.

Return
a string containing the entity
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

variable JSON_GetVariable(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Get a numeric, boolean or null entity as variable from a JSON object.

Return
a numeric variable containing the entity
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

wave JSON_GetTextWave(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Get an array as text wave from a JSON object.

Return
a text wave with the elements of the array
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

wave JSON_GetWave(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

Get an array as numeric wave from a JSON object.

Return
a numeric wave with the elements of the array
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

std::tuple<Int64> JSON_GetInt64(Variable jsonID, String jsonPath, Variable ignoreErr = defaultValue)

Get a 64bit integer from a JSON object.

Return
a 64bit variable
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

std::tuple<UInt64> JSON_GetUInt64(Variable jsonID, String jsonPath, Variable ignoreErr = defaultValue)

Get an unsigned 64bit integer from a JSON object.

Return
an unsigned 64bit variable
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

JSON_GetKeys

group JSONXOP_GetKeys

Get the name of all object members of the specified path.

Return
a text wave with all elements as rows.
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors
  • esc: [optional, 0 or 1] set to ignore RFC 6901 path escaping standards

Functions

wave JSON_GetKeys(variable jsonID, string jsonPath, variable esc = defaultValue, variable ignoreErr = defaultValue)

arrays

JSON_GetArraySize

group JSONXOP_GetArraySize

Get the number of elements in an array.

Return
a numeric variable with the number of elements the array at jsonPath
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

Functions

variable JSON_GetArraySize(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

JSON_GetMaxArraySize

group JSONXOP_GetMaxArraySize

Get the maximum element size for each dimension in an array.

Return
a free numeric wave with the size for each dimension as rows
Parameters
  • jsonID: numeric identifier of the JSON object
  • jsonPath: RFC 6901 compliant JSON Pointer
  • ignoreErr: [optional, default 0] set to ignore runtime errors

Functions

wave JSON_GetMaxArraySize(variable jsonID, string jsonPath, variable ignoreErr = defaultValue)

version information

JSON_Version

group JSONXOP_Version

Functions

string JSON_Version(variable ignoreErr = defaultValue)

Output version information useful for issue reports.

Parameters
  • ignoreErr: [optional, default 0] set to ignore runtime errors