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
0
votes
1 answer

rapidjson with gzstream lib last char '-1'

I've written simple wrapper of gzstream 1.5 for using with rapidjson 0.1 (ios, xcode 6.1). Problem: I have to check for eof in Peek() and Take(). Otherwise, I get '\377' (-1) as last character. I know that it's returned by std::basic_stream::get()…
Erdemus
  • 2,728
  • 2
  • 17
  • 10
0
votes
1 answer

Json parsing using rapidJson in c++ giving Error

The given string Format is given Below: "{"success":"yes","error":"","message":"","arguments":"[{\"assetId\":\"7384\",\"assetSerialNo\":\"Base…
Ali Raza
  • 7
  • 1
  • 7
0
votes
1 answer

rapidJSON and UNICODE in VisualStudio 2013

I came across a problem I am not sure how to solve. Here is my code. #include "rapidjson/write.h" #include "rapidjson/stringbuffer.h" ... void WriteResultToJSON() { CHAR a[] = "a"; TCHAR b[] = _T("b"); WCHAR c[] = L"c"; StringBuffer s; …
yary
  • 15
  • 1
  • 4
0
votes
1 answer

Rapidjson assertions during HasMember

To all those that are familiar with rapidjson i have the following issue: I have a certain function that accepts as parameter a date and if that date exists in the json file the method does some operations and if not some other…
loukwn
  • 174
  • 2
  • 14
0
votes
1 answer

Parsing POCO POST response to JSON using Rapidjson

I am suffering from burnout messing with this backlashes... I made a POST request in C++ and receive the following string: "{\"results\": [{\"sku\": \"peds-std-us\", \"url\": \"https://d2y247jlvj8usn.cloudfront.net/1/2014.06.12/upload test.xlsx\",…
Claudiordgz
  • 3,023
  • 1
  • 21
  • 48
0
votes
2 answers

Rapidjson document as a member variable crashes that application

When I use rapidjson document as member variable and do this: class Test { rapidjson::Document m_jsonDocument; public: void f() { // WORKS FINE rapidjson::Document document; if (document.Parse<0>("{ \"hello\"…
Narek
  • 38,779
  • 79
  • 233
  • 389
0
votes
2 answers

Request for some sample program to parse nested objects using Rapidjson

I have been trying to parse some JSON data that contains nested objects such as below. {"channels": {"route1": {"post1": "/opt/v1/route1"}, "route2": {"post2": "/opt/v1/route2"}, "route3": {"post3": "/opt/v1/route3"}}} In order to get name string…
0
votes
1 answer

Why does the member variable change after invoking the assignment operator in rapidjson?

The source codes shown below is a part of checking members of an object of the Document class. We tried to create an object of the Value Class that is ‘memberObject’ and to store the object reference into ‘_value’ Value reference private member…
0
votes
1 answer

RapidJson - fix a bug in writing

I'm using the latest version of RapidJson I found and I got now a strange warning when compiling, not shown before. I use this approach to write a Document in a Json using RapidJson: GenericStringBuffer< UTF8<> > buffer; Writer< GenericStringBuffer<…
Zappescu
  • 1,429
  • 2
  • 12
  • 25
0
votes
2 answers

Difficulty with rapidjson .11 GetInt(), always returns 0

Here is the json form: {"simpleChannels":{"item":[{"channelID":4248,"majorChannelNumber":22,"minorChannelNumber":0,"channelType":"SLL","simpleSchedules":[],"channelKey":"4248_1343210400000","shortName":"KWHY","longName":"A3 Los Angeles 22 KWHY…
kelvin
  • 57
  • 3
-1
votes
1 answer

Creating some Value by constructor and trying to add to Document does not work using rapidjson

I am starting to use rapidjson and I am testing the following example, based on the rapidjson tutorial: // Create an empty document: Document d; // Null d.SetObject(); // Create an empty value: Value v; // Null // Give it an int…
jstechg
  • 123
  • 1
  • 2
  • 10
-1
votes
1 answer

How to check if a nested member exists Rapidjson

I have a JSON File like this { "Person":[ { "name":"Frank", "age":69, "amount_of_jobs":9, "years_worked":6, "unemployed":true, "job_seeking":false }, …
Koos
  • 117
  • 4
  • 15
-1
votes
1 answer

c++ attempting to reference a deleted function in non existing constructor (using rapidJson)

I'm currently getting this error: 'User::User(const User&)': attempting to reference a deleted function The program passes a string value of an object into the class. User Constructor: User::User(string s){ int size = s.length() + 1; char*…
Meerfall the dewott
  • 209
  • 1
  • 4
  • 19
-1
votes
1 answer

String to JSON in Poco/JSON or rapidjson

i want to convert the following std::string message into a json object so that I can easily to traverse the object and get the key/value pair as needed. I prefer to use either rapidjson or Poco::JSON std::string request; std::cout << request <<…
GoQuestion
  • 71
  • 2
  • 9
-1
votes
1 answer

Retriving json value with the help of path in c++

I am currently working on a project to retrieve value from a Json through the path acquired from a json schema as I want to get the values of only those keys that are present in the json schema from the Json. Paths from where I need to retrieve…
A.v
  • 31
  • 1
  • 8
1 2 3
25
26