System.JSON.Readers.TJsonReader.Depth

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Depth: Integer read GetDepth;

C++

__property int Depth = {read=GetDepth, nodefault};

Properties

Type Visibility Source Unit Parent
property public
System.JSON.Readers.pas
System.JSON.Readers.hpp
System.JSON.Readers TJsonReader

Description

Gets the depth of the current token in the JSON document.

Depth returns an integer that represents the nested level of the current token.

For example:

'{"Transaction":[' 
  '{"id":662713, "firstName":"John", "lastName":"Doe", "price": 2.1, "parent_id": null, validated:true},'
  '{"id":662714, "firstName":"Anna", "lastName":"Smith", "price": 4.5, "parent_id": null, validated: false},' 
  '{"id":662715, "firstName":"Peter", "lastName":"Jones", "price": 3.6, "parent_id": null, validated: true}' 
  ']}'
  • (StartObject) { - Depth = 0
  • First name/value pair "Transaction":[ - Depth = 1
  • (StartObject) { - Depth = 2
  • Name/value pairs inside the objects from the array - Depth = 3

See Also