Menu

Home

Sans Pareil Technologies, Inc.

Qt4 JSON API

The API provides a SAX style \Parser that invokes call-back methods defined in a \Handler interface. Client-code may implement their own handler implementations and consume the JSON data into their custom data structures.

The API provides a QVariant based model to represent JSON objects and arrays, as well as a simple DOM parser to parse JSON data into the appropriate data models. The default data model uses shared pointers to represent nested object and array instances to avoid excessive copying of the QVariantHash and QVariantList instances used to store object and array data.

The DOMParser implementation provides a generic parse method that parses JSON data from a QIODevice and returns a shared pointer to the object or array representation. This makes it possible to parse JSON data without needing to know whether it is an object or array at compile time.

Build

Use the json.pro Qmake project to build the JSON library. You may use the scripts under the bin directory to build (debug version at present) and run the unit test suite. The simplest option may be to copy the sources directly into your project and use.

Documentation

API Specifications - HTML PDF

Project Members: