From RAD Studio API Documentation
Jump to: navigation, search



TJsonTextReader = class(TJsonReader)


class PASCALIMPLEMENTATION TJsonTextReader : public TJsonReader


Type Visibility Source Unit Parent
class public
System.JSON.Readers System.JSON.Readers


Class to read data serialized in JSON format.

To read JSON data:

  1. Create a JSON reader that reads data from a text reader.
  2. Call Read so that the reader moves to the first JSON token of the input data.
  3. Keep calling Read to go through all the JSON tokens of the input data. Read returns False when it reaches the end of the input data.
  4. When you are finished reading the input data, you can either close or destroy the reader.

Instead of Read, you may alternatively use any of the following reading methods if you can anticipate the type of the next token:

TJsonTextReader also provides some additional features:

  • CloseInput determines whether the reader closes the stream reader that provides the input data when you close the reader (True) or not (False).
  • Rewind resets the reader to the state that it has when you create it, but it does not rewind the stream reader that provides the input data.

See Also