TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RapidJSON configuration

Configuration macros for library features. More...

Macros

#define RAPIDJSON_HAS_STDSTRING
 Enable RapidJSON support for std::string. More...
 
#define RAPIDJSON_MAJOR_VERSION   1
 Major version of RapidJSON in integer. More...
 
#define RAPIDJSON_MINOR_VERSION   0
 Minor version of RapidJSON in integer. More...
 
#define RAPIDJSON_PATCH_VERSION   2
 Patch version of RapidJSON in integer. More...
 
#define RAPIDJSON_VERSION_STRING   RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION)
 Version of RapidJSON in "<major>.<minor>.<patch>" string format. More...
 
#define RAPIDJSON_NAMESPACE   rapidjson
 provide custom rapidjson namespace More...
 
#define RAPIDJSON_NAMESPACE_BEGIN   namespace RAPIDJSON_NAMESPACE {
 provide custom rapidjson namespace (opening expression) More...
 
#define RAPIDJSON_NAMESPACE_END   }
 provide custom rapidjson namespace (closing expression) More...
 
#define RAPIDJSON_ALIGN(x)   ((x + 3u) & ~3u)
 Data alignment of the machine. More...
 
#define RAPIDJSON_ASSERT(x)   assert(x)
 Assertion. More...
 

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 overriden 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

#define RAPIDJSON_ALIGN (   x)    ((x + 3u) & ~3u)

Data alignment of the machine.

Parameters
xpointer to align

Some machines require strict data alignment. Currently the default uses 4 bytes alignment. User can customize by defining the RAPIDJSON_ALIGN function macro.,

#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.

Note
Parsing errors are handled and can be customized by the RapidJSON error handling APIs.
#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.

#define RAPIDJSON_MAJOR_VERSION   1

Major version of RapidJSON in integer.

#define RAPIDJSON_MINOR_VERSION   0

Minor version of RapidJSON in integer.

#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:

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

provide custom rapidjson namespace (opening expression)

See also
RAPIDJSON_NAMESPACE
#define RAPIDJSON_NAMESPACE_END   }

provide custom rapidjson namespace (closing expression)

See also
RAPIDJSON_NAMESPACE
#define RAPIDJSON_PATCH_VERSION   2

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.