|
Represents a JSON value. Use Value for UTF8 encoding and default allocator. More...
#include <document.h>
Classes | |
struct | Array |
union | Data |
struct | Member |
Name-value pair in an object. More... | |
union | Number |
struct | Object |
struct | String |
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 Member * | MemberIterator |
Member iterator for iterating in object. More... | |
typedef const Member * | ConstMemberIterator |
Constant member iterator for iterating in object. More... | |
typedef GenericValue * | ValueIterator |
Value iterator for iterating in array. More... | |
typedef const GenericValue * | ConstValueIterator |
Constant value iterator for iterating in array. More... | |
Public Member Functions | |
Assignment operators | |
GenericValue & | operator= (GenericValue &rhs) |
Assignment with move semantics. More... | |
template<typename T > | |
GenericValue & | operator= (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_ | |
GenericValue & | SetNull_ () |
Bool_ | |
bool | GetBool_ () const |
GenericValue & | SetBool_ (bool b) |
Object | |
GenericValue & | SetObject () |
Set this value as an empty object. More... | |
GenericValue & | operator[] (const Ch *name) |
Get the value associated with the object's name. More... | |
const GenericValue & | operator[] (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... | |
GenericValue & | AddMember (GenericValue &name, GenericValue &value, Allocator &allocator) |
Add a member (name-value pair) to the object. More... | |
GenericValue & | AddMember (const Ch *name, Allocator &nameAllocator, GenericValue &value, Allocator &allocator) |
GenericValue & | AddMember (const Ch *name, GenericValue &value, Allocator &allocator) |
template<typename T > | |
GenericValue & | AddMember (const Ch *name, T value, Allocator &allocator) |
bool | RemoveMember (const Ch *name) |
Remove a member in object by its name. More... | |
Array | |
GenericValue & | SetArray () |
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... | |
GenericValue & | operator[] (SizeType index) |
Get an element from array by index. More... | |
const GenericValue & | operator[] (SizeType index) const |
ValueIterator | Begin () |
Element iterator. More... | |
ValueIterator | End () |
ConstValueIterator | Begin () const |
ConstValueIterator | End () const |
GenericValue & | Reserve (SizeType newCapacity, Allocator &allocator) |
Request the array to have enough capacity to store elements. More... | |
GenericValue & | PushBack (GenericValue &value, Allocator &allocator) |
Append a value at the end of the array. More... | |
template<typename T > | |
GenericValue & | PushBack (T value, Allocator &allocator) |
GenericValue & | PopBack () |
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 |
GenericValue & | SetInt (int i) |
GenericValue & | SetUint (unsigned u) |
GenericValue & | SetInt64 (int64_t i64) |
GenericValue & | SetUint64 (uint64_t u64) |
GenericValue & | SetDouble (double d) |
String | |
enum | { kBool_Flag = 0x100 , kNumberFlag = 0x200 , kIntFlag = 0x400 , kUintFlag = 0x800 , kInt64Flag = 0x1000 , kUint64Flag = 0x2000 , kDoubleFlag = 0x4000 , kStringFlag = 0x100000 , kCopyFlag = 0x200000 , kNull_Flag = kNull_Type , kTrueFlag = kTrueType | kBool_Flag , kFalseFlag = kFalseType | kBool_Flag , kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag , kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag , kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag , kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag , kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag , kConstStringFlag = kStringType | kStringFlag , kCopyStringFlag = kStringType | kStringFlag | kCopyFlag , kObjectFlag = kObjectType , kArrayFlag = kArrayType , kTypeMask = 0xFF } |
template<typename , typename > | |
class | GenericDocument |
static const SizeType | kDefaultArrayCapacity = 16 |
static const SizeType | kDefaultObjectCapacity = 16 |
Data | data_ |
unsigned | flags_ |
const Ch * | GetString () const |
SizeType | GetStringLength () const |
Get the length of string. More... | |
GenericValue & | SetString (const Ch *s, SizeType length) |
Set this value as a string without copying source string. More... | |
GenericValue & | SetString (const Ch *s) |
Set this value as a string without copying source string. More... | |
GenericValue & | SetString (const Ch *s, SizeType length, Allocator &allocator) |
Set this value as a string by copying from source string. More... | |
GenericValue & | SetString (const Ch *s, Allocator &allocator) |
Set this value as a string by copying from source string. More... | |
template<typename Handler > | |
const GenericValue & | Accept (Handler &handler) const |
Generate events of this value to a Handler. More... | |
Member * | FindMember (const Ch *name) |
Find member by name. More... | |
const Member * | FindMember (const Ch *name) const |
void | SetArrayRaw (GenericValue *values, SizeType count, Allocator &alloctaor) |
void | SetObjectRaw (Member *members, SizeType count, Allocator &alloctaor) |
Initialize this value as object with initial data, without calling destructor. More... | |
void | SetStringRaw (const Ch *s, SizeType length) |
Initialize this value as constant string, without calling destructor. More... | |
void | SetStringRaw (const Ch *s, SizeType length, Allocator &allocator) |
Initialize this value as copy string with initial data, without calling destructor. More... | |
void | RawAssign (GenericValue &rhs) |
Assignment without calling destructor. More... | |
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... | |
GenericValue (const GenericValue &rhs) | |
Copy constructor is not permitted. More... | |
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
Encoding | Encoding of the value. (Even non-string values need to have the same encoding in a document) |
Allocator | Allocator type for allocating memory of object, array and string. |
typedef Allocator rapidjson::GenericValue< Encoding, Allocator >::AllocatorType |
Allocator type from template parameter.
typedef Encoding::Ch rapidjson::GenericValue< Encoding, Allocator >::Ch |
Character type derived from Encoding.
typedef const Member* rapidjson::GenericValue< Encoding, Allocator >::ConstMemberIterator |
Constant member iterator for iterating in object.
typedef const GenericValue* rapidjson::GenericValue< Encoding, Allocator >::ConstValueIterator |
Constant value iterator for iterating in array.
typedef Encoding rapidjson::GenericValue< Encoding, Allocator >::EncodingType |
Encoding type from template parameter.
typedef Member* rapidjson::GenericValue< Encoding, Allocator >::MemberIterator |
Member iterator for iterating in object.
typedef GenericValue* rapidjson::GenericValue< Encoding, Allocator >::ValueIterator |
Value iterator for iterating in array.
|
private |
|
inline |
Default constructor creates a null value.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::operator=(), rapidjson::GenericValue< Encoding, Allocator >::Reserve(), rapidjson::GenericValue< Encoding, Allocator >::SetArray(), rapidjson::GenericValue< Encoding, Allocator >::SetBool_(), rapidjson::GenericValue< Encoding, Allocator >::SetDouble(), rapidjson::GenericValue< Encoding, Allocator >::SetInt(), rapidjson::GenericValue< Encoding, Allocator >::SetInt64(), rapidjson::GenericValue< Encoding, Allocator >::SetNull_(), rapidjson::GenericValue< Encoding, Allocator >::SetObject(), rapidjson::GenericValue< Encoding, Allocator >::SetUint(), and rapidjson::GenericValue< Encoding, Allocator >::SetUint64().
|
private |
Copy constructor is not permitted.
|
inline |
Constructor with JSON value type.
This creates a Value of specified type with default content.
type | Type of the value. |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kArrayFlag, rapidjson::GenericValue< Encoding, Allocator >::kConstStringFlag, rapidjson::GenericValue< Encoding, Allocator >::kDoubleFlag, rapidjson::GenericValue< Encoding, Allocator >::kFalseFlag, rapidjson::GenericValue< Encoding, Allocator >::kInt64Flag, rapidjson::GenericValue< Encoding, Allocator >::kIntFlag, rapidjson::GenericValue< Encoding, Allocator >::kNull_Flag, rapidjson::GenericValue< Encoding, Allocator >::kNumberFlag, rapidjson::kNumberType, rapidjson::GenericValue< Encoding, Allocator >::kObjectFlag, rapidjson::GenericValue< Encoding, Allocator >::kTrueFlag, rapidjson::GenericValue< Encoding, Allocator >::kUint64Flag, rapidjson::GenericValue< Encoding, Allocator >::kUintFlag, and RAPIDJSON_ASSERT.
|
inline |
Constructor for boolean value.
|
inline |
Constructor for int value.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, constants::i, rapidjson::GenericValue< Encoding, Allocator >::Number::i64, rapidjson::GenericValue< Encoding, Allocator >::kUint64Flag, rapidjson::GenericValue< Encoding, Allocator >::kUintFlag, and rapidjson::GenericValue< Encoding, Allocator >::Data::n.
|
inline |
Constructor for unsigned value.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kInt64Flag, rapidjson::GenericValue< Encoding, Allocator >::kIntFlag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, and rapidjson::GenericValue< Encoding, Allocator >::Number::u64.
|
inline |
Constructor for int64_t value.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::Number::i64, rapidjson::GenericValue< Encoding, Allocator >::kIntFlag, rapidjson::GenericValue< Encoding, Allocator >::kNumberUint64Flag, rapidjson::GenericValue< Encoding, Allocator >::kUintFlag, and rapidjson::GenericValue< Encoding, Allocator >::Data::n.
|
inline |
Constructor for uint64_t value.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kInt64Flag, rapidjson::GenericValue< Encoding, Allocator >::kIntFlag, rapidjson::GenericValue< Encoding, Allocator >::kUintFlag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, and rapidjson::GenericValue< Encoding, Allocator >::Number::u64.
|
inline |
Constructor for double value.
References rapidjson::GenericValue< Encoding, Allocator >::Number::d, rapidjson::GenericValue< Encoding, Allocator >::data_, and rapidjson::GenericValue< Encoding, Allocator >::Data::n.
|
inline |
Constructor for constant string (i.e. do not make a copy of string)
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kConstStringFlag, rapidjson::GenericValue< Encoding, Allocator >::String::length, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Data::s, and rapidjson::GenericValue< Encoding, Allocator >::String::str.
|
inline |
Constructor for constant string (i.e. do not make a copy of string)
References rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw(), and rapidjson::internal::StrLen().
|
inline |
Constructor for copy-string (i.e. do make a copy of string)
References rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw().
|
inline |
Constructor for copy-string (i.e. do make a copy of string)
References rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw(), and rapidjson::internal::StrLen().
|
inline |
Destructor.
Need to destruct elements of array, members of object, or copy-string.
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kArrayFlag, rapidjson::GenericValue< Encoding, Allocator >::kCopyStringFlag, rapidjson::GenericValue< Encoding, Allocator >::kObjectFlag, rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Data::o, rapidjson::GenericValue< Encoding, Allocator >::Data::s, rapidjson::GenericValue< Encoding, Allocator >::Object::size, rapidjson::GenericValue< Encoding, Allocator >::Array::size, and rapidjson::GenericValue< Encoding, Allocator >::String::str.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::operator=(), rapidjson::GenericValue< Encoding, Allocator >::SetArray(), rapidjson::GenericValue< Encoding, Allocator >::SetBool_(), rapidjson::GenericValue< Encoding, Allocator >::SetDouble(), rapidjson::GenericValue< Encoding, Allocator >::SetInt(), rapidjson::GenericValue< Encoding, Allocator >::SetInt64(), rapidjson::GenericValue< Encoding, Allocator >::SetNull_(), rapidjson::GenericValue< Encoding, Allocator >::SetObject(), rapidjson::GenericValue< Encoding, Allocator >::SetString(), rapidjson::GenericValue< Encoding, Allocator >::SetUint(), and rapidjson::GenericValue< Encoding, Allocator >::SetUint64().
|
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.
Handler | type of handler. |
handler | An object implementing concept Handler. |
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::Number::d, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::GetType(), rapidjson::GenericValue< Encoding, Allocator >::Number::I::i, rapidjson::GenericValue< Encoding, Allocator >::Number::i, rapidjson::GenericValue< Encoding, Allocator >::Number::i64, rapidjson::GenericValue< Encoding, Allocator >::IsInt(), rapidjson::GenericValue< Encoding, Allocator >::IsInt64(), rapidjson::GenericValue< Encoding, Allocator >::IsUint(), rapidjson::GenericValue< Encoding, Allocator >::IsUint64(), rapidjson::kArrayType, rapidjson::kFalseType, rapidjson::kNull_Type, rapidjson::kNumberType, rapidjson::kObjectType, rapidjson::kStringType, rapidjson::kTrueType, rapidjson::GenericValue< Encoding, Allocator >::String::length, rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Data::n, rapidjson::GenericValue< Encoding, Allocator >::Data::o, rapidjson::GenericValue< Encoding, Allocator >::Data::s, rapidjson::GenericValue< Encoding, Allocator >::Object::size, rapidjson::GenericValue< Encoding, Allocator >::Array::size, rapidjson::GenericValue< Encoding, Allocator >::String::str, rapidjson::GenericValue< Encoding, Allocator >::Number::U::u, rapidjson::GenericValue< Encoding, Allocator >::Number::u, and rapidjson::GenericValue< Encoding, Allocator >::Number::u64.
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::AddMember(), n, units::name, and rapidjson::internal::StrLen().
|
inline |
|
inline |
|
inline |
Add a member (name-value pair) to the object.
name | A string value as name of member. |
value | Value of any type. |
allocator | Allocator for reallocating memory. |
References rapidjson::GenericValue< Encoding, Allocator >::Object::capacity, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsObject(), rapidjson::GenericValue< Encoding, Allocator >::kDefaultObjectCapacity, rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Member::name, units::name, rapidjson::GenericValue< Encoding, Allocator >::Data::o, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Object::size, and rapidjson::GenericValue< Encoding, Allocator >::Member::value.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::AddMember().
|
inline |
Element iterator.
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), and RAPIDJSON_ASSERT.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::Begin().
|
inline |
|
inline |
|
inline |
Remove all elements in the array.
This function do not deallocate memory in the array, i.e. the capacity is unchanged.
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, constants::i, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
|
inline |
Check whether the array is empty.
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::PopBack().
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::End().
|
inline |
|
inlineprivate |
Find member by name.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsObject(), rapidjson::GenericValue< Encoding, Allocator >::Object::members, units::name, rapidjson::GenericValue< Encoding, Allocator >::Data::o, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Object::size, and rapidjson::internal::StrLen().
Referenced by rapidjson::GenericValue< Encoding, Allocator >::FindMember(), rapidjson::GenericValue< Encoding, Allocator >::HasMember(), rapidjson::GenericValue< Encoding, Allocator >::operator[](), and rapidjson::GenericValue< Encoding, Allocator >::RemoveMember().
|
inlineprivate |
References rapidjson::GenericValue< Encoding, Allocator >::FindMember(), and units::name.
|
inline |
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::Number::d, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::Number::I::i, rapidjson::GenericValue< Encoding, Allocator >::Number::i, rapidjson::GenericValue< Encoding, Allocator >::Number::i64, rapidjson::GenericValue< Encoding, Allocator >::IsNumber(), rapidjson::GenericValue< Encoding, Allocator >::kDoubleFlag, rapidjson::GenericValue< Encoding, Allocator >::kInt64Flag, rapidjson::GenericValue< Encoding, Allocator >::kIntFlag, rapidjson::GenericValue< Encoding, Allocator >::kUint64Flag, rapidjson::GenericValue< Encoding, Allocator >::kUintFlag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Number::U::u, rapidjson::GenericValue< Encoding, Allocator >::Number::u, and rapidjson::GenericValue< Encoding, Allocator >::Number::u64.
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::Number::I::i, rapidjson::GenericValue< Encoding, Allocator >::Number::i, rapidjson::GenericValue< Encoding, Allocator >::kIntFlag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, and RAPIDJSON_ASSERT.
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::Number::i64, rapidjson::GenericValue< Encoding, Allocator >::kInt64Flag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, and RAPIDJSON_ASSERT.
|
inline |
|
inline |
Get the length of string.
Since rapidjson permits "\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsString(), rapidjson::GenericValue< Encoding, Allocator >::String::length, RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Data::s.
|
inline |
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kUintFlag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Number::U::u, and rapidjson::GenericValue< Encoding, Allocator >::Number::u.
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kUint64Flag, rapidjson::GenericValue< Encoding, Allocator >::Data::n, RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Number::u64.
|
inline |
Check whether a member exists in the object.
References rapidjson::GenericValue< Encoding, Allocator >::FindMember(), and units::name.
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::flags_, and rapidjson::GenericValue< Encoding, Allocator >::kArrayFlag.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::Begin(), rapidjson::GenericValue< Encoding, Allocator >::Capacity(), rapidjson::GenericValue< Encoding, Allocator >::Clear(), rapidjson::GenericValue< Encoding, Allocator >::Empty(), rapidjson::GenericValue< Encoding, Allocator >::End(), rapidjson::GenericValue< Encoding, Allocator >::operator[](), rapidjson::GenericValue< Encoding, Allocator >::PopBack(), rapidjson::GenericValue< Encoding, Allocator >::PushBack(), rapidjson::GenericValue< Encoding, Allocator >::Reserve(), and rapidjson::GenericValue< Encoding, Allocator >::Size().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::flags_, and rapidjson::GenericValue< Encoding, Allocator >::kObjectFlag.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::AddMember(), rapidjson::GenericValue< Encoding, Allocator >::FindMember(), rapidjson::GenericValue< Encoding, Allocator >::MemberBegin(), rapidjson::GenericValue< Encoding, Allocator >::MemberEnd(), and rapidjson::GenericValue< Encoding, Allocator >::RemoveMember().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsObject(), rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Data::o, RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Object::size.
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsObject(), rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Data::o, RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Object::size.
|
inline |
Assignment with move semantics.
rhs | Source of the assignment. It will become a null value after assignment. |
References rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kNull_Flag, RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
inline |
Assignment with primitive types.
T | Either Type, int, unsigned, int64_t, uint64_t, const Ch* |
value | The value to be assigned. |
References rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
inline |
Get the value associated with the object's name.
References rapidjson::GenericValue< Encoding, Allocator >::FindMember(), and units::name.
|
inline |
References units::name.
|
inline |
Get an element from array by index.
index | Zero-based index of element. |
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
|
inline |
|
inline |
Remove the last element in the array.
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::Empty(), rapidjson::GenericValue< Encoding, Allocator >::IsArray(), RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
|
inline |
Append a value at the end of the array.
value | The value to be appended. |
allocator | The allocator for allocating memory. It must be the same one use previously. |
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::Array::capacity, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), rapidjson::GenericValue< Encoding, Allocator >::kDefaultArrayCapacity, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Reserve(), and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::PushBack().
|
inline |
References rapidjson::GenericValue< Encoding, Allocator >::PushBack().
|
inlineprivate |
Assignment without calling destructor.
References rapidjson::GenericValue< Encoding, Allocator >::flags_, and rapidjson::GenericValue< Encoding, Allocator >::kNull_Flag.
|
inline |
Remove a member in object by its name.
name | Name of member to be removed. |
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::FindMember(), rapidjson::GenericValue< Encoding, Allocator >::IsObject(), rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Member::name, units::name, rapidjson::GenericValue< Encoding, Allocator >::Data::o, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Object::size, and rapidjson::GenericValue< Encoding, Allocator >::Member::value.
|
inline |
Request the array to have enough capacity to store elements.
newCapacity | The capacity that the array at least need to have. |
allocator | The allocator for allocating memory. It must be the same one use previously. |
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::Array::capacity, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), rapidjson::GenericValue< Encoding, Allocator >::IsArray(), and RAPIDJSON_ASSERT.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::PushBack().
|
inline |
Set this value as an empty array.
References rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), rapidjson::kArrayType, and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
inlineprivate |
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::Array::capacity, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::Array::elements, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kArrayFlag, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set this value as an empty object.
References rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), rapidjson::kObjectType, and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
inlineprivate |
Initialize this value as object with initial data, without calling destructor.
References rapidjson::GenericValue< Encoding, Allocator >::Object::capacity, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kObjectFlag, rapidjson::GenericValue< Encoding, Allocator >::Object::members, rapidjson::GenericValue< Encoding, Allocator >::Data::o, and rapidjson::GenericValue< Encoding, Allocator >::Object::size.
|
inline |
Set this value as a string without copying source string.
s | source string pointer. |
References rapidjson::GenericValue< Encoding, Allocator >::SetString(), and rapidjson::internal::StrLen().
Referenced by rapidjson::GenericValue< Encoding, Allocator >::SetString().
|
inline |
Set this value as a string by copying from source string.
s | source string. |
allocator | Allocator for allocating copied buffer. Commonly use document.GetAllocator(). |
References rapidjson::GenericValue< Encoding, Allocator >::SetString(), and rapidjson::internal::StrLen().
Referenced by rapidjson::GenericValue< Encoding, Allocator >::SetString().
|
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.
s | source string pointer. |
length | The length of source string, excluding the trailing null terminator. |
References rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw(), and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
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.
s | source string. |
length | The length of source string, excluding the trailing null terminator. |
allocator | Allocator for allocating copied buffer. Commonly use document.GetAllocator(). |
References rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw(), and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
inlineprivate |
Initialize this value as constant string, without calling destructor.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kConstStringFlag, rapidjson::GenericValue< Encoding, Allocator >::String::length, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Data::s, and rapidjson::GenericValue< Encoding, Allocator >::String::str.
Referenced by rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), and rapidjson::GenericValue< Encoding, Allocator >::SetString().
|
inlineprivate |
Initialize this value as copy string with initial data, without calling destructor.
References rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::flags_, rapidjson::GenericValue< Encoding, Allocator >::kCopyStringFlag, rapidjson::GenericValue< Encoding, Allocator >::String::length, RAPIDJSON_ASSERT, rapidjson::GenericValue< Encoding, Allocator >::Data::s, and rapidjson::GenericValue< Encoding, Allocator >::String::str.
|
inline |
|
inline |
|
inline |
Get the number of elements in array.
References rapidjson::GenericValue< Encoding, Allocator >::Data::a, rapidjson::GenericValue< Encoding, Allocator >::data_, rapidjson::GenericValue< Encoding, Allocator >::IsArray(), RAPIDJSON_ASSERT, and rapidjson::GenericValue< Encoding, Allocator >::Array::size.
|
friend |
|
private |
Referenced by rapidjson::GenericValue< Encoding, Allocator >::Accept(), rapidjson::GenericValue< Encoding, Allocator >::AddMember(), rapidjson::GenericValue< Encoding, Allocator >::Begin(), rapidjson::GenericValue< Encoding, Allocator >::Capacity(), rapidjson::GenericValue< Encoding, Allocator >::Clear(), rapidjson::GenericValue< Encoding, Allocator >::Empty(), rapidjson::GenericValue< Encoding, Allocator >::End(), rapidjson::GenericValue< Encoding, Allocator >::FindMember(), rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), rapidjson::GenericValue< Encoding, Allocator >::GetDouble(), rapidjson::GenericValue< Encoding, Allocator >::GetInt(), rapidjson::GenericValue< Encoding, Allocator >::GetInt64(), rapidjson::GenericValue< Encoding, Allocator >::GetString(), rapidjson::GenericValue< Encoding, Allocator >::GetStringLength(), rapidjson::GenericValue< Encoding, Allocator >::GetUint(), rapidjson::GenericValue< Encoding, Allocator >::GetUint64(), rapidjson::GenericValue< Encoding, Allocator >::MemberBegin(), rapidjson::GenericValue< Encoding, Allocator >::MemberEnd(), rapidjson::GenericValue< Encoding, Allocator >::operator[](), rapidjson::GenericValue< Encoding, Allocator >::PopBack(), rapidjson::GenericValue< Encoding, Allocator >::PushBack(), rapidjson::GenericValue< Encoding, Allocator >::RemoveMember(), rapidjson::GenericValue< Encoding, Allocator >::Reserve(), rapidjson::GenericValue< Encoding, Allocator >::SetArrayRaw(), rapidjson::GenericValue< Encoding, Allocator >::SetObjectRaw(), rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw(), rapidjson::GenericValue< Encoding, Allocator >::Size(), and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
private |
Referenced by rapidjson::GenericValue< Encoding, Allocator >::GenericValue(), rapidjson::GenericValue< Encoding, Allocator >::GetBool_(), rapidjson::GenericValue< Encoding, Allocator >::GetDouble(), rapidjson::GenericValue< Encoding, Allocator >::GetInt(), rapidjson::GenericValue< Encoding, Allocator >::GetInt64(), rapidjson::GenericValue< Encoding, Allocator >::GetType(), rapidjson::GenericValue< Encoding, Allocator >::GetUint(), rapidjson::GenericValue< Encoding, Allocator >::GetUint64(), rapidjson::GenericValue< Encoding, Allocator >::IsArray(), rapidjson::GenericValue< Encoding, Allocator >::IsBool_(), rapidjson::GenericValue< Encoding, Allocator >::IsDouble(), rapidjson::GenericValue< Encoding, Allocator >::IsFalse(), rapidjson::GenericValue< Encoding, Allocator >::IsInt(), rapidjson::GenericValue< Encoding, Allocator >::IsInt64(), rapidjson::GenericValue< Encoding, Allocator >::IsNull_(), rapidjson::GenericValue< Encoding, Allocator >::IsNumber(), rapidjson::GenericValue< Encoding, Allocator >::IsObject(), rapidjson::GenericValue< Encoding, Allocator >::IsString(), rapidjson::GenericValue< Encoding, Allocator >::IsTrue(), rapidjson::GenericValue< Encoding, Allocator >::IsUint(), rapidjson::GenericValue< Encoding, Allocator >::IsUint64(), rapidjson::GenericValue< Encoding, Allocator >::operator=(), rapidjson::GenericValue< Encoding, Allocator >::RawAssign(), rapidjson::GenericValue< Encoding, Allocator >::SetArrayRaw(), rapidjson::GenericValue< Encoding, Allocator >::SetObjectRaw(), rapidjson::GenericValue< Encoding, Allocator >::SetStringRaw(), and rapidjson::GenericValue< Encoding, Allocator >::~GenericValue().
|
staticprivate |
Referenced by rapidjson::GenericValue< Encoding, Allocator >::PushBack().
|
staticprivate |
Referenced by rapidjson::GenericValue< Encoding, Allocator >::AddMember().