|
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.
|
typedef StackAllocator | StackAllocatorType |
| StackAllocator type from template parameter.
|
typedef GenericMember< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR > | Member |
| Name-value pair in an object.
|
typedef Encoding | EncodingType |
| Encoding type from template parameter.
|
typedef RAPIDJSON_DEFAULT_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, RAPIDJSON_DEFAULT_ALLOCATOR >::Iterator | MemberIterator |
| Member iterator for iterating in object.
|
typedef GenericMemberIterator< true, Encoding, RAPIDJSON_DEFAULT_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, RAPIDJSON_DEFAULT_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
|
| GenericDocument (Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0) |
| Constructor
|
GenericDocument & | Swap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT |
| Exchange the contents of this document with those of another.
|
template<typename Generator> |
GenericDocument & | Populate (Generator &g) |
| Populate this document by a generator which produces SAX events.
|
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) |
GenericValue & | Swap (GenericValue &other) RAPIDJSON_NOEXCEPT |
| Exchange the contents of this value with those of other.
|
template<unsigned parseFlags, typename SourceEncoding, typename InputStream> |
GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream (with Encoding conversion)
|
template<unsigned parseFlags, typename InputStream> |
GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream
|
template<typename InputStream> |
GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream (with kParseDefaultFlags)
|
template<unsigned parseFlags> |
GenericDocument & | ParseInsitu (Ch *str) |
| Parse JSON text from a mutable string
|
GenericDocument & | ParseInsitu (Ch *str) |
| Parse JSON text from a mutable string (with kParseDefaultFlags)
|
template<unsigned parseFlags, typename SourceEncoding> |
GenericDocument & | Parse (const typename SourceEncoding::Ch *str) |
| Parse JSON text from a read-only string (with Encoding conversion)
|
template<unsigned parseFlags> |
GenericDocument & | Parse (const Ch *str) |
| Parse JSON text from a read-only string
|
GenericDocument & | Parse (const Ch *str) |
| Parse JSON text from a read-only string (with kParseDefaultFlags)
|
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
|
| ~GenericValue () |
| Destructor.
|
bool | operator== (const GenericValue< Encoding, SourceAllocator > &rhs) const |
| Equal-to operator
|
bool | operator!= (const GenericValue< Encoding, SourceAllocator > &rhs) const |
| Not-equal-to operator
|
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 |
bool | IsLosslessDouble () const |
bool | IsFloat () const |
bool | IsLosslessFloat () const |
GenericValue & | SetNull () |
bool | GetBool () const |
| Set boolean value
|
GenericValue & | SetBool (bool b) |
GenericValue & | SetObject () |
| Set this value as an empty object.
|
SizeType | MemberCount () const |
| Get the number of members in the object.
|
SizeType | MemberCapacity () const |
| Get the capacity of object.
|
bool | ObjectEmpty () const |
| Check whether the object is empty.
|
GenericValue & | operator[] (T *name) |
| Get a value from an object associated with the name.
|
ConstMemberIterator | MemberBegin () const |
| Const member iterator
|
ConstMemberIterator | MemberEnd () const |
| Const past-the-end member iterator
|
GenericValue & | MemberReserve (SizeType newCapacity, RAPIDJSON_DEFAULT_ALLOCATOR &allocator) |
| Request the object to have enough capacity to store members.
|
bool | HasMember (const Ch *name) const |
| Check whether a member exists in the object.
|
MemberIterator | FindMember (const Ch *name) |
| Find member by name.
|
GenericValue & | AddMember (GenericValue &name, GenericValue &value, RAPIDJSON_DEFAULT_ALLOCATOR &allocator) |
| Add a member (name-value pair) to the object.
|
void | RemoveAllMembers () |
| Remove all members in the object.
|
bool | RemoveMember (const Ch *name) |
| Remove a member in object by its name.
|
MemberIterator | EraseMember (ConstMemberIterator pos) |
| Remove a member from an object by iterator.
|
Object | GetObject () |
Object | GetObj () |
int | GetInt () const |
unsigned | GetUint () const |
int64_t | GetInt64 () const |
uint64_t | GetUint64 () const |
double | GetDouble () const |
| Get the value as double type.
|
float | GetFloat () const |
| Get the value as float type.
|
GenericValue & | SetInt (int i) |
GenericValue & | SetUint (unsigned u) |
GenericValue & | SetInt64 (int64_t i64) |
GenericValue & | SetUint64 (uint64_t u64) |
GenericValue & | SetDouble (double d) |
GenericValue & | SetFloat (float f) |
const Ch * | GetString () const |
SizeType | GetStringLength () const |
| Get the length of string.
|
GenericValue & | SetString (const Ch *s, SizeType length) |
| Set this value as a string without copying source string.
|
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.
|
ValueIterator | Begin () |
| Element iterator
|
ValueIterator | End () |
| Past-the-end element iterator
|
GenericValue & | Reserve (SizeType newCapacity, RAPIDJSON_DEFAULT_ALLOCATOR &allocator) |
| Request the array to have enough capacity to store elements.
|
GenericValue & | PushBack (GenericValue &value, RAPIDJSON_DEFAULT_ALLOCATOR &allocator) |
| Append a GenericValue at the end of the array.
|
GenericValue & | PopBack () |
| Remove the last element in the array.
|
ValueIterator | Erase (ConstValueIterator pos) |
| Remove an element of array by iterator.
|
Array | GetArray () |
bool | Is () const |
| Templated version for checking whether this value is type T.
|
T | Get () const |
ValueType & | Set (const T &data) |
bool | Accept (Handler &handler) const |
| Generate events of this value to a Handler.
|
GenericValue & | operator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT |
| Assignment with move semantics.
|
GenericValue & | CopyFrom (const GenericValue< Encoding, SourceAllocator > &rhs, RAPIDJSON_DEFAULT_ALLOCATOR &allocator, bool copyConstStrings=false) |
| Deep-copy assignment from Value
|
GenericValue & | Swap (GenericValue &other) RAPIDJSON_NOEXCEPT |
| Exchange the contents of this value with those of other.
|
GenericValue & | Move () RAPIDJSON_NOEXCEPT |
| Prepare Value for move semantics
|
template<typename
Encoding, typename
Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
class rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >
A document for parsing JSON text as DOM.
- 注解
- implements Handler concept
- 模板参数
-
- 警告
- 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.