From 3dba370486091ef1e9b8b5c70ed037933168b73f Mon Sep 17 00:00:00 2001 From: Sergey Kosarevsky Date: Mon, 29 Feb 2016 17:51:32 +0100 Subject: [PATCH] Added IterativeParsingReaderHandler::RawNumber() --- include/rapidjson/reader.h | 6 +++--- test/unittest/readertest.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index a4cb0af..e6c7471 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -1299,11 +1299,11 @@ private: } else { StackStream stackStream(stack_); - SizeType numCharsToCopy = s.Length(); + SizeType numCharsToCopy = s.Length(); while (numCharsToCopy--) { - Transcoder::Transcode(is, stackStream); + Transcoder::Transcode(is, stackStream); } - stackStream.Put('\0'); + stackStream.Put('\0'); const typename TargetEncoding::Ch* str = stackStream.Pop(); const SizeType length = static_cast(stackStream.Length()) - 1; cont = handler.RawNumber(str, SizeType(length), true); diff --git a/test/unittest/readertest.cpp b/test/unittest/readertest.cpp index 221fd2f..8690da6 100644 --- a/test/unittest/readertest.cpp +++ b/test/unittest/readertest.cpp @@ -1170,6 +1170,8 @@ struct IterativeParsingReaderHandler { bool Double(double) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_DOUBLE; return true; } + bool RawNumber(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; } + bool String(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; } bool StartObject() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTOBJECT; return true; }