950 Commits

Author SHA1 Message Date
Christopher Warrington
6e38649ec6 Guard against min/max being macros in document.h
Sometimes, particularly when Microsoft's windows.h is included, min/max
are defined as macros, interfering with use of
std::numeric_limits::min() and the like.

To guard against this, the function name is wrapped in an extra set of
parenthesis, which inhibits function-style macro expansion.
2017-09-05 18:26:47 -07:00
Minmin Gong
f91405801f Specifies the endian of msvc ARM64 configuration. 2017-08-31 23:16:59 -07:00
bluehero
f9004b90c5 modify 2017-08-07 13:09:22 +08:00
bluehero
c831675026 modify 2017-08-07 11:58:37 +08:00
bluehero
5fb06596a9 modify 2017-08-07 11:44:27 +08:00
bluehero
7c1f208253 modify 2017-08-05 16:53:45 +08:00
Milo Yip
c34e3dfc72 Merge pull request #1018 from miloyip/issue1017_allOfHandler
Fix #1017 allOf keyword fail with Writer handler
2017-07-13 16:57:56 +08:00
Milo Yip
fcd2e1f60c Fix #1017 allOf keyword fail with Writer handler
Gave up using static binding for null handler, because it cannot be
used with arbitrary handler type. Change `OutputHandler handler_` to
pointer type.
2017-07-13 16:07:36 +08:00
Philipp A. Hartmann
70171f9790 GenericStringRef: move assert out of expression 2017-07-10 22:32:18 +02:00
Milo Yip
f624a3037c Merge pull request #1010 from pah/fixes/817-stringref-null
Improve handling of NULL strings
2017-07-10 10:08:21 +08:00
Philipp A. Hartmann
47c3c1ec9f Improved handling of NULL strings
* Safely assert upon passing NULL string without length
   (requires usage of RAPIDJSON_ASSERT within an expression)
 * Allow using a NULL string together with an explicit length 0
   (GenericStringRef, GenericValue::SetString, ...), see #817
 * Add GenericValue::SetString(StringRefType, Allocator&) overload
 * Add tests for the various cases
2017-07-09 14:46:59 +02:00
Philipp A. Hartmann
14218aeb0a ParseResult: improve bool conversion and add operator!=
* Use safe-bool idiom for boolean conversion to avoid accidental
   misuse of ParseResult values (closes #989)
 * Add operator!= to support more comparison expressions
   (previously silently/erroneously used operator bool)
2017-07-09 11:13:31 +02:00
Milo Yip
2f45319b4e Merge pull request #968 from TomaszNo/icc-preprocessor-guard
Intel C++ Compiler preprocessor guard for #pragma intrinsic - diyfp.h
2017-06-28 11:36:55 +08:00
Milo Yip
df6362d450 Fix patternProperties & additionalProperties lead to ASSERT
Fix #825
2017-06-09 10:16:24 +08:00
Philipp A. Hartmann
68c96e987b Fixup #964 by forwarding copyConstStrings recursively
As reported by @Llerd in #962, the `copyConstStrings` parameter
has not been forwarded recursively to the constructors of
object members and array elements.
2017-05-27 10:26:35 +02:00
Tomasz Noczynski (Linux)
294ad93e30 To avoid Intel C++ Compiler #1879 warnings:
warning #1879: unimplemented pragma ignored: #pragma intrinsic(_BitScanReverse64)
warning #1879: unimplemented pragma ignored: #pragma intrinsic(_umul128)
2017-05-25 14:14:16 +02:00
Tomasz Noczynski (Linux)
77d2fadfb6 If storage class is not specified as first in declaration then Intel C++ Compiler 2017 generates message:
message #82: storage class is not first
2017-05-25 13:21:57 +02:00
Philipp A. Hartmann
4ef1ff4fba GenericValue::CopyFrom: add option to force copying of strings
Copying the result of an in-situ parsing into another value/document
currently requires that the original buffer - still holding the strings
from the parsing, outlives the  destination object as well.

In order to obtain a "full" copy of a GenericValue, this commit adds
an optional flag `copyConstStrings` to `CopyFrom`, which then forces
to take a copy of all embedded strings in the source value.

This solves the problem discussed in #962.
2017-05-18 19:11:04 +02:00
Hartwig
568107e178 Add convenience method Key(std::basic_string<Ch> const&) to Writer 2017-05-10 22:56:01 +02:00
Harry Wong
cba45fe9de Onley apply to GCC 7 2017-05-04 10:32:45 +08:00
Harry Wong
fe19b7b601 Supress implicit fallthrough in GCC 2017-05-04 10:08:48 +08:00
Milo Yip
b45c5408d1 Merge pull request #932 from JunHe77/master
Added ARM-Neon support for SIMD.SkipWhitespace*
2017-04-24 16:22:14 +08:00
Oliver Hahm
885b5cd2f9 common notation of empty if/else case 2017-04-21 14:49:30 +02:00
Oliver Hahm
63423eb6f8 fix return values 2017-04-21 14:49:12 +02:00
Alejandro Martinez
2291258bb8 Added ARM-Neon support for SIMD.SkipWhitespace*
Change-Id: Iaf210d029758723a7eeb7f28fc10cab7467889a9
Signed-off-by: Jun He <jun.he@arm.com>
2017-04-21 07:33:17 +00:00
Milo Yip
e6d7247ed9 Merge pull request #924 from lichray/fix-gcc7-warning
Fix a non-type template parameter type mismatch
2017-04-17 14:44:08 +08:00
Philipp A. Hartmann
f93a29bec2 RAPIDJSON_STATIC_ASSERT: use C++11 static_assert, if available 2017-04-14 20:19:16 +02:00
Zhihao Yuan
ec90588c72
Fix a non-type template parameter type mismatch
This issues a warning in gcc7.
2017-04-08 22:51:15 -05:00
Milo Yip
77f643dc51 Fix #910 incorrect casting 2017-04-07 10:23:30 +08:00
Milo Yip
5d9d0f78b5 Merge pull request #909 from miloyip/issue905_PrettyWriterWriteFlags
Fix #905 unable to set writeFlags for PrettyWriter
2017-03-27 18:26:17 +08:00
Milo Yip
d88be8ef16 Fix #905 unable to set writeFlags for PrettyWriter 2017-03-27 14:05:03 +08:00
Alejandro Martinez
85500e8c8f Changed error code for invalid special ascii chars, fixed writer tests 2017-03-24 13:37:23 +00:00
Alejandro Martinez
da4fd6794c Fixed bug on space hexadecimal encoding 2017-03-22 10:19:54 +00:00
Milo Yip
e5635fb27f Fix #899 2017-03-16 10:46:48 +08:00
Milo Yip
bba388b4fa Merge pull request #896 from StilesCrisis/writer-flush-api
Writer flush api
2017-03-16 10:36:25 +08:00
Milo Yip
465fab45c1 Merge pull request #897 from StilesCrisis/issue-889-pretty-writer
Issue 889 pretty writer
2017-03-16 10:35:26 +08:00
John Stiles
d5d18cf694 Fix template length optimization issue in PrettyWriter
Missed PrettyWriter in the initial fix for Issue #889
2017-03-14 23:48:41 -07:00
John Stiles
31c6c50ac6 Provide a Flush() API within Writer
This is helpful if you’re writing code that needs to control flush
behavior and you don’t want to pass around your buffer object to each
handler function alongside the writer. Seems like an easy convenience
to add.
2017-03-14 23:28:59 -07:00
John Stiles
55f8a32020 Remove broken templatized string length optimization
It did not support char arrays.
2017-03-12 23:47:59 -07:00
John Stiles
c4e3d6243c Fix msvc x64 compilation issue
Disambiguate by putting the ENABLEIF on the return value instead of in
the argument list.
2017-03-05 09:50:03 -08:00
John Stiles
cdea825a0b Assert that String() and Key() are given null-terminated strings
Assert in case users attempt to pass a char array to String() or Key()
that is not null terminated; that is not the intended use of the API.
Null terminate your string buffers.
2017-03-05 09:23:03 -08:00
John Stiles
61f8c4ef0d Quoted strings to String() or Key() are auto-sized by template
Same fix as previous commit, to prettywriter
2017-03-05 00:38:34 -08:00
John Stiles
dd97ede84d Quoted strings to String() or Key() are auto-sized by template
No strlen call needs to be made when templates can auto-deduce the
string length. No strlen = faster!

Unfortunately this needs a touch of  SFINAE to allow multiple overrides
to coexist cleanly.
2017-03-05 00:27:08 -08:00
John Stiles
db8d3bb4d6 Remove unneeded change 2017-03-03 00:42:00 -08:00
John Stiles
3f9ebfe9e9 Trivial change to trigger Travis CI 2017-03-02 21:24:03 -08:00
StilesCrisis
6e2e5c7dbe Specialize StrLen for char/wchar_t
Compilers generally provide a much smarter strlen than ours.
2017-02-28 01:11:30 -08:00
Milo Yip
e6b192a75c Merge pull request #869 from StilesCrisis/writer-key-fix
Writer EndObject missing-value fix
2017-02-28 16:02:52 +08:00
StilesCrisis
4643104b8a Fix null handler construction
We should not malloc the null-handler object and cast to OutputHandler;
we need to actually invoke the constructor via placement new.
2017-02-27 23:28:25 -08:00
StilesCrisis
fa84cd18f4 Add matching fix for PrettyWriter
PrettyWriter EndObject will now also assert if called when a key is
missing its matching value.
2017-02-27 22:53:59 -08:00
StilesCrisis
2e9b7b1ae6 Added assertion
Documented existing assertions in EndObject
Added new assertion in EndObject to catch error condition where objects
are ended with a key but no matching value.
2017-02-27 22:44:13 -08:00