System.JSON.Readers.TJsonReader.Path

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

property Path: string read GetPath;

C++

__property System::UnicodeString Path = {read=GetPath};

Propriétés

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


Description

Obtient le chemin d'accès au token JSON en cours.

Par exemple :

Voici un objet JSON appelé "Transaction" qui contient un tableau d'objets JSON avec des paires nom/valeur contenant des informations sur les registres d'achat d'un site web.

'{"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}' 
  ']}'

Le résultat de la propriété Path ressemble à ceci :

  • "[Transaction][0].id"  : chemin d'accès du token JSON correspondant à la propriété "id" du premier élément du tableau.
  • "[Transaction][1].price"  : chemin d'accès du token JSON correspondant à la propriété "price" du premier élément du tableau.

Voir aussi

Extrait de code JSON Reader