2442 Commits

Author SHA1 Message Date
ardb-uk
14f1e37f85
Resolve issue 1948
Correct instances of >> as they failed compilation.
2021-10-12 16:22:22 +01:00
Ivan Le Lann
e6736d1baa
Support CMake none targets
When trying to import rapidjson with for exemple : 
fetchcontent_declare(rapidjson GIT_REPOSITORY https://github.com/Tencent/rapidjson.git)

if your CMake/Clang is "bare metal", exemple given : 

set(CMAKE_SYSTEM_NAME none)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_COMPILER_TARGET x86_64-elf-none)
set(CMAKE_CXX_COMPILER_TARGET x86_64-elf-none)

CMake fails to process CMakeLists.txt because of the switch on UNIX/CYGWIN/WIN32 for install directory.

Error is: 

CMake Error at cmake-build-debug-clang/_deps/rapidjson-src/CMakeLists.txt:244 (INSTALL):
  INSTALL FILES given no DESTINATION!
2021-10-02 15:26:17 +02:00
Milo Yip
2e8f5d897d
Merge pull request #1940 from smhdfdl/issue-1924
Issue 1924 - stop erroneous compiler warnings
2021-09-24 18:05:03 +08:00
Steve Hanson
9ea3f45dbd fix the warning 2021-09-24 08:51:03 +01:00
Milo Yip
b9ae2499ef
Merge pull request #1941 from DiamondI/patch-1
typo on documentation dom.zh-cn.md: "己于" -> "已于"
2021-09-24 11:47:04 +08:00
Andrew
553a3ea31f
typo on documentation dom.zh-cn.md: "己于" -> "已于" 2021-09-24 10:57:46 +08:00
Steve Hanson
864e44aef8 Merge branch 'master' of https://github.com/Tencent/rapidjson 2021-09-23 14:33:30 +01:00
Milo Yip
00dbcf2c6e
Merge pull request #1926 from Kyrega/master
Fix RawNumber for characters with sizeof(Ch) > sizeof(char)
2021-08-13 12:25:41 +08:00
Kyrega
22ee8b07c8 Correct WIStreamWrapper 2021-08-10 17:39:04 +02:00
Kyrega
a3d52c75b7 No default template parameter for older compilers 2021-08-10 17:38:41 +02:00
Kyrega
19b55c9049 No default template parameter for older compilers 2021-08-10 17:38:23 +02:00
Kyrega
128b1031b0 Use rapidjson internal::SelectIf 2021-08-10 17:38:09 +02:00
Kyrega
8710d7e989 Do not depend on c++11 conditional 2021-08-10 17:37:35 +02:00
Kyrega
e0512e0944 Using unsigned for WIStreamWrapper 2021-08-10 17:36:31 +02:00
Kyrega
7fac34f7bb Added typename 2021-08-10 17:35:49 +02:00
Kyrega
b952a592a4 Fix RawNumber for longer char types 2021-08-10 17:35:07 +02:00
Milo Yip
28c59ab4c6
Merge pull request #1922 from jack-perisich/grisu2_precision
Fix small errors in dtoa output for certain doubles
2021-08-10 22:16:46 +08:00
jack_perisich
bb06211088 Fix small errors in dtoa output for certain doubles 2021-07-27 19:50:51 -04:00
Steve Hanson
7ee918fc8f Merge branch 'master' of https://github.com/Tencent/rapidjson 2021-07-09 10:47:18 +01:00
Milo Yip
48fbd8cd20
Merge pull request #1848 from smhdfdl/id-and-ref
Fix issue 1843 - support Id keyword
2021-07-09 10:57:40 +08:00
Steve Hanson
8d16abd980 Uri Parse improvements 2021-06-30 17:09:52 +01:00
Milo Yip
b557259f88
Merge pull request #1904 from Tencent/issue1899_pointerappend
Fix Pointer::Append() crash for custom allocator on Windows
2021-06-14 22:49:09 +08:00
Steve Hanson
a21cf9f7b8 equiv fix for issue 1899 2021-06-14 11:35:00 +01:00
Milo Yip
8c29a7b493 Fix Pointer::Append() crash for custom allocator on Windows
Fix #1899
2021-06-11 11:49:14 +08:00
Steve Hanson
12b88efa6f fix coverage again 2021-06-09 18:11:04 +01:00
Steve Hanson
f6ebcb2008 fix Uri.Match optional arg 2021-06-09 16:38:40 +01:00
Steve Hanson
3df804c128 fix coverage, unit test allocators and equality 2021-06-09 10:31:09 +01:00
Steve Hanson
18ab3b16bc remove temp debug statements 2021-06-08 17:11:42 +01:00
Steve Hanson
6d253c160d remove compiler warning 2021-06-08 15:31:25 +01:00
Steve Hanson
28bcbd3f35 make std::string optional 2021-06-08 10:53:10 +01:00
Steve Hanson
494447b731 remove copyright & debug statements 2021-05-21 15:55:11 +01:00
Steve Hanson
6e58a53f44 fix coverage 2021-05-20 17:44:34 +01:00
Steve Hanson
3987d82f41 Merge branch 'master' of https://github.com/Tencent/rapidjson into id-and-ref 2021-05-20 12:20:12 +01:00
Steve Hanson
9c1002f94d rge branch 'master' of https://github.com/Tencent/rapidjson 2021-05-20 12:18:46 +01:00
Milo Yip
17aa824c92
Merge pull request #1885 from saurabhchardereal/master
Improve documentation
2021-05-07 17:00:48 +08:00
Saurabh Charde
cd737fb545
Improve documentation
Signed-off-by: Saurabh Charde <saurabhchardereal@gmail.com>
2021-05-07 14:13:33 +05:30
Milo Yip
25fa7a119d
Merge pull request #1883 from nkolotov/fix/issues/1882
Fixed -Wshadow warning.
2021-05-06 09:54:52 +08:00
N. Kolotov
3aa8d04b74 Fixed -Wshadow warning. 2021-05-03 01:56:41 +03:00
Milo Yip
e0f68a4356
Merge pull request #1877 from hendrikmuhs/windows-GetObject-conflict-#1418
add a workaround for GetObject macro defined by windows.h
2021-04-20 10:02:53 +08:00
Hendrik Muhs
3cdfde14d6 replace auto with concrete type 2021-04-19 13:15:11 -07:00
Hendrik Muhs
d179facf90 don't let the GetObject macro rewrite the GetObject method, add a GetObj alias 2021-04-19 12:29:11 -07:00
Hendrik Muhs
3168d7c343 add a test that provokes a compile time error on windows 2021-04-18 18:06:35 +02:00
Milo Yip
47b837e14a
Merge pull request #1485 from ylavic/MemberMap
Object members stored in std::multimap
2021-04-08 10:06:28 +08:00
ylavic
be4a5a9087 Turn some Tests to RAPIDJSON_USE_MEMBERSMAP in CI. 2021-04-07 18:22:46 +02:00
ylavic
fc08f4f61b Tests for Members in std::multimap. 2021-04-07 18:22:46 +02:00
ylavic
71f0fa7eb3 Set RAPIDJSON_USE_MEMBERSMAP to use a (std::multi)map for object members.
When RAPIDJSON_USE_MEMBERSMAP is defined, an object Value will store
its members in an (re)allocated array of Members like before, but also
in an std::multimap<GenericValue::Data,SizeType> where the key and value
reference the corresponding Member by its Data and index in the array,
respectively, and in a relocatable manner.

The layout of the members map/array is now:
 {multimap*}<>{capacity}<>{Member[capacity]}<>{multimap::iterator[capacity]}
where <> stands for the RAPIDJSON_ALIGN-ment of each part, if needed.

This layout needs to be reallocated when the current capacity is
exhausted, which requires to take care of the multimap and its iterators
explicitely. The multimap is allocated separately and only its pointer is
saved in this layout, so it can easily be restored in its new position.
As for the old/alive iterators, they must move to their new offset according
to the new capacity.

With this in place, it's immediate to get the multimap::iterator from a
MemberIterator and vice versa, thus the same complexity applies for the
operations with MemberIterator or MapIterator.

For FindMember() and RemoveMember(), the complexity drops from O(n) to
the multimap/rbtree's O(log n).
For EraseMember() it drops from O(n-m) to O((log n)-m), m representing
the move/copy of the trailing members.
For AddMember() though, the complexity grows from O(1) to O(log n) due to
the insertion in the multimap too.

Consequently parsing will be slower, up to ~20% measured in perftests on
my laptop (since it's mainly composed of insertions). But later work on
the Document (usually the goal of parsing...) will be much faster; the
new DocumentFind perftest included in this commit is 8 times faster with
RAPIDJSON_USE_MEMBERSMAP (still on my laptop). Overall the tests are 4%
slower (mainly composed of parsing), and notably 15% slower for schemas
parsing/validation (which supposedly comes from the larger JSON files
parsing, still). As a side note, when RAPIDJSON_USE_MEMBERSMAP is not
defined, this commit does nothing (same results for perftest with regard
to previous versions).

Finally, the multimap is allocated and constructed using StdAllocator,
so they will use the same Allocator than for any other Value allocation,
and thus will benefit from the same performance/safety/security/whatever
provided by the user given Allocator.
2021-04-07 18:22:46 +02:00
Milo Yip
7d801bbe45
Merge pull request #1503 from ylavic/sub_value_assignment
Fix (Sub-)Value assignment
2021-04-07 17:52:51 +08:00
Milo Yip
03676c9bf5
Merge pull request #1870 from ylavic/allocators_rvalues
Add rvalue copy and assignment to MemoryPoolAllocator and StdAllocator.
2021-04-07 17:39:26 +08:00
ylavic
aa0675ffd7 Try some tests with -D_GLIBCXX_DEBUG and coverage with -O0. 2021-04-04 12:51:47 +02:00
ylavic
5c764d9a81 Tests for Allocators copy by rvalue reference. 2021-04-04 12:51:47 +02:00