ABL JSON

The JSON Parser for Progress ABL has started as an open-source project that more or less wraps over the cJSON project – “An ultra-lightweight, portable, single-file, simple-as-can-be ANSI-C compliant JSON parser, under MIT license”.

This was extended for better performance on serializing complex structures (data set, temp-table) and to support serialization/de-serialization for such complex data structures and can now be used to add JSON parsing facilities to Progress versions prior to 10.2B – in fact it can be used starting from version 9.1A being completely OS independent.

The initial project is still available on SourceForge web site – abljson; while the extended version can be purchased through ShareIt platform including full source code and maintenance options – ABL JSON.

The reader object can be used to load and parse a JSON string from either a file on the file system or from a character, longchar or memptr variable.

The ‘automated’ parse method will go through all JSON elements and call the corresponding call-back methods on read handler depending on the element type (array, object, string, numeric, logical), the read handler should have been set before calling the parse method.

The reader can also directly read buffer or temp-table buffer object content from a JSON document that was previously loaded.

The writer object can be used to create JSON documents using either lower level methods to create JSON elements or directly serialize complex data structures like dataset, temp-table, buffer or even query results.

The complete API documentation can be consulted online or downloaded.

Comments are closed.