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; }
28 bool RawNumber(
const char* str,
SizeType length,
bool) { type =
"Number:"; data = std::string(str, length);
return true; }
29 bool String(
const char* str,
SizeType length,
bool) { type =
"String:"; data = std::string(str, length);
return true; }
30 bool StartObject() { type =
"StartObject"; data.clear();
return true; }
31 bool Key(
const char* str,
SizeType length,
bool) { type =
"Key:"; data = std::string(str, length);
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.)
RAPIDJSON_FORCEINLINE bool IterativeParseComplete()
Check if token-by-token parsing JSON text is complete.
bool String(const char *str, SizeType length, bool)
bool EndObject(SizeType memberCount)
Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS. ...
unsigned __int64 uint64_t
bool IterativeParseNext(InputStream &is, Handler &handler)
Parse one token from JSON text.
bool EndArray(SizeType elementCount)
void IterativeParseInit()
Initialize JSON text token-by-token parsing.
bool RawNumber(const char *str, SizeType length, bool)
std::string stringify(T x)
bool Key(const char *str, SizeType length, bool)