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