Wire Sysio Wire Sysion 1.0.0
|
Represents a JSON value. Use Value for UTF8 encoding and default allocator. More...
#include <document.h>
Classes | |
struct | ArrayData |
union | Data |
struct | Flag |
union | Number |
struct | ObjectData |
struct | ShortString |
struct | String |
Public Types | |
typedef GenericMember< Encoding, Allocator > | Member |
Name-value pair in an object. | |
typedef Encoding | EncodingType |
Encoding type from template parameter. | |
typedef Allocator | AllocatorType |
Allocator type from template parameter. | |
typedef Encoding::Ch | Ch |
Character type derived from Encoding. | |
typedef GenericStringRef< Ch > | StringRefType |
Reference to a constant string. | |
typedef GenericMemberIterator< false, Encoding, Allocator >::Iterator | MemberIterator |
Member iterator for iterating in object. | |
typedef GenericMemberIterator< true, Encoding, Allocator >::Iterator | ConstMemberIterator |
Constant member iterator for iterating in object. | |
typedef GenericValue * | ValueIterator |
Value iterator for iterating in array. | |
typedef const GenericValue * | ConstValueIterator |
Constant value iterator for iterating in array. | |
typedef GenericValue< Encoding, Allocator > | ValueType |
Value type of itself. | |
typedef GenericArray< false, ValueType > | Array |
typedef GenericArray< true, ValueType > | ConstArray |
typedef GenericObject< false, ValueType > | Object |
typedef GenericObject< true, ValueType > | ConstObject |
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 } |
template<typename , typename , typename > | |
class | GenericDocument |
static const SizeType | kDefaultArrayCapacity = 16 |
static const SizeType | kDefaultObjectCapacity = 16 |
Data | data_ |
GenericValue & | operator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT |
Assignment with move semantics. | |
GenericValue & | operator= (StringRefType str) RAPIDJSON_NOEXCEPT |
Assignment of constant string reference (no copy) | |
template<typename T > | |
RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator | |
Assignment with primitive types. | |
RAPIDJSON_FORCEINLINE const Ch * | GetStringPointer () const |
RAPIDJSON_FORCEINLINE const Ch * | SetStringPointer (const Ch *str) |
RAPIDJSON_FORCEINLINE GenericValue * | GetElementsPointer () const |
RAPIDJSON_FORCEINLINE GenericValue * | SetElementsPointer (GenericValue *elements) |
RAPIDJSON_FORCEINLINE Member * | GetMembersPointer () const |
RAPIDJSON_FORCEINLINE Member * | SetMembersPointer (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. | |
void | SetStringRaw (StringRefType s) RAPIDJSON_NOEXCEPT |
Initialize this value as constant string, without calling destructor. | |
void | SetStringRaw (StringRefType s, Allocator &allocator) |
Initialize this value as copy string with initial data, without calling destructor. | |
void | RawAssign (GenericValue &rhs) RAPIDJSON_NOEXCEPT |
Assignment without calling destructor. | |
template<typename SourceAllocator > | |
bool | StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const |
Constructors and destructor. | |
GenericValue () RAPIDJSON_NOEXCEPT | |
Default constructor creates a null value. | |
GenericValue (Type type) RAPIDJSON_NOEXCEPT | |
Constructor with JSON value type. | |
template<typename SourceAllocator > | |
GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator, bool copyConstStrings=false) | |
Explicit copy constructor (with allocator) | |
template<typename T > | |
GenericValue (T b, RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))) RAPIDJSON_NOEXCEPT | |
Constructor for boolean value. | |
GenericValue (int i) RAPIDJSON_NOEXCEPT | |
Constructor for int value. | |
GenericValue (unsigned u) RAPIDJSON_NOEXCEPT | |
Constructor for unsigned value. | |
GenericValue (int64_t i64) RAPIDJSON_NOEXCEPT | |
Constructor for int64_t value. | |
GenericValue (uint64_t u64) RAPIDJSON_NOEXCEPT | |
Constructor for uint64_t value. | |
GenericValue (double d) RAPIDJSON_NOEXCEPT | |
Constructor for double value. | |
GenericValue (float f) RAPIDJSON_NOEXCEPT | |
Constructor for float value. | |
GenericValue (const Ch *s, SizeType length) RAPIDJSON_NOEXCEPT | |
Constructor for constant string (i.e. do not make a copy of string) | |
GenericValue (StringRefType s) RAPIDJSON_NOEXCEPT | |
Constructor for constant string (i.e. do not make a copy of string) | |
GenericValue (const Ch *s, SizeType length, Allocator &allocator) | |
Constructor for copy-string (i.e. do make a copy of string) | |
GenericValue (const Ch *s, Allocator &allocator) | |
Constructor for copy-string (i.e. do make a copy of string) | |
GenericValue (Array a) RAPIDJSON_NOEXCEPT | |
Constructor for Array. | |
GenericValue (Object o) RAPIDJSON_NOEXCEPT | |
Constructor for Object. | |
~GenericValue () | |
Destructor. | |
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. |
Definition at line 578 of file document.h.
Allocator GenericValue< Encoding, Allocator >::AllocatorType |
Definition at line 583 of file document.h.
GenericArray<false, ValueType> GenericValue< Encoding, Allocator >::Array |
Definition at line 591 of file document.h.
Encoding::Ch GenericValue< Encoding, Allocator >::Ch |
Definition at line 584 of file document.h.
GenericArray<true, ValueType> GenericValue< Encoding, Allocator >::ConstArray |
Definition at line 592 of file document.h.
GenericMemberIterator<true,Encoding,Allocator>::Iterator GenericValue< Encoding, Allocator >::ConstMemberIterator |
Definition at line 587 of file document.h.
GenericObject<true, ValueType> GenericValue< Encoding, Allocator >::ConstObject |
Definition at line 594 of file document.h.
const GenericValue* GenericValue< Encoding, Allocator >::ConstValueIterator |
Definition at line 589 of file document.h.
Encoding GenericValue< Encoding, Allocator >::EncodingType |
Definition at line 582 of file document.h.
GenericMember<Encoding, Allocator> GenericValue< Encoding, Allocator >::Member |
Definition at line 581 of file document.h.
GenericMemberIterator<false,Encoding,Allocator>::Iterator GenericValue< Encoding, Allocator >::MemberIterator |
Definition at line 586 of file document.h.
GenericObject<false, ValueType> GenericValue< Encoding, Allocator >::Object |
Definition at line 593 of file document.h.
GenericStringRef<Ch> GenericValue< Encoding, Allocator >::StringRefType |
Definition at line 585 of file document.h.
GenericValue* GenericValue< Encoding, Allocator >::ValueIterator |
Definition at line 588 of file document.h.
GenericValue<Encoding, Allocator> GenericValue< Encoding, Allocator >::ValueType |
Definition at line 590 of file document.h.
Definition at line 1911 of file document.h.
|
inline |
|
inlineexplicit |
This creates a Value of specified type with default content.
type | Type of the value. |
Definition at line 630 of file document.h.
|
inline |
Creates a copy of a Value by using the given Allocator
SourceAllocator | allocator of rhs |
rhs | Value to copy from (read-only) |
allocator | Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). |
copyConstStrings | Force copying of constant strings (e.g. referencing an in-situ buffer) |
Definition at line 652 of file document.h.
|
inlineexplicit |
b | Boolean value |
bool
, if you want to construct a boolean JSON value in such cases. Definition at line 701 of file document.h.
|
inlineexplicit |
Definition at line 712 of file document.h.
|
inlineexplicit |
Definition at line 718 of file document.h.
|
inlineexplicit |
Definition at line 724 of file document.h.
|
inlineexplicit |
Definition at line 739 of file document.h.
|
inlineexplicit |
Definition at line 751 of file document.h.
|
inlineexplicit |
Definition at line 754 of file document.h.
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
a | An array obtained by GetArray() . |
Array
is always pass-by-value. Definition at line 781 of file document.h.
|
inline |
o | An object obtained by GetObject() . |
Object
is always pass-by-value. Definition at line 792 of file document.h.
|
inline |
Need to destruct elements of array, members of object, or copy-string.
Definition at line 800 of file document.h.
|
inline |
|
inline |
|
inline |
|
inline |
rhs | Source of the assignment. It will become a null value after assignment. |
Definition at line 836 of file document.h.
|
inline |
str | Constant string reference to be assigned |
Definition at line 856 of file document.h.
GenericValue< Encoding, Allocator >::RAPIDJSON_DISABLEIF_RETURN | ( | (internal::IsPointer< T >) | , |
(GenericValue< Encoding, Allocator > &) | ) |
T | Either Type, int , unsigned , int64_t , uint64_t |
value | The value to be assigned. |
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
|
inline |
|
inline |
Definition at line 2034 of file document.h.
|
inline |
|
inline |
|
inline |
Definition at line 2047 of file document.h.
|
inline |
|
inline |
Definition at line 2060 of file document.h.
|
inline |
Definition at line 2067 of file document.h.
|
inline |
Definition at line 2091 of file document.h.
|
friend |
Definition at line 1909 of file document.h.
Data GenericValue< Encoding, Allocator >::data_ |
Definition at line 2106 of file document.h.
|
static |
Definition at line 1942 of file document.h.
|
static |
Definition at line 1943 of file document.h.