cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GenericValue< Encoding, Allocator > Class Template Reference

Represents a JSON value. Use Value for UTF8 encoding and default allocator. More...

#include <document.h>

Inheritance diagram for GenericValue< Encoding, Allocator >:
GenericDocument< Encoding, Allocator >

Classes

struct  Member
 Name-value pair in an object. More...
 

Public Types

typedef Encoding EncodingType
 Encoding type from template parameter. More...
 
typedef Allocator AllocatorType
 Allocator type from template parameter. More...
 
typedef Encoding::Ch Ch
 Character type derived from Encoding. More...
 
typedef MemberMemberIterator
 Member iterator for iterating in object. More...
 
typedef const MemberConstMemberIterator
 Constant member iterator for iterating in object. More...
 
typedef GenericValueValueIterator
 Value iterator for iterating in array. More...
 
typedef const GenericValueConstValueIterator
 Constant value iterator for iterating in array. More...
 

Public Member Functions

template<typename Handler >
const GenericValueAccept (Handler &handler) const
 Generate events of this value to a Handler. More...
 
Assignment operators
GenericValueoperator= (GenericValue &rhs)
 Assignment with move semantics. More...
 
local operator= ( local rhs)
 Assignment with move semantics. More...
 
template<typename T >
GenericValueoperator= (T value)
 Assignment with primitive types. More...
 
template<typename T >
local operator= ( local value)
 Assignment with primitive types. More...
 
Type
Type GetType () const
bool IsNull () const
bool IsFalse () const
bool IsTrue () const
bool IsBool () const
bool IsObject () const
bool IsArray () const
bool IsNumber () const
bool IsInt () const
bool IsUint () const
bool IsInt64 () const
bool IsUint64 () const
bool IsDouble () const
bool IsString () const
Null
GenericValueSetNull ()
Bool
bool GetBool () const
GenericValueSetBool (bool b)
var SetBool ( var b)
local SetBool ( local b)
Object
GenericValueSetObject ()
 Set this value as an empty object. More...
 
GenericValueoperator[] (const Ch *name)
 Get the value associated with the object's name. More...
 
var operator[] ( var name)
 Get the value associated with the object's name. More...
 
local operator[] ( local name)
 Get the value associated with the object's name. More...
 
const GenericValueoperator[] (const Ch *name) const
ConstMemberIterator MemberonBegin () const
 Member iterators. More...
 
ConstMemberIterator MemberonEnd () const
MemberIterator MemberonBegin ()
MemberIterator MemberonEnd ()
bool HasMember (const Ch *name) const
 Check whether a member exists in the object. More...
 
local HasMember ( local name)
 Check whether a member exists in the object. More...
 
GenericValueAddMember (GenericValue &name, GenericValue &value, Allocator &allocator)
 Add a member (name-value pair) to the object. More...
 
local AddMember ( local name, local value, local allocator)
 Add a member (name-value pair) to the object. More...
 
GenericValueAddMember (const Ch *name, Allocator &nameAllocator, GenericValue &value, Allocator &allocator)
var AddMember ( var name, var nameAllocator, var value, var allocator)
local AddMember ( local name, local nameAllocator, local value, local allocator)
GenericValueAddMember (const Ch *name, GenericValue &value, Allocator &allocator)
template<typename T >
GenericValueAddMember (const Ch *name, T value, Allocator &allocator)
template<typename T >
local AddMember ( local name, local value, local allocator)
bool RemoveMember (const Ch *name)
 Remove a member in object by its name. More...
 
Array
GenericValueSetArray ()
 Set this value as an empty array. More...
 
SizeType Size () const
 Get the number of elements in array. More...
 
SizeType Capacity () const
 Get the capacity of array. More...
 
bool Empty () const
 Check whether the array is empty. More...
 
void Clear ()
 Remove all elements in the array. More...
 
GenericValueoperator[] (SizeType index)
 Get an element from array by index. More...
 
local operator[] ( local index)
 Get an element from array by index. More...
 
const GenericValueoperator[] (SizeType index) const
ValueIterator onBegin ()
 Element iterator. More...
 
ValueIterator onEnd ()
var onEnd ()
local onEnd ()
ConstValueIterator onBegin () const
ConstValueIterator onEnd () const
GenericValueReserve (SizeType newCapacity, Allocator &allocator)
 Request the array to have enough capacity to store elements. More...
 
GenericValuePushBack (GenericValue &value, Allocator &allocator)
 Append a value at the end of the array. More...
 
local PushBack ( local value, local allocator)
 Append a value at the end of the array. More...
 
template<typename T >
GenericValuePushBack (T value, Allocator &allocator)
template<typename T >
var PushBack ( var value, var allocator)
template<typename T >
local PushBack ( local value, local allocator)
GenericValuePopBack ()
 Remove the last element in the array. More...
 
Number
int GetInt () const
unsigned GetUint () const
int64_t GetInt64 () const
uint64_t GetUint64 () const
double GetDouble () const
GenericValueSetInt (int i)
var SetInt ( var i)
local SetInt ( local i)
GenericValueSetUint (unsigned u)
var SetUint ( var u)
local SetUint ( local u)
GenericValueSetInt64 (int64_t i64)
var SetInt64 ( var i64)
local SetInt64 ( local i64)
GenericValueSetUint64 (uint64_t u64)
GenericValueSetDouble (double d)
String
const ChGetString () const
SizeType GetStringLength () const
 Get the length of string. More...
 
local GetStringLength ()
 Get the length of string. More...
 
GenericValueSetString (const Ch *s, SizeType length)
 Set this value as a string without copying source string. More...
 
local SetString ( local s, local length)
 Set this value as a string without copying source string. More...
 
GenericValueSetString (const Ch *s)
 Set this value as a string without copying source string. More...
 
GenericValueSetString (const Ch *s, SizeType length, Allocator &allocator)
 Set this value as a string by copying from source string. More...
 
local SetString ( local s, local length, local allocator)
 Set this value as a string by copying from source string. More...
 
GenericValueSetString (const Ch *s, Allocator &allocator)
 Set this value as a string by copying from source string. More...
 

Friends

template<typename , typename >
class GenericDocument

Constructors and destructor.

 GenericValue ()
 Default constructor creates a null value. More...
 
 GenericValue (Type type)
 Constructor with JSON value type. More...
 
 GenericValue (bool b)
 Constructor for boolean value. More...
 
 GenericValue (int i)
 Constructor for int value. More...
 
 GenericValue (unsigned u)
 Constructor for unsigned value. More...
 
 GenericValue (int64_t i64)
 Constructor for int64_t value. More...
 
 GenericValue (uint64_t u64)
 Constructor for uint64_t value. More...
 
 GenericValue (double d)
 Constructor for double value. More...
 
 GenericValue (const Ch *s, SizeType length)
 Constructor for constant string (i.e. do not make a copy of string) More...
 
 GenericValue (const Ch *s)
 Constructor for constant string (i.e. do not make a copy of string) More...
 
 GenericValue (const Ch *s, SizeType length, Allocator &allocator)
 Constructor for copy-string (i.e. do make a copy of string) More...
 
 GenericValue (const Ch *s, Allocator &allocator)
 Constructor for copy-string (i.e. do make a copy of string) More...
 
 ~GenericValue ()
 Destructor. More...
 

Detailed Description

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
class rapidjson::GenericValue< Encoding, Allocator >

Represents a JSON value. Use Value for UTF8 encoding and default allocator.

A JSON value can be one of 7 types. This class is a variant type supporting these types.

Use the Value if UTF8 and default allocator

Template Parameters
EncodingEncoding of the value. (Even non-string values need to have the same encoding in a document)
AllocatorAllocator type for allocating memory of object, array and string.

Member Typedef Documentation

Allocator type from template parameter.

Allocator type from template parameter.

Allocator type from template parameter.

typedef Encoding::Ch Ch

Character type derived from Encoding.

var Ch

Character type derived from Encoding.

local Ch

Character type derived from Encoding.

typedef const Member*
ConstMemberIterator

Constant member iterator for iterating in object.

Constant member iterator for iterating in object.

Constant member iterator for iterating in object.

Constant value iterator for iterating in array.

Constant value iterator for iterating in array.

Constant value iterator for iterating in array.

Encoding type from template parameter.

Encoding type from template parameter.

local EncodingType

Encoding type from template parameter.

Member iterator for iterating in object.

Member iterator for iterating in object.

Member iterator for iterating in object.

Value iterator for iterating in array.

Value iterator for iterating in array.

Value iterator for iterating in array.

Constructor & Destructor Documentation

GenericValue ( )
inline

Default constructor creates a null value.

var GenericValue ( )
inline

Default constructor creates a null value.

local GenericValue ( )
inline

Default constructor creates a null value.

GenericValue ( Type  type)
inline

Constructor with JSON value type.

This creates a Value of specified type with default content.

Parameters
typeType of the value.
Note
Default content for number is zero.
var GenericValue ( var  type)
inline

Constructor with JSON value type.

This creates a Value of specified type with default content.

Parameters
typeType of the value.
Note
Default content for number is zero.
local GenericValue ( local  type)
inline

Constructor with JSON value type.

This creates a Value of specified type with default content.

Parameters
typeType of the value.
Note
Default content for number is zero.
GenericValue ( bool  b)
inline

Constructor for boolean value.

var GenericValue ( var  b)
inline

Constructor for boolean value.

local GenericValue ( local  b)
inline

Constructor for boolean value.

GenericValue ( int  i)
inline

Constructor for int value.

var GenericValue ( var  i)
inline

Constructor for int value.

local GenericValue ( local  i)
inline

Constructor for int value.

GenericValue ( unsigned  u)
inline

Constructor for unsigned value.

var GenericValue ( var  u)
inline

Constructor for unsigned value.

local GenericValue ( local  u)
inline

Constructor for unsigned value.

GenericValue ( int64_t  i64)
inline

Constructor for int64_t value.

var GenericValue ( var  i64)
inline

Constructor for int64_t value.

local GenericValue ( local  i64)
inline

Constructor for int64_t value.

GenericValue ( uint64_t  u64)
inline

Constructor for uint64_t value.

var GenericValue ( var  u64)
inline

Constructor for uint64_t value.

local GenericValue ( local  u64)
inline

Constructor for uint64_t value.

GenericValue ( double  d)
inline

Constructor for double value.

var GenericValue ( var  d)
inline

Constructor for double value.

local GenericValue ( local  d)
inline

Constructor for double value.

GenericValue ( const Ch s,
SizeType  length 
)
inline

Constructor for constant string (i.e. do not make a copy of string)

var GenericValue ( var  s,
var  length 
)
inline

Constructor for constant string (i.e. do not make a copy of string)

local GenericValue ( local  s,
local  length 
)
inline

Constructor for constant string (i.e. do not make a copy of string)

GenericValue ( const Ch s)
inline

Constructor for constant string (i.e. do not make a copy of string)

var GenericValue ( var  s)
inline

Constructor for constant string (i.e. do not make a copy of string)

local GenericValue ( local  s)
inline

Constructor for constant string (i.e. do not make a copy of string)

GenericValue ( const Ch s,
SizeType  length,
Allocator allocator 
)
inline

Constructor for copy-string (i.e. do make a copy of string)

var GenericValue ( var  s,
var  length,
var  allocator 
)
inline

Constructor for copy-string (i.e. do make a copy of string)

local GenericValue ( local  s,
local  length,
local  allocator 
)
inline

Constructor for copy-string (i.e. do make a copy of string)

GenericValue ( const Ch s,
Allocator allocator 
)
inline

Constructor for copy-string (i.e. do make a copy of string)

var GenericValue ( var  s,
var  allocator 
)
inline

Constructor for copy-string (i.e. do make a copy of string)

local GenericValue ( local  s,
local  allocator 
)
inline

Constructor for copy-string (i.e. do make a copy of string)

~GenericValue ( )
inline

Destructor.

Need to destruct elements of array, members of object, or copy-string.

var ~GenericValue ( )
inline

Destructor.

Need to destruct elements of array, members of object, or copy-string.

local ~GenericValue ( )
inline

Destructor.

Need to destruct elements of array, members of object, or copy-string.

Member Function Documentation

const GenericValue& Accept ( Handler handler) const
inline

Generate events of this value to a Handler.

This function adopts the GoF visitor pattern. Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. It can also be used to deep clone this value via GenericDocument, which is also a Handler.

Template Parameters
Handlertype of handler.
Parameters
handlerAn object implementing concept Handler.
var Accept ( var  handler)
inline

Generate events of this value to a Handler.

This function adopts the GoF visitor pattern. Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. It can also be used to deep clone this value via GenericDocument, which is also a Handler.

Template Parameters
Handlertype of handler.
Parameters
handlerAn object implementing concept Handler.
local Accept ( local  handler)
inline

Generate events of this value to a Handler.

This function adopts the GoF visitor pattern. Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. It can also be used to deep clone this value via GenericDocument, which is also a Handler.

Template Parameters
Handlertype of handler.
Parameters
handlerAn object implementing concept Handler.
GenericValue& AddMember ( GenericValue< Encoding, Allocator > &  name,
GenericValue< Encoding, Allocator > &  value,
Allocator allocator 
)
inline

Add a member (name-value pair) to the object.

Parameters
nameA string value as name of member.
valueValue of any type.
allocatorAllocator for reallocating memory.
Returns
The value itself for fluent API.
Note
The ownership of name and value will be transfered to this object if success.
var AddMember ( var  name,
var  value,
var  allocator 
)
inline

Add a member (name-value pair) to the object.

Parameters
nameA string value as name of member.
valueValue of any type.
allocatorAllocator for reallocating memory.
Returns
The value itself for fluent API.
Note
The ownership of name and value will be transfered to this object if success.
local AddMember ( local  name,
local  value,
local  allocator 
)
inline

Add a member (name-value pair) to the object.

Parameters
nameA string value as name of member.
valueValue of any type.
allocatorAllocator for reallocating memory.
Returns
The value itself for fluent API.
Note
The ownership of name and value will be transfered to this object if success.
GenericValue& AddMember ( const Ch name,
Allocator nameAllocator,
GenericValue< Encoding, Allocator > &  value,
Allocator allocator 
)
inline
var AddMember ( var  name,
var  nameAllocator,
var  value,
var  allocator 
)
inline
local AddMember ( local  name,
local  nameAllocator,
local  value,
local  allocator 
)
inline
GenericValue& AddMember ( const Ch name,
GenericValue< Encoding, Allocator > &  value,
Allocator allocator 
)
inline
var AddMember ( var  name,
var  value,
var  allocator 
)
inline
local AddMember ( local  name,
local  value,
local  allocator 
)
inline
GenericValue& AddMember ( const Ch name,
value,
Allocator allocator 
)
inline
var AddMember ( var  name,
var  value,
var  allocator 
)
inline
local AddMember ( local  name,
local  value,
local  allocator 
)
inline
SizeType Capacity ( ) const
inline

Get the capacity of array.

var Capacity ( )
inline

Get the capacity of array.

local Capacity ( )
inline

Get the capacity of array.

void Clear ( )
inline

Remove all elements in the array.

This function do not deallocate memory in the array, i.e. the capacity is unchanged.

var Clear ( )
inline

Remove all elements in the array.

This function do not deallocate memory in the array, i.e. the capacity is unchanged.

local Clear ( )
inline

Remove all elements in the array.

This function do not deallocate memory in the array, i.e. the capacity is unchanged.

bool Empty ( ) const
inline

Check whether the array is empty.

var Empty ( )
inline

Check whether the array is empty.

local Empty ( )
inline

Check whether the array is empty.

bool GetBool ( ) const
inline
var GetBool ( )
inline
local GetBool ( )
inline
double GetDouble ( ) const
inline
var GetDouble ( )
inline
local GetDouble ( )
inline
int GetInt ( ) const
inline
var GetInt ( )
inline
local GetInt ( )
inline
int64_t GetInt64 ( ) const
inline
var GetInt64 ( )
inline
local GetInt64 ( )
inline
const Ch* GetString ( ) const
inline
var GetString ( )
inline
local GetString ( )
inline
SizeType GetStringLength ( ) const
inline

Get the length of string.

Since rapidjson permits "\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().

var GetStringLength ( )
inline

Get the length of string.

Since rapidjson permits "\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().

local GetStringLength ( )
inline

Get the length of string.

Since rapidjson permits "\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().

Type GetType ( ) const
inline
var GetType ( )
inline
local GetType ( )
inline
unsigned GetUint ( ) const
inline
var GetUint ( )
inline
local GetUint ( )
inline
uint64_t GetUint64 ( ) const
inline
var GetUint64 ( )
inline
local GetUint64 ( )
inline
bool HasMember ( const Ch name) const
inline

Check whether a member exists in the object.

var HasMember ( var  name)
inline

Check whether a member exists in the object.

local HasMember ( local  name)
inline

Check whether a member exists in the object.

bool IsArray ( ) const
inline
var IsArray ( )
inline
local IsArray ( )
inline
bool IsBool ( ) const
inline
var IsBool ( )
inline
local IsBool ( )
inline
bool IsDouble ( ) const
inline
var IsDouble ( )
inline
local IsDouble ( )
inline
bool IsFalse ( ) const
inline
var IsFalse ( )
inline
local IsFalse ( )
inline
bool IsInt ( ) const
inline
var IsInt ( )
inline
local IsInt ( )
inline
bool IsInt64 ( ) const
inline
var IsInt64 ( )
inline
local IsInt64 ( )
inline
bool IsNull ( ) const
inline
var IsNull ( )
inline
local IsNull ( )
inline
bool IsNumber ( ) const
inline
var IsNumber ( )
inline
local IsNumber ( )
inline
bool IsObject ( ) const
inline
var IsObject ( )
inline
local IsObject ( )
inline
bool IsString ( ) const
inline
var IsString ( )
inline
local IsString ( )
inline
bool IsTrue ( ) const
inline
var IsTrue ( )
inline
local IsTrue ( )
inline
bool IsUint ( ) const
inline
var IsUint ( )
inline
local IsUint ( )
inline
bool IsUint64 ( ) const
inline
var IsUint64 ( )
inline
local IsUint64 ( )
inline
ConstMemberIterator MemberonBegin ( ) const
inline

Member iterators.

var MemberonBegin ( )
inline

Member iterators.

local MemberonBegin ( )
inline

Member iterators.

MemberIterator MemberonBegin ( )
inline
var MemberonBegin ( )
inline
local MemberonBegin ( )
inline
ConstMemberIterator MemberonEnd ( ) const
inline
var MemberonEnd ( )
inline
local MemberonEnd ( )
inline
MemberIterator MemberonEnd ( )
inline
var MemberonEnd ( )
inline
local MemberonEnd ( )
inline
ValueIterator onBegin ( )
inline

Element iterator.

var onBegin ( )
inline

Element iterator.

local onBegin ( )
inline

Element iterator.

ConstValueIterator onBegin ( ) const
inline
var onBegin ( )
inline
local onBegin ( )
inline
ValueIterator onEnd ( )
inline
var onEnd ( )
inline
local onEnd ( )
inline
ConstValueIterator onEnd ( ) const
inline
var onEnd ( )
inline
local onEnd ( )
inline
GenericValue& operator= ( GenericValue< Encoding, Allocator > &  rhs)
inline

Assignment with move semantics.

Parameters
rhsSource of the assignment. It will become a null value after assignment.
GenericValue& operator= ( var  rhs)
inline

Assignment with move semantics.

Parameters
rhsSource of the assignment. It will become a null value after assignment.
GenericValue& operator= ( local  rhs)
inline

Assignment with move semantics.

Parameters
rhsSource of the assignment. It will become a null value after assignment.
GenericValue& operator= ( value)
inline

Assignment with primitive types.

Template Parameters
TEither Type, int, unsigned, int64_t, uint64_t, const Ch*
Parameters
valueThe value to be assigned.
GenericValue& operator= ( var  value)
inline

Assignment with primitive types.

Template Parameters
TEither Type, int, unsigned, int64_t, uint64_t, const Ch*
Parameters
valueThe value to be assigned.
GenericValue& operator= ( local  value)
inline

Assignment with primitive types.

Template Parameters
TEither Type, int, unsigned, int64_t, uint64_t, const Ch*
Parameters
valueThe value to be assigned.
GenericValue& operator[] ( const Ch name)
inline

Get the value associated with the object's name.

GenericValue& operator[] ( var  name)
inline

Get the value associated with the object's name.

GenericValue& operator[] ( local  name)
inline

Get the value associated with the object's name.

const GenericValue& operator[] ( const Ch name) const
inline
const GenericValue& operator[] ( var  name)
inline
const GenericValue& operator[] ( local  name)
inline
GenericValue& operator[] ( SizeType  index)
inline

Get an element from array by index.

Parameters
indexZero-based index of element.
Note
a.PushBack(123);
int x = a[0].GetInt(); // Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.
int y = a[SizeType(0)].GetInt(); // Cast to SizeType will work.
int z = a[0u].GetInt(); // This works too.
GenericValue& operator[] ( var  index)
inline

Get an element from array by index.

Parameters
indexZero-based index of element.
Note
a.PushBack(123);
int x = a[0].GetInt(); // Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.
int y = a[SizeType(0)].GetInt(); // Cast to SizeType will work.
int z = a[0u].GetInt(); // This works too.
GenericValue& operator[] ( local  index)
inline

Get an element from array by index.

Parameters
indexZero-based index of element.
Note
a.PushBack(123);
int x = a[0].GetInt(); // Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.
int y = a[SizeType(0)].GetInt(); // Cast to SizeType will work.
int z = a[0u].GetInt(); // This works too.
const GenericValue& operator[] ( SizeType  index) const
inline
const GenericValue& operator[] ( var  index)
inline
const GenericValue& operator[] ( local  index)
inline
GenericValue& PopBack ( )
inline

Remove the last element in the array.

var PopBack ( )
inline

Remove the last element in the array.

local PopBack ( )
inline

Remove the last element in the array.

GenericValue& PushBack ( GenericValue< Encoding, Allocator > &  value,
Allocator allocator 
)
inline

Append a value at the end of the array.

Parameters
valueThe value to be appended.
allocatorThe allocator for allocating memory. It must be the same one use previously.
Returns
The value itself for fluent API.
Note
The ownership of the value will be transfered to this object if success.
If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
var PushBack ( var  value,
var  allocator 
)
inline

Append a value at the end of the array.

Parameters
valueThe value to be appended.
allocatorThe allocator for allocating memory. It must be the same one use previously.
Returns
The value itself for fluent API.
Note
The ownership of the value will be transfered to this object if success.
If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
local PushBack ( local  value,
local  allocator 
)
inline

Append a value at the end of the array.

Parameters
valueThe value to be appended.
allocatorThe allocator for allocating memory. It must be the same one use previously.
Returns
The value itself for fluent API.
Note
The ownership of the value will be transfered to this object if success.
If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
GenericValue& PushBack ( value,
Allocator allocator 
)
inline
var PushBack ( var  value,
var  allocator 
)
inline
local PushBack ( local  value,
local  allocator 
)
inline
bool RemoveMember ( const Ch name)
inline

Remove a member in object by its name.

Parameters
nameName of member to be removed.
Returns
Whether the member existed.
Note
Removing member is implemented by moving the last member. So the ordering of members is changed.
var RemoveMember ( var  name)
inline

Remove a member in object by its name.

Parameters
nameName of member to be removed.
Returns
Whether the member existed.
Note
Removing member is implemented by moving the last member. So the ordering of members is changed.
local RemoveMember ( local  name)
inline

Remove a member in object by its name.

Parameters
nameName of member to be removed.
Returns
Whether the member existed.
Note
Removing member is implemented by moving the last member. So the ordering of members is changed.
GenericValue& Reserve ( SizeType  newCapacity,
Allocator allocator 
)
inline

Request the array to have enough capacity to store elements.

Parameters
newCapacityThe capacity that the array at least need to have.
allocatorThe allocator for allocating memory. It must be the same one use previously.
Returns
The value itself for fluent API.
var Reserve ( var  newCapacity,
var  allocator 
)
inline

Request the array to have enough capacity to store elements.

Parameters
newCapacityThe capacity that the array at least need to have.
allocatorThe allocator for allocating memory. It must be the same one use previously.
Returns
The value itself for fluent API.
local Reserve ( local  newCapacity,
local  allocator 
)
inline

Request the array to have enough capacity to store elements.

Parameters
newCapacityThe capacity that the array at least need to have.
allocatorThe allocator for allocating memory. It must be the same one use previously.
Returns
The value itself for fluent API.
GenericValue& SetArray ( )
inline

Set this value as an empty array.

var SetArray ( )
inline

Set this value as an empty array.

local SetArray ( )
inline

Set this value as an empty array.

GenericValue& SetBool ( bool  b)
inline
var SetBool ( var  b)
inline
local SetBool ( local  b)
inline
GenericValue& SetDouble ( double  d)
inline
var SetDouble ( var  d)
inline
local SetDouble ( local  d)
inline
GenericValue& SetInt ( int  i)
inline
var SetInt ( var  i)
inline
local SetInt ( local  i)
inline
GenericValue& SetInt64 ( int64_t  i64)
inline
var SetInt64 ( var  i64)
inline
local SetInt64 ( local  i64)
inline
GenericValue& SetNull ( )
inline
var SetNull ( )
inline
local SetNull ( )
inline
GenericValue& SetObject ( )
inline

Set this value as an empty object.

var SetObject ( )
inline

Set this value as an empty object.

local SetObject ( )
inline

Set this value as an empty object.

GenericValue& SetString ( const Ch s,
SizeType  length 
)
inline

Set this value as a string without copying source string.

This version has better performance with supplied length, and also support string containing null character.

Parameters
ssource string pointer.
lengthThe length of source string, excluding the trailing null terminator.
Returns
The value itself for fluent API.
var SetString ( var  s,
var  length 
)
inline

Set this value as a string without copying source string.

This version has better performance with supplied length, and also support string containing null character.

Parameters
ssource string pointer.
lengthThe length of source string, excluding the trailing null terminator.
Returns
The value itself for fluent API.
local SetString ( local  s,
local  length 
)
inline

Set this value as a string without copying source string.

This version has better performance with supplied length, and also support string containing null character.

Parameters
ssource string pointer.
lengthThe length of source string, excluding the trailing null terminator.
Returns
The value itself for fluent API.
GenericValue& SetString ( const Ch s)
inline

Set this value as a string without copying source string.

Parameters
ssource string pointer.
Returns
The value itself for fluent API.
var SetString ( var  s)
inline

Set this value as a string without copying source string.

Parameters
ssource string pointer.
Returns
The value itself for fluent API.
local SetString ( local  s)
inline

Set this value as a string without copying source string.

Parameters
ssource string pointer.
Returns
The value itself for fluent API.
GenericValue& SetString ( const Ch s,
SizeType  length,
Allocator allocator 
)
inline

Set this value as a string by copying from source string.

This version has better performance with supplied length, and also support string containing null character.

Parameters
ssource string.
lengthThe length of source string, excluding the trailing null terminator.
allocatorAllocator for allocating copied buffer. Commonly use document.GetAllocator().
Returns
The value itself for fluent API.
var SetString ( var  s,
var  length,
var  allocator 
)
inline

Set this value as a string by copying from source string.

This version has better performance with supplied length, and also support string containing null character.

Parameters
ssource string.
lengthThe length of source string, excluding the trailing null terminator.
allocatorAllocator for allocating copied buffer. Commonly use document.GetAllocator().
Returns
The value itself for fluent API.
local SetString ( local  s,
local  length,
local  allocator 
)
inline

Set this value as a string by copying from source string.

This version has better performance with supplied length, and also support string containing null character.

Parameters
ssource string.
lengthThe length of source string, excluding the trailing null terminator.
allocatorAllocator for allocating copied buffer. Commonly use document.GetAllocator().
Returns
The value itself for fluent API.
GenericValue& SetString ( const Ch s,
Allocator allocator 
)
inline

Set this value as a string by copying from source string.

Parameters
ssource string.
allocatorAllocator for allocating copied buffer. Commonly use document.GetAllocator().
Returns
The value itself for fluent API.
var SetString ( var  s,
var  allocator 
)
inline

Set this value as a string by copying from source string.

Parameters
ssource string.
allocatorAllocator for allocating copied buffer. Commonly use document.GetAllocator().
Returns
The value itself for fluent API.
local SetString ( local  s,
local  allocator 
)
inline

Set this value as a string by copying from source string.

Parameters
ssource string.
allocatorAllocator for allocating copied buffer. Commonly use document.GetAllocator().
Returns
The value itself for fluent API.
GenericValue& SetUint ( unsigned  u)
inline
var SetUint ( var  u)
inline
local SetUint ( local  u)
inline
GenericValue& SetUint64 ( uint64_t  u64)
inline
var SetUint64 ( var  u64)
inline
local SetUint64 ( local  u64)
inline
SizeType Size ( ) const
inline

Get the number of elements in array.

var Size ( )
inline

Get the number of elements in array.

local Size ( )
inline

Get the number of elements in array.

Friends And Related Function Documentation

friend class GenericDocument
friend
var GenericDocument
friend
local GenericDocument
friend

The documentation for this class was generated from the following file: