rj_schema 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rj_schema/rapidjson/CMakeLists.txt +23 -1
- data/ext/rj_schema/rapidjson/appveyor.yml +49 -1
- data/ext/rj_schema/rapidjson/bin/types/alotofkeys.json +502 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/idandref.json +69 -0
- data/ext/rj_schema/rapidjson/doc/stream.md +7 -7
- data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +1 -1
- data/ext/rj_schema/rapidjson/doc/tutorial.md +15 -15
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +2 -0
- data/ext/rj_schema/rapidjson/example/traverseaspointer.cpp +39 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +460 -52
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +350 -60
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +14 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +68 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +60 -11
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +249 -102
- data/ext/rj_schema/rapidjson/include/rapidjson/uri.h +466 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +5 -4
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +20 -2
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +2 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +193 -1
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +2 -0
- data/ext/rj_schema/rapidjson/test/unittest/platformtest.cpp +40 -0
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +62 -2
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +372 -7
- data/ext/rj_schema/rapidjson/test/unittest/uritest.cpp +718 -0
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +12 -2
- data/ext/rj_schema/rj_schema.cpp +3 -10
- data/lib/rj_schema.rb +1 -1
- metadata +9 -3
@@ -124,6 +124,19 @@
|
|
124
124
|
#define RAPIDJSON_NAMESPACE_END }
|
125
125
|
#endif
|
126
126
|
|
127
|
+
///////////////////////////////////////////////////////////////////////////////
|
128
|
+
// __cplusplus macro
|
129
|
+
|
130
|
+
//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
|
131
|
+
|
132
|
+
#if defined(_MSC_VER)
|
133
|
+
#define RAPIDJSON_CPLUSPLUS _MSVC_LANG
|
134
|
+
#else
|
135
|
+
#define RAPIDJSON_CPLUSPLUS __cplusplus
|
136
|
+
#endif
|
137
|
+
|
138
|
+
//!@endcond
|
139
|
+
|
127
140
|
///////////////////////////////////////////////////////////////////////////////
|
128
141
|
// RAPIDJSON_HAS_STDSTRING
|
129
142
|
|
@@ -149,6 +162,24 @@
|
|
149
162
|
#include <string>
|
150
163
|
#endif // RAPIDJSON_HAS_STDSTRING
|
151
164
|
|
165
|
+
///////////////////////////////////////////////////////////////////////////////
|
166
|
+
// RAPIDJSON_USE_MEMBERSMAP
|
167
|
+
|
168
|
+
/*! \def RAPIDJSON_USE_MEMBERSMAP
|
169
|
+
\ingroup RAPIDJSON_CONFIG
|
170
|
+
\brief Enable RapidJSON support for object members handling in a \c std::multimap
|
171
|
+
|
172
|
+
By defining this preprocessor symbol to \c 1, \ref rapidjson::GenericValue object
|
173
|
+
members are stored in a \c std::multimap for faster lookup and deletion times, a
|
174
|
+
trade off with a slightly slower insertion time and a small object allocat(or)ed
|
175
|
+
memory overhead.
|
176
|
+
|
177
|
+
\hideinitializer
|
178
|
+
*/
|
179
|
+
#ifndef RAPIDJSON_USE_MEMBERSMAP
|
180
|
+
#define RAPIDJSON_USE_MEMBERSMAP 0 // not by default
|
181
|
+
#endif
|
182
|
+
|
152
183
|
///////////////////////////////////////////////////////////////////////////////
|
153
184
|
// RAPIDJSON_NO_INT64DEFINE
|
154
185
|
|
@@ -411,7 +442,7 @@ RAPIDJSON_NAMESPACE_END
|
|
411
442
|
|
412
443
|
// Prefer C++11 static_assert, if available
|
413
444
|
#ifndef RAPIDJSON_STATIC_ASSERT
|
414
|
-
#if
|
445
|
+
#if RAPIDJSON_CPLUSPLUS >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 )
|
415
446
|
#define RAPIDJSON_STATIC_ASSERT(x) \
|
416
447
|
static_assert(x, RAPIDJSON_STRINGIFY(x))
|
417
448
|
#endif // C++11
|
@@ -541,8 +572,14 @@ RAPIDJSON_NAMESPACE_END
|
|
541
572
|
///////////////////////////////////////////////////////////////////////////////
|
542
573
|
// C++11 features
|
543
574
|
|
575
|
+
#ifndef RAPIDJSON_HAS_CXX11
|
576
|
+
#define RAPIDJSON_HAS_CXX11 (RAPIDJSON_CPLUSPLUS >= 201103L)
|
577
|
+
#endif
|
578
|
+
|
544
579
|
#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS
|
545
|
-
#if
|
580
|
+
#if RAPIDJSON_HAS_CXX11
|
581
|
+
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
|
582
|
+
#elif defined(__clang__)
|
546
583
|
#if __has_feature(cxx_rvalue_references) && \
|
547
584
|
(defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306)
|
548
585
|
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
|
@@ -559,8 +596,14 @@ RAPIDJSON_NAMESPACE_END
|
|
559
596
|
#endif
|
560
597
|
#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
|
561
598
|
|
599
|
+
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
|
600
|
+
#include <utility> // std::move
|
601
|
+
#endif
|
602
|
+
|
562
603
|
#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT
|
563
|
-
#if
|
604
|
+
#if RAPIDJSON_HAS_CXX11
|
605
|
+
#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
|
606
|
+
#elif defined(__clang__)
|
564
607
|
#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept)
|
565
608
|
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
|
566
609
|
(defined(_MSC_VER) && _MSC_VER >= 1900) || \
|
@@ -570,11 +613,13 @@ RAPIDJSON_NAMESPACE_END
|
|
570
613
|
#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
|
571
614
|
#endif
|
572
615
|
#endif
|
616
|
+
#ifndef RAPIDJSON_NOEXCEPT
|
573
617
|
#if RAPIDJSON_HAS_CXX11_NOEXCEPT
|
574
618
|
#define RAPIDJSON_NOEXCEPT noexcept
|
575
619
|
#else
|
576
|
-
#define RAPIDJSON_NOEXCEPT
|
620
|
+
#define RAPIDJSON_NOEXCEPT throw()
|
577
621
|
#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
|
622
|
+
#endif
|
578
623
|
|
579
624
|
// no automatic detection, yet
|
580
625
|
#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS
|
@@ -600,9 +645,17 @@ RAPIDJSON_NAMESPACE_END
|
|
600
645
|
///////////////////////////////////////////////////////////////////////////////
|
601
646
|
// C++17 features
|
602
647
|
|
603
|
-
#
|
604
|
-
#
|
605
|
-
#
|
648
|
+
#ifndef RAPIDJSON_HAS_CXX17
|
649
|
+
#define RAPIDJSON_HAS_CXX17 (RAPIDJSON_CPLUSPLUS >= 201703L)
|
650
|
+
#endif
|
651
|
+
|
652
|
+
#if RAPIDJSON_HAS_CXX17
|
653
|
+
# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]]
|
654
|
+
#elif defined(__has_cpp_attribute)
|
655
|
+
# if __has_cpp_attribute(clang::fallthrough)
|
656
|
+
# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[clang::fallthrough]]
|
657
|
+
# elif __has_cpp_attribute(fallthrough)
|
658
|
+
# define RAPIDJSON_DELIBERATE_FALLTHROUGH __attribute__((fallthrough))
|
606
659
|
# else
|
607
660
|
# define RAPIDJSON_DELIBERATE_FALLTHROUGH
|
608
661
|
# endif
|
@@ -628,12 +681,8 @@ RAPIDJSON_NAMESPACE_END
|
|
628
681
|
|
629
682
|
#ifndef RAPIDJSON_NOEXCEPT_ASSERT
|
630
683
|
#ifdef RAPIDJSON_ASSERT_THROWS
|
631
|
-
#if RAPIDJSON_HAS_CXX11_NOEXCEPT
|
632
|
-
#define RAPIDJSON_NOEXCEPT_ASSERT(x)
|
633
|
-
#else
|
634
684
|
#include <cassert>
|
635
685
|
#define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x)
|
636
|
-
#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
|
637
686
|
#else
|
638
687
|
#define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x)
|
639
688
|
#endif // RAPIDJSON_ASSERT_THROWS
|