@@ -9,19 +9,19 @@ struct MyHandler {
9
9
std::string data;
10
10
11
11
bool Null () { type = " Null" ; data.clear (); return true ; }
12
- bool Bool (bool b) { type = " Bool" ; data = b? " true" : " false" ; return true ; }
13
- bool Int (int i) { type = " Int" ; data = std::to_string (i); return true ; }
14
- bool Uint (unsigned u) { type = " Uint" ; data = std::to_string (u); return true ; }
15
- bool Int64 (int64_t i) { type = " Int64" ; data = std::to_string (i); return true ; }
16
- bool Uint64 (uint64_t u) { type = " Uint64" ; data = std::to_string (u); return true ; }
17
- bool Double (double d) { type = " Double" ; data = std::to_string (d); return true ; }
18
- bool RawNumber (const char * str, SizeType length, bool ) { type = " Number" ; data = std::string (str, length); return true ; }
19
- bool String (const char * str, SizeType length, bool ) { type = " String" data = std::string (str, length); return true ; }
12
+ bool Bool (bool b) { type = " Bool: " ; data = b? " true" : " false" ; return true ; }
13
+ bool Int (int i) { type = " Int: " ; data = std::to_string (i); return true ; }
14
+ bool Uint (unsigned u) { type = " Uint: " ; data = std::to_string (u); return true ; }
15
+ bool Int64 (int64_t i) { type = " Int64: " ; data = std::to_string (i); return true ; }
16
+ bool Uint64 (uint64_t u) { type = " Uint64: " ; data = std::to_string (u); return true ; }
17
+ bool Double (double d) { type = " Double: " ; data = std::to_string (d); return true ; }
18
+ bool RawNumber (const char * str, SizeType length, bool ) { type = " Number: " ; data = std::string (str, length); return true ; }
19
+ bool String (const char * str, SizeType length, bool ) { type = " String: " ; data = std::string (str, length); return true ; }
20
20
bool StartObject () { type = " StartObject" ; data.clear (); return true ; }
21
- bool Key (const char * str, SizeType length, bool ) { type = " Key" data = std::string (str, length); return true ; }
22
- bool EndObject (SizeType memberCount) { type = " EndObject" ; data = std::to_string (memberCount); return true ; }
21
+ bool Key (const char * str, SizeType length, bool ) { type = " Key: " ; data = std::string (str, length); return true ; }
22
+ bool EndObject (SizeType memberCount) { type = " EndObject: " ; data = std::to_string (memberCount); return true ; }
23
23
bool StartArray () { type = " StartArray" ; data.clear (); return true ; }
24
- bool EndArray (SizeType elementCount) { type = " EndArray" ; data = std::to_string (elementCount); return true ; }
24
+ bool EndArray (SizeType elementCount) { type = " EndArray: " ; data = std::to_string (elementCount); return true ; }
25
25
};
26
26
27
27
int main () {
@@ -33,7 +33,7 @@ int main() {
33
33
reader.IterativeParseInit ();
34
34
while (!reader.IterativeParseComplete ()) {
35
35
reader.IterativeParseNext <kParseDefaultFlags >(ss, handler);
36
- cout << handler.type << " : " << handler.data << endl;
36
+ cout << handler.type << handler.data << endl;
37
37
}
38
38
39
39
return 0 ;
0 commit comments