All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rapidjson.h File Reference

common definitions and configuration More...

#include <cstdlib>
#include <cstring>
#include <stdint.h>
#include <inttypes.h>
#include <cassert>
#include "allocators.h"
#include "encodings.h"

Go to the source code of this file.

Classes

struct  rapidjson::StreamTraits< Stream >
 Provides additional information for stream. More...
 
struct  rapidjson::GenericStringStream< Encoding >
 Read-only string stream. More...
 
struct  rapidjson::StreamTraits< GenericStringStream< Encoding > >
 
struct  rapidjson::GenericInsituStringStream< Encoding >
 A read-write string stream. More...
 
struct  rapidjson::StreamTraits< GenericInsituStringStream< Encoding > >
 

Namespaces

namespace  rapidjson
 main RapidJSON namespace
 

Macros

#define __STDC_CONSTANT_MACROS   1
 
#define RAPIDJSON_FORCEINLINE
 
#define RAPIDJSON_LITTLEENDIAN   0
 Little endian machine.
 
#define RAPIDJSON_BIGENDIAN   1
 Big endian machine.
 
#define RAPIDJSON_ALIGN(x)   ((x + 3u) & ~3u)
 Endianness of the machine. More...
 
#define RAPIDJSON_ASSERT(x)   assert(x)
 Assertion. More...
 
#define RAPIDJSON_JOIN(X, Y)   RAPIDJSON_DO_JOIN(X, Y)
 
#define RAPIDJSON_DO_JOIN(X, Y)   RAPIDJSON_DO_JOIN2(X, Y)
 
#define RAPIDJSON_DO_JOIN2(X, Y)   X##Y
 
#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
 
#define RAPIDJSON_STATIC_ASSERT(x)
 (internal) macro to check for conditions at compile-time More...
 
#define RAPIDJSON_MULTILINEMACRO_BEGIN   do {
 
#define RAPIDJSON_MULTILINEMACRO_END   } while((void)0, 0)
 
#define RAPIDJSON_VERSION_CODE(x, y, z)   (((x)*100000) + ((y)*100) + (z))
 
#define RAPIDJSON_STRINGIFY(x)   RAPIDJSON_DO_STRINGIFY(x)
 
#define RAPIDJSON_DO_STRINGIFY(x)   #x
 
#define RAPIDJSON_DIAG_OFF(x)   /* ignored */
 
#define RAPIDJSON_DIAG_PUSH   /* ignored */
 
#define RAPIDJSON_DIAG_POP   /* ignored */
 

Typedefs

typedef unsigned rapidjson::SizeType
 Use 32-bit array/string indices even for 64-bit platform, instead of using size_t. More...
 
typedef GenericStringStream
< UTF8<> > 
rapidjson::StringStream
 String stream with UTF8 encoding.
 
typedef
GenericInsituStringStream
< UTF8<> > 
rapidjson::InsituStringStream
 Insitu string stream with UTF8 encoding.
 

Enumerations

enum  rapidjson::Type {
  rapidjson::kNullType = 0, rapidjson::kFalseType = 1, rapidjson::kTrueType = 2, rapidjson::kObjectType = 3,
  rapidjson::kArrayType = 4, rapidjson::kStringType = 5, rapidjson::kNumberType = 6
}
 Type of JSON value. More...
 

Functions

template<typename Stream , typename Ch >
void rapidjson::PutN (Stream &stream, Ch c, size_t n)
 Put N copies of a character to a stream.
 

Detailed Description

common definitions and configuration

Todo:
Complete Doxygen documentation for configure macros.

Macro Definition Documentation

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

Endianness of the machine.

GCC 4.6 provided macro for detecting endianness of the target machine. But other compilers may not have this. User can define RAPIDJSON_ENDIAN to either RAPIDJSON_LITTLEENDIAN or RAPIDJSON_BIGENDIAN.

Implemented with reference to https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hppData alignment of the machine.

Some machine requires strict data alignment. Currently the default uses 4 bytes alignment. User can customize this.

#define RAPIDJSON_ASSERT (   x)    assert(x)

Assertion.

By default, rapidjson uses C assert() for assertion. User can override it by defining RAPIDJSON_ASSERT(x) macro.

#define RAPIDJSON_STATIC_ASSERT (   x)

(internal) macro to check for conditions at compile-time

Parameters
xcompile-time condition