System.JSON.TJSONArrayEnumerator

De RAD Studio API Documentation
Aller à : navigation, rechercher

System.TObjectTJSONArrayEnumerator

Delphi

TJSONArrayEnumerator = class

C++

class PASCALIMPLEMENTATION TJSONArrayEnumerator : public System::TObject

Propriétés

Type Visibilité  Source Unité  Parent
class public
System.JSON.pas
System.JSON.hpp
System.JSON System.JSON


Description

Itérateur pour les éléments des tableaux JSON.

Pour utiliser un itérateur afin de parcourir un objet TJSONArray, appelez GetEnumerator depuis l'objet tableau JSON pour créer un itérateur TJSONArrayEnumerator et utilisez MoveNext et Current pour parcourir les valeurs JSON du tableau JSON :

Delphi :
MyJSONArrayIterator := TJSONArrayEnumerator.Create(MyJSONArray);
while MyJSONArrayIterator.MoveNext do
begin
    MyJSONValue := MyJSONArrayIterator.Current;
    // …
end;
C++ :
TJSONArrayEnumerator* MyJSONArrayIterator = new TJSONArrayEnumerator(MyJSONArray);
while (MyJSONArrayIterator->MoveNext())
{
    TJSONValue* MyJSONValue = MyJSONArrayIterator->Current;
    // …
}

Voir aussi