|
template<typename Handler > |
const GenericValue & | Accept (Handler &handler) const |
| Generate events of this value to a Handler. More...
|
|
|
GenericValue & | operator= (GenericValue &rhs) |
| Assignment with move semantics. More...
|
|
template<typename T > |
GenericValue & | operator= (T value) |
| Assignment with primitive types. More...
|
|
|
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 |
|
|
GenericValue & | SetNull () |
|
|
bool | GetBool () const |
|
GenericValue & | SetBool (bool b) |
|
|
GenericValue & | SetObject () |
| Set this value as an empty object.
|
|
GenericValue & | operator[] (const Ch *name) |
| Get the value associated with the name. More...
|
|
const GenericValue & | operator[] (const Ch *name) const |
|
ConstMemberIterator | MemberBegin () const |
| Member iterators.
|
|
ConstMemberIterator | MemberEnd () const |
|
MemberIterator | MemberBegin () |
|
MemberIterator | MemberEnd () |
|
bool | HasMember (const Ch *name) const |
| Check whether a member exists in the object. More...
|
|
Member * | FindMember (const Ch *name) |
| Find member by name. More...
|
|
const Member * | FindMember (const Ch *name) const |
|
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...
|
|
|
GenericValue & | SetArray () |
| Set this value as an empty array.
|
|
SizeType | Size () const |
| Get the number of elements in array.
|
|
SizeType | Capacity () const |
| Get the capacity of array.
|
|
bool | Empty () const |
| Check whether the array is empty.
|
|
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.
|
|
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.
|
|
|
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) |
|
|
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...
|
|
|
enum | {
kBoolFlag = 0x100,
kNumberFlag = 0x200,
kIntFlag = 0x400,
kUintFlag = 0x800,
kInt64Flag = 0x1000,
kUint64Flag = 0x2000,
kDoubleFlag = 0x4000,
kStringFlag = 0x100000,
kCopyFlag = 0x200000,
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,
kConstStringFlag = kStringType | kStringFlag,
kCopyStringFlag = kStringType | kStringFlag | kCopyFlag,
kObjectFlag = kObjectType,
kArrayFlag = kArrayType,
kTypeMask = 0xFF
} |
|
|
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.
|
|
void | SetStringRaw (const Ch *s, SizeType length) |
| Initialize this value as constant string, without calling destructor.
|
|
void | SetStringRaw (const Ch *s, SizeType length, Allocator &allocator) |
| Initialize this value as copy string with initial data, without calling destructor.
|
|
void | RawAssign (GenericValue &rhs) |
| Assignment without calling destructor.
|
|
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
-
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. |
template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
template<typename Handler >
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
-
- Parameters
-
handler | An object implementing concept Handler. |