332 Commits

Author SHA1 Message Date
Milo Yip
c203f682e9 Add capitalize example 2014-07-13 03:51:18 +08:00
Milo Yip
a73ed78fd6 Suppress effc++ warning in messagereader 2014-07-13 03:28:09 +08:00
Milo Yip
a5c1324da9 Add messagereader example 2014-07-13 01:17:38 +08:00
Milo Yip
9e3ed44e85 Suppress VS2013 warnings due to #64 2014-07-13 01:10:25 +08:00
Milo Yip
8d70a8d03e Merge remote-tracking branch 'origin/master' 2014-07-13 01:06:30 +08:00
Milo Yip
e78654235f Revert "Add kParseErrorTermination English error message."
This reverts commit 025c516f827845c2510f761b203fce7ae3b669a1.
2014-07-13 01:06:22 +08:00
Milo Yip
cb3f213186 Merge pull request #64 from pah/feature/exception-support
Improve exception safety and add support for swtiching error handling to exceptions
2014-07-13 01:05:54 +08:00
Milo Yip
025c516f82 Add kParseErrorTermination English error message. 2014-07-13 01:00:03 +08:00
Philipp A. Hartmann
ff5713faf0 error/en.h: fix typo, add termination string 2014-07-12 18:45:49 +02:00
Philipp A. Hartmann
c69610239a error.h: add kParseErrorTermination (from #61) 2014-07-12 18:44:31 +02:00
Philipp A. Hartmann
152db11ad6 Merge branch 'upstream/master' into feature/exception-support
Conflicts:
	include/rapidjson/reader.h
2014-07-12 18:42:06 +02:00
Milo Yip
b55fcbd36a Merge pull request #61 from miloyip/issue59terminate
Fixes #59 by adding bool return value for each event handler function
2014-07-12 23:42:50 +08:00
Milo Yip
75cee948d4 Fixes main() return should be int in new examples 2014-07-12 23:41:01 +08:00
Milo Yip
3c8a923439 Add simplereader, simplewriter examples.
Also modify premake to add all projects in example folder.
2014-07-12 23:07:41 +08:00
Milo Yip
6225092355 Travis config trial: git config --global 2014-07-12 18:42:26 +08:00
Milo Yip
ca05d85183 Revert "Travis config trial: using original name/email"
This reverts commit ded7dc723d0609111f5c2df0ff32eeaf0894b2d9.
2014-07-12 18:34:29 +08:00
Milo Yip
ded7dc723d Travis config trial: using original name/email 2014-07-12 18:30:19 +08:00
Milo Yip
75bee4cd76 Update token 2014-07-12 18:24:32 +08:00
Milo Yip
75d7bfe3be Revert "Update token"
This reverts commit fd9bc121553bfe1f9e7c3dd70918fe90350db799.
2014-07-12 18:24:13 +08:00
Milo Yip
fd9bc12155 Update token 2014-07-12 18:20:16 +08:00
Milo Yip
3096970720 Merge pull request #63 from pah/fixes/value-assign
GenericValue::operator= : fixup assignment operator (again)
2014-07-11 23:56:56 +08:00
Milo Yip
31113b4f52 Merge pull request #65 from pah/travis-ci
travis-ci.org: improve config, debug GH_TOKEN issue
2014-07-11 23:55:31 +08:00
Philipp A. Hartmann
33da6610f9 travis-doxygen.sh: temporarily ignore failing GH page update 2014-07-11 13:29:50 +02:00
Philipp A. Hartmann
5050f18743 travis-doxygen.sh: add GH_TOKEN sanity check 2014-07-11 13:20:18 +02:00
Philipp A. Hartmann
33e96f866d .travis.yml: simplify config, prepare for running 32/64 bit configurations 2014-07-11 13:20:18 +02:00
Philipp A. Hartmann
418a5829b3 update documentation of ParseResult and related functions 2014-07-11 09:39:20 +02:00
Philipp A. Hartmann
2fcb999749 add ParseResult 2014-07-11 09:39:20 +02:00
Philipp A. Hartmann
4475521177 GenericDocument: simplify error handling in ParseStream
* unconditionally store error state of reader after parsing
 * clear stack after parsing by using a ClearStackOnExit scope guard
2014-07-11 09:39:20 +02:00
Philipp A. Hartmann
3c1d4bc21d reader.h: prepare "early return path" for exception support
In case of a user-defined RAPIDJSON_PARSE_ERROR_NORETURN that throws
an exception instead of using the Rapidjson ParseError API, the early
return paths performing the stack unwinding manually can be omitted as
well.

This patch provides a customizable RAPIDJSON_PARSE_ERROR_EARLY_RETURN
macro to remove these (then unneeded) control paths from the parsing
implementation (with and without a return value).

Secondly, clearing the parse stack is moved to a small helper struct
that calls stack_.Clear() from its destructor.  This avoids the need
for the 'goto' in the ParseStream function and ensures proper cleanup
even if e.g. a user-defined Allocator throws an exception.
2014-07-11 09:39:20 +02:00
Philipp A. Hartmann
b37bd85318 move ParseErrorCode to error/error.h
In order to enable the customization of the error macros
 - RAPIDJSON_PARSE_ERROR_NORETURN
 - RAPIDJSON_PARSE_ERROR_EARLY_RETURN
the user may need to have access to the ParseErrorCode enum
already.  This requires a separate header location than the
GenericReader.
2014-07-11 09:39:20 +02:00
Philipp A. Hartmann
41d211cd51 GenericValue::operator= : fixup assignment operator
While MSVC doesn't like the explicit `.template operator=<...>` syntax
(see 4f40ed6), Clang 3.5 complains about the absence of it:

In file included from ../../test/perftest/rapidjsontest.cpp:6:
../../include/rapidjson/document.h:504:18: error: use 'template' keyword to treat 'operator =' as a dependent template name
                return (*this).operator=<StringRefType>(str);
                               ^
                               template

Delegate both operator=(StringRefType) and operator=(T) to operator(GenericValue&).
2014-07-11 08:27:28 +02:00
Milo Yip
e440b695a1 Merge pull request #62 from pah/fixes/msvc
Fixes and cleanups for MSVC
2014-07-11 07:39:44 +08:00
Philipp A. Hartmann
6d5583628a premake4.lua: only enable "-Wswitch-default" in unittest
There's no need to enforce this flag during the build of the perftest
or the GoogleTest library, as both include third-party code.
2014-07-10 20:49:10 +02:00
Philipp A. Hartmann
ca36a2e66e writer.h: use warning macros for MSVC 2014-07-10 19:49:52 +02:00
Philipp A. Hartmann
7a2e6e79c6 StrLen: align implementations
There are two copies of `StrLen` in the RapidJSON code base
 * strfunc.h: rapidjson::internal::StrLen<Ch>
 * unittest.h: Strlen<Ch>

To hide a warning on MSVC, align both implementations to use
'unsigned/SizeType' as return type and add an explicit cast.
2014-07-10 19:41:17 +02:00
Philipp A. Hartmann
4f40ed64b6 MSVC: fix compiler error in GenericDocument
The `StringRefType` assignment operator overload
leads to a compiler error on MSVC 2005 and later:

..\..\include\rapidjson/document.h(504) : error C2951: template declarations are only permitted at global, namespace, or class scope

Drop the unneeded 'template' keyword here.
2014-07-10 19:41:08 +02:00
Philipp A. Hartmann
3cdfb0dafe rapidjsontest.cpp: silence a warning (C4244) on MSVC 2014-07-10 19:38:57 +02:00
Philipp A. Hartmann
bde95eca04 Writer::WriteUint: add cast to hide warning C4244 on MSVC 2014-07-10 19:38:23 +02:00
Philipp A. Hartmann
04f9c5020f encodings.h: hide narrowing conversion warnings on MSVC 2014-07-10 19:38:23 +02:00
Philipp A. Hartmann
e63125f1a1 MSVC: fix SSE/intrinsic support
MSVC with enabled RAPIDJSON_SSE2/RAPIDJSON_SSE42 requires the explicit
definition of the `_BitScanForward` intrinsic.  This can be reliably
ensured by including "intrin.h" and properly marking '_BitScanForward'
as intrinsic.

Confirmed on MSVC 2005, 2008.
Should fix https://code.google.com/p/rapidjson/issues/detail?id=96
2014-07-10 19:35:47 +02:00
Milo Yip
f1ae39f9e2 Fixed readertest compilation error 2014-07-11 00:37:55 +08:00
Milo Yip
cc04219e36 Fixes #59 by adding bool return value for each event handler function 2014-07-10 19:33:01 +08:00
Milo Yip
63d054349a Fixes whitespaces in travis script 2014-07-10 02:25:11 +08:00
Milo Yip
10596ee882 Fixes travis token 2014-07-10 02:19:27 +08:00
Milo Yip
e1431e5836 Change travis token 2014-07-10 01:55:51 +08:00
Milo Yip
59cef2a4f7 Merge pull request #60 from pah/fix/travis-ghtoken
travis-doxygen.sh: avoid leaking the GitHub token in build log
2014-07-10 01:54:51 +08:00
Philipp A. Hartmann
72d0d42a1f travis-doxygen.sh: avoid leaking the GitHub token in build log 2014-07-09 18:24:13 +02:00
Milo Yip
63de910d16 Merge pull request #57 from pah/cleanup/string-handling
Improved handling of (constant) strings
2014-07-09 23:05:00 +08:00
Philipp A. Hartmann
12c5805c7e tutorial.md: update for new string API 2014-07-09 11:26:22 +02:00
Philipp A. Hartmann
58b741ac4b tutorial.md: document GenericValue::Move() 2014-07-09 11:25:55 +02:00