Configuration macros for library features. Plus de détails...
Macros | |
#define | RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024) |
User-defined kDefaultChunkCapacity definition. | |
#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_ALIGN(x) (((x) + static_cast<size_t>(7u)) & ~static_cast<size_t>(7u)) |
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) assert(x) |
Assertion. | |
#define | RAPIDJSON_LIKELY(x) (x) |
Compiler branching hint for expression with high probability to be true. | |
#define | RAPIDJSON_UNLIKELY(x) (x) |
Compiler branching hint for expression with low probability to be true. | |
#define | RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x) |
Assertion (in non-throwing contexts). | |
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.
#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.
Définition à la ligne 308 du fichier rapidjson.h.
#define RAPIDJSON_ALIGN | ( | x | ) | (((x) + static_cast<size_t>(7u)) & ~static_cast<size_t>(7u)) |
Data alignment of the machine.
x | pointer to align |
Some machines require strict data alignment. The default is 8 bytes. User can customize by defining the RAPIDJSON_ALIGN function macro.
Définition à la ligne 277 du fichier rapidjson.h.
#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.
Définition à la ligne 65 du fichier allocators.h.
#define RAPIDJSON_ASSERT | ( | x | ) | assert(x) |
Assertion.
By default, rapidjson uses C assert()
for internal assertions. User can override it by defining RAPIDJSON_ASSERT(x) macro.
Définition à la ligne 407 du fichier rapidjson.h.
#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.
Définition à la ligne 135 du fichier rapidjson.h.
#define RAPIDJSON_LIKELY | ( | x | ) | (x) |
Compiler branching hint for expression with high probability to be true.
x | Boolean expression likely to be true. |
Définition à la ligne 464 du fichier rapidjson.h.
#define RAPIDJSON_MAJOR_VERSION 1 |
Major version of RapidJSON in integer.
Définition à la ligne 76 du fichier rapidjson.h.
#define RAPIDJSON_MINOR_VERSION 1 |
Minor version of RapidJSON in integer.
Définition à la ligne 77 du fichier rapidjson.h.
#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:
Définition à la ligne 119 du fichier rapidjson.h.
#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE { |
provide custom rapidjson namespace (opening expression)
Définition à la ligne 122 du fichier rapidjson.h.
#define RAPIDJSON_NAMESPACE_END } |
provide custom rapidjson namespace (closing expression)
Définition à la ligne 125 du fichier rapidjson.h.
#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:
Définition à la ligne 22 du fichier JSONWriter.cc.
#define RAPIDJSON_NOEXCEPT_ASSERT | ( | x | ) | RAPIDJSON_ASSERT(x) |
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.
Définition à la ligne 639 du fichier rapidjson.h.
#define RAPIDJSON_PATCH_VERSION 0 |
Patch version of RapidJSON in integer.
Définition à la ligne 78 du fichier rapidjson.h.
#define RAPIDJSON_UNLIKELY | ( | x | ) | (x) |
Compiler branching hint for expression with low probability to be true.
x | Boolean expression unlikely to be true. |
Définition à la ligne 477 du fichier rapidjson.h.
#define RAPIDJSON_VERSION_STRING RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION) |
Version of RapidJSON in "<major>.<minor>.<patch>" string format.
Définition à la ligne 79 du fichier rapidjson.h.