Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
GenericDocument< Encoding, Allocator, StackAllocator > Class Template Reference

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

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/common/arccore/common/internal/json/rapidjson/document.h>

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

Classes

struct  ClearStackOnExit

Public Types

typedef Encoding::Ch Ch
 Character type derived from Encoding.
typedef GenericValue< Encoding, AllocatorValueType
 Value type of the document.
typedef Allocator AllocatorType
 Allocator type from template parameter.
typedef StackAllocator StackAllocatorType
 StackAllocator type from template parameter.
Public Types inherited from GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >
typedef GenericMember< Encoding, RAPIDJSON_DEFAULT_ALLOCATORMember
 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< ChStringRefType
 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 GenericValueValueIterator
 Value iterator for iterating in array.
typedef const GenericValueConstValueIterator
 Constant value iterator for iterating in array.
typedef GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATORValueType
 Value type of itself.
typedef GenericArray< false, ValueTypeArray
typedef GenericArray< true, ValueTypeConstArray
typedef GenericObject< false, ValueTypeObject
typedef GenericObject< true, ValueTypeConstObject
enum  

Public Member Functions

 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.
GenericDocumentSwap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT
 Exchange the contents of this document with those of another.
template<typename Generator>
GenericDocumentPopulate (Generator &g)
 Populate this document by a generator which produces SAX events.
AllocatorGetAllocator ()
 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)
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.
Public Member Functions inherited from GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR >
 GenericValue () RAPIDJSON_NOEXCEPT
 Default constructor creates a null value.
 ~GenericValue ()
 Destructor.
GenericValueoperator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment with move semantics.
 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)
RAPIDJSON_FORCEINLINE MemberDoAllocMembers (SizeType capacity, RAPIDJSON_DEFAULT_ALLOCATOR &allocator)
void DoReserveMembers (SizeType newCapacity, RAPIDJSON_DEFAULT_ALLOCATOR &allocator)
MemberIterator DoFindMember (const GenericValue< Encoding, SourceAllocator > &name)
void DoClearMembers ()
void DoFreeMembers ()
void DoAddMember (GenericValue &name, GenericValue &value, RAPIDJSON_DEFAULT_ALLOCATOR &allocator)
MemberIterator DoRemoveMember (MemberIterator m)
MemberIterator DoEraseMembers (ConstMemberIterator first, ConstMemberIterator last)
void DoCopyMembers (const GenericValue< Encoding, SourceAllocator > &rhs, RAPIDJSON_DEFAULT_ALLOCATOR &allocator, bool copyConstStrings)
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 RawAssign (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment without calling destructor.
bool StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const

Private Member Functions

 GenericDocument (const GenericDocument &)
 Prohibit copying.
GenericDocumentoperator= (const GenericDocument &)
 Prohibit assignment.
void ClearStack ()
void Destroy ()

Private Attributes

Allocatorallocator_
AllocatorownAllocator_
internal::Stack< StackAllocator > stack_
ParseResult parseResult_

Static Private Attributes

static const size_t kDefaultStackCapacity = 1024

Friends

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

Additional Inherited Members

static RAPIDJSON_FORCEINLINE const ChDataString (const Data &data)
static RAPIDJSON_FORCEINLINE SizeType DataStringLength (const Data &data)
Data data_
static const SizeType kDefaultArrayCapacity
static const SizeType kDefaultObjectCapacity

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 2501 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 2505 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 2503 of file document.h.

◆ StackAllocatorType

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

StackAllocator type from template parameter.

Definition at line 2506 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 2504 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 2515 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 2528 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 2550 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 2823 of file document.h.

◆ ClearStack()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
void GenericDocument< Encoding, Allocator, StackAllocator >::ClearStack ( )
inlineprivate

Definition at line 2870 of file document.h.

◆ Destroy()

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
void GenericDocument< Encoding, Allocator, StackAllocator >::Destroy ( )
inlineprivate

Definition at line 2879 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 2828 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 2858 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 2850 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 2797 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 2779 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 2776 of file document.h.

Referenced by Arcane::JSONDocument::parse().

Here is the caller graph for this function:

◆ 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 2803 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 2773 of file document.h.

Referenced by Arcane::JSONDocument::parse().

Here is the caller graph for this function:

◆ 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 2824 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 2826 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 2848 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 2822 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:2710
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
Definition document.h:2891
RAPIDJSON_NAMESPACE_BEGIN const RAPIDJSON_ERROR_CHARTYPE * GetParseError_En(ParseErrorCode parseErrorCode)
Maps error code of parsing into error message.
Definition en.h:37
Result of parsing (wraps ParseErrorCode).
Definition error.h:107
ParseErrorCode Code() const
Get the error code.
Definition error.h:117
size_t Offset() const
Get the error offset, if IsError(), 0 otherwise.
Definition error.h:119

Definition at line 2793 of file document.h.

◆ Parse() [1/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 2728 of file document.h.

◆ Parse() [2/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 2721 of file document.h.

◆ Parse() [3/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 2746 of file document.h.

◆ Parse() [4/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 2742 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 2710 of file document.h.

Referenced by GenericDocument< UTF8<> >::Parse(), Arcane::JSONDocument::parse(), and GenericDocument< UTF8<> >::ParseStream().

Here is the caller graph for this function:

◆ 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 2733 of file document.h.

◆ ParseInsitu() [1/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 2696 of file document.h.

◆ ParseInsitu() [2/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 2687 of file document.h.

Referenced by GenericDocument< UTF8<> >::ParseInsitu().

Here is the caller graph for this function:

◆ ParseStream() [1/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 2673 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 2663 of file document.h.

◆ ParseStream() [3/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 2644 of file document.h.

Referenced by GenericDocument< UTF8<> >::Parse(), GenericDocument< UTF8<> >::ParseInsitu(), and GenericDocument< UTF8<> >::ParseStream().

Here is the caller graph for this function:

◆ 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 2624 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 2830 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 2856 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 2846 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 2838 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 2591 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 2825 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 2827 of file document.h.

◆ 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 2818 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:2616
See also
Swap()

Definition at line 2616 of file document.h.

Member Data Documentation

◆ allocator_

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
Allocator* GenericDocument< Encoding, Allocator, StackAllocator >::allocator_
private

Definition at line 2884 of file document.h.

◆ kDefaultStackCapacity

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
const size_t GenericDocument< Encoding, Allocator, StackAllocator >::kDefaultStackCapacity = 1024
staticprivate

Definition at line 2883 of file document.h.

◆ ownAllocator_

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
Allocator* GenericDocument< Encoding, Allocator, StackAllocator >::ownAllocator_
private

Definition at line 2885 of file document.h.

◆ parseResult_

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
ParseResult GenericDocument< Encoding, Allocator, StackAllocator >::parseResult_
private

Definition at line 2887 of file document.h.

◆ stack_

template<typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR>
internal::Stack<StackAllocator> GenericDocument< Encoding, Allocator, StackAllocator >::stack_
private

Definition at line 2886 of file document.h.


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