Sign in Join
FPDoc Onlineexperiment

JsonReader unit

Event-based JSON reading with SAX-like parsing

The jsonreader unit provides event-based JSON reading functionality. It offers a SAX-like approach to JSON parsing where events are fired as JSON elements are encountered during parsing. This allows for efficient processing of large JSON documents without loading the entire structure into memory. The unit includes abstract base classes, event-driven readers, and interface-based consumers for flexible JSON processing.

Classes and records

EJSONParserclassException class for JSON parsing errors
IJSONConsumerinterfaceInterface for JSON data consumers
TBaseJSONReaderclassAbstract base class for JSON readers
TJSONConsumerReaderclassJSON reader that uses an IJSONConsumer for processing
TJSONEventReaderclassEvent-based JSON reader that fires events for JSON elements

Types

TOnJSONBooleanprocedure typeEvent handler for JSON boolean values
TOnJSONFloatprocedure typeEvent handler for JSON floating-point values
TOnJSONInt64procedure typeEvent handler for JSON 64-bit integer values
TOnJSONIntegerprocedure typeEvent handler for JSON integer values
TOnJSONKeyprocedure typeEvent handler for JSON object key names
TOnJSONQWordprocedure typeEvent handler for JSON unsigned quadword values
TOnJSONStringprocedure typeEvent handler for JSON string values

Topics

JSONConsumerUsagetopicUsing TJSONConsumerReader with IJSONConsumer interface
JSONEventReaderUsagetopicUsing TJSONEventReader for event-based JSON parsing
JSONReaderStreamUsagetopicUsing JSON readers with streams and files

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.