From 0f4071046f73466efae6b0808e364de5e59ceb62 Mon Sep 17 00:00:00 2001 From: Kosta Date: Thu, 4 Sep 2014 15:30:44 +0200 Subject: [PATCH] fix `simplereader.cpp` and the `Key()->String()` forwarding in `BaseReaderHandler` --- example/simplereader/simplereader.cpp | 1 + include/rapidjson/reader.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/example/simplereader/simplereader.cpp b/example/simplereader/simplereader.cpp index 9914253..83b3f1d 100644 --- a/example/simplereader/simplereader.cpp +++ b/example/simplereader/simplereader.cpp @@ -17,6 +17,7 @@ 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 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; } diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index f02dd16..92fd781 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -182,7 +182,7 @@ struct BaseReaderHandler { bool Double(double) { return static_cast(*this).Default(); } bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } bool StartObject() { return static_cast(*this).Default(); } - bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); } + bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } bool EndObject(SizeType) { return static_cast(*this).Default(); } bool StartArray() { return static_cast(*this).Default(); } bool EndArray(SizeType) { return static_cast(*this).Default(); }