21 bool Null() { type =
"Null"; data.clear();
return true; }
22 bool Bool(
bool b) { type =
"Bool:"; data = b?
"true":
"false";
return true; }
23 bool Int(
int i) { type =
"Int:"; data =
stringify(i);
return true; }
24 bool Uint(
unsigned u) { type =
"Uint:"; data =
stringify(u);
return true; }
30 bool StartObject() { type =
"StartObject"; data.clear();
return true; }
33 bool StartArray() { type =
"StartArray"; data.clear();
return true; }
41 const char json[] =
" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
49 cout << handler.
type << handler.
data << endl;
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
bool Key(const char *str, SizeType length, bool)
bool EndArray(SizeType elementCount)
Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS. ...
bool String(const char *str, SizeType length, bool)
unsigned __int64 uint64_t
bool IterativeParseNext(InputStream &is, Handler &handler)
Parse one token from JSON text.
void IterativeParseInit()
Initialize JSON text token-by-token parsing.
bool RawNumber(const char *str, SizeType length, bool)
connection< TProtocol > & operator=(const connection< TProtocol > &obj)
RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const
Check if token-by-token parsing JSON text is complete.
bool EndObject(SizeType memberCount)
std::string stringify(T x)