Summary
BeginArray method is a low-level method, which allows to de-serialize array like data manually. Every call to BeginArray method should be matched by a call to NG.Serialization.TDeserializer.EndArray method.
Syntax
procedure BeginArray;
Remarks
To de-serialize array data, usually there are no need to use BeginArray method, the real Delphi array can be de-serialized using a single call to Value method:
Delphi | Copy Code |
---|---|
MyArray := S.Value<TMyArray>; |
- Calling Value method.
- Calling NG.Serialization.TDeserializer.TryNull method, to check, whether the element is Null.
- Calling NG.Serialization.TDeserializer.BeginObject(string)/NG.Serialization.TDeserializer.EndObject methods, if an object element value is expected.
- Calling BeginArray/NG.Serialization.TDeserializer.EndArray methods, if an array element value is expected.
Examples
Delphi | Copy Code |
---|---|
D.BeginArray; while D.HasNext do MyIntList.Add(D.Value<Integer>); D.EndArray; |