Table of Contents

TJsonReader Class

Provides a forward-only, streaming JSON reader for parsing JSON documents.

Remarks

Reads JSON tokens sequentially from a string or stream. The reader maintains a state machine that tracks the current position and validates the JSON structure.

Syntax

Unit: Bcl.Json.Reader

TJsonReader = class(TObject);

Constructors

Name Description
Create Overloaded
Create(string)
Create(TStream)

Methods

Name Description
Eof Indicates whether the reader has reached the end of the JSON document.
HasNext Indicates whether more elements exist in the current array or object.
IsFloat Indicates whether the next numeric value is a floating-point number.
IsInt64 Indicates whether the next numeric value is a 64-bit integer.
IsNull Indicates whether the next token is a JSON null value.
Path Returns the current JSON path in the document.
Peek Returns the type of the next token without consuming it.
PreviousPath Returns the JSON path of the previously read element.
ReadBeginArray Reads the beginning of a JSON array token.
ReadBeginObject Reads the beginning of a JSON object token.
ReadBoolean Reads and returns the next value as a boolean.
ReadDouble Reads and returns the next value as a double-precision floating-point number.
ReadEndArray Reads the end of a JSON array token.
ReadEndObject Reads the end of a JSON object token.
ReadInt64 Reads and returns the next value as a 64-bit integer.
ReadInteger Reads and returns the next value as an integer.
ReadName Reads and returns the next property name in a JSON object.
ReadNull Reads and consumes a JSON null value.
ReadString Reads and returns the next value as a string.
SkipValue Skips the next value or entire structured element (object or array) in the JSON stream.