Unit 'fpjson' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#fcl]

TJSONParserHandler

Callback to parse JSON into JSONData.

Declaration

Source position: fpjson.pp line 780

type TJSONParserHandler = procedure(

  AStream: TStream;

  const AUseUTF8: Boolean;

  out Data: TJSONData

);

Arguments

AStream

  

Stream to parse.

AUseUTF8

  

Use UTF-8 in returned ansistrings.

Data

  

Resulting JSON data.

Description

TJSONParserHandler is a callback prototype used by the GetJSON function to do the actual parsing. It has 2 arguments: AStream, which is the stream containing the JSON that must be parsed, and AUseUTF8, which indicates whether the (ansi) strings contain UTF-8.

The result should be returned in Data.

The parser is expected to use the JSON class types registered using the SetJSONInstanceType method, the actual types can be retrieved with GetJSONInstanceType

See also

GetJSON

  

Convert JSON string to JSON data structure.

SetJSONInstanceType

  

JSON factory: Set the JSONData class types to use.

GetJSONInstanceType

  

JSON factory: Get the JSONData class types to use.


Documentation generated on: Dec 26 2024