|
typedef Encoding::Ch | Ch |
| Character type derived from Encoding.
|
|
typedef GenericValue< Encoding, Allocator > | ValueType |
| Value type of the document.
|
|
typedef Allocator | AllocatorType |
| Allocator type from template parameter.
|
|
enum | {
kBoolFlag = 0x0008,
kNumberFlag = 0x0010,
kIntFlag = 0x0020,
kUintFlag = 0x0040,
kInt64Flag = 0x0080,
kUint64Flag = 0x0100,
kDoubleFlag = 0x0200,
kStringFlag = 0x0400,
kCopyFlag = 0x0800,
kInlineStrFlag = 0x1000,
kRawOutputStrFlag = 0x8000,
kNullFlag = kNullType,
kTrueFlag = static_cast<int>(kTrueType) | static_cast<int>(kBoolFlag),
kFalseFlag = static_cast<int>(kFalseType) | static_cast<int>(kBoolFlag),
kNumberIntFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kIntFlag | kInt64Flag),
kNumberUintFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag),
kNumberInt64Flag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kInt64Flag),
kNumberUint64Flag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kUint64Flag),
kNumberDoubleFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kDoubleFlag),
kNumberAnyFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag),
kConstStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag),
kCopyStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag | kCopyFlag),
kShortStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag | kCopyFlag | kInlineStrFlag),
kObjectFlag = kObjectType,
kArrayFlag = kArrayType,
kTypeMask = 0x07
} |
|
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 |
|
|
| GenericDocument (Type type, Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0) |
| Constructor. More...
|
|
| GenericDocument (Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0) |
| Constructor. More...
|
|
GenericDocument & | Swap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT |
| Exchange the contents of this document with those of another. More...
|
|
template<typename Generator > |
GenericDocument & | Populate (Generator &g) |
| Populate this document by a generator which produces SAX events. More...
|
|
Allocator & | GetAllocator () |
| Get the allocator of this document.
|
|
size_t | GetStackCapacity () const |
| Get the capacity of stack in bytes.
|
|
bool | Null () |
|
bool | Bool (bool b) |
|
bool | Int (int i) |
|
bool | Uint (unsigned i) |
|
bool | Int64 (int64_t i) |
|
bool | Uint64 (uint64_t i) |
|
bool | Double (double d) |
|
bool | RawNumber (const Ch *str, SizeType length, bool copy) |
|
bool | String (const Ch *str, SizeType length, bool copy) |
|
bool | StartObject () |
|
bool | Key (const Ch *str, SizeType length, bool copy) |
|
bool | EndObject (SizeType memberCount) |
|
bool | StartArray () |
|
bool | EndArray (SizeType elementCount) |
|
|
template<unsigned parseFlags, typename SourceEncoding , typename InputStream > |
GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream (with Encoding conversion) More...
|
|
template<unsigned parseFlags, typename InputStream > |
GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream. More...
|
|
template<typename InputStream > |
GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream (with kParseDefaultFlags) More...
|
|
|
template<unsigned parseFlags> |
GenericDocument & | ParseInsitu (Ch *str) |
| Parse JSON text from a mutable string. More...
|
|
GenericDocument & | ParseInsitu (Ch *str) |
| Parse JSON text from a mutable string (with kParseDefaultFlags) More...
|
|
|
template<unsigned parseFlags, typename SourceEncoding > |
GenericDocument & | Parse (const typename SourceEncoding::Ch *str) |
| Parse JSON text from a read-only string (with Encoding conversion) More...
|
|
template<unsigned parseFlags> |
GenericDocument & | Parse (const Ch *str) |
| Parse JSON text from a read-only string. More...
|
|
GenericDocument & | Parse (const Ch *str) |
| Parse JSON text from a read-only string (with kParseDefaultFlags) More...
|
|
template<unsigned parseFlags, typename SourceEncoding > |
GenericDocument & | Parse (const typename SourceEncoding::Ch *str, size_t length) |
|
template<unsigned parseFlags> |
GenericDocument & | Parse (const Ch *str, size_t length) |
|
GenericDocument & | Parse (const Ch *str, size_t length) |
|
|
bool | HasParseError () const |
| Whether a parse error has occurred in the last parsing.
|
|
ParseErrorCode | GetParseError () const |
| Get the ParseErrorCode of last parsing.
|
|
size_t | GetErrorOffset () const |
| Get the position of last parsing error in input, 0 otherwise.
|
|
| operator ParseResult () const |
| Implicit conversion to get the last parse result. More...
|
|
template<typename T > |
| RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator |
| Assignment with primitive types. More...
|
|
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) |
|
RAPIDJSON_FORCEINLINE Member * | DoAllocMembers (SizeType capacity, Allocator &allocator) |
|
void | DoReserveMembers (SizeType newCapacity, Allocator &allocator) |
|
template<typename SourceAllocator > |
MemberIterator | DoFindMember (const GenericValue< Encoding, SourceAllocator > &name) |
|
void | DoClearMembers () |
|
void | DoFreeMembers () |
|
void | DoAddMember (GenericValue &name, GenericValue &value, Allocator &allocator) |
|
MemberIterator | DoRemoveMember (MemberIterator m) |
|
MemberIterator | DoEraseMembers (ConstMemberIterator first, ConstMemberIterator last) |
|
template<typename SourceAllocator > |
void | DoCopyMembers (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator, bool copyConstStrings) |
|
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 |
|
GenericValue & | operator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT |
| Assignment with move semantics. More...
|
|
GenericValue & | operator= (StringRefType str) RAPIDJSON_NOEXCEPT |
| Assignment of constant string reference (no copy) More...
|
|
| GenericValue () RAPIDJSON_NOEXCEPT |
| Default constructor creates a null value.
|
|
| GenericValue (Type type) RAPIDJSON_NOEXCEPT |
| Constructor with JSON value type. More...
|
|
template<typename SourceAllocator > |
| GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator, bool copyConstStrings=false) |
| 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.
|
|
| 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. More...
|
|
| GenericValue (Object o) RAPIDJSON_NOEXCEPT |
| Constructor for Object. More...
|
|
| ~GenericValue () |
| Destructor. More...
|
|
template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
class GenericDocument< Encoding, Allocator, StackAllocator >
A document for parsing JSON text as DOM.
- Note
- implements Handler concept
- Template Parameters
-
Encoding | Encoding for both parsing and string storage. |
Allocator | Allocator for allocating memory for the DOM |
StackAllocator | Allocator for allocating memory for stack during parsing. |
- Warning
- Although GenericDocument inherits from GenericValue, the API does not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not
delete
a GenericDocument object via a pointer to a GenericValue.