/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/rapidjson/rapidjson.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/rapidjson/rapidjson.h Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/rapidjson/rapidjson.h Source File
rapidjson.h
Go to the documentation of this file.
1 // Tencent is pleased to support the open source community by making RapidJSON available.
2 //
3 // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
4 //
5 // Licensed under the MIT License (the "License"); you may not use this file except
6 // in compliance with the License. You may obtain a copy of the License at
7 //
8 // http://opensource.org/licenses/MIT
9 //
10 // Unless required by applicable law or agreed to in writing, software distributed
11 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 // specific language governing permissions and limitations under the License.
14 
15 #ifndef RAPIDJSON_RAPIDJSON_H_
16 #define RAPIDJSON_RAPIDJSON_H_
17 
39 #include <cstdlib> // malloc(), realloc(), free(), size_t
40 #include <cstring> // memset(), memcpy(), memmove(), memcmp()
41 
43 // RAPIDJSON_VERSION_STRING
44 //
45 // ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt.
46 //
47 
49 // token stringification
50 #define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x)
51 #define RAPIDJSON_DO_STRINGIFY(x) #x
52 
53 // token concatenation
54 #define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y)
55 #define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y)
56 #define RAPIDJSON_DO_JOIN2(X, Y) X##Y
58 
75 #define RAPIDJSON_MAJOR_VERSION 1
76 #define RAPIDJSON_MINOR_VERSION 1
77 #define RAPIDJSON_PATCH_VERSION 0
78 #define RAPIDJSON_VERSION_STRING \
79  RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION)
80 
82 // RAPIDJSON_NAMESPACE_(BEGIN|END)
117 #ifndef RAPIDJSON_NAMESPACE
118 #define RAPIDJSON_NAMESPACE rapidjson
119 #endif
120 #ifndef RAPIDJSON_NAMESPACE_BEGIN
121 #define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE {
122 #endif
123 #ifndef RAPIDJSON_NAMESPACE_END
124 #define RAPIDJSON_NAMESPACE_END }
125 #endif
126 
128 // __cplusplus macro
129 
131 
132 #if defined(_MSC_VER)
133 #define RAPIDJSON_CPLUSPLUS _MSVC_LANG
134 #else
135 #define RAPIDJSON_CPLUSPLUS __cplusplus
136 #endif
137 
139 
141 // RAPIDJSON_HAS_STDSTRING
142 
143 #ifndef RAPIDJSON_HAS_STDSTRING
144 #ifdef RAPIDJSON_DOXYGEN_RUNNING
145 #define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation
146 #else
147 #define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default
148 #endif
159 #endif // !defined(RAPIDJSON_HAS_STDSTRING)
160 
161 #if RAPIDJSON_HAS_STDSTRING
162 #include <string>
163 #endif // RAPIDJSON_HAS_STDSTRING
164 
166 // RAPIDJSON_USE_MEMBERSMAP
167 
179 #ifndef RAPIDJSON_USE_MEMBERSMAP
180 #define RAPIDJSON_USE_MEMBERSMAP 0 // not by default
181 #endif
182 
184 // RAPIDJSON_NO_INT64DEFINE
185 
196 #ifndef RAPIDJSON_NO_INT64DEFINE
198 #if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013
199 #include "msinttypes/stdint.h"
200 #include "msinttypes/inttypes.h"
201 #else
202 // Other compilers should have this.
203 #include <stdint.h>
204 #include <inttypes.h>
205 #endif
207 #ifdef RAPIDJSON_DOXYGEN_RUNNING
208 #define RAPIDJSON_NO_INT64DEFINE
209 #endif
210 #endif // RAPIDJSON_NO_INT64TYPEDEF
211 
213 // RAPIDJSON_FORCEINLINE
214 
215 #ifndef RAPIDJSON_FORCEINLINE
217 #if defined(_MSC_VER) && defined(NDEBUG)
218 #define RAPIDJSON_FORCEINLINE __forceinline
219 #elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG)
220 #define RAPIDJSON_FORCEINLINE __attribute__((always_inline))
221 #else
222 #define RAPIDJSON_FORCEINLINE
223 #endif
225 #endif // RAPIDJSON_FORCEINLINE
226 
228 // RAPIDJSON_ENDIAN
229 #define RAPIDJSON_LITTLEENDIAN 0
230 #define RAPIDJSON_BIGENDIAN 1
231 
233 
245 #ifndef RAPIDJSON_ENDIAN
246 // Detect with GCC 4.6's macro
247 #ifdef __BYTE_ORDER__
248 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
249 #define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
250 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
251 #define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
252 #else
253 #error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN.
254 #endif // __BYTE_ORDER__
255 // Detect with GLIBC's endian.h
256 #elif defined(__GLIBC__)
257 #include <endian.h>
258 #if(__BYTE_ORDER == __LITTLE_ENDIAN)
259 #define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
260 #elif(__BYTE_ORDER == __BIG_ENDIAN)
261 #define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
262 #else
263 #error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN.
264 #endif // __GLIBC__
265 // Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro
266 #elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
267 #define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
268 #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
269 #define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
270 // Detect with architecture macros
271 #elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || \
272  defined(__ppc__) || defined(__ppc64__) || defined(__hpux) || defined(__hppa) || \
273  defined(_MIPSEB) || defined(_POWER) || defined(__s390__)
274 #define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
275 #elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || \
276  defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || \
277  defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || \
278  defined(_M_X64) || defined(__bfin__)
279 #define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
280 #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
281 #define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
282 #elif defined(RAPIDJSON_DOXYGEN_RUNNING)
283 #define RAPIDJSON_ENDIAN
284 #else
285 #error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN.
286 #endif
287 #endif // RAPIDJSON_ENDIAN
288 
290 // RAPIDJSON_64BIT
291 
293 #ifndef RAPIDJSON_64BIT
294 #if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || \
295  defined(__EMSCRIPTEN__)
296 #define RAPIDJSON_64BIT 1
297 #else
298 #define RAPIDJSON_64BIT 0
299 #endif
300 #endif // RAPIDJSON_64BIT
301 
303 // RAPIDJSON_ALIGN
304 
306 
312 #ifndef RAPIDJSON_ALIGN
313 #define RAPIDJSON_ALIGN(x) (((x) + static_cast<size_t>(7u)) & ~static_cast<size_t>(7u))
314 #endif
315 
317 // RAPIDJSON_UINT64_C2
318 
320 
325 #ifndef RAPIDJSON_UINT64_C2
326 #define RAPIDJSON_UINT64_C2(high32, low32) \
327  ((static_cast<uint64_t>(high32) << 32) | static_cast<uint64_t>(low32))
328 #endif
329 
331 // RAPIDJSON_48BITPOINTER_OPTIMIZATION
332 
334 
341 #ifndef RAPIDJSON_48BITPOINTER_OPTIMIZATION
342 #if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \
343  defined(_M_X64) || defined(_M_AMD64)
344 #define RAPIDJSON_48BITPOINTER_OPTIMIZATION 1
345 #else
346 #define RAPIDJSON_48BITPOINTER_OPTIMIZATION 0
347 #endif
348 #endif // RAPIDJSON_48BITPOINTER_OPTIMIZATION
349 
350 #if RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1
351 #if RAPIDJSON_64BIT != 1
352 #error RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when RAPIDJSON_64BIT=1
353 #endif
354 #define RAPIDJSON_SETPOINTER(type, p, x) \
355  (p = reinterpret_cast<type*>( \
356  (reinterpret_cast<uintptr_t>(p) & \
357  static_cast<uintptr_t>(RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | \
358  reinterpret_cast<uintptr_t>(reinterpret_cast<const void*>(x))))
359 #define RAPIDJSON_GETPOINTER(type, p) \
360  (reinterpret_cast<type*>(reinterpret_cast<uintptr_t>(p) & \
361  static_cast<uintptr_t>(RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF))))
362 #else
363 #define RAPIDJSON_SETPOINTER(type, p, x) (p = (x))
364 #define RAPIDJSON_GETPOINTER(type, p) (p)
365 #endif
366 
368 // RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_NEON/RAPIDJSON_SIMD
369 
396 #if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) || defined(RAPIDJSON_NEON) || \
397  defined(RAPIDJSON_DOXYGEN_RUNNING)
398 #define RAPIDJSON_SIMD
399 #endif
400 
402 // RAPIDJSON_NO_SIZETYPEDEFINE
403 
404 #ifndef RAPIDJSON_NO_SIZETYPEDEFINE
420 #ifdef RAPIDJSON_DOXYGEN_RUNNING
421 #define RAPIDJSON_NO_SIZETYPEDEFINE
422 #endif
425 
429 typedef unsigned SizeType;
431 #endif
432 
433 // always import std::size_t to rapidjson namespace
435 using std::size_t;
437 
439 // RAPIDJSON_ASSERT
440 
442 
449 #ifndef RAPIDJSON_ASSERT
450 #include <cassert>
451 #define RAPIDJSON_ASSERT(x) assert(x)
452 #endif // RAPIDJSON_ASSERT
453 
455 // RAPIDJSON_STATIC_ASSERT
456 
457 // Prefer C++11 static_assert, if available
458 #ifndef RAPIDJSON_STATIC_ASSERT
459 #if RAPIDJSON_CPLUSPLUS >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
460 #define RAPIDJSON_STATIC_ASSERT(x) static_assert(x, RAPIDJSON_STRINGIFY(x))
461 #endif // C++11
462 #endif // RAPIDJSON_STATIC_ASSERT
463 
464 // Adopt C++03 implementation from boost
465 #ifndef RAPIDJSON_STATIC_ASSERT
466 #ifndef __clang__
468 #endif
470 template <bool x>
471 struct STATIC_ASSERTION_FAILURE;
472 template <>
473 struct STATIC_ASSERTION_FAILURE<true>
474 {
475  enum
476  {
477  value = 1
478  };
479 };
480 template <size_t x>
481 struct StaticAssertTest
482 {
483 };
485 
486 #if defined(__GNUC__) || defined(__clang__)
487 #define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
488 #else
489 #define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
490 #endif
491 #ifndef __clang__
493 #endif
494 
500 #define RAPIDJSON_STATIC_ASSERT(x) \
501  typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest<sizeof( \
502  ::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE<bool(x)>)> \
503  RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
504 #endif // RAPIDJSON_STATIC_ASSERT
505 
507 // RAPIDJSON_LIKELY, RAPIDJSON_UNLIKELY
508 
510 
514 #ifndef RAPIDJSON_LIKELY
515 #if defined(__GNUC__) || defined(__clang__)
516 #define RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1)
517 #else
518 #define RAPIDJSON_LIKELY(x) (x)
519 #endif
520 #endif
521 
523 
527 #ifndef RAPIDJSON_UNLIKELY
528 #if defined(__GNUC__) || defined(__clang__)
529 #define RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0)
530 #else
531 #define RAPIDJSON_UNLIKELY(x) (x)
532 #endif
533 #endif
534 
536 // Helpers
537 
539 
540 #define RAPIDJSON_MULTILINEMACRO_BEGIN \
541  do \
542  {
543 #define RAPIDJSON_MULTILINEMACRO_END \
544  } \
545  while((void)0, 0)
546 
547 // adopted from Boost
548 #define RAPIDJSON_VERSION_CODE(x, y, z) (((x) * 100000) + ((y) * 100) + (z))
549 
550 #if defined(__has_builtin)
551 #define RAPIDJSON_HAS_BUILTIN(x) __has_builtin(x)
552 #else
553 #define RAPIDJSON_HAS_BUILTIN(x) 0
554 #endif
555 
557 // RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF
558 
559 #if defined(__GNUC__)
560 #define RAPIDJSON_GNUC RAPIDJSON_VERSION_CODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
561 #endif
562 
563 #if defined(__clang__) || \
564  (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4, 2, 0))
565 
566 #define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x))
567 #define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x)
568 #define RAPIDJSON_DIAG_OFF(x) \
569  RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W, x)))
570 
571 // push/pop support in Clang and GCC>=4.6
572 #if defined(__clang__) || \
573  (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4, 6, 0))
574 #define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)
575 #define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop)
576 #else // GCC >= 4.2, < 4.6
577 #define RAPIDJSON_DIAG_PUSH /* ignored */
578 #define RAPIDJSON_DIAG_POP /* ignored */
579 #endif
580 
581 #elif defined(_MSC_VER)
582 
583 // pragma (MSVC specific)
584 #define RAPIDJSON_PRAGMA(x) __pragma(x)
585 #define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x))
586 
587 #define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable : x)
588 #define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)
589 #define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop)
590 
591 #else
592 
593 #define RAPIDJSON_DIAG_OFF(x) /* ignored */
594 #define RAPIDJSON_DIAG_PUSH /* ignored */
595 #define RAPIDJSON_DIAG_POP /* ignored */
596 
597 #endif // RAPIDJSON_DIAG_*
598 
600 // C++11 features
601 
602 #ifndef RAPIDJSON_HAS_CXX11
603 #define RAPIDJSON_HAS_CXX11 (RAPIDJSON_CPLUSPLUS >= 201103L)
604 #endif
605 
606 #ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS
607 #if RAPIDJSON_HAS_CXX11
608 #define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
609 #elif defined(__clang__)
610 #if __has_feature(cxx_rvalue_references) && (defined(_MSC_VER) || defined(_LIBCPP_VERSION) || \
611  defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306)
612 #define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
613 #else
614 #define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
615 #endif
616 #elif(defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4, 3, 0)) && \
617  defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
618  (defined(_MSC_VER) && _MSC_VER >= 1600) || \
619  (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
620 
621 #define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
622 #else
623 #define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
624 #endif
625 #endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
626 
627 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
628 #include <utility> // std::move
629 #endif
630 
631 #ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT
632 #if RAPIDJSON_HAS_CXX11
633 #define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
634 #elif defined(__clang__)
635 #define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept)
636 #elif(defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4, 6, 0)) && \
637  defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
638  (defined(_MSC_VER) && _MSC_VER >= 1900) || \
639  (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
640 #define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
641 #else
642 #define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
643 #endif
644 #endif
645 #ifndef RAPIDJSON_NOEXCEPT
646 #if RAPIDJSON_HAS_CXX11_NOEXCEPT
647 #define RAPIDJSON_NOEXCEPT noexcept
648 #else
649 #define RAPIDJSON_NOEXCEPT throw()
650 #endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
651 #endif
652 
653 // no automatic detection, yet
654 #ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS
655 #if(defined(_MSC_VER) && _MSC_VER >= 1700)
656 #define RAPIDJSON_HAS_CXX11_TYPETRAITS 1
657 #else
658 #define RAPIDJSON_HAS_CXX11_TYPETRAITS 0
659 #endif
660 #endif
661 
662 #ifndef RAPIDJSON_HAS_CXX11_RANGE_FOR
663 #if defined(__clang__)
664 #define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for)
665 #elif(defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4, 6, 0)) && \
666  defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
667  (defined(_MSC_VER) && _MSC_VER >= 1700) || \
668  (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
669 #define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
670 #else
671 #define RAPIDJSON_HAS_CXX11_RANGE_FOR 0
672 #endif
673 #endif // RAPIDJSON_HAS_CXX11_RANGE_FOR
674 
676 // C++17 features
677 
678 #ifndef RAPIDJSON_HAS_CXX17
679 #define RAPIDJSON_HAS_CXX17 (RAPIDJSON_CPLUSPLUS >= 201703L)
680 #endif
681 
682 #if RAPIDJSON_HAS_CXX17
683 #define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]]
684 #elif defined(__has_cpp_attribute)
685 #if __has_cpp_attribute(clang::fallthrough)
686 #define RAPIDJSON_DELIBERATE_FALLTHROUGH [[clang::fallthrough]]
687 #elif __has_cpp_attribute(fallthrough)
688 #define RAPIDJSON_DELIBERATE_FALLTHROUGH __attribute__((fallthrough))
689 #else
690 #define RAPIDJSON_DELIBERATE_FALLTHROUGH
691 #endif
692 #else
693 #define RAPIDJSON_DELIBERATE_FALLTHROUGH
694 #endif
695 
697 
699 
710 // RAPIDJSON_NOEXCEPT_ASSERT
711 
712 #ifndef RAPIDJSON_NOEXCEPT_ASSERT
713 #ifdef RAPIDJSON_ASSERT_THROWS
714 #include <cassert>
715 #define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x)
716 #else
717 #define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x)
718 #endif // RAPIDJSON_ASSERT_THROWS
719 #endif // RAPIDJSON_NOEXCEPT_ASSERT
720 
722 // malloc/realloc/free
723 
724 #ifndef RAPIDJSON_MALLOC
726 #define RAPIDJSON_MALLOC(size) std::malloc(size)
727 #endif
728 #ifndef RAPIDJSON_REALLOC
730 #define RAPIDJSON_REALLOC(ptr, new_size) std::realloc(ptr, new_size)
731 #endif
732 #ifndef RAPIDJSON_FREE
734 #define RAPIDJSON_FREE(ptr) std::free(ptr)
735 #endif
736 
738 // new/delete
739 
740 #ifndef RAPIDJSON_NEW
742 #define RAPIDJSON_NEW(TypeName) new TypeName
743 #endif
744 #ifndef RAPIDJSON_DELETE
746 #define RAPIDJSON_DELETE(x) delete x
747 #endif
748 
750 // Type
751 
757 
759 enum Type
760 {
761  kNullType = 0,
763  kTrueType = 2,
767  kNumberType = 6
768 };
769 
771 
772 #endif // RAPIDJSON_RAPIDJSON_H_
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:121
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:124
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1697
Type
Type of JSON value.
Definition: rapidjson.h:760
@ kFalseType
false
Definition: rapidjson.h:762
@ kObjectType
object
Definition: rapidjson.h:764
@ kTrueType
true
Definition: rapidjson.h:763
@ kStringType
string
Definition: rapidjson.h:766
@ kNullType
null
Definition: rapidjson.h:761
@ kArrayType
array
Definition: rapidjson.h:765
@ kNumberType
number
Definition: rapidjson.h:767
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:429