System.JSON.TJSONArrayEnumerator

Aus RAD Studio API Documentation
Wechseln zu: Navigation, Suche

System.TObjectTJSONArrayEnumerator

Delphi

TJSONArrayEnumerator = class

C++

class PASCALIMPLEMENTATION TJSONArrayEnumerator : public System::TObject

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
class public
System.JSON.pas
System.JSON.hpp
System.JSON System.JSON


Beschreibung

Iterator für Elemente von JSON-Arrays.

Rufen Sie für die Verwendung eines Iterators zum Durchlaufen eines TJSONArray-Objekts GetEnumerator aus dem JSON-Array-Objekt auf, um einen TJSONArrayEnumerator-Iterator zu erstellen, und verwenden Sie MoveNext und Current zum Iterieren durch die JSON-Werte des JSON-Arrays:

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;
    // …
}

Siehe auch