C/C++ JSON parser [closed]

We have requirement of C/C++ Parser in my application. What application does is it calls rest webservice and takes output from service. If output is JSON , it should parse it and shows the result to end user.

Could you please recommend me good/best C/CPP JSON parser (according to you) so that I can use in my application?

When I search online, I am getting multiple JSON parsers. But I would like to know about the best.

Thanks in advance

6

3 Answers

Assuming you're happy with a C++ implementation of the parser, I've not had any issues with nlohmann/json; although there are faster libraries it has been fast enough for my requirements and has the advantages that:

  • It is very easy to integrate into your project (single header)
  • A clean and simple API without excessively verbose syntax
  • Good test coverage

The Github page linked above has a great overview so it's not worth me going into much more detail here.

For a comparison of libraries along multiple facets (not just performance) you could look here: miloyip/nativejson-benchmark

0

I highly recommend Cereal. It's a portable, easy to use serialization library for C++, that supports JSON, XML, plain text, and binary formats.

3

We are happy with RapidJson, which is in use for AssetImporterLib for the GLTF-importer.

You can find a performance test here ( 100% is best ). Regarding to these examples RapiJson has won. Be never measured the performance on our own to this lib in special.

0

You Might Also Like