Questions tagged [rapidjson]

A fast JSON parser/generator for C++ with both SAX/DOM style API

Rapidjson is an attempt to create the fastest JSON parser and generator.

  • Small but complete. Supports both SAX and DOM style API. SAX parser only a few hundred lines of code.
  • Fast. In the order of magnitude of strlen(). Optionally supports SSE2/SSE4.2 for acceleration.
  • Self-contained. Minimal dependency on standard libraries. No BOOST, not even STL.
  • Compact. Each JSON value is 16 or 20 bytes for 32 or 64-bit machines respectively (excluding text string storage). With the custom memory allocator, parser allocates memory compactly during parsing.
  • Full RFC4627 compliance. Supports UTF-8, UTF-16 and UTF-32.
  • Support both in-situ parsing (directly decode strings into the source JSON text) and non-destructive parsing (decode strings into new buffers).
  • Parse number to int/unsigned/int64_t/uint64_t/double depending on input
  • Support custom memory allocation. Also, the default memory pool allocator can also be supplied with a user buffer (such as a buffer allocated on user's heap or programme stack) to minimize allocation.

As the name implies, rapidjson is inspired by rapidxml.

383 questions
-1
votes
1 answer

json Comparison in c++

I am a little stuck here can anyone help please. #include #include "include/rapidjson/document.h" #include "include/rapidjson/writer.h" #include "include/rapidjson/prettywriter.h" //#include "include/rapidjson/stringbuffer.h" using…
Bishal Sahoo
  • 71
  • 2
  • 11
-1
votes
2 answers

Rapidjson seg fault with g++ optimization

I am using Rapidjson and have noticed that when I turn on optimization in g++ (-O1/-O2/-O3) I am getting a segmentation fault. I think I have tracked it down to the GenericValue& AddMember() function within rapidjson. GenericValue&…
-1
votes
1 answer

Convert mixed JSON-Number-Array to int, uint, float using lib rapidjson

As I understood this char* is a valid json-string. const char* json = { "array":[14, -15, 3.17], "array_type": ["uint", "int", "float"] } All numbers in the array shall be 4 bytes. How could one loop through the array using rapidjson? This is my…
frank schmidt
  • 121
  • 3
  • 15
-1
votes
1 answer

access arrays with rapidJson (c++)

I am trying to parse a Json file with rapidJson (v 0.11) but I fail to do it with what seems to be a simple array. Here is the structure of my file : [{"id": "my_id1","type":"my_type1"}, {"id": "my_id2","type":"my_type2"}, ... ] It seems that…
Arcyno
  • 4,153
  • 3
  • 34
  • 52
-2
votes
1 answer

Read JSON with RapidJSON

Using RapidJSON, I can read a local json file by: std::ifstream ifs { R"(/home//am_v2.json)" }; IStreamWrapper isw { ifs }; Document doc {}; doc.ParseStream( isw ); However, I want to read a variable received from: auto msg =…
thecoder
  • 7
  • 3
-2
votes
1 answer

How to update rapidjson in Xcode 5.1.1

The rapidjson build within Xcode 5.1.1 is already old. I found the FileStream class which is already deprecated and there is no FileReadStream. Anyone know How to update rapidjson in Xcode 5.1.1?
-4
votes
1 answer

Retrieving Java data from internet with c++

I am currently writing a Windows application with multiple features in MS Visual Studio 2013 in C++. One of the features has to be that it can plot actual data on the screen. I have succeeded in plotting the graph, but I have not been able yet to…
Robert Smit
  • 183
  • 1
  • 1
  • 6
1 2 3
25
26