rj_schema 1.0.0 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rj_schema/rapidjson/CMakeLists.txt +23 -1
  3. data/ext/rj_schema/rapidjson/appveyor.yml +49 -1
  4. data/ext/rj_schema/rapidjson/bin/types/alotofkeys.json +502 -0
  5. data/ext/rj_schema/rapidjson/bin/unittestschema/idandref.json +69 -0
  6. data/ext/rj_schema/rapidjson/doc/stream.md +7 -7
  7. data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +1 -1
  8. data/ext/rj_schema/rapidjson/doc/tutorial.md +15 -15
  9. data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +2 -0
  10. data/ext/rj_schema/rapidjson/example/traverseaspointer.cpp +39 -0
  11. data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +460 -52
  12. data/ext/rj_schema/rapidjson/include/rapidjson/document.h +350 -60
  13. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +14 -0
  14. data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +68 -1
  15. data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +60 -11
  16. data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +249 -102
  17. data/ext/rj_schema/rapidjson/include/rapidjson/uri.h +466 -0
  18. data/ext/rj_schema/rapidjson/test/perftest/perftest.h +5 -4
  19. data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +20 -2
  20. data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +2 -0
  21. data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +193 -1
  22. data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +2 -0
  23. data/ext/rj_schema/rapidjson/test/unittest/platformtest.cpp +40 -0
  24. data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +62 -2
  25. data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +372 -7
  26. data/ext/rj_schema/rapidjson/test/unittest/uritest.cpp +718 -0
  27. data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +12 -2
  28. data/ext/rj_schema/rj_schema.cpp +3 -10
  29. data/lib/rj_schema.rb +1 -1
  30. 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 __cplusplus >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 )
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 defined(__clang__)
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 defined(__clang__)
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 /* 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
- #if defined(__has_cpp_attribute)
604
- # if __has_cpp_attribute(fallthrough)
605
- # define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]]
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