JSONParser and JSONGenerator enhancements

In order to support

  1. getting and setting an item by path, and

  2. handling special values such as JsonNaN (invalid number), JsonPositiveInfinity (positive infinity), and JsonNegativeInfinity (negative infinity),

JSONParser object has added or improved the following functions:

  • New GetNumberType function -- Determines the value type of a number item: JsonNumber, JsonNaN, JsonPositiveInfinity, or JsonNegativeInfinity.

  • The following functions have been enhanced to support JsonNaN, JsonPositiveInfinity, and JsonNegativeInfinity:

    • LoadString supports to load a string which contains JsonNaN/JsonPositiveInfinity/JsonNegativeInfinity value

    • LoadFile supports to load a file which contains JsonNaN/JsonPositiveInfinity/JsonNegativeInfinity value

    • GetItemObjectJSONString and GetItemArrayJSONString support the returned object or array which contains JsonNaN/JsonPositiveInfinity/JsonNegativeInfinity value

    • GetItemNumber supports to get value which is JsonNaN/JsonPositiveInfinity/JsonNegativeInfinity

  • New GetItemByPath function -- Gets the item handle according to the path.

  • New ContainsPath function -- Checks if a path exists.

  • New GetItemObjectJSONString and GetItemArrayJSONString functions -- Gets the string value (in JSON format) of the object item or array item.

  • The following functions have been enhanced to get items by path: GetChildCount, GetChildKey, GetChildItem, GetItemArray, GetItemBlob, GetItemBoolean, GetItemDate, GetItemDateTime, GetItemNumber, GetItemObject, GetItemString, GetItemTime, GetItemType, and ContainsKey.

JSONGenerator object has added or improved the following functions:

  • New ImportFile and ImportString functions -- Imports a JSON item from a JSON string or file.

  • New GetItemByPath and GetPathByItem functions -- Gets item handle by path or gets path by item handle.

  • The following functions have been enhanced to support JsonNaN, JsonPositiveInfinity, and JsonNegativeInfinity:

    • AddItemNumber, ImportFile and ImportString support the parameter which contains JsonNaN/JsonPositiveInfinity/JsonNegativeInfinity value

    • GetJSONString supports the returned value which contains JsonNaN/JsonPositiveInfinity/JsonNegativeInfinity value

  • The following functions have been enhanced to add items by path: AddItemArray, AddItemBlob, AddItemBoolean, AddItemDate, AddItemDateTime, AddItemNull, AddItemNumber, AddItemObject, AddItemString, and AddItemTime.