The error messages in ParseNumber used `is.Tell` to report the
position of the number parsing error. Depending on the copy
optimization of the current stream, this can lead to different
behaviour (beginning of number vs. position of error).
* Delegate constant string construction to SetStringRaw
* Delegate "const Ch*" overloads to GenericValue variants
of operator[], FindMember and RemoveMember
* Remove repeated template arguments in nested struct Array
(cherry-picked from ca9b0332d)
Instead of hard-coding the value 0 for the parseFlags in the
various parsing overloads, explicitly use kParseDefaultFlags
to provide more self-documenting code.
In order to activate the suppression of "-Weffc++" warnings in the
template meta function classes (non-virtual destructor), move the
inclusion of the meta-function header `internal/meta.h` after the
suppression pragma.
Add dedicated class-based member iterator to prepare the switch to a
(safe) API change to return MemberEnd() from FindMember().
Pointer-based iterator can be kept by defining
RAPIDJSON_NOMEMBERITERATORCLASS. This may be useful for platforms without
a working <iterator> header.
rapidjson.h:
* StreamLocalCopy: add default argument to copy optimization selector
based on StreamTraits of Stream parameter
* drop operator->, operator*
* make Stream (reference) member public
* drop empty destructor
reader.h:
* add local references, initialized from "copy"
(reverts algorithmic bodies back to plain 's.xx()')
The previous optimization #32 has problem that restoration requires
assignment operator.
Change the backup/restore process using a template wrapper class to
select code path.
Parse errors is represented as enum type `ParseErrorCode`.
Error texts are optional for user.
Added `GetParseError_En()` in `error/en.h`, user can localize this file
into other files. User may dynamically change the locale in runtime.
Compound types (object and array) call ParseString() and ParseValue()
for key and values. If there is parse errors inside those calls, it
should stop continue parsing. Otherwise, it may be possible to continue
parsing and calling handler incorrectly.
For example, in ["a\u,","b"], \u generates an error (it should follow
but 4 hex digits), the parser continues to treat the first comma as
element separator, and treat "," as a JSON string and call the handler.
It may be unacceptable in the application code.
The C++ standard does not include the C99 macros used to set the (U)INT64
constants in document.h and reader.h (see adf66292 and ce1fece2).
Many implementations include their definition when the
__STDC_CONSTANT_MACROS preprocessor symbol is defined.
See e.g. http://www.cprogramdevelop.com/5272623/,
needed to successfully build in travis-ci.org's environment.