CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
rapidjson::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 rapidjson::GenericValue< Encoding, Allocator >:
rapidjson::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...
 
template<typename T >
GenericValueoperator= (T 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)
 
Object
GenericValueSetObject ()
 Set this value as an empty object. More...
 
GenericValueoperator[] (const Ch *name)
 Get the value associated with the object's name. More...
 
const GenericValueoperator[] (const Ch *name) const
 
ConstMemberIterator MemberBegin () const
 Member iterators. More...
 
ConstMemberIterator MemberEnd () const
 
MemberIterator MemberBegin ()
 
MemberIterator MemberEnd ()
 
bool HasMember (const Ch *name) const
 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...
 
GenericValueAddMember (const Ch *name, Allocator &nameAllocator, GenericValue &value, Allocator &allocator)
 
GenericValueAddMember (const Ch *name, GenericValue &value, Allocator &allocator)
 
template<typename T >
GenericValueAddMember (const Ch *name, T value, Allocator &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...
 
const GenericValueoperator[] (SizeType index) const
 
ValueIterator Begin ()
 Element iterator. More...
 
ValueIterator End ()
 
ConstValueIterator Begin () const
 
ConstValueIterator End () 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...
 
template<typename T >
GenericValuePushBack (T value, Allocator &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)
 
GenericValueSetUint (unsigned u)
 
GenericValueSetInt64 (int64_t i64)
 
GenericValueSetUint64 (uint64_t u64)
 
GenericValueSetDouble (double d)
 
String
const ChGetString () const
 
SizeType GetStringLength () const
 Get the length of string. More...
 
GenericValueSetString (const Ch *s, SizeType 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...
 
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.

Definition at line 30 of file document.h.

Member Typedef Documentation

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

Allocator type from template parameter.

Definition at line 39 of file document.h.

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

Character type derived from Encoding.

Definition at line 40 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
typedef const Member* rapidjson::GenericValue< Encoding, Allocator >::ConstMemberIterator

Constant member iterator for iterating in object.

Definition at line 42 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
typedef const GenericValue* rapidjson::GenericValue< Encoding, Allocator >::ConstValueIterator

Constant value iterator for iterating in array.

Definition at line 44 of file document.h.

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

Encoding type from template parameter.

Definition at line 38 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
typedef Member* rapidjson::GenericValue< Encoding, Allocator >::MemberIterator

Member iterator for iterating in object.

Definition at line 41 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
typedef GenericValue* rapidjson::GenericValue< Encoding, Allocator >::ValueIterator

Value iterator for iterating in array.

Definition at line 43 of file document.h.

Constructor & Destructor Documentation

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( )
inline

Default constructor creates a null value.

Definition at line 50 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 63 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( bool  b)
inline

Constructor for boolean value.

Definition at line 74 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( int  i)
inline

Constructor for int value.

Definition at line 77 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( unsigned  u)
inline

Constructor for unsigned value.

Definition at line 84 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( int64_t  i64)
inline

Constructor for int64_t value.

Definition at line 91 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( uint64_t  u64)
inline

Constructor for uint64_t value.

Definition at line 105 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( double  d)
inline

Constructor for double value.

Definition at line 116 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( const Ch s,
SizeType  length 
)
inline

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

Definition at line 119 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( const Ch s)
inline

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

Definition at line 127 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( const Ch s,
SizeType  length,
Allocator allocator 
)
inline

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

Definition at line 130 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::GenericValue ( const Ch s,
Allocator allocator 
)
inline

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

Definition at line 133 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericValue< Encoding, Allocator >::~GenericValue ( )
inline

Destructor.

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

Definition at line 138 of file document.h.

Member Function Documentation

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
template<typename Handler >
const GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 494 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 258 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::AddMember ( const Ch name,
Allocator nameAllocator,
GenericValue< Encoding, Allocator > &  value,
Allocator allocator 
)
inline

Definition at line 279 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::AddMember ( const Ch name,
GenericValue< Encoding, Allocator > &  value,
Allocator allocator 
)
inline

Definition at line 284 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::AddMember ( const Ch name,
value,
Allocator allocator 
)
inline

Definition at line 290 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
ValueIterator rapidjson::GenericValue< Encoding, Allocator >::Begin ( )
inline

Element iterator.

Definition at line 370 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
ConstValueIterator rapidjson::GenericValue< Encoding, Allocator >::Begin ( ) const
inline

Definition at line 372 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
SizeType rapidjson::GenericValue< Encoding, Allocator >::Capacity ( ) const
inline

Get the capacity of array.

Definition at line 336 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericValue< Encoding, Allocator >::Clear ( )
inline

Remove all elements in the array.

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

Definition at line 344 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::Empty ( ) const
inline

Check whether the array is empty.

Definition at line 339 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
ValueIterator rapidjson::GenericValue< Encoding, Allocator >::End ( )
inline

Definition at line 371 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
ConstValueIterator rapidjson::GenericValue< Encoding, Allocator >::End ( ) const
inline

Definition at line 373 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::GetBool ( ) const
inline

Definition at line 220 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
double rapidjson::GenericValue< Encoding, Allocator >::GetDouble ( ) const
inline

Definition at line 427 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
int rapidjson::GenericValue< Encoding, Allocator >::GetInt ( ) const
inline

Definition at line 422 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
int64_t rapidjson::GenericValue< Encoding, Allocator >::GetInt64 ( ) const
inline

Definition at line 424 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
const Ch* rapidjson::GenericValue< Encoding, Allocator >::GetString ( ) const
inline

Definition at line 447 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
SizeType rapidjson::GenericValue< Encoding, Allocator >::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().

Definition at line 452 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
Type rapidjson::GenericValue< Encoding, Allocator >::GetType ( ) const
inline

Definition at line 193 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
unsigned rapidjson::GenericValue< Encoding, Allocator >::GetUint ( ) const
inline

Definition at line 423 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
uint64_t rapidjson::GenericValue< Encoding, Allocator >::GetUint64 ( ) const
inline

Definition at line 425 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::HasMember ( const Ch name) const
inline

Check whether a member exists in the object.

Definition at line 249 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsArray ( ) const
inline

Definition at line 199 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsBool ( ) const
inline

Definition at line 197 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsDouble ( ) const
inline

Definition at line 205 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsFalse ( ) const
inline

Definition at line 195 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsInt ( ) const
inline

Definition at line 201 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsInt64 ( ) const
inline

Definition at line 203 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsNull ( ) const
inline

Definition at line 194 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsNumber ( ) const
inline

Definition at line 200 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsObject ( ) const
inline

Definition at line 198 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsString ( ) const
inline

Definition at line 206 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsTrue ( ) const
inline

Definition at line 196 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsUint ( ) const
inline

Definition at line 202 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::IsUint64 ( ) const
inline

Definition at line 204 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
ConstMemberIterator rapidjson::GenericValue< Encoding, Allocator >::MemberBegin ( ) const
inline

Member iterators.

Definition at line 243 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
MemberIterator rapidjson::GenericValue< Encoding, Allocator >::MemberBegin ( )
inline

Definition at line 245 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
ConstMemberIterator rapidjson::GenericValue< Encoding, Allocator >::MemberEnd ( ) const
inline

Definition at line 244 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
MemberIterator rapidjson::GenericValue< Encoding, Allocator >::MemberEnd ( )
inline

Definition at line 246 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::operator= ( GenericValue< Encoding, Allocator > &  rhs)
inline

Assignment with move semantics.

Parameters
rhsSource of the assignment. It will become a null value after assignment.

Definition at line 170 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 183 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::operator[] ( const Ch name)
inline

Get the value associated with the object's name.

Definition at line 232 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
const GenericValue& rapidjson::GenericValue< Encoding, Allocator >::operator[] ( const Ch name) const
inline

Definition at line 240 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 362 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
const GenericValue& rapidjson::GenericValue< Encoding, Allocator >::operator[] ( SizeType  index) const
inline

Definition at line 367 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::PopBack ( )
inline

Remove the last element in the array.

Definition at line 411 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 396 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::PushBack ( value,
Allocator allocator 
)
inline

Definition at line 405 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 301 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 380 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetArray ( )
inline

Set this value as an empty array.

Definition at line 330 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetBool ( bool  b)
inline

Definition at line 221 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetDouble ( double  d)
inline

Definition at line 440 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetInt ( int  i)
inline

Definition at line 436 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetInt64 ( int64_t  i64)
inline

Definition at line 438 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetNull ( )
inline

Definition at line 213 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetObject ( )
inline

Set this value as an empty object.

Definition at line 229 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 460 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 466 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 475 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::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.

Definition at line 482 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetUint ( unsigned  u)
inline

Definition at line 437 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
GenericValue& rapidjson::GenericValue< Encoding, Allocator >::SetUint64 ( uint64_t  u64)
inline

Definition at line 439 of file document.h.

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
SizeType rapidjson::GenericValue< Encoding, Allocator >::Size ( ) const
inline

Get the number of elements in array.

Definition at line 333 of file document.h.

Friends And Related Function Documentation

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
template<typename , typename >
friend class GenericDocument
friend

Definition at line 533 of file document.h.


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