2

Is there any difference between Rapid JSON and Json parser in Boost Library(Boost\property_Tree\Json_parser.hpp)

Thanks.

vishnubvrit
  • 317
  • 1
  • 3
  • 14
  • 1
    BOOST.Json is available from 1.75.0 https://www.boost.org/doc/libs/1_75_0_beta1/libs/json/doc/html/index.html – Raaam Feb 25 '21 at 12:21

2 Answers2

4

I have compared 37 C/C++ JSON libraries in nativejson-benchmark for standard conformance and performance.

However, I failed to integrate Boost.PropertyTree (1.60) in the benchmark, because it parses number, true, false, null types as strings.


Edit: To answer the question more directly, Boost.PropertyTree cannot provide JSON functionalities most JSON libraries do. On the other side, RapidJSON is a JSON library with high conformance and performance. BTW, in addition to parsing/stringifying JSON, RapidJSON also provides streaming-style API, JSON pointer and JSON schema. These features are uncommon in open source libraries.

Milo Yip
  • 4,902
  • 2
  • 25
  • 27
  • 1
    Of course. It's not a JSON library. It's a property tree library. If you need a JSON library, use a JSON library. – sehe Apr 16 '16 at 00:03
  • is the json library and rapid json one and the same? – vishnubvrit Apr 16 '16 at 10:04
  • @user3262531 That was the question, and that's what I answered. However, Boost Property **is not** a JSON library. It **uses** one (to implement one of possible backends for property trees). – sehe Apr 16 '16 at 14:18
  • To JSON library I mean libraries providing JSON capabilities. Boost.PropertyTree provides some functionalities for parsing and serializing JSON. It just stores the representations in property tree. Every library providing JSON capability has some sorts of representations. I have also tested Qt, V8, C++ Rest SDK, etc., and they are of course not just a "JSON library". – Milo Yip Apr 16 '16 at 14:30
0

EDIT - the Boost Library seems to only use RapidXML, not RapidJSON.


It should be of no concern to you because it's an implementation detail of the library anyways.

So the answer might be "no" (more likely, "yes") and you stand to gain absolutely nothing from it because you cannot depend on it.

Just pick your own XML library and use it where you need it: What XML parser should I use in C++?

IIRC Boost mostly modified the namespace, so you won't have ODR clashes when you select RapidXML

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633
  • I see I misread RapidJSON as RapidXML. The same applies, mutatis mutandis – sehe Apr 14 '16 at 15:35
  • What do you mean. You have one option only. That will be the one to use – sehe Apr 15 '16 at 06:44
  • @user3262531 **EDIT** - the Boost Library seems to only use RapidXML, not RapidJSON. This is why I was confused with the question (I knew of RapidXML inside Boost) – sehe Apr 16 '16 at 14:22