bes  Updated for version 3.20.6
GenericValue< Encoding, Allocator > Class Template Reference

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

#include <document.h>

Collaboration diagram for GenericValue< Encoding, Allocator >:
Collaboration graph

Classes

struct  ArrayData
 
union  Data
 
struct  Flag
 
union  Number
 
struct  ObjectData
 
struct  ShortString
 
struct  String
 

Public Types

typedef Allocator AllocatorType
 Allocator type from template parameter. More...
 
typedef Allocator AllocatorType
 Allocator type from template parameter. More...
 
typedef GenericArray< false, ValueTypeArray
 
typedef GenericArray< false, ValueTypeArray
 
typedef Encoding::Ch Ch
 Character type derived from Encoding. More...
 
typedef Encoding::Ch Ch
 Character type derived from Encoding. More...
 
typedef GenericArray< true, ValueTypeConstArray
 
typedef GenericArray< true, ValueTypeConstArray
 
typedef GenericMemberIterator< true, Encoding, Allocator >::Iterator ConstMemberIterator
 Constant member iterator for iterating in object. More...
 
typedef GenericMemberIterator< true, Encoding, Allocator >::Iterator ConstMemberIterator
 Constant member iterator for iterating in object. More...
 
typedef GenericObject< true, ValueTypeConstObject
 
typedef GenericObject< true, ValueTypeConstObject
 
typedef Encoding EncodingType
 Encoding type from template parameter. More...
 
typedef Encoding EncodingType
 Encoding type from template parameter. More...
 
typedef GenericMember< Encoding, AllocatorMember
 Name-value pair in an object. More...
 
typedef GenericMember< Encoding, AllocatorMember
 Name-value pair in an object. More...
 
typedef GenericMemberIterator< false, Encoding, Allocator >::Iterator MemberIterator
 Member iterator for iterating in object. More...
 
typedef GenericMemberIterator< false, Encoding, Allocator >::Iterator MemberIterator
 Member iterator for iterating in object. More...
 
typedef GenericObject< false, ValueTypeObject
 
typedef GenericObject< false, ValueTypeObject
 
typedef GenericStringRef< ChStringRefType
 Reference to a constant string. More...
 
typedef GenericStringRef< ChStringRefType
 Reference to a constant string. More...
 
typedef GenericValueValueIterator
 Value iterator for iterating in array. More...
 
typedef GenericValueValueIterator
 Value iterator for iterating in array. More...
 
typedef GenericValue< Encoding, AllocatorValueType
 Value type of itself. More...
 
typedef GenericValue< Encoding, AllocatorValueType
 Value type of itself. More...
 

Public Attributes

const typedef GenericValueConstValueIterator
 Constant value iterator for iterating in array. More...
 

Constructors and destructor.

 GenericValue () RAPIDJSON_NOEXCEPT
 Default constructor creates a null value. More...
 
 GenericValue (Type type) RAPIDJSON_NOEXCEPT
 Constructor with JSON value type. More...
 
template<typename SourceAllocator >
 GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator)
 Explicit copy constructor (with allocator) More...
 
template<typename T >
 GenericValue (T b, RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))) RAPIDJSON_NOEXCEPT
 Constructor for boolean value. More...
 
 GenericValue (int i) RAPIDJSON_NOEXCEPT
 Constructor for int value. More...
 
 GenericValue (unsigned u) RAPIDJSON_NOEXCEPT
 Constructor for unsigned value. More...
 
 GenericValue (int64_t i64) RAPIDJSON_NOEXCEPT
 Constructor for int64_t value. More...
 
 GenericValue (uint64_t u64) RAPIDJSON_NOEXCEPT
 Constructor for uint64_t value. More...
 
 GenericValue (double d) RAPIDJSON_NOEXCEPT
 Constructor for double value. More...
 
 GenericValue (const Ch *s, SizeType length) RAPIDJSON_NOEXCEPT
 Constructor for constant string (i.e. do not make a copy of string) More...
 
 GenericValue (StringRefType s) RAPIDJSON_NOEXCEPT
 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 (Array a) RAPIDJSON_NOEXCEPT
 Constructor for Array. More...
 
 GenericValue (Object o) RAPIDJSON_NOEXCEPT
 Constructor for Object. More...
 
 ~GenericValue ()
 Destructor. More...
 
 GenericValue () RAPIDJSON_NOEXCEPT
 Default constructor creates a null value. More...
 
 GenericValue (Type type) RAPIDJSON_NOEXCEPT
 Constructor with JSON value type. More...
 
template<typename SourceAllocator >
 GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator)
 Explicit copy constructor (with allocator) More...
 
template<typename T >
 GenericValue (T b, RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))) RAPIDJSON_NOEXCEPT
 Constructor for boolean value. More...
 
 GenericValue (int i) RAPIDJSON_NOEXCEPT
 Constructor for int value. More...
 
 GenericValue (unsigned u) RAPIDJSON_NOEXCEPT
 Constructor for unsigned value. More...
 
 GenericValue (int64_t i64) RAPIDJSON_NOEXCEPT
 Constructor for int64_t value. More...
 
 GenericValue (uint64_t u64) RAPIDJSON_NOEXCEPT
 Constructor for uint64_t value. More...
 
 GenericValue (double d) RAPIDJSON_NOEXCEPT
 Constructor for double value. More...
 
 GenericValue (const Ch *s, SizeType length) RAPIDJSON_NOEXCEPT
 Constructor for constant string (i.e. do not make a copy of string) More...
 
 GenericValue (StringRefType s) RAPIDJSON_NOEXCEPT
 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 (Array a) RAPIDJSON_NOEXCEPT
 Constructor for Array. More...
 
 GenericValue (Object o) RAPIDJSON_NOEXCEPT
 Constructor for Object. More...
 
 ~GenericValue ()
 Destructor. More...
 

Assignment operators

enum  {
  kBoolFlag = 0x0008, kNumberFlag = 0x0010, kIntFlag = 0x0020, kUintFlag = 0x0040,
  kInt64Flag = 0x0080, kUint64Flag = 0x0100, kDoubleFlag = 0x0200, kStringFlag = 0x0400,
  kCopyFlag = 0x0800, kInlineStrFlag = 0x1000, kNullFlag = kNullType, kTrueFlag = kTrueType | kBoolFlag,
  kFalseFlag = kFalseType | kBoolFlag, kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,
  kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, kConstStringFlag = kStringType | kStringFlag,
  kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, kObjectFlag = kObjectType, kArrayFlag = kArrayType,
  kTypeMask = 0x07
}
 
enum  {
  kBoolFlag = 0x0008, kNumberFlag = 0x0010, kIntFlag = 0x0020, kUintFlag = 0x0040,
  kInt64Flag = 0x0080, kUint64Flag = 0x0100, kDoubleFlag = 0x0200, kStringFlag = 0x0400,
  kCopyFlag = 0x0800, kInlineStrFlag = 0x1000, kNullFlag = kNullType, kTrueFlag = kTrueType | kBoolFlag,
  kFalseFlag = kFalseType | kBoolFlag, kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,
  kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, kConstStringFlag = kStringType | kStringFlag,
  kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, kObjectFlag = kObjectType, kArrayFlag = kArrayType,
  kTypeMask = 0x07
}
 
Data data_
 
template<typename , typename , typename >
class GenericDocument
 
template<typename , typename , typename >
class GenericDocument
 
static const SizeType kDefaultArrayCapacity = 16
 
static const SizeType kDefaultObjectCapacity = 16
 
GenericValueoperator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment with move semantics. More...
 
GenericValueoperator= (StringRefType str) RAPIDJSON_NOEXCEPT
 Assignment of constant string reference (no copy) More...
 
template<typename T >
 RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator
 Assignment with primitive types. More...
 
const RAPIDJSON_FORCEINLINE ChGetStringPointer () const
 
const RAPIDJSON_FORCEINLINE ChSetStringPointer (const Ch *str)
 
RAPIDJSON_FORCEINLINE GenericValueGetElementsPointer () const
 
RAPIDJSON_FORCEINLINE GenericValueSetElementsPointer (GenericValue *elements)
 
RAPIDJSON_FORCEINLINE MemberGetMembersPointer () const
 
RAPIDJSON_FORCEINLINE MemberSetMembersPointer (Member *members)
 
void SetArrayRaw (GenericValue *values, SizeType count, Allocator &allocator)
 
void SetObjectRaw (Member *members, SizeType count, Allocator &allocator)
 Initialize this value as object with initial data, without calling destructor. More...
 
void SetStringRaw (StringRefType s) RAPIDJSON_NOEXCEPT
 Initialize this value as constant string, without calling destructor. More...
 
void SetStringRaw (StringRefType s, Allocator &allocator)
 Initialize this value as copy string with initial data, without calling destructor. More...
 
void RawAssign (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment without calling destructor. More...
 
template<typename SourceAllocator >
bool StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const
 
GenericValueoperator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment with move semantics. More...
 
GenericValueoperator= (StringRefType str) RAPIDJSON_NOEXCEPT
 Assignment of constant string reference (no copy) More...
 
template<typename T >
 RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator
 Assignment with primitive types. More...
 
const RAPIDJSON_FORCEINLINE ChGetStringPointer () const
 
const RAPIDJSON_FORCEINLINE ChSetStringPointer (const Ch *str)
 
RAPIDJSON_FORCEINLINE GenericValueGetElementsPointer () const
 
RAPIDJSON_FORCEINLINE GenericValueSetElementsPointer (GenericValue *elements)
 
RAPIDJSON_FORCEINLINE MemberGetMembersPointer () const
 
RAPIDJSON_FORCEINLINE MemberSetMembersPointer (Member *members)
 
void SetArrayRaw (GenericValue *values, SizeType count, Allocator &allocator)
 
void SetObjectRaw (Member *members, SizeType count, Allocator &allocator)
 Initialize this value as object with initial data, without calling destructor. More...
 
void SetStringRaw (StringRefType s) RAPIDJSON_NOEXCEPT
 Initialize this value as constant string, without calling destructor. More...
 
void SetStringRaw (StringRefType s, Allocator &allocator)
 Initialize this value as copy string with initial data, without calling destructor. More...
 
void RawAssign (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment without calling destructor. More...
 
template<typename SourceAllocator >
bool StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const
 

Detailed Description

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
class 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 59 of file cmr_module/rapidjson/document.h.

Member Typedef Documentation

◆ AllocatorType [1/2]

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

Allocator type from template parameter.

Definition at line 545 of file cmr_module/rapidjson/document.h.

◆ AllocatorType [2/2]

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

Allocator type from template parameter.

Definition at line 545 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ Ch [1/2]

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

Character type derived from Encoding.

Definition at line 546 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ Ch [2/2]

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

Character type derived from Encoding.

Definition at line 546 of file cmr_module/rapidjson/document.h.

◆ ConstMemberIterator [1/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericMemberIterator<true,Encoding,Allocator>::Iterator GenericValue< Encoding, Allocator >::ConstMemberIterator

Constant member iterator for iterating in object.

Definition at line 549 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ ConstMemberIterator [2/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericMemberIterator<true,Encoding,Allocator>::Iterator GenericValue< Encoding, Allocator >::ConstMemberIterator

Constant member iterator for iterating in object.

Definition at line 549 of file cmr_module/rapidjson/document.h.

◆ EncodingType [1/2]

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

Encoding type from template parameter.

Definition at line 544 of file cmr_module/rapidjson/document.h.

◆ EncodingType [2/2]

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

Encoding type from template parameter.

Definition at line 544 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ Member [1/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericMember<Encoding, Allocator> GenericValue< Encoding, Allocator >::Member

Name-value pair in an object.

Definition at line 543 of file cmr_module/rapidjson/document.h.

◆ Member [2/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericMember<Encoding, Allocator> GenericValue< Encoding, Allocator >::Member

Name-value pair in an object.

Definition at line 543 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ MemberIterator [1/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericMemberIterator<false,Encoding,Allocator>::Iterator GenericValue< Encoding, Allocator >::MemberIterator

Member iterator for iterating in object.

Definition at line 548 of file cmr_module/rapidjson/document.h.

◆ MemberIterator [2/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericMemberIterator<false,Encoding,Allocator>::Iterator GenericValue< Encoding, Allocator >::MemberIterator

Member iterator for iterating in object.

Definition at line 548 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ StringRefType [1/2]

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

Reference to a constant string.

Definition at line 547 of file cmr_module/rapidjson/document.h.

◆ StringRefType [2/2]

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

Reference to a constant string.

Definition at line 547 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ ValueIterator [1/2]

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

Value iterator for iterating in array.

Definition at line 550 of file cmr_module/rapidjson/document.h.

◆ ValueIterator [2/2]

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

Value iterator for iterating in array.

Definition at line 550 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ ValueType [1/2]

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

Value type of itself.

Definition at line 552 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ ValueType [2/2]

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

Value type of itself.

Definition at line 552 of file cmr_module/rapidjson/document.h.

Constructor & Destructor Documentation

◆ GenericValue() [1/30]

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

Default constructor creates a null value.

Definition at line 562 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [2/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericValue< Encoding, Allocator >::GenericValue ( Type  type)
inlineexplicit

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 592 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [3/30]

template<typename Encoding , typename Allocator >
template<typename SourceAllocator >
GenericValue< Encoding, Allocator >::GenericValue ( const GenericValue< Encoding, SourceAllocator > &  rhs,
Allocator allocator 
)
inline

Explicit copy constructor (with allocator)

Creates a copy of a Value by using the given Allocator

Template Parameters
SourceAllocatorallocator of rhs
Parameters
rhsValue to copy from (read-only)
allocatorAllocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator().
See also
CopyFrom()

Definition at line 2408 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [4/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue< Encoding, Allocator >::GenericValue ( b,
RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))   
)
inlineexplicit

Constructor for boolean value.

Parameters
bBoolean value
Note
This constructor is limited to real boolean values and rejects implicitly converted types like arbitrary pointers. Use an explicit cast to bool, if you want to construct a boolean JSON value in such cases.

Definition at line 623 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [5/30]

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

Constructor for int value.

Definition at line 634 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [6/30]

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

Constructor for unsigned value.

Definition at line 640 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [7/30]

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

Constructor for int64_t value.

Definition at line 646 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [8/30]

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

Constructor for uint64_t value.

Definition at line 661 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [9/30]

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

Constructor for double value.

Definition at line 673 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [10/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
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 676 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [11/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericValue< Encoding, Allocator >::GenericValue ( StringRefType  s)
inlineexplicit

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

Definition at line 679 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [12/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
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 682 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [13/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
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 685 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [14/30]

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

Constructor for Array.

Parameters
aAn array obtained by GetArray().
Note
Array is always pass-by-value.
the source array is moved into this value and the sourec array becomes empty.

Definition at line 700 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [15/30]

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

Constructor for Object.

Parameters
oAn object obtained by GetObject().
Note
Object is always pass-by-value.
the source object is moved into this value and the sourec object becomes empty.

Definition at line 711 of file cmr_module/rapidjson/document.h.

◆ ~GenericValue() [1/2]

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

Destructor.

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

Definition at line 719 of file cmr_module/rapidjson/document.h.

◆ GenericValue() [16/30]

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

Default constructor creates a null value.

Definition at line 562 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [17/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericValue< Encoding, Allocator >::GenericValue ( Type  type)
inlineexplicit

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 592 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [18/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<typename SourceAllocator >
GenericValue< Encoding, Allocator >::GenericValue ( const GenericValue< Encoding, SourceAllocator > &  rhs,
Allocator allocator 
)

Explicit copy constructor (with allocator)

Creates a copy of a Value by using the given Allocator

Template Parameters
SourceAllocatorallocator of rhs
Parameters
rhsValue to copy from (read-only)
allocatorAllocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator().
See also
CopyFrom()

◆ GenericValue() [19/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue< Encoding, Allocator >::GenericValue ( b,
RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))   
)
inlineexplicit

Constructor for boolean value.

Parameters
bBoolean value
Note
This constructor is limited to real boolean values and rejects implicitly converted types like arbitrary pointers. Use an explicit cast to bool, if you want to construct a boolean JSON value in such cases.

Definition at line 623 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [20/30]

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

Constructor for int value.

Definition at line 634 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [21/30]

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

Constructor for unsigned value.

Definition at line 640 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [22/30]

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

Constructor for int64_t value.

Definition at line 646 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [23/30]

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

Constructor for uint64_t value.

Definition at line 661 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [24/30]

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

Constructor for double value.

Definition at line 673 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [25/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
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 676 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [26/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericValue< Encoding, Allocator >::GenericValue ( StringRefType  s)
inlineexplicit

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

Definition at line 679 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [27/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
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 682 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [28/30]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
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 685 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [29/30]

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

Constructor for Array.

Parameters
aAn array obtained by GetArray().
Note
Array is always pass-by-value.
the source array is moved into this value and the sourec array becomes empty.

Definition at line 700 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ GenericValue() [30/30]

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

Constructor for Object.

Parameters
oAn object obtained by GetObject().
Note
Object is always pass-by-value.
the source object is moved into this value and the sourec object becomes empty.

Definition at line 711 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ ~GenericValue() [2/2]

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

Destructor.

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

Definition at line 719 of file dmrpp_module/xml2json/include/rapidjson/document.h.

Member Function Documentation

◆ operator=() [1/4]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericValue& 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 755 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ operator=() [2/4]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericValue& 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 755 of file cmr_module/rapidjson/document.h.

◆ operator=() [3/4]

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

Assignment of constant string reference (no copy)

Parameters
strConstant string reference to be assigned
Note
This overload is needed to avoid clashes with the generic primitive type assignment overload below.
See also
GenericStringRef, operator=(T)

Definition at line 774 of file cmr_module/rapidjson/document.h.

◆ operator=() [4/4]

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

Assignment of constant string reference (no copy)

Parameters
strConstant string reference to be assigned
Note
This overload is needed to avoid clashes with the generic primitive type assignment overload below.
See also
GenericStringRef, operator=(T)

Definition at line 774 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ RAPIDJSON_DISABLEIF_RETURN() [1/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue< Encoding, Allocator >::RAPIDJSON_DISABLEIF_RETURN ( (internal::IsPointer< T >)  ,
(GenericValue< Encoding, Allocator > &)   
)

Assignment with primitive types.

Template Parameters
TEither Type, int, unsigned, int64_t, uint64_t
Parameters
valueThe value to be assigned.
Note
The source type T explicitly disallows all pointer types, especially (const) Ch*. This helps avoiding implicitly referencing character strings with insufficient lifetime, use SetString(const Ch*, Allocator&) (for copying) or StringRef() (to explicitly mark the pointer as constant) instead. All other pointer types would implicitly convert to bool, use SetBool() instead. Set boolean value

◆ RAPIDJSON_DISABLEIF_RETURN() [2/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<typename T >
GenericValue< Encoding, Allocator >::RAPIDJSON_DISABLEIF_RETURN ( (internal::IsPointer< T >)  ,
(GenericValue< Encoding, Allocator > &)   
)

Assignment with primitive types.

Template Parameters
TEither Type, int, unsigned, int64_t, uint64_t
Parameters
valueThe value to be assigned.
Note
The source type T explicitly disallows all pointer types, especially (const) Ch*. This helps avoiding implicitly referencing character strings with insufficient lifetime, use SetString(const Ch*, Allocator&) (for copying) or StringRef() (to explicitly mark the pointer as constant) instead. All other pointer types would implicitly convert to bool, use SetBool() instead. Set boolean value

◆ RawAssign() [1/2]

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

Assignment without calling destructor.

Definition at line 1984 of file cmr_module/rapidjson/document.h.

◆ RawAssign() [2/2]

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

Assignment without calling destructor.

Definition at line 1984 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ SetObjectRaw() [1/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::SetObjectRaw ( Member members,
SizeType  count,
Allocator allocator 
)
inline

Initialize this value as object with initial data, without calling destructor.

Definition at line 1947 of file cmr_module/rapidjson/document.h.

◆ SetObjectRaw() [2/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::SetObjectRaw ( Member members,
SizeType  count,
Allocator allocator 
)
inline

Initialize this value as object with initial data, without calling destructor.

Definition at line 1947 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ SetStringRaw() [1/4]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::SetStringRaw ( StringRefType  s)
inline

Initialize this value as constant string, without calling destructor.

Definition at line 1960 of file dmrpp_module/xml2json/include/rapidjson/document.h.

◆ SetStringRaw() [2/4]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::SetStringRaw ( StringRefType  s)
inline

Initialize this value as constant string, without calling destructor.

Definition at line 1960 of file cmr_module/rapidjson/document.h.

◆ SetStringRaw() [3/4]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::SetStringRaw ( StringRefType  s,
Allocator allocator 
)
inline

Initialize this value as copy string with initial data, without calling destructor.

Definition at line 1967 of file cmr_module/rapidjson/document.h.

◆ SetStringRaw() [4/4]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::SetStringRaw ( StringRefType  s,
Allocator allocator 
)
inline

Initialize this value as copy string with initial data, without calling destructor.

Definition at line 1967 of file dmrpp_module/xml2json/include/rapidjson/document.h.

Member Data Documentation

◆ ConstValueIterator

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

Constant value iterator for iterating in array.

Definition at line 551 of file cmr_module/rapidjson/document.h.


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