System.JSON.Readers.TJsonReader.Depth
Delphi
property Depth: Integer read GetDepth;
C++
__property int Depth = {read=GetDepth, nodefault};
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
property | public | System.JSON.Readers.pas System.JSON.Readers.hpp |
System.JSON.Readers | TJsonReader |
Description
Obtient la profondeur du token en cours dans le document JSON.
Depth renvoie un entier qui représente le niveau imbriqué du token en cours.
Par exemple :
'{"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 - Paire prénom/valeur
"Transaction":[
- Depth = 1 - (StartObject)
{
- Depth = 2 - Paires nom/valeur à l'intérieur des objets du tableau - Depth = 3