NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
rapidjson::GenericDocument< Encoding, Allocator, StackAllocator > Class Template Reference

Search Toolkit Book for rapidjson::GenericDocument

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

#include <misc/jsonwrapp/rapidjson11/document.h>

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

Classes

struct  ClearStackOnExit
 

Public Types

typedef Encoding::Ch Ch
 Character type derived from Encoding. More...
 
typedef GenericValue< Encoding, AllocatorValueType
 Value type of the document. More...
 
typedef Allocator AllocatorType
 Allocator type from template parameter. More...
 
- Public Types inherited from rapidjson::GenericValue< Encoding, MemoryPoolAllocator<> >
typedef GenericMember< Encoding, MemoryPoolAllocator<> > Member
 Name-value pair in an object. More...
 
typedef Encoding EncodingType
 Encoding type from template parameter. More...
 
typedef MemoryPoolAllocator<> AllocatorType
 Allocator type from template parameter. More...
 
typedef Encoding::Ch Ch
 Character type derived from Encoding. More...
 
typedef GenericStringRef< ChStringRefType
 Reference to a constant string. More...
 
typedef GenericMemberIterator< false, Encoding, MemoryPoolAllocator<> >::Iterator MemberIterator
 Member iterator for iterating in object. More...
 
typedef GenericMemberIterator< true, Encoding, MemoryPoolAllocator<> >::Iterator ConstMemberIterator
 Constant member iterator for iterating in object. More...
 
typedef GenericValueValueIterator
 Value iterator for iterating in array. More...
 
typedef const GenericValueConstValueIterator
 Constant value iterator for iterating in array. More...
 
typedef GenericValue< Encoding, MemoryPoolAllocator<> > ValueType
 Value type of itself. More...
 
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. More...
 
 GenericDocument (Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0)
 Constructor. More...
 
 ~GenericDocument ()
 
GenericDocumentSwap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT
 Exchange the contents of this document with those of another. More...
 
template<typename Generator >
GenericDocumentPopulate (Generator &g)
 Populate this document by a generator which produces SAX events. More...
 
AllocatorGetAllocator () const
 Get the allocator of this document. More...
 
AllocatorGetOwnAllocator () const
 
size_t GetStackCapacity () const
 Get the capacity of stack in bytes. More...
 
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) More...
 
template<unsigned parseFlags, typename InputStream >
GenericDocumentParseStream (InputStream &is)
 Parse JSON text from an input stream. More...
 
template<typename InputStream >
GenericDocumentParseStream (InputStream &is)
 Parse JSON text from an input stream (with kParseDefaultFlags) More...
 
Parse in-place from mutable string
template<unsigned parseFlags>
GenericDocumentParseInsitu (Ch *str)
 Parse JSON text from a mutable string. More...
 
GenericDocumentParseInsitu (Ch *str)
 Parse JSON text from a mutable string (with kParseDefaultFlags) More...
 
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) More...
 
template<unsigned parseFlags>
GenericDocumentParse (const Ch *str)
 Parse JSON text from a read-only string. More...
 
GenericDocumentParse (const Ch *str)
 Parse JSON text from a read-only string (with kParseDefaultFlags) More...
 
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 occured in the last parsing. More...
 
ParseErrorCode GetParseError () const
 Get the ParseErrorCode of last parsing. More...
 
size_t GetErrorOffset () const
 Get the position of last parsing error in input, 0 otherwise. More...
 
void SetParseResult (const ParseResult &result)
 
 operator ParseResult () const
 Implicit conversion to get the last parse result. More...
 
- Public Member Functions inherited from rapidjson::GenericValue< Encoding, MemoryPoolAllocator<> >
GenericValueoperator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment with move semantics. More...
 
GenericValueoperator= (StringRefType str) RAPIDJSON_NOEXCEPT
 Assignment of constant string reference (no copy) More...
 
 RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator
 Assignment with primitive types. More...
 
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, MemoryPoolAllocator<> &allocator)
 
void SetObjectRaw (Member *members, SizeType count, MemoryPoolAllocator<> &allocator)
 Initialize this value as object with initial data, without calling destructor. More...
 
void SetStringRaw (StringRefType s) RAPIDJSON_NOEXCEPT
 Initialize this value as constant string, without calling destructor. More...
 
void SetStringRaw (StringRefType s, MemoryPoolAllocator<> &allocator)
 Initialize this value as copy string with initial data, without calling destructor. More...
 
void RawAssign (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment without calling destructor. More...
 
bool StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const
 
ValueTypeSetValueAllocator (MemoryPoolAllocator<> *allocator)
 
MemoryPoolAllocator<> * GetValueAllocator (void) const
 
 GenericValue () RAPIDJSON_NOEXCEPT
 Default constructor creates a null value. More...
 
 GenericValue (Type type) RAPIDJSON_NOEXCEPT
 Constructor with JSON value type. More...
 
 GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, MemoryPoolAllocator<> &allocator)
 Explicit copy constructor (with allocator) More...
 
 GenericValue (T b, RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))) RAPIDJSON_NOEXCEPT
 Constructor for boolean value. More...
 
 GenericValue (int i) RAPIDJSON_NOEXCEPT
 Constructor for int value. More...
 
 GenericValue (unsigned u) RAPIDJSON_NOEXCEPT
 Constructor for unsigned value. More...
 
 GenericValue (int64_t i64) RAPIDJSON_NOEXCEPT
 Constructor for int64_t value. More...
 
 GenericValue (uint64_t u64) RAPIDJSON_NOEXCEPT
 Constructor for uint64_t value. More...
 
 GenericValue (double d) RAPIDJSON_NOEXCEPT
 Constructor for double value. More...
 
 GenericValue (float f) RAPIDJSON_NOEXCEPT
 Constructor for float value. More...
 
 GenericValue (const Ch *s, SizeType length) RAPIDJSON_NOEXCEPT
 Constructor for constant string (i.e. do not make a copy of string) More...
 
 GenericValue (StringRefType s) RAPIDJSON_NOEXCEPT
 Constructor for constant string (i.e. do not make a copy of string) More...
 
 GenericValue (const Ch *s, SizeType length, MemoryPoolAllocator<> &allocator)
 Constructor for copy-string (i.e. do make a copy of string) More...
 
 GenericValue (const Ch *s, MemoryPoolAllocator<> &allocator)
 Constructor for copy-string (i.e. do make a copy of string) More...
 
 GenericValue (Array a) RAPIDJSON_NOEXCEPT
 Constructor for Array. More...
 
 GenericValue (Object o) RAPIDJSON_NOEXCEPT
 Constructor for Object. More...
 
 ~GenericValue ()
 Destructor. More...
 

Private Member Functions

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

Private Attributes

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 More...
 

Additional Inherited Members

- Public Attributes inherited from rapidjson::GenericValue< Encoding, MemoryPoolAllocator<> >
Data data_
 
- Static Public Attributes inherited from rapidjson::GenericValue< Encoding, MemoryPoolAllocator<> >
static const SizeType kDefaultArrayCapacity
 
static const SizeType kDefaultObjectCapacity
 
- Protected Attributes inherited from rapidjson::GenericValue< Encoding, MemoryPoolAllocator<> >
MemoryPoolAllocator<> * allocator_
 

Detailed Description

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
class rapidjson::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 2121 of file document.h.

Member Typedef Documentation

◆ AllocatorType

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

Allocator type from template parameter.

Definition at line 2125 of file document.h.

◆ Ch

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

Character type derived from Encoding.

Definition at line 2123 of file document.h.

◆ ValueType

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

Value type of the document.

Definition at line 2124 of file document.h.

Constructor & Destructor Documentation

◆ GenericDocument() [1/3]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
rapidjson::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 2143 of file document.h.

References RAPIDJSON_NEW.

◆ GenericDocument() [2/3]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
rapidjson::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 2168 of file document.h.

References RAPIDJSON_NEW.

◆ ~GenericDocument()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::~GenericDocument ( )
inline

Definition at line 2197 of file document.h.

◆ GenericDocument() [3/3]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::GenericDocument ( const GenericDocument< Encoding, Allocator, StackAllocator > &  )
private

Prohibit copying.

Member Function Documentation

◆ Bool()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Bool ( bool  b)
inline

Definition at line 2478 of file document.h.

References b.

◆ ClearStack()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
void rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::ClearStack ( )
inlineprivate

Definition at line 2525 of file document.h.

◆ Destroy()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
void rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Destroy ( void  )
inlineprivate

Definition at line 2534 of file document.h.

References RAPIDJSON_DELETE.

◆ Double()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Double ( double  d)
inline

Definition at line 2483 of file document.h.

◆ EndArray()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::EndArray ( SizeType  elementCount)
inline

Definition at line 2513 of file document.h.

◆ EndObject()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::EndObject ( SizeType  memberCount)
inline

Definition at line 2505 of file document.h.

◆ GetAllocator()

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

Get the allocator of this document.

Definition at line 2453 of file document.h.

Referenced by CJson_Document::CJson_Document(), CJson_Document::operator=(), and rapidjson::GenericPointer< ValueType, Allocator >::Set().

◆ GetErrorOffset()

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

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

Definition at line 2423 of file document.h.

◆ GetOwnAllocator()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
Allocator* rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::GetOwnAllocator ( ) const
inline

Definition at line 2454 of file document.h.

◆ GetParseError()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
ParseErrorCode rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::GetParseError ( ) const
inline

Get the ParseErrorCode of last parsing.

Definition at line 2420 of file document.h.

Referenced by CJson_Document::EndOfData(), and CJson_Document::GetReadError().

◆ GetStackCapacity()

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

Get the capacity of stack in bytes.

Definition at line 2458 of file document.h.

◆ HasParseError()

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

Whether a parse error has occured in the last parsing.

Definition at line 2417 of file document.h.

Referenced by CJson_Document::ParseMutableString(), CJson_Document::ParseString(), CJson_Document::Read(), CJson_Document::ReadBuffered(), and CJson_Document::ReadSucceeded().

◆ Int()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Int ( int  i)
inline

Definition at line 2479 of file document.h.

References i.

◆ Int64()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Int64 ( int64_t  i)
inline

Definition at line 2481 of file document.h.

References i.

◆ Key()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Key ( const Ch str,
SizeType  length,
bool  copy 
)
inline

Definition at line 2503 of file document.h.

References copy(), and str().

◆ Null()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Null ( )
inline

Definition at line 2477 of file document.h.

◆ operator ParseResult()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
rapidjson::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());
const char * GetParseError_En(ParseErrorCode parseErrorCode)
Maps error code of parsing into error message.
Definition: en.h:36
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
Definition: document.h:2547

Definition at line 2442 of file document.h.

◆ operator=()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::operator= ( const GenericDocument< Encoding, Allocator, StackAllocator > &  )
private

Prohibit assignment.

◆ Parse() [1/6]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags>
GenericDocument& rapidjson::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 2365 of file document.h.

References str().

◆ Parse() [2/6]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
GenericDocument& rapidjson::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 2372 of file document.h.

References str().

◆ Parse() [3/6]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags>
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const Ch str,
size_t  length 
)
inline

Definition at line 2386 of file document.h.

References str().

◆ Parse() [4/6]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
GenericDocument& rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Parse ( const Ch str,
size_t  length 
)
inline

Definition at line 2390 of file document.h.

References str().

◆ Parse() [5/6]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename SourceEncoding >
GenericDocument& rapidjson::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 2354 of file document.h.

References rapidjson::kParseInsituFlag, RAPIDJSON_ASSERT, and str().

Referenced by CJson_Document::CJson_Document(), and CJson_Document::ParseString().

◆ Parse() [6/6]

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

Definition at line 2377 of file document.h.

References rapidjson::kParseInsituFlag, RAPIDJSON_ASSERT, and str().

◆ ParseInsitu() [1/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags>
GenericDocument& rapidjson::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 2331 of file document.h.

References str().

Referenced by CJson_Document::ParseMutableString().

◆ ParseInsitu() [2/2]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
GenericDocument& rapidjson::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 2340 of file document.h.

References str().

◆ ParseStream() [1/3]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename SourceEncoding , typename InputStream >
GenericDocument& rapidjson::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 2286 of file document.h.

References RAPIDJSON_ASSERT.

Referenced by CJson_Document::Read(), and CJson_Document::ReadBuffered().

◆ ParseStream() [2/3]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream >
GenericDocument& rapidjson::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 2307 of file document.h.

◆ ParseStream() [3/3]

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<typename InputStream >
GenericDocument& rapidjson::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 2317 of file document.h.

◆ Populate()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<typename Generator >
GenericDocument& rapidjson::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 2266 of file document.h.

References g(), and RAPIDJSON_ASSERT.

Referenced by CJson_Document::Read().

◆ RawNumber()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::RawNumber ( const Ch str,
SizeType  length,
bool  copy 
)
inline

Definition at line 2485 of file document.h.

References copy(), and str().

◆ SetParseResult()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
void rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::SetParseResult ( const ParseResult result)
inline

Definition at line 2426 of file document.h.

References result.

Referenced by CJson_Document::Read().

◆ StartArray()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::StartArray ( )
inline

Definition at line 2511 of file document.h.

References rapidjson::kArrayType.

◆ StartObject()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::StartObject ( )
inline

Definition at line 2501 of file document.h.

References rapidjson::kObjectType.

◆ String()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::String ( const Ch str,
SizeType  length,
bool  copy 
)
inline

Definition at line 2493 of file document.h.

References copy(), and str().

◆ Swap()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
GenericDocument& rapidjson::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 2236 of file document.h.

References rapidjson::internal::Swap().

◆ Uint()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Uint ( unsigned  i)
inline

Definition at line 2480 of file document.h.

References i.

◆ Uint64()

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
bool rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::Uint64 ( uint64_t  i)
inline

Definition at line 2482 of file document.h.

References i.

Friends And Related Function Documentation

◆ GenericValue

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
template<typename , typename >
friend class GenericValue
friend

Definition at line 2473 of file document.h.

◆ swap

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
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:2258
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
Definition: ncbimisc.hpp:1508
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1126
See also
Swap()

Definition at line 2258 of file document.h.

Member Data Documentation

◆ kDefaultStackCapacity

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
const size_t rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::kDefaultStackCapacity = 1024
staticprivate

Definition at line 2538 of file document.h.

◆ ownAllocator_

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
Allocator* rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::ownAllocator_
private

Definition at line 2541 of file document.h.

◆ parseResult_

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
ParseResult rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::parseResult_
private

Definition at line 2543 of file document.h.

◆ stack_

template<typename Encoding , typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
internal::Stack<StackAllocator> rapidjson::GenericDocument< Encoding, Allocator, StackAllocator >::stack_
private

Definition at line 2542 of file document.h.


The documentation for this class was generated from the following file:
Modified on Wed Apr 17 13:10:02 2024 by modify_doxy.py rev. 669887