rapidjson::GenericDocument< Encoding, Allocator, StackAllocator > 模板类 参考

A document for parsing JSON text as DOM. 更多...

#include <document.h>

类 rapidjson::GenericDocument< Encoding, Allocator, StackAllocator > 继承关系图:
rapidjson::GenericValue< Encoding, Allocator >

Public 类型

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.
 
- Public 类型 继承自 rapidjson::GenericValue< Encoding, Allocator >
typedef GenericMember< Encoding, AllocatorMember
 Name-value pair in an object.
 
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 GenericStringRef< ChStringRefType
 Reference to a constant string
 
typedef GenericMemberIterator< false, Encoding, Allocator >::Iterator MemberIterator
 Member iterator for iterating in object.
 
typedef GenericMemberIterator< true, Encoding, 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, AllocatorValueType
 Value type of itself.
 
typedef GenericArray< false, ValueTypeArray
 
typedef GenericArray< true, ValueTypeConstArray
 
typedef GenericObject< false, ValueTypeObject
 
typedef GenericObject< true, ValueTypeConstObject
 

Public 成员函数

 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)
 
template<unsigned parseFlags, typename SourceEncoding >
GenericDocumentParse (const std::basic_string< typename SourceEncoding::Ch > &str)
 
template<unsigned parseFlags>
GenericDocumentParse (const std::basic_string< Ch > &str)
 
GenericDocumentParse (const std::basic_string< Ch > &str)
 
Handling parse errors
bool HasParseError () const
 Whether a parse error has occured 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 成员函数 继承自 rapidjson::GenericValue< Encoding, Allocator >
template<typename Handler >
bool Accept (Handler &handler) const
 Generate events of this value to a Handler. 更多...
 
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
 
bool IsLosslessDouble () const
 
bool IsFloat () const
 
bool IsLosslessFloat () const
 
GenericValueSetNull ()
 
bool GetBool () const
 Set boolean value
 
GenericValueSetBool (bool b)
 
GenericValueSetObject ()
 Set this value as an empty object. 更多...
 
SizeType MemberCount () const
 Get the number of members in the object.
 
bool ObjectEmpty () const
 Check whether the object is empty.
 
template<typename T >
GenericValueoperator[] (T *name)
 Get a value from an object associated with the name. 更多...
 
template<typename T >
const GenericValueoperator[] (T *name) const
 
template<typename SourceAllocator >
GenericValueoperator[] (const GenericValue< Encoding, SourceAllocator > &name)
 Get a value from an object associated with the name. 更多...
 
template<typename SourceAllocator >
const GenericValueoperator[] (const GenericValue< Encoding, SourceAllocator > &name) const
 
GenericValueoperator[] (const std::basic_string< Ch > &name)
 Get a value from an object associated with name (string object).
 
const GenericValueoperator[] (const std::basic_string< Ch > &name) const
 
ConstMemberIterator MemberBegin () const
 Const member iterator 更多...
 
ConstMemberIterator MemberEnd () const
 Const past-the-end member iterator 更多...
 
MemberIterator MemberBegin ()
 Member iterator 更多...
 
MemberIterator MemberEnd ()
 Past-the-end member iterator 更多...
 
bool HasMember (const Ch *name) const
 Check whether a member exists in the object. 更多...
 
bool HasMember (const std::basic_string< Ch > &name) const
 Check whether a member exists in the object with string object. 更多...
 
template<typename SourceAllocator >
bool HasMember (const GenericValue< Encoding, SourceAllocator > &name) const
 Check whether a member exists in the object with GenericValue name. 更多...
 
MemberIterator FindMember (const Ch *name)
 Find member by name. 更多...
 
ConstMemberIterator FindMember (const Ch *name) const
 
template<typename SourceAllocator >
MemberIterator FindMember (const GenericValue< Encoding, SourceAllocator > &name)
 Find member by name. 更多...
 
template<typename SourceAllocator >
ConstMemberIterator FindMember (const GenericValue< Encoding, SourceAllocator > &name) const
 
MemberIterator FindMember (const std::basic_string< Ch > &name)
 Find member by string object name. 更多...
 
ConstMemberIterator FindMember (const std::basic_string< Ch > &name) const
 
GenericValueAddMember (GenericValue &name, GenericValue &value, Allocator &allocator)
 Add a member (name-value pair) to the object. 更多...
 
GenericValueAddMember (GenericValue &name, StringRefType value, Allocator &allocator)
 Add a constant string value as member (name-value pair) to the object. 更多...
 
GenericValueAddMember (GenericValue &name, std::basic_string< Ch > &value, Allocator &allocator)
 Add a string object as member (name-value pair) to the object. 更多...
 
template<typename T >
GenericValueAddMember (GenericValue &name, T value, Allocator &allocator)
 Add any primitive value as member (name-value pair) to the object. 更多...
 
GenericValueAddMember (StringRefType name, GenericValue &value, Allocator &allocator)
 Add a member (name-value pair) to the object. 更多...
 
GenericValueAddMember (StringRefType name, StringRefType value, Allocator &allocator)
 Add a constant string value as member (name-value pair) to the object. 更多...
 
template<typename T >
GenericValueAddMember (StringRefType name, T value, Allocator &allocator)
 Add any primitive value as member (name-value pair) to the object. 更多...
 
void RemoveAllMembers ()
 Remove all members in the object. 更多...
 
bool RemoveMember (const Ch *name)
 Remove a member in object by its name. 更多...
 
bool RemoveMember (const std::basic_string< Ch > &name)
 
template<typename SourceAllocator >
bool RemoveMember (const GenericValue< Encoding, SourceAllocator > &name)
 
MemberIterator RemoveMember (MemberIterator m)
 Remove a member in object by iterator. 更多...
 
MemberIterator EraseMember (ConstMemberIterator pos)
 Remove a member from an object by iterator. 更多...
 
MemberIterator EraseMember (ConstMemberIterator first, ConstMemberIterator last)
 Remove members in the range [first, last) from an object. 更多...
 
bool EraseMember (const Ch *name)
 Erase a member in object by its name. 更多...
 
bool EraseMember (const std::basic_string< Ch > &name)
 
template<typename SourceAllocator >
bool EraseMember (const GenericValue< Encoding, SourceAllocator > &name)
 
Object GetObject ()
 
ConstObject GetObject () const
 
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
 
ValueIterator Begin ()
 Element iterator 更多...
 
ValueIterator End ()
 Past-the-end element iterator 更多...
 
ConstValueIterator Begin () const
 Constant element iterator 更多...
 
ConstValueIterator End () const
 Constant past-the-end element iterator 更多...
 
GenericValueReserve (SizeType newCapacity, Allocator &allocator)
 Request the array to have enough capacity to store elements. 更多...
 
GenericValuePushBack (GenericValue &value, Allocator &allocator)
 Append a GenericValue at the end of the array. 更多...
 
GenericValuePushBack (StringRefType value, Allocator &allocator)
 Append a constant string reference at the end of the array. 更多...
 
template<typename T >
GenericValuePushBack (T value, Allocator &allocator)
 Append a primitive value at the end of the array. 更多...
 
GenericValuePopBack ()
 Remove the last element in the array. 更多...
 
ValueIterator Erase (ConstValueIterator pos)
 Remove an element of array by iterator. 更多...
 
ValueIterator Erase (ConstValueIterator first, ConstValueIterator last)
 Remove elements in the range [first, last) of the array. 更多...
 
Array GetArray ()
 
ConstArray GetArray () const
 
template<typename T >
bool Is () const
 Templated version for checking whether this value is type T. 更多...
 
template<typename T >
Get () const
 
template<typename T >
Get ()
 
template<typename T >
ValueTypeSet (const T &data)
 
template<typename T >
ValueTypeSet (const T &data, AllocatorType &allocator)
 
int GetInt () const
 
unsigned GetUint () const
 
int64_t GetInt64 () const
 
uint64_t GetUint64 () const
 
double GetDouble () const
 Get the value as double type. 更多...
 
float GetFloat () const
 Get the value as float type. 更多...
 
GenericValueSetInt (int i)
 
GenericValueSetUint (unsigned u)
 
GenericValueSetInt64 (int64_t i64)
 
GenericValueSetUint64 (uint64_t u64)
 
GenericValueSetDouble (double d)
 
GenericValueSetFloat (float f)
 
const ChGetString () const
 
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 (StringRefType 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. 更多...
 
GenericValueSetString (StringRefType s, Allocator &allocator)
 Set this value as a string by copying from source string. 更多...
 
GenericValueSetString (const std::basic_string< Ch > &s, Allocator &allocator)
 Set this value as a string by copying from source string. 更多...
 
GenericValueoperator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT
 Assignment with move semantics. 更多...
 
GenericValueoperator= (StringRefType str) RAPIDJSON_NOEXCEPT
 Assignment of constant string reference (no copy) 更多...
 
template<typename T >
GenericValueoperator= (T value)
 Assignment with primitive types. 更多...
 
template<typename SourceAllocator >
GenericValueCopyFrom (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator, bool copyConstStrings=false)
 Deep-copy assignment from Value 更多...
 
GenericValueSwap (GenericValue &other) RAPIDJSON_NOEXCEPT
 Exchange the contents of this value with those of other. 更多...
 
GenericValueMove () RAPIDJSON_NOEXCEPT
 Prepare Value for move semantics 更多...
 
template<typename SourceAllocator >
bool operator== (const GenericValue< Encoding, SourceAllocator > &rhs) const
 Equal-to operator 更多...
 
bool operator== (const Ch *rhs) const
 Equal-to operator with const C-string pointer
 
bool operator== (const std::basic_string< Ch > &rhs) const
 Equal-to operator with string object 更多...
 
template<typename T >
bool operator== (const T &rhs) const
 Equal-to operator with primitive types 更多...
 
template<typename SourceAllocator >
bool operator!= (const GenericValue< Encoding, SourceAllocator > &rhs) const
 Not-equal-to operator 更多...
 
bool operator!= (const Ch *rhs) const
 Not-equal-to operator with const C-string pointer
 
template<typename T >
bool operator!= (const T &rhs) const
 Not-equal-to operator with arbitrary types 更多...
 
 GenericValue () RAPIDJSON_NOEXCEPT
 Default constructor creates a null value.
 
 GenericValue (Type type) RAPIDJSON_NOEXCEPT
 Constructor with JSON value type. 更多...
 
template<typename SourceAllocator >
 GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, Allocator &allocator, bool copyConstStrings=false)
 Explicit copy constructor (with allocator) 更多...
 
 GenericValue (bool b) RAPIDJSON_NOEXCEPT
 Constructor for boolean value. 更多...
 
 GenericValue (int i) RAPIDJSON_NOEXCEPT
 Constructor for int value.
 
 GenericValue (unsigned u) RAPIDJSON_NOEXCEPT
 Constructor for unsigned value.
 
 GenericValue (int64_t i64) RAPIDJSON_NOEXCEPT
 Constructor for int64_t value.
 
 GenericValue (uint64_t u64) RAPIDJSON_NOEXCEPT
 Constructor for uint64_t value.
 
 GenericValue (double d) RAPIDJSON_NOEXCEPT
 Constructor for double value.
 
 GenericValue (float f) RAPIDJSON_NOEXCEPT
 Constructor for float value.
 
 GenericValue (const Ch *s, SizeType length) RAPIDJSON_NOEXCEPT
 Constructor for constant string (i.e. do not make a copy of string)
 
 GenericValue (StringRefType s) RAPIDJSON_NOEXCEPT
 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 (const std::basic_string< Ch > &s, Allocator &allocator)
 Constructor for copy-string from a string object (i.e. do make a copy of string) 更多...
 
 GenericValue (Array a) RAPIDJSON_NOEXCEPT
 Constructor for Array. 更多...
 
 GenericValue (Object o) RAPIDJSON_NOEXCEPT
 Constructor for Object. 更多...
 
 ~GenericValue ()
 Destructor. 更多...
 

友元

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

详细描述

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

A document for parsing JSON text as DOM.

注解
implements Handler concept
模板参数
EncodingEncoding for both parsing and string storage.
AllocatorAllocator for allocating memory for the DOM
StackAllocatorAllocator for allocating memory for stack during parsing.
警告
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.

构造及析构函数说明

◆ GenericDocument() [1/2]

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.

参数
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.

◆ GenericDocument() [2/2]

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.

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

成员函数说明

◆ 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

返回
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());

◆ Parse() [1/3]

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)

模板参数
parseFlagsCombination of ParseFlag (must not contain kParseInsituFlag).
SourceEncodingTranscoding from input Encoding
参数
strRead-only zero-terminated string to be parsed.

◆ Parse() [2/3]

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

模板参数
parseFlagsCombination of ParseFlag (must not contain kParseInsituFlag).
参数
strRead-only zero-terminated string to be parsed.

◆ Parse() [3/3]

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)

参数
strRead-only zero-terminated string to be parsed.

◆ 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

模板参数
parseFlagsCombination of ParseFlag.
参数
strMutable zero-terminated string to be parsed.
返回
The document itself for fluent API.

◆ 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)

参数
strMutable zero-terminated string to be parsed.
返回
The document itself for fluent API.

◆ 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)

模板参数
parseFlagsCombination of ParseFlag.
SourceEncodingEncoding of input stream
InputStreamType of input stream, implementing Stream concept
参数
isInput stream to be parsed.
返回
The document itself for fluent API.

◆ 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

模板参数
parseFlagsCombination of ParseFlag.
InputStreamType of input stream, implementing Stream concept
参数
isInput stream to be parsed.
返回
The document itself for fluent API.

◆ 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)

模板参数
InputStreamType of input stream, implementing Stream concept
参数
isInput stream to be parsed.
返回
The document itself for fluent API.

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

模板参数
GeneratorA functor with bool f(Handler) prototype.
参数
gGenerator functor which sends SAX events to the parameter.
返回
The document itself for fluent API.

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

参数
rhsAnother document.
注解
Constant complexity.
参见
GenericValue::Swap

友元及相关函数文档

◆ 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);
// ...
}
参见
Swap()

该类的文档由以下文件生成: