Skip to content

Instantly share code, notes, and snippets.

@LincolnBurrows
Created November 9, 2015 02:02
Show Gist options
  • Save LincolnBurrows/2c786f46b9e4bb6c2420 to your computer and use it in GitHub Desktop.
Save LincolnBurrows/2c786f46b9e4bb6c2420 to your computer and use it in GitHub Desktop.
#include "rapidjson/document.h"
using namespace rapidjson;
Document document;
const char* json = {
"hello": "world",
"t": true ,
"f": false,
"n": null,
"i": 123,
"pi": 3.1416,
"a": [1, 2, 3, 4]
}
document.Parse(json);
const Value& a = document["a"];
for(SizeType i = 0;i<a.Size();i++)
printf("a[%d] = %d\n",i,a[i].GetInt());
for(Value::ConstValueIterator itr = a.Begin();itr!=a.End();++itr)
printf("%d",itr->GetInt());
for(Value::ConstMemberIterator itr=document.MemberBegin();itr!=document.MemberEnd();++itr)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment