System.JSON.TJSONArrayEnumerator

From RAD Studio API Documentation
Jump to: navigation, search

System.TObjectTJSONArrayEnumerator

Delphi

TJSONArrayEnumerator = class

C++

class PASCALIMPLEMENTATION TJSONArrayEnumerator : public System::TObject

Properties

Type Visibility Source Unit Parent
class public
System.JSON.pas
System.JSON.hpp
System.JSON System.JSON

Description

Iterator for items of JSON arrays.

To use an iterator to iterate a TJSONArray object, call GetEnumerator from the JSON array object to create a TJSONArrayEnumerator iterator, and use MoveNext and Current to iterate through the JSON values of the JSON array:

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

See Also