Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
RapidJSON configuration

Configuration macros for library features. More...

Macros

#define RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY   (64 * 1024)
 User-defined kDefaultChunkCapacity definition.
#define RAPIDJSON_DEFAULT_ALLOCATOR   ::RAPIDJSON_NAMESPACE::MemoryPoolAllocator<::RAPIDJSON_NAMESPACE::CrtAllocator>
 Allows to choose default allocator.
#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR   ::RAPIDJSON_NAMESPACE::CrtAllocator
 Allows to choose default stack allocator for Document.
#define RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY   16
 User defined kDefaultObjectCapacity value.
#define RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY   16
 User defined kDefaultArrayCapacity value.
#define RAPIDJSON_MAJOR_VERSION   1
 Major version of RapidJSON in integer.
#define RAPIDJSON_MINOR_VERSION   1
 Minor version of RapidJSON in integer.
#define RAPIDJSON_PATCH_VERSION   0
 Patch version of RapidJSON in integer.
#define RAPIDJSON_VERSION_STRING   RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION)
 Version of RapidJSON in "<major>.<minor>.<patch>" string format.
#define RAPIDJSON_NAMESPACE   rapidjson
 provide custom rapidjson namespace
#define RAPIDJSON_NAMESPACE_BEGIN   namespace RAPIDJSON_NAMESPACE {
 provide custom rapidjson namespace (opening expression)
#define RAPIDJSON_NAMESPACE_END   }
 provide custom rapidjson namespace (closing expression)
#define RAPIDJSON_HAS_STDSTRING
 Enable RapidJSON support for std::string.
#define RAPIDJSON_USE_MEMBERSMAP
 Enable RapidJSON support for object members handling in a std::multimap.
#define RAPIDJSON_ALIGN(x)
 Data alignment of the machine.
#define RAPIDJSON_48BITPOINTER_OPTIMIZATION   0
 Use only lower 48-bit address for some pointers.
#define RAPIDJSON_NO_SIZETYPEDEFINE
 User-provided SizeType definition.
#define RAPIDJSON_ASSERT(x)
 Assertion.
#define RAPIDJSON_LIKELY(x)
 Compiler branching hint for expression with high probability to be true.
#define RAPIDJSON_UNLIKELY(x)
 Compiler branching hint for expression with low probability to be true.
#define RAPIDJSON_NOEXCEPT_ASSERT(x)
 Assertion (in non-throwing contexts).
#define RAPIDJSON_VALIDATE_DEFAULT_FLAGS   kValidateNoFlags
 User-defined kValidateDefaultFlags definition.

Detailed Description

Configuration macros for library features.

Some RapidJSON features are configurable to adapt the library to a wide variety of platforms, environments and usage scenarios. Most of the features can be configured in terms of overridden or predefined preprocessor macros at compile-time.

Some additional customization is available in the RapidJSON error handling APIs.

Note
These macros should be given on the compiler command-line (where applicable) to avoid inconsistent values when compiling different translation units of a single application.

Macro Definition Documentation

◆ RAPIDJSON_48BITPOINTER_OPTIMIZATION

#define RAPIDJSON_48BITPOINTER_OPTIMIZATION   0

Use only lower 48-bit address for some pointers.

This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address. The higher 16-bit can be used for storing other data. GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture.

Definition at line 339 of file rapidjson.h.

◆ RAPIDJSON_ALIGN

#define RAPIDJSON_ALIGN ( x)
Value:
(((x) + static_cast<size_t>(7u)) & ~static_cast<size_t>(7u))

Data alignment of the machine.

Parameters
xpointer to align

Some machines require strict data alignment. The default is 8 bytes. User can customize by defining the RAPIDJSON_ALIGN function macro.

Definition at line 308 of file rapidjson.h.

Referenced by MemoryPoolAllocator< BaseAllocator >::Malloc(), and MemoryPoolAllocator< BaseAllocator >::Realloc().

◆ RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY

#define RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY   (64 * 1024)

User-defined kDefaultChunkCapacity definition.

User can define this as any size that is a power of 2.

Definition at line 73 of file allocators.h.

◆ RAPIDJSON_ASSERT

◆ RAPIDJSON_DEFAULT_ALLOCATOR

#define RAPIDJSON_DEFAULT_ALLOCATOR   ::RAPIDJSON_NAMESPACE::MemoryPoolAllocator<::RAPIDJSON_NAMESPACE::CrtAllocator>

Allows to choose default allocator.

User can define this to use CrtAllocator or MemoryPoolAllocator.

Definition at line 79 of file document.h.

◆ RAPIDJSON_DEFAULT_STACK_ALLOCATOR

#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR   ::RAPIDJSON_NAMESPACE::CrtAllocator

Allows to choose default stack allocator for Document.

User can define this to use CrtAllocator or MemoryPoolAllocator.

Definition at line 89 of file document.h.

◆ RAPIDJSON_HAS_STDSTRING

#define RAPIDJSON_HAS_STDSTRING

Enable RapidJSON support for std::string.

By defining this preprocessor symbol to 1, several convenience functions for using rapidjson::GenericValue with std::string are enabled, especially for construction and comparison.

Definition at line 148 of file rapidjson.h.

◆ RAPIDJSON_LIKELY

#define RAPIDJSON_LIKELY ( x)
Value:
(x)

Compiler branching hint for expression with high probability to be true.

Parameters
xBoolean expression likely to be true.

Definition at line 495 of file rapidjson.h.

Referenced by GenericStringRef< Ch >::GenericStringRef(), GenericReader< UTF8< char >, UTF8< char >, CrtAllocator >::IterativeParseNext(), GenericMember< Encoding, Allocator >::operator=(), and GenericValue< Encoding, Allocator >::operator=().

◆ RAPIDJSON_MAJOR_VERSION

#define RAPIDJSON_MAJOR_VERSION   1

Major version of RapidJSON in integer.

Definition at line 76 of file rapidjson.h.

◆ RAPIDJSON_MINOR_VERSION

#define RAPIDJSON_MINOR_VERSION   1

Minor version of RapidJSON in integer.

Definition at line 77 of file rapidjson.h.

◆ RAPIDJSON_NAMESPACE

#define RAPIDJSON_NAMESPACE   rapidjson

provide custom rapidjson namespace

In order to avoid symbol clashes and/or "One Definition Rule" errors between multiple inclusions of (different versions of) RapidJSON in a single binary, users can customize the name of the main RapidJSON namespace.

In case of a single nesting level, defining RAPIDJSON_NAMESPACE to a custom name (e.g. MyRapidJSON) is sufficient. If multiple levels are needed, both RAPIDJSON_NAMESPACE_BEGIN and RAPIDJSON_NAMESPACE_END need to be defined as well:

// in some .cpp file
#define RAPIDJSON_NAMESPACE my::rapidjson
#define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson {
#define RAPIDJSON_NAMESPACE_END } }
#include "rapidjson/..."
See also
rapidjson

Definition at line 119 of file rapidjson.h.

◆ RAPIDJSON_NAMESPACE_BEGIN

#define RAPIDJSON_NAMESPACE_BEGIN   namespace RAPIDJSON_NAMESPACE {

provide custom rapidjson namespace (opening expression)

See also
RAPIDJSON_NAMESPACE

Definition at line 122 of file rapidjson.h.

◆ RAPIDJSON_NAMESPACE_END

#define RAPIDJSON_NAMESPACE_END   }

provide custom rapidjson namespace (closing expression)

See also
RAPIDJSON_NAMESPACE

Definition at line 125 of file rapidjson.h.

◆ RAPIDJSON_NO_SIZETYPEDEFINE

#define RAPIDJSON_NO_SIZETYPEDEFINE

User-provided SizeType definition.

In order to avoid using 32-bit size types for indexing strings and arrays, define this preprocessor symbol and provide the type rapidjson::SizeType before including RapidJSON:

#define RAPIDJSON_NO_SIZETYPEDEFINE
namespace rapidjson { typedef ::std::size_t SizeType; }
#include "rapidjson/..."
main RapidJSON namespace
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.).
Definition rapidjson.h:416
See also
rapidjson::SizeType

Definition at line 22 of file JSONWriter.cc.

◆ RAPIDJSON_NOEXCEPT_ASSERT

#define RAPIDJSON_NOEXCEPT_ASSERT ( x)
Value:
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition rapidjson.h:438

Assertion (in non-throwing contexts).

Some functions provide a noexcept guarantee, if the compiler supports it. In these cases, the RAPIDJSON_ASSERT macro cannot be overridden to throw an exception. This macro adds a separate customization point for such cases.

Defaults to C assert() (as RAPIDJSON_ASSERT), if noexcept is supported, and to RAPIDJSON_ASSERT otherwise.

Definition at line 688 of file rapidjson.h.

Referenced by MemoryPoolAllocator< BaseAllocator >::Capacity(), MemoryPoolAllocator< BaseAllocator >::Clear(), GenericValue< Encoding, Allocator >::GenericValue(), MemoryPoolAllocator< BaseAllocator >::Malloc(), MemoryPoolAllocator< BaseAllocator >::operator==(), MemoryPoolAllocator< BaseAllocator >::Realloc(), MemoryPoolAllocator< BaseAllocator >::Shared(), and MemoryPoolAllocator< BaseAllocator >::Size().

◆ RAPIDJSON_PATCH_VERSION

#define RAPIDJSON_PATCH_VERSION   0

Patch version of RapidJSON in integer.

Definition at line 78 of file rapidjson.h.

◆ RAPIDJSON_UNLIKELY

#define RAPIDJSON_UNLIKELY ( x)
Value:
(x)

Compiler branching hint for expression with low probability to be true.

Parameters
xBoolean expression unlikely to be true.

Definition at line 508 of file rapidjson.h.

Referenced by GenericReader< UTF8< char >, UTF8< char >, CrtAllocator >::IterativeParseNext(), MemoryPoolAllocator< BaseAllocator >::Malloc(), and GenericReader< UTF8< char >, UTF8< char >, CrtAllocator >::Parse().

◆ RAPIDJSON_USE_MEMBERSMAP

#define RAPIDJSON_USE_MEMBERSMAP

Enable RapidJSON support for object members handling in a std::multimap.

By defining this preprocessor symbol to 1, rapidjson::GenericValue object members are stored in a std::multimap for faster lookup and deletion times, a trade off with a slightly slower insertion time and a small object allocat(or)ed memory overhead.

Definition at line 181 of file rapidjson.h.

Referenced by GenericValue< Encoding, Allocator >::~GenericValue().

◆ RAPIDJSON_VALIDATE_DEFAULT_FLAGS

#define RAPIDJSON_VALIDATE_DEFAULT_FLAGS   kValidateNoFlags

User-defined kValidateDefaultFlags definition.

User can define this as any ValidateFlag combinations.

Definition at line 175 of file schema.h.

◆ RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY

#define RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY   16

User defined kDefaultArrayCapacity value.

User can define this as any natural number.

Definition at line 111 of file document.h.

◆ RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY

#define RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY   16

User defined kDefaultObjectCapacity value.

User can define this as any natural number.

Definition at line 100 of file document.h.

◆ RAPIDJSON_VERSION_STRING

#define RAPIDJSON_VERSION_STRING   RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION)

Version of RapidJSON in "<major>.<minor>.<patch>" string format.

Definition at line 79 of file rapidjson.h.