383 Commits

Author SHA1 Message Date
Philipp A. Hartmann
d0c283254b Stack<>: add _ suffix to member ownAllocator_
For consistency, all member variables should follow the same pattern.
2014-10-30 18:21:27 +01:00
Philipp A. Hartmann
c557b230a6 Add customization macros for global new/delete
As mentioned in #181, some environments may require adaptations to
the internal calls to the global `new`/`delete` operators, like
adding explicit `NULL` checks to `delete.

This patch adds two new macros
 * RAPIDJSON_NEW(x)
 * RAPIDJSON_DELETE(x)
to allow user-defined expressions in these cases.

This fixes #181 in an alternative manner.
2014-10-30 11:20:46 +01:00
Sean Leather
716907b9fb Clarify documentation on RemoveMember, EraseMember ordering 2014-10-27 15:04:26 +02:00
Milo Yip
8fc0e57926 Merge pull request #177 from spl/use-deprecated
Use 'deprecated' instead of 'depreciated'
2014-10-27 14:53:29 +08:00
Sean Leather
32525a5d5e Use 'deprecated' instead of 'depreciated' 2014-10-26 14:51:35 +02:00
ecorm
b0328d2d3b GenericDocument move-assignment now uses std::foward to move-assign the base class. 2014-10-24 15:25:27 -03:00
ecorm
20a9cd2810 Merge branch 'master' into issue123movesupport 2014-10-24 14:09:30 -03:00
ecorm
fd12dcb3db Added MemoryPoolAllocator to GenericDocument moveunit tests. Added comment in GenericDocument move assignment operator explaining why the static_cast is needed to move the base class. 2014-10-24 14:05:32 -03:00
Philipp A. Hartmann
6bd5ecb08c GenericValue: improve documentation for operator[] 2014-10-24 14:45:48 +02:00
Philipp A. Hartmann
e8445e0bbc GenericValue: improve operator[] disambiguation
In the original disambiguation fix for `GenericValue::operator[]` (#170),
the documentation has been missing, which led to quite badly rendered
Doxygen pages.

During a cleanup, I've realized that a much simpler disambiguation is
possible:

````cpp
  GenericValue& operator[](SizeType idx); // array
  template <typename T>
  GenericValue& operator[](T* name);      // object
````

This approach works, as non-template functions are preferred over
template functions.

In order to improve the error messages, the pointer type is restricted
to `(const) Ch`.

Update `tutorial.md` to drop the ambiguity warning.
2014-10-24 13:55:26 +02:00
ecorm
cb33f910c3 Merge branch 'master' into issue123movesupport 2014-10-24 03:11:34 -03:00
ecorm
02f3b00ee6 Implemented C++11 move semantics for GenericDocument 2014-10-24 02:51:17 -03:00
Zhihao Yuan
7303d92990 Disambiguate GenericValue's [0] and ["string"] 2014-10-23 21:50:39 -04:00
Zhihao Yuan
0d90bcc709 No implicit conversion from Type to GenericValue 2014-10-23 21:50:39 -04:00
Sean Leather
0e715872c0 Fix MemoryStream::Peek() and add test for fix
MemoryStream::Peek() did not return '\0' if src_ == end_, but Peek() == '\0' is
used in parsing in the GenericReader. Without this change, parsing with
MemoryStream as the InputStream could result in a segmentation fault.
2014-10-23 00:31:19 +02:00
Milo Yip
faa877ff78 Partial StrtodDiyFp implementation [ci skip] 2014-09-19 08:59:36 +08:00
TyRoXx
b9608f2cf2 turn implicit integer conversions into static_casts to avoid -Wconversion warnings 2014-09-17 20:30:19 +02:00
Milo Yip
475b242087 Minor refactoring before optimization trial 2014-09-16 19:38:18 +08:00
Milo Yip
5171775d4c Minor optimizations in BigInteger 2014-09-16 19:23:28 +08:00
Milo Yip
299e9f1e32 Added missing files 2014-09-16 18:47:35 +08:00
Philipp A. Hartmann
5117f9e555 explicitly qualify C(++) library functions
Some compilers do not export the standard C library functions
to the global namespace, in case the C++ header variants are
included (<cstdlib>, <cstring>).

RapidJSON currently uses:
 * malloc, realloc, free
 * memcpy, memmove, memset, memcpy

Add an explicit namespace qualification to avoid lookup problems.
2014-09-16 10:42:14 +02:00
Philipp A. Hartmann
c0bde81b03 rapidjson.h: explicitly import std::size_t to rapidjson namespace 2014-09-16 10:37:37 +02:00
Philipp A. Hartmann
e052c727b2 GenericValue: drop forced packing pragma 2014-09-16 10:19:40 +02:00
Milo Yip
74b81fa510 Extract classes into various files. 2014-09-16 15:23:18 +08:00
Milo Yip
4f99e25b9d Minor code cleaning 2014-09-16 15:06:44 +08:00
Milo Yip
a425ad5552 Trimming leading/trailing zeros and correct underflow case 2014-09-16 10:52:40 +08:00
miloyip
50fc3fedb2 Fix round towards even 2014-09-15 16:53:57 +08:00
miloyip
b29acfb90d Limit significand to 17 digits for fast path
Should fix gcc debug error in tranvis. May need further refactoring.
2014-09-15 15:54:15 +08:00
Milo Yip
bea4fa7f6a Remove unused BigInteger::operator+=(const BigInteger&) 2014-09-15 00:31:38 +08:00
Milo Yip
cbd7475242 Fix normal-subnormal boundary and add more boundary cases in unit tests. 2014-09-15 00:30:22 +08:00
Milo Yip
4c2128818f Add 32-bit support for custom strtod 2014-09-14 12:42:58 +08:00
Milo Yip
855da06d0f Makes gcc x64 runnable, but failed on one case. [ci skip] 2014-09-14 10:52:33 +08:00
Milo Yip
98dd0a0a64 Make custom strtod work for denormal numbers and some boundary cases [ci skip] 2014-09-13 23:24:40 +08:00
Milo Yip
4bd240abee Implementing custom strtod, fail on some cases [ci skip] 2014-09-12 23:03:20 +08:00
Koji Kobayashi
a69dffbc53 make MemoryPoolAllocator's Malloc work after Clear if a buffer was not supplied by the user 2014-09-10 20:35:23 -07:00
Milo Yip
359ebc78c0 Extract conversion code to strtod.h [ci skip] 2014-09-10 23:36:09 +08:00
miloyip
30ea2a32d1 Prepare custom strtod data. (cannot pass unit test) [ci skip] 2014-09-10 18:54:41 +08:00
Philipp A. Hartmann
296c7db140 Stack: adjust growth factor
The growth factor for the `internal::Stack` helper has not been updated
together with the growth factors used in GenericValue (#130).
2014-09-09 10:49:40 +02:00
miloyip
d0f98d2da1 Fix a bug in dtoa on gcc
Discovered in https://github.com/miloyip/dtoa-benchmark/issues/1 with
assertion fail.
2014-09-07 15:20:09 +08:00
miloyip
a71f2e60ff Optimize ParseNumber() 2014-09-05 19:51:20 +08:00
Milo Yip
881c91d696 Merge master and implement kParseFullPrecision 2014-09-05 13:22:56 +08:00
Milo Yip
d875f16ad7 Refactor ParseNumber for two modes (incomplete) 2014-09-05 10:45:44 +08:00
Kosta
f0d9ab4ec9 finally fixing Reader::ParseString()
It was a copy-n-paste error for the last argument of `Key()` and `String()`...
2014-09-04 18:00:05 +02:00
Kosta
00ac1024ee more changes 2014-09-04 17:37:13 +02:00
Kosta
e70494bc00 fix for Reader::ParseString() implementation plus some minor code cleanups and additions 2014-09-04 17:29:52 +02:00
Kosta
4a71dc6d58 reunified ParseKey, ParseString, and ParseStringOrKey again 2014-09-04 16:54:01 +02:00
Kosta
0f4071046f fix simplereader.cpp and the Key()->String() forwarding in BaseReaderHandler 2014-09-04 15:30:44 +02:00
Kosta
17b1a14d62 add Key() method to Writer and PrettyWriter 2014-09-04 15:20:05 +02:00
Kosta
57e1c87553 add Key() method to the Handler concept
For more details see: https://github.com/miloyip/rapidjson/issues/132

This commit tries to minimize the required code changes and forwards the `Handler::Key()` calls to `Handler::String()` wherever possible in order to not break existing code; or at least not code deriving from `BaseReaderHandler` when implementing a custom `Handler`.
2014-09-04 15:14:18 +02:00
miloyip
b0436911a8 Check "fast path cases in disguise" in strtod 2014-09-03 14:45:37 +08:00