QJson

the easiest way for managing JSON objects with Qt

Source code

QJson code is hosted on gitorious. You can download latest version using the following command:

        git clone git://gitorious.org/qjson/qjson.git
        

Howto contribute

You can send your contribute in different ways:

Before submitting your contribution please ensure:

  • The code compiles.
  • The patch/single commits are fixing a specific issue or implementing a new feature (they are not doing multiple things at the same time).
  • If you have patched the bison parser please don't include changes made to json_parser.{cc,hh} into the diff file.
  • QJson unit tests have been updated.
  • QJson unit tests are passing.

Unit testing

QJson unit tests are located under the tests directory. You can enable them passing the following option to cmake:

        -DKDE4_BUILD_TESTS=TRUE
        

In order to run them just type:

        make tests
        

If you want to run the parser unit tests just type:

        ./testparser
        

If you want to run the serializer unit tests just type:

        ./testserializer
        

If you want to test the QJson parser against a specific JSON object you can use the cmdline_tester program.

This binary is located under the tests directory and has a straightforward syntax:

        ./cmdline_tester text_file_containing_json_object
        

The command will convert the JSON object to a QVariant and dump it to stdout.

Note well: cmdline_tester relies on qDebug() for dumping the object. qDebug has some limitations, like being unable to print utf8 chars.