79 {
81 DocumentType doc;
82
83 const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
84
85 doc.Parse(json);
87
88 doc.SetNull();
90 doc.template ParseStream<0>(
s);
92
93 doc.SetNull();
94 char *buffer = strdup(json);
95 doc.ParseInsitu(buffer);
97 free(buffer);
98
99
100 size_t length = strlen(json);
101 buffer = reinterpret_cast<char*>(malloc(length * 2));
102 memcpy(buffer, json, length);
103 memset(buffer + length,
'X', length);
104#if RAPIDJSON_HAS_STDSTRING
105 std::string s2(buffer, length);
106#endif
107 doc.SetNull();
108 doc.Parse(buffer, length);
109 free(buffer);
111
112#if RAPIDJSON_HAS_STDSTRING
113
114 doc.SetNull();
115 doc.Parse(s2);
117#endif
118}
A document for parsing JSON text as DOM.
Concept for allocating, resizing and freeing memory block.
void ParseCheck(DocumentType &doc)
memset(pInfo->slotDescription, ' ', 64)
memcpy((char *) pInfo->slotDescription, s, l)