mirror of
https://github.com/Tencent/rapidjson
synced 2026-08-26 06:23:05 -04:00
fix for Reader::ParseString() implementation plus some minor code cleanups and additions
This commit is contained in:
parent
4a71dc6d58
commit
e70494bc00
5 changed files with 14 additions and 12 deletions
|
|
@ -4,7 +4,7 @@
|
|||
using namespace rapidjson;
|
||||
using namespace std;
|
||||
|
||||
struct MyHandler {
|
||||
struct MyHandler : public BaseReaderHandler<UTF8<>, MyHandler> {
|
||||
bool Null() { cout << "Null()" << endl; return true; }
|
||||
bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
|
||||
bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
|
||||
|
|
@ -17,7 +17,10 @@ struct MyHandler {
|
|||
return true;
|
||||
}
|
||||
bool StartObject() { cout << "StartObject()" << endl; return true; }
|
||||
bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
|
||||
bool Key(const char* str, SizeType length, bool copy) {
|
||||
cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
|
||||
return true;
|
||||
}
|
||||
bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
|
||||
bool StartArray() { cout << "StartArray()" << endl; return true; }
|
||||
bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue