86 Commits

Author SHA1 Message Date
Silas S. Brown
b7734d97c0 Remove unnecessary wording from BSD license not needed for MIT license (fixes #528) 2020-10-09 10:04:27 +01:00
Gustav
ac0fc79c76 Fixes issue #1718 2020-05-18 14:06:39 +02:00
Jun
814bb27bf0
Replace RAPIDJSON_CLZLL with internal clzll (#1660)
RAPIDJSON_CLZLL is defined as macro of __builtin_clzll when
using gcc to compile. This introduces two issues:
1. in gcc __builtin_clzll returns int, not uint32_t.
2. __builtin_clzll return is undefined when input x is 0
See: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

This patch removes RAPIDJSON_CLZLL, merges __builtin_clzll to
internal clzll with input check and return value explicit cast.

Change-Id: Iac4b355dc5e5b4ed9b3f35a640b6b5537e76f22c
Signed-off-by: Jun He <jun.he@arm.com>

Co-authored-by: Jun He <jun.he@arm.com>
2020-03-11 15:11:25 +08:00
Charles Milette
d5d7171f6d
Fix ARM NEON under MSVC 2019-07-25 16:38:34 -04:00
Jean-Claude Monnin
51ca982aa1 Fix warning when NDEBUG is defined [-Wunused-variable]
Because `isPeek()` is side effect free this should not change anything.

The reason this warning is not shown in the unit tests is because the asserts
are always evaluated in the unit test:

#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u)
2018-11-21 13:24:06 +01:00
Zoltan Kovago
0fdd8040ce fix compilation on windows with clang 2018-04-09 15:47:17 +02:00
Milo Yip
966987625c Add transcoding/validation to Writer::RawValue()
Fix #1152
2018-02-13 10:58:41 +08:00
Hartwig
568107e178 Add convenience method Key(std::basic_string<Ch> const&) to Writer 2017-05-10 22:56:01 +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
Alejandro Martinez
da4fd6794c Fixed bug on space hexadecimal encoding 2017-03-22 10:19:54 +00: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
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
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
Milo Yip
3693e942b7 Fix output character type in writers 2017-01-24 14:54:50 +08:00
Zhihao Yuan
3cc77d5d63
Treat signed-unsigned conversions as errors. 2017-01-18 18:09:18 -06:00
Milo Yip
f28203c7a1 Fix #741 2016-09-21 11:09:04 +08:00
Tall??di Mih??ly
307e021606 Move constructor support for Writer
This also requires turning off the c++98 compatibility checks when building
with clang.
2016-09-19 21:47:27 +02:00
Milo Yip
3e2172bd52 Add preconditions in writer and string functions 2016-09-03 23:37:00 +08:00
Milo Yip
17254e090e Version 1.1.0
Change version numbers
Fixed some document linkage
Fix #648
2016-08-25 14:35:17 +08:00
Milo Yip
db6a6f3f64 Add Flush() for all value types
Fixes #684
2016-07-21 09:33:00 +08:00
Milo Yip
fee5190def Fix a clang warning 2016-06-13 09:34:47 +08:00
Michael Thon
135da7ab34 Allow options for writing and parsing NaN/Infinity
This adds kWriteNanAndInfFlag to Writer to allow writing of nan,
inf and -inf doubles as "NaN", "Infinity" and "-Infinity",
respectively, and kParseNanAndInfFlag to Reader to allow parsing
of "NaN", "Inf", "Infinity", "-Inf" and "-Infinity". This is part
of issue #36, adding optional support for relaxed JSON syntax.
2016-05-20 23:54:55 +02:00
Milo Yip
d9cf99baf6 Normalize all line endings 2016-03-04 09:44:01 +08:00
Milo Yip
6d0f0b2a84 Merge pull request #564 from corporateshark/stringnumbers
Implemented feature as in #560 (ints/doubles as strings)
2016-03-03 09:34:53 +08:00
Milo Yip
29c95808ac Inlucde SIMD headers for writer.h 2016-03-02 17:58:16 +08:00
Sergey Kosarevsky
2bbfe0d8a8 Number() -> RawNumber() to avoid name clashes with the union Number 2016-02-28 18:50:04 +01:00
Sergey Kosarevsky
eeb13bdb4c Added Writer::Number() 2016-02-28 18:12:57 +01:00
Milo Yip
e733690e69 Merge pull request #543 from miloyip/issue205
Add (Pretty)Writer::RawValue()
2016-02-15 13:06:23 +08:00
Milo Yip
9ecf073aff Merge pull request #536 from miloyip/issue362
Add Writer::SetMaxDecimalPlaces()
2016-02-15 13:05:05 +08:00
Milo Yip
6a6d9c7e05 Optimize Writer::WriteString() with SIMD 2016-02-14 17:37:53 +08:00
Milo Yip
e7cb2b1cbf Add (Pretty)Writer::RawValue()
Fix #205
2016-02-14 15:31:24 +08:00
Milo Yip
1d856b2761 Add Writer::SetMaxDecimalPlaces() 2016-02-11 16:08:17 +08:00
Milo Yip
964d89e34b Add encoding validation option for Writer/PrettyWriter 2016-02-10 11:31:29 +08:00
Milo Yip
935e2ef7ed Merge pull request #510 from miloyip/issue509_writingnaninf
Fix #509 by checking Nan/Inf when writing a double
2016-02-09 18:12:17 +08:00
Milo Yip
8cb978dc15 Add fwd.h and extract stream.h 2016-02-02 18:20:36 +08:00
Milo Yip
122c722993 More LIKELY/UNLIKELY in Writer 2015-12-31 16:17:52 +08:00
Milo Yip
ef6957c177 PutReserve() and PutUnsafe() optimisation for Writer 2015-12-31 15:30:28 +08:00
Milo Yip
74c8dcfd57 Fix clang -Weverything 2015-12-18 18:34:04 +08:00
scheiber
d26d50092d fixing sign conversion warnings and loss of precision warnings 2015-07-21 15:15:42 -06:00
miloyip
18a8891f0d Improve coverage for Writer and PrettyWriter 2015-04-13 14:50:08 +08:00
miloyip
3c028685df Add tests for Writer API for RAPIDJSON_HAS_STDSTRING 2015-04-13 14:25:05 +08:00
miloyip
127ce7175a Add a missing error handling for Writer, and add tests for invalid encoding. 2015-04-13 14:05:43 +08:00
Milo Yip
d1959ba6e3 Change copyright owner and related changes. 2015-04-03 12:57:16 +08:00
Drew Noakes
1a76879c12 Include <string> if RAPIDJSON_HAS_STDSTRING set. 2015-02-02 09:34:48 +00:00
Drew Noakes
3cfd675163 Add std::string overload to Writer when RAPIDJSON_HAS_STDSTRING defined. 2015-02-02 09:21:28 +00:00