From 7fb82c252883e9800ccb5f7fce92aee831092fc7 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Fri, 21 Mar 2014 16:17:43 +0100 Subject: [PATCH] GenericDocument::ParseStream: make SourceEncoding optional The ParseStream() function current requires explicitly passing the SourceEncoding parameter as explicit template argument while the other Parse*() functions provide overloads to omit this parameter and use the document's own encoding by default. This patch adds the corresponding overload for ParseStream(), enabling the simple usage again: rapidjson::FileStream is(fp); rapidjson::Document d; d.ParseStream<0>(is); --- include/rapidjson/document.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index a41288e..a150f36 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -734,6 +734,11 @@ public: return *this; } + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + //! Parse JSON text from a mutable string. /*! \tparam parseFlags Combination of ParseFlag. \param str Mutable zero-terminated string to be parsed.