Documentation
Public Types |
Public Member Functions |
Private Member Functions |
Private Attributes |
Static Private Attributes |
List of all members
rapidjson::GenericDocument< Encoding, Allocator > Class Template Reference
A document for parsing JSON text as DOM. More...
#include <document.h>
Inheritance diagram for rapidjson::GenericDocument< Encoding, Allocator >:
Collaboration diagram for rapidjson::GenericDocument< Encoding, Allocator >:
Public Types | |
| 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. | |
Public Types inherited from rapidjson::GenericValue< Encoding, Allocator > | |
| 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 Member * | MemberIterator |
| Member iterator for iterating in object. | |
| typedef const Member * | 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. | |
Public Member Functions | |
| GenericDocument (Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity) | |
| Constructor. More... | |
| template<unsigned parseFlags, typename SourceEncoding , typename InputStream > | |
| GenericDocument & | ParseStream (InputStream &is) |
| Parse JSON text from an input stream. More... | |
| template<unsigned parseFlags, typename SourceEncoding > | |
| GenericDocument & | ParseInsitu (Ch *str) |
| Parse JSON text from a mutable string. More... | |
| template<unsigned parseFlags> | |
| GenericDocument & | ParseInsitu (Ch *str) |
| template<unsigned parseFlags, typename SourceEncoding > | |
| GenericDocument & | Parse (const Ch *str) |
| Parse JSON text from a read-only string. More... | |
| template<unsigned parseFlags> | |
| GenericDocument & | Parse (const Ch *str) |
| bool | HasParseError () const |
| Whether a parse error was occured in the last parsing. | |
| const char * | GetParseError () const |
| Get the message of parsing error. | |
| size_t | GetErrorOffset () const |
| Get the offset in character of the parsing error. | |
| Allocator & | GetAllocator () |
| Get the allocator of this document. | |
| size_t | GetStackCapacity () const |
| Get the capacity of stack in bytes. | |
| void | Null () |
| void | Bool (bool b) |
| void | Int (int i) |
| void | Uint (unsigned i) |
| void | Int64 (int64_t i) |
| void | Uint64 (uint64_t i) |
| void | Double (double d) |
| void | String (const Ch *str, SizeType length, bool copy) |
| void | StartObject () |
| void | EndObject (SizeType memberCount) |
| void | StartArray () |
| void | EndArray (SizeType elementCount) |
Public Member Functions inherited from rapidjson::GenericValue< Encoding, Allocator > | |
| 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... | |
| GenericValue () | |
| Default constructor creates a null value. | |
| GenericValue (Type type) | |
| Constructor with JSON value type. More... | |
| GenericValue (bool b) | |
| Constructor for boolean value. | |
| GenericValue (int i) | |
| Constructor for int value. | |
| GenericValue (unsigned u) | |
| Constructor for unsigned value. | |
| GenericValue (int64_t i64) | |
| Constructor for int64_t value. | |
| GenericValue (uint64_t u64) | |
| Constructor for uint64_t value. | |
| GenericValue (double d) | |
| Constructor for double value. | |
| GenericValue (const Ch *s, SizeType length) | |
| Constructor for constant string (i.e. do not make a copy of string) | |
| GenericValue (const Ch *s) | |
| 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 () | |
| Destructor. More... | |
Private Member Functions | |
| GenericDocument & | operator= (const GenericDocument &) |
| void | ClearStack () |
Private Attributes | |
| internal::Stack< Allocator > | stack_ |
| const char * | parseError_ |
| size_t | errorOffset_ |
Static Private Attributes | |
| static const size_t | kDefaultStackCapacity = 1024 |
Detailed Description
template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
class rapidjson::GenericDocument< Encoding, Allocator >
A document for parsing JSON text as DOM.
- Template Parameters
-
Encoding encoding for both parsing and string storage. Alloactor allocator for allocating memory for the DOM, and the stack during parsing.
Constructor & Destructor Documentation
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
|
inline |
Constructor.
- Parameters
-
allocator Optional allocator for allocating stack memory. stackCapacity Initial capacity of stack in bytes.
Member Function Documentation
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<unsigned parseFlags, typename SourceEncoding >
|
inline |
Parse JSON text from a read-only string.
- Template Parameters
-
parseFlags Combination of ParseFlag (must not contain kParseInsituFlag).
- Parameters
-
str Read-only zero-terminated string to be parsed.
Here is the caller graph for this function:
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<unsigned parseFlags, typename SourceEncoding >
|
inline |
Parse JSON text from a mutable string.
- Template Parameters
-
parseFlags Combination of ParseFlag.
- Parameters
-
str Mutable zero-terminated string to be parsed.
- Returns
- The document itself for fluent API.
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<unsigned parseFlags, typename SourceEncoding , typename InputStream >
|
inline |
Parse JSON text from an input stream.
- Template Parameters
-
parseFlags Combination of ParseFlag.
- Parameters
-
stream Input stream to be parsed.
- Returns
- The document itself for fluent API.
Here is the call graph for this function:
The documentation for this class was generated from the following file:
- /home/travis/build/urho3d/Urho3D/Source/ThirdParty/rapidjson/include/rapidjson/document.h

Public Types inherited from