bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
GenericDocument< Encoding, Allocator, StackAllocator > Class Template Reference

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

#include <document.h>

Inheritance diagram for GenericDocument< Encoding, Allocator, StackAllocator >:
Inheritance graph
Collaboration diagram for GenericDocument< Encoding, Allocator, StackAllocator >:
Collaboration graph

Public Types

typedef Allocator AllocatorType
 Allocator type from template parameter.
 
typedef GenericArray< false, ValueTypeArray
 
typedef Encoding::Ch Ch
 Character type derived from Encoding.
 
typedef GenericArray< true, ValueTypeConstArray
 
typedef GenericMemberIterator< true, Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::Iterator ConstMemberIterator
 Constant member iterator for iterating in object.
 
typedef GenericObject< true, ValueTypeConstObject
 
typedef const GenericValueConstValueIterator
 Constant value iterator for iterating in array.
 
typedef Encoding EncodingType
 Encoding type from template parameter.
 
typedef GenericMember< Encoding, RAPIDJSON_DEFAULT_ALLOCATORMember
 Name-value pair in an object.
 
typedef GenericMemberIterator< false, Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::Iterator MemberIterator
 Member iterator for iterating in object.
 
typedef GenericObject< false, ValueTypeObject
 
typedef GenericStringRef< ChStringRefType
 Reference to a constant string.
 
typedef GenericValueValueIterator
 Value iterator for iterating in array.
 
typedef GenericValue< Encoding, AllocatorValueType
 Value type of the document.
 

Public Member Functions

bool Bool (bool b)
 
bool Double (double d)
 
bool EndArray (SizeType elementCount)
 
bool EndObject (SizeType memberCount)
 
 GenericDocument (Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0)
 Constructor.
 
 GenericDocument (Type type, Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0)
 Constructor.
 
AllocatorGetAllocator ()
 Get the allocator of this document.
 
size_t GetStackCapacity () const
 Get the capacity of stack in bytes.
 
bool Int (int i)
 
bool Int64 (int64_t i)
 
bool Key (const Ch *str, SizeType length, bool copy)
 
bool Null ()
 
template<typename Generator>
GenericDocumentPopulate (Generator &g)
 Populate this document by a generator which produces SAX events.
 
bool RawNumber (const Ch *str, SizeType length, bool copy)
 
bool StartArray ()
 
bool StartObject ()
 
bool String (const Ch *str, SizeType length, bool copy)
 
GenericDocumentSwap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT
 Exchange the contents of this document with those of another.
 
bool Uint (unsigned i)
 
bool Uint64 (uint64_t i)
 
Parse from stream
template<unsigned parseFlags, typename SourceEncoding, typename InputStream>
GenericDocumentParseStream (InputStream &is)
 Parse JSON text from an input stream (with Encoding conversion)
 
template<unsigned parseFlags, typename InputStream>
GenericDocumentParseStream (InputStream &is)
 Parse JSON text from an input stream.
 
template<typename InputStream>
GenericDocumentParseStream (InputStream &is)
 Parse JSON text from an input stream (with kParseDefaultFlags)
 
Parse in-place from mutable string
template<unsigned parseFlags>
GenericDocumentParseInsitu (Ch *str)
 Parse JSON text from a mutable string.
 
GenericDocumentParseInsitu (Ch *str)
 Parse JSON text from a mutable string (with kParseDefaultFlags)
 
Parse from read-only string
template<unsigned parseFlags, typename SourceEncoding>
GenericDocumentParse (const typename SourceEncoding::Ch *str)
 Parse JSON text from a read-only string (with Encoding conversion)
 
template<unsigned parseFlags>
GenericDocumentParse (const Ch *str)
 Parse JSON text from a read-only string.
 
GenericDocumentParse (const Ch *str)
 Parse JSON text from a read-only string (with kParseDefaultFlags)
 
template<unsigned parseFlags, typename SourceEncoding>
GenericDocumentParse (const typename SourceEncoding::Ch *str, size_t length)
 
template<unsigned parseFlags>
GenericDocumentParse (const Ch *str, size_t length)
 
GenericDocumentParse (const Ch *str, size_t length)
 
Handling parse errors
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.
 

Friends

template<typename, typename>
class GenericValue
 
void swap (GenericDocument &a, GenericDocument &b) RAPIDJSON_NOEXCEPT
 free-standing swap function helper
 

Assignment operators

enum  
 
 RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator
 Assignment with primitive types.
 
RAPIDJSON_FORCEINLINE const ChGetStringPointer () const
 
RAPIDJSON_FORCEINLINE const ChSetStringPointer (const Ch *str)
 
RAPIDJSON_FORCEINLINE GenericValueGetElementsPointer () const
 
RAPIDJSON_FORCEINLINE GenericValueSetElementsPointer (GenericValue *elements)
 
RAPIDJSON_FORCEINLINE MemberGetMembersPointer () const
 
RAPIDJSON_FORCEINLINE MemberSetMembersPointer (Member *members)
 
void SetArrayRaw (GenericValue *values, SizeType count, RAPIDJSON_DEFAULT_ALLOCATOR &allocator)
 
void SetObjectRaw (Member *members, SizeType count, RAPIDJSON_DEFAULT_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, RAPIDJSON_DEFAULT_ALLOCATOR &allocator)
 Initialize this value as copy string with initial data, without calling destructor.
 
void RawAssign (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment without calling destructor.
 
bool StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const
 
static const SizeType kDefaultArrayCapacity
 
static const SizeType kDefaultObjectCapacity
 
Data data_
 

Detailed Description

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
EncodingEncoding for both parsing and string storage.
AllocatorAllocator for allocating memory for the DOM
StackAllocatorAllocator 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.

Definition at line 2203 of file document.h.

Member Typedef Documentation

◆ AllocatorType

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
typedef Allocator GenericDocument< Encoding, Allocator, StackAllocator >::AllocatorType

Allocator type from template parameter.

Definition at line 2207 of file document.h.

◆ Array

Definition at line 670 of file document.h.

◆ Ch

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
typedef Encoding::Ch GenericDocument< Encoding, Allocator, StackAllocator >::Ch

Character type derived from Encoding.

Definition at line 2205 of file document.h.

◆ ConstArray

typedef GenericArray<true, ValueType> GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::ConstArray
inherited

Definition at line 671 of file document.h.

◆ ConstMemberIterator

Constant member iterator for iterating in object.

Definition at line 666 of file document.h.

◆ ConstObject

typedef GenericObject<true, ValueType> GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::ConstObject
inherited

Definition at line 673 of file document.h.

◆ ConstValueIterator

typedef const GenericValue* GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::ConstValueIterator
inherited

Constant value iterator for iterating in array.

Definition at line 668 of file document.h.

◆ EncodingType

typedef Encoding GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::EncodingType
inherited

Encoding type from template parameter.

Definition at line 661 of file document.h.

◆ Member

Name-value pair in an object.

Definition at line 660 of file document.h.

◆ MemberIterator

Member iterator for iterating in object.

Definition at line 665 of file document.h.

◆ Object

Definition at line 672 of file document.h.

◆ StringRefType

typedef GenericStringRef<Ch> GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::StringRefType
inherited

Reference to a constant string.

Definition at line 664 of file document.h.

◆ ValueIterator

typedef GenericValue* GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::ValueIterator
inherited

Value iterator for iterating in array.

Definition at line 667 of file document.h.

◆ ValueType

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
typedef GenericValue<Encoding, Allocator> GenericDocument< Encoding, Allocator, StackAllocator >::ValueType

Value type of the document.

Definition at line 2206 of file document.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Definition at line 1990 of file document.h.

Constructor & Destructor Documentation

◆ GenericDocument() [1/2]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument< Encoding, Allocator, StackAllocator >::GenericDocument ( Type type,
Allocator * allocator = 0,
size_t stackCapacity = kDefaultStackCapacity,
StackAllocator * stackAllocator = 0 )
inlineexplicit

Constructor.

Creates an empty document of specified type.

Parameters
typeMandatory type of object to create.
allocatorOptional allocator for allocating memory.
stackCapacityOptional initial capacity of stack in bytes.
stackAllocatorOptional allocator for allocating memory for stack.

Definition at line 2216 of file document.h.

◆ GenericDocument() [2/2]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument< Encoding, Allocator, StackAllocator >::GenericDocument ( Allocator * allocator = 0,
size_t stackCapacity = kDefaultStackCapacity,
StackAllocator * stackAllocator = 0 )
inline

Constructor.

Creates an empty document which type is Null.

Parameters
allocatorOptional allocator for allocating memory.
stackCapacityOptional initial capacity of stack in bytes.
stackAllocatorOptional allocator for allocating memory for stack.

Definition at line 2229 of file document.h.

◆ ~GenericDocument()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument< Encoding, Allocator, StackAllocator >::~GenericDocument ( )
inline

Definition at line 2251 of file document.h.

Member Function Documentation

◆ Bool()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Bool ( bool b)
inline

Definition at line 2517 of file document.h.

◆ Double()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Double ( double d)
inline

Definition at line 2522 of file document.h.

◆ EndArray()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::EndArray ( SizeType elementCount)
inline

Definition at line 2552 of file document.h.

◆ EndObject()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::EndObject ( SizeType memberCount)
inline

Definition at line 2544 of file document.h.

◆ GetAllocator()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
Allocator & GenericDocument< Encoding, Allocator, StackAllocator >::GetAllocator ( )
inline

Get the allocator of this document.

Definition at line 2491 of file document.h.

◆ GetElementsPointer()

RAPIDJSON_FORCEINLINE GenericValue * GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::GetElementsPointer ( ) const
inlineinherited

Definition at line 2107 of file document.h.

◆ GetErrorOffset()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
size_t GenericDocument< Encoding, Allocator, StackAllocator >::GetErrorOffset ( ) const
inline

Get the position of last parsing error in input, 0 otherwise.

Definition at line 2473 of file document.h.

◆ GetMembersPointer()

RAPIDJSON_FORCEINLINE Member * GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::GetMembersPointer ( ) const
inlineinherited

Definition at line 2109 of file document.h.

◆ GetParseError()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
ParseErrorCode GenericDocument< Encoding, Allocator, StackAllocator >::GetParseError ( ) const
inline

Get the ParseErrorCode of last parsing.

Definition at line 2470 of file document.h.

◆ GetStackCapacity()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
size_t GenericDocument< Encoding, Allocator, StackAllocator >::GetStackCapacity ( ) const
inline

Get the capacity of stack in bytes.

Definition at line 2497 of file document.h.

◆ GetStringPointer()

RAPIDJSON_FORCEINLINE const Ch * GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::GetStringPointer ( ) const
inlineinherited

Definition at line 2105 of file document.h.

◆ HasParseError()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::HasParseError ( ) const
inline

Whether a parse error has occurred in the last parsing.

Definition at line 2467 of file document.h.

◆ Int()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Int ( int i)
inline

Definition at line 2518 of file document.h.

◆ Int64()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Int64 ( int64_t i)
inline

Definition at line 2520 of file document.h.

◆ Key()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Key ( const Ch * str,
SizeType length,
bool copy )
inline

Definition at line 2542 of file document.h.

◆ Null()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Null ( )
inline

Definition at line 2516 of file document.h.

◆ operator ParseResult()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument< Encoding, Allocator, StackAllocator >::operator ParseResult ( ) const
inline

Implicit conversion to get the last parse result.

Returns
ParseResult of the last parse operation
ParseResult ok = doc.Parse(json);
if (!ok)
printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset());
GenericDocument & Parse(const typename SourceEncoding::Ch *str)
Parse JSON text from a read-only string (with Encoding conversion)
Definition document.h:2404
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
Definition document.h:2585
RAPIDJSON_NAMESPACE_BEGIN const RAPIDJSON_ERROR_CHARTYPE * GetParseError_En(ParseErrorCode parseErrorCode)
Maps error code of parsing into error message.
Definition en.h:36
Result of parsing (wraps ParseErrorCode)
Definition error.h:106
ParseErrorCode Code() const
Get the error code.
Definition error.h:116
size_t Offset() const
Get the error offset, if IsError(), 0 otherwise.
Definition error.h:118

Definition at line 2487 of file document.h.

◆ Parse() [1/6]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::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.

Definition at line 2415 of file document.h.

◆ Parse() [2/6]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const Ch * str)
inline

Parse JSON text from a read-only string (with kParseDefaultFlags)

Parameters
strRead-only zero-terminated string to be parsed.

Definition at line 2422 of file document.h.

◆ Parse() [3/6]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const Ch * str,
size_t length )
inline

Definition at line 2436 of file document.h.

◆ Parse() [4/6]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const Ch * str,
size_t length )
inline

Definition at line 2440 of file document.h.

◆ Parse() [5/6]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags, typename SourceEncoding>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const typename SourceEncoding::Ch * str)
inline

Parse JSON text from a read-only string (with Encoding conversion)

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

Definition at line 2404 of file document.h.

◆ Parse() [6/6]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags, typename SourceEncoding>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const typename SourceEncoding::Ch * str,
size_t length )
inline

Definition at line 2427 of file document.h.

◆ ParseInsitu() [1/2]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::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.

Definition at line 2381 of file document.h.

◆ ParseInsitu() [2/2]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::ParseInsitu ( Ch * str)
inline

Parse JSON text from a mutable string (with kParseDefaultFlags)

Parameters
strMutable zero-terminated string to be parsed.
Returns
The document itself for fluent API.

Definition at line 2390 of file document.h.

◆ ParseStream() [1/3]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags, typename SourceEncoding, typename InputStream>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::ParseStream ( InputStream & is)
inline

Parse JSON text from an input stream (with Encoding conversion)

Template Parameters
parseFlagsCombination of ParseFlag.
SourceEncodingEncoding of input stream
InputStreamType of input stream, implementing Stream concept
Parameters
isInput stream to be parsed.
Returns
The document itself for fluent API.

Definition at line 2338 of file document.h.

◆ ParseStream() [2/3]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<unsigned parseFlags, typename InputStream>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::ParseStream ( InputStream & is)
inline

Parse JSON text from an input stream.

Template Parameters
parseFlagsCombination of ParseFlag.
InputStreamType of input stream, implementing Stream concept
Parameters
isInput stream to be parsed.
Returns
The document itself for fluent API.

Definition at line 2357 of file document.h.

◆ ParseStream() [3/3]

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<typename InputStream>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::ParseStream ( InputStream & is)
inline

Parse JSON text from an input stream (with kParseDefaultFlags)

Template Parameters
InputStreamType of input stream, implementing Stream concept
Parameters
isInput stream to be parsed.
Returns
The document itself for fluent API.

Definition at line 2367 of file document.h.

◆ Populate()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<typename Generator>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Populate ( Generator & g)
inline

Populate this document by a generator which produces SAX events.

Template Parameters
GeneratorA functor with bool f(Handler) prototype.
Parameters
gGenerator functor which sends SAX events to the parameter.
Returns
The document itself for fluent API.

Definition at line 2318 of file document.h.

◆ RAPIDJSON_DISABLEIF_RETURN()

GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::RAPIDJSON_DISABLEIF_RETURN ( (internal::IsPointer< T >) ,
(GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR > &)  )
inherited

Assignment with primitive types.

Template Parameters
TEither Type, int, unsigned, int64_t, uint64_t
Parameters
valueThe value to be assigned.
Note
The source type 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

◆ RawAssign()

Assignment without calling destructor.

Definition at line 2163 of file document.h.

◆ RawNumber()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::RawNumber ( const Ch * str,
SizeType length,
bool copy )
inline

Definition at line 2524 of file document.h.

◆ SetArrayRaw()

Definition at line 2113 of file document.h.

◆ SetElementsPointer()

RAPIDJSON_FORCEINLINE GenericValue * GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::SetElementsPointer ( GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR > * elements)
inlineinherited

Definition at line 2108 of file document.h.

◆ SetMembersPointer()

RAPIDJSON_FORCEINLINE Member * GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::SetMembersPointer ( Member * members)
inlineinherited

Definition at line 2110 of file document.h.

◆ SetObjectRaw()

void GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::SetObjectRaw ( Member * members,
SizeType count,
RAPIDJSON_DEFAULT_ALLOCATOR & allocator )
inlineinherited

Initialize this value as object with initial data, without calling destructor.

Definition at line 2126 of file document.h.

◆ SetStringPointer()

RAPIDJSON_FORCEINLINE const Ch * GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::SetStringPointer ( const Ch * str)
inlineinherited

Definition at line 2106 of file document.h.

◆ SetStringRaw() [1/2]

void GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::SetStringRaw ( StringRefType s)
inlineinherited

Initialize this value as constant string, without calling destructor.

Definition at line 2139 of file document.h.

◆ SetStringRaw() [2/2]

void GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::SetStringRaw ( StringRefType s,
RAPIDJSON_DEFAULT_ALLOCATOR & allocator )
inlineinherited

Initialize this value as copy string with initial data, without calling destructor.

Definition at line 2146 of file document.h.

◆ StartArray()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::StartArray ( )
inline

Definition at line 2550 of file document.h.

◆ StartObject()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::StartObject ( )
inline

Definition at line 2540 of file document.h.

◆ String()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::String ( const Ch * str,
SizeType length,
bool copy )
inline

Definition at line 2532 of file document.h.

◆ StringEqual()

bool GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::StringEqual ( const GenericValue< Encoding, SourceAllocator > & rhs) const
inlineinherited

Definition at line 2170 of file document.h.

◆ Swap()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
GenericDocument & GenericDocument< Encoding, Allocator, StackAllocator >::Swap ( GenericDocument< Encoding, Allocator, StackAllocator > & rhs)
inline

Exchange the contents of this document with those of another.

Parameters
rhsAnother document.
Note
Constant complexity.
See also
GenericValue::Swap

Definition at line 2285 of file document.h.

◆ Uint()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Uint ( unsigned i)
inline

Definition at line 2519 of file document.h.

◆ Uint64()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
bool GenericDocument< Encoding, Allocator, StackAllocator >::Uint64 ( uint64_t i)
inline

Definition at line 2521 of file document.h.

Friends And Related Symbol Documentation

◆ GenericValue

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
template<typename, typename>
friend class GenericValue
friend

Definition at line 2512 of file document.h.

◆ swap

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
void swap ( GenericDocument< Encoding, Allocator, StackAllocator > & a,
GenericDocument< Encoding, Allocator, StackAllocator > & b )
friend

free-standing swap function helper

Helper function to enable support for common swap implementation pattern based on std::swap:

void swap(MyClass& a, MyClass& b) {
using std::swap;
swap(a.doc, b.doc);
// ...
}
friend void swap(GenericDocument &a, GenericDocument &b) RAPIDJSON_NOEXCEPT
free-standing swap function helper
Definition document.h:2310
See also
Swap()

Definition at line 2310 of file document.h.

Member Data Documentation

◆ data_

Definition at line 2185 of file document.h.

◆ kDefaultArrayCapacity

const SizeType GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::kDefaultArrayCapacity
staticinherited

Definition at line 2021 of file document.h.

◆ kDefaultObjectCapacity

const SizeType GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >::kDefaultObjectCapacity
staticinherited

Definition at line 2022 of file document.h.


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