VR-Vantage 2.2 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
rapidjson::GenericDocument< Encoding, Allocator > Class Template Reference

A document for parsing JSON text as DOM. More...

Inheritance diagram for rapidjson::GenericDocument< Encoding, Allocator >:
Inheritance graph
[legend]

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 MemberMemberIterator
 Member iterator for iterating in object.
typedef const MemberConstMemberIterator
 Constant member iterator for iterating in object.
typedef GenericValueValueIterator
 Value iterator for iterating in array.
typedef const GenericValueConstValueIterator
 Constant value iterator for iterating in array.

Public Member Functions

 GenericDocument (Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity)
 Constructor.
template<unsigned parseFlags, typename Stream >
GenericDocumentParseStream (Stream &stream)
 Parse JSON text from an input stream.
template<unsigned parseFlags>
GenericDocumentParseInsitu (Ch *str)
 Parse JSON text from a mutable string.
template<unsigned parseFlags>
GenericDocumentParse (const Ch *str)
 Parse JSON text from a read-only string.
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.
AllocatorGetAllocator ()
 Get the allocator of this document.
size_t GetStackCapacity () const
 Get the capacity of stack in bytes.
- Public Member Functions inherited from rapidjson::GenericValue< Encoding, Allocator >
template<typename Handler >
const GenericValueAccept (Handler &handler) const
 Generate events of this value to a Handler.
GenericValueoperator= (GenericValue &rhs)
 Assignment with move semantics.
template<typename T >
GenericValueoperator= (T value)
 Assignment with primitive types.
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
GenericValueSetNull ()
bool GetBool () const
GenericValueSetBool (bool b)
GenericValueSetObject ()
 Set this value as an empty object.
GenericValueoperator[] (const Ch *name)
 Get the value associated with the object's name.
const GenericValueoperator[] (const Ch *name) const
 Set this value as an empty object.
ConstMemberIterator MemberBegin () const
 Member iterators.
ConstMemberIterator MemberEnd () const
 Set this value as an empty object.
MemberIterator MemberBegin ()
 Set this value as an empty object.
MemberIterator MemberEnd ()
 Set this value as an empty object.
bool HasMember (const Ch *name) const
 Check whether a member exists in the object.
GenericValueAddMember (GenericValue &name, GenericValue &value, Allocator &allocator)
 Add a member (name-value pair) to the object.
GenericValueAddMember (const Ch *name, Allocator &nameAllocator, GenericValue &value, Allocator &allocator)
 Set this value as an empty object.
GenericValueAddMember (const Ch *name, GenericValue &value, Allocator &allocator)
 Set this value as an empty object.
template<typename T >
GenericValueAddMember (const Ch *name, T value, Allocator &allocator)
 Set this value as an empty object.
bool RemoveMember (const Ch *name)
 Remove a member in object by its name.
GenericValueSetArray ()
 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.
GenericValueoperator[] (SizeType index)
 Get an element from array by index.
const GenericValueoperator[] (SizeType index) const
 Set this value as an empty array.
ValueIterator Begin ()
 Element iterator.
ValueIterator End ()
 Set this value as an empty array.
ConstValueIterator Begin () const
 Set this value as an empty array.
ConstValueIterator End () const
 Set this value as an empty array.
GenericValueReserve (SizeType newCapacity, Allocator &allocator)
 Request the array to have enough capacity to store elements.
GenericValuePushBack (GenericValue &value, Allocator &allocator)
 Append a value at the end of the array.
template<typename T >
GenericValuePushBack (T value, Allocator &allocator)
 Set this value as an empty array.
GenericValuePopBack ()
 Remove the last element in the array.
int GetInt () const
unsigned GetUint () const
int64_t GetInt64 () const
uint64_t GetUint64 () const
double GetDouble () const
GenericValueSetInt (int i)
GenericValueSetUint (unsigned u)
GenericValueSetInt64 (int64_t i64)
GenericValueSetUint64 (uint64_t u64)
GenericValueSetDouble (double d)
const ChGetString () const
 Get the length of string.
SizeType GetStringLength () const
 Get the length of string.
GenericValueSetString (const Ch *s, SizeType length)
 Set this value as a string without copying source string.
GenericValueSetString (const Ch *s)
 Set this value as a string without copying source string.
GenericValueSetString (const Ch *s, SizeType length, Allocator &allocator)
 Set this value as a string by copying from source string.
GenericValueSetString (const Ch *s, Allocator &allocator)
 Set this value as a string by copying from source string.
 GenericValue ()
 Default constructor creates a null value.
 GenericValue (Type type)
 Constructor with JSON value type.
 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.

Private Member Functions

GenericDocumentoperator= (const GenericDocument &)
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)
void ClearStack ()

Private Attributes

internal::Stack< Allocatorstack_
const char * parseError_
size_t errorOffset_

Static Private Attributes

static const size_t kDefaultStackCapacity = 1024

Friends

class GenericReader< Encoding, Allocator >

Detailed Description

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
class rapidjson::GenericDocument< Encoding, Allocator >

A document for parsing JSON text as DOM.

Template Parameters
Encodingencoding for both parsing and string storage.
Alloactorallocator for allocating memory for the DOM, and the stack during parsing.

Member Typedef Documentation

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef Encoding::Ch rapidjson::GenericDocument< Encoding, Allocator >::Ch

Character type derived from Encoding.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef GenericValue<Encoding, Allocator> rapidjson::GenericDocument< Encoding, Allocator >::ValueType

Value type of the document.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
typedef Allocator rapidjson::GenericDocument< Encoding, Allocator >::AllocatorType

Allocator type from template parameter.

Constructor & Destructor Documentation

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
rapidjson::GenericDocument< Encoding, Allocator >::GenericDocument ( Allocator allocator = 0,
size_t  stackCapacity = kDefaultStackCapacity 
)
inline

Constructor.

Parameters
allocatorOptional allocator for allocating stack memory.
stackCapacityInitial capacity of stack in bytes.

Member Function Documentation

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<unsigned parseFlags, typename Stream >
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator >::ParseStream ( Stream stream)
inline
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<unsigned parseFlags>
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator >::ParseInsitu ( Ch str)
inline

Parse JSON text from a mutable string.

Template Parameters
parseFlagsCombination of ParseFlag.
Parameters
strMutable zero-terminated string to be parsed.
Returns
The document itself for fluent API.
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
template<unsigned parseFlags>
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator >::Parse ( const Ch str)
inline

Parse JSON text from a read-only string.

Template Parameters
parseFlagsCombination of ParseFlag (must not contain kParseInsituFlag).
Parameters
strRead-only zero-terminated string to be parsed.

References rapidjson::kParseInsituFlag, and RAPIDJSON_ASSERT.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
bool rapidjson::GenericDocument< Encoding, Allocator >::HasParseError ( ) const
inline

Whether a parse error was occured in the last parsing.

References rapidjson::GenericDocument< Encoding, Allocator >::parseError_.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
const char* rapidjson::GenericDocument< Encoding, Allocator >::GetParseError ( ) const
inline

Get the message of parsing error.

References rapidjson::GenericDocument< Encoding, Allocator >::parseError_.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
size_t rapidjson::GenericDocument< Encoding, Allocator >::GetErrorOffset ( ) const
inline

Get the offset in character of the parsing error.

References rapidjson::GenericDocument< Encoding, Allocator >::errorOffset_.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
Allocator& rapidjson::GenericDocument< Encoding, Allocator >::GetAllocator ( )
inline
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
size_t rapidjson::GenericDocument< Encoding, Allocator >::GetStackCapacity ( ) const
inline

Get the capacity of stack in bytes.

References rapidjson::GenericDocument< Encoding, Allocator >::stack_.

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator >::operator= ( const GenericDocument< Encoding, Allocator > &  )
private
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Null ( )
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Bool ( bool  b)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Int ( int  i)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Uint ( unsigned  i)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Int64 ( int64_t  i)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Uint64 ( uint64_t  i)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::Double ( double  d)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::String ( const Ch str,
SizeType  length,
bool  copy 
)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::StartObject ( )
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::EndObject ( SizeType  memberCount)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::StartArray ( )
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::EndArray ( SizeType  elementCount)
inlineprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
void rapidjson::GenericDocument< Encoding, Allocator >::ClearStack ( )
inlineprivate

Friends And Related Function Documentation

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
friend class GenericReader< Encoding, Allocator >
friend

Member Data Documentation

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
const size_t rapidjson::GenericDocument< Encoding, Allocator >::kDefaultStackCapacity = 1024
staticprivate
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
internal::Stack<Allocator> rapidjson::GenericDocument< Encoding, Allocator >::stack_
private
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
const char* rapidjson::GenericDocument< Encoding, Allocator >::parseError_
private
template<typename Encoding , typename Allocator = MemoryPoolAllocator<>>
size_t rapidjson::GenericDocument< Encoding, Allocator >::errorOffset_
private

The documentation for this class was generated from the following file:


Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)