A document for parsing JSON text as DOM. Plus de détails...
#include <arcane/utils/internal/json/rapidjson/document.h>
Classes | |
struct | ClearStackOnExit |
Types publics | |
typedef Encoding::Ch | Ch |
Character type derived from Encoding. | |
typedef GenericValue< Encoding, Allocator > | ValueType |
Value type of the document. | |
typedef Allocator | AllocatorType |
Allocator type from template parameter. | |
typedef StackAllocator | StackAllocatorType |
StackAllocator type from template parameter. | |
![]() | |
typedef GenericMember< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR > | Member |
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< Ch > | StringRefType |
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 GenericValue * | ValueIterator |
Value iterator for iterating in array. | |
typedef const GenericValue * | ConstValueIterator |
Constant value iterator for iterating in array. | |
typedef GenericValue< Encoding, RAPIDJSON_DEFAULT_ALLOCATOR > | ValueType |
Value type of itself. | |
typedef GenericArray< false, ValueType > | Array |
typedef GenericArray< true, ValueType > | ConstArray |
typedef GenericObject< false, ValueType > | Object |
typedef GenericObject< true, ValueType > | ConstObject |
enum | |
Fonctions membres publiques | |
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. | |
GenericDocument & | Swap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT |
Exchange the contents of this document with those of another. | |
template<typename Generator> | |
GenericDocument & | Populate (Generator &g) |
Populate this document by a generator which produces SAX events. | |
Allocator & | GetAllocator () |
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> | |
GenericDocument & | ParseStream (InputStream &is) |
Parse JSON text from an input stream (with Encoding conversion) | |
template<unsigned parseFlags, typename InputStream> | |
GenericDocument & | ParseStream (InputStream &is) |
Parse JSON text from an input stream. | |
template<typename InputStream> | |
GenericDocument & | ParseStream (InputStream &is) |
Parse JSON text from an input stream (with kParseDefaultFlags) | |
Parse in-place from mutable string | |
template<unsigned parseFlags> | |
GenericDocument & | ParseInsitu (Ch *str) |
Parse JSON text from a mutable string. | |
GenericDocument & | ParseInsitu (Ch *str) |
Parse JSON text from a mutable string (with kParseDefaultFlags) | |
Parse from read-only string | |
template<unsigned parseFlags, typename SourceEncoding> | |
GenericDocument & | Parse (const typename SourceEncoding::Ch *str) |
Parse JSON text from a read-only string (with Encoding conversion) | |
template<unsigned parseFlags> | |
GenericDocument & | Parse (const Ch *str) |
Parse JSON text from a read-only string. | |
GenericDocument & | Parse (const Ch *str) |
Parse JSON text from a read-only string (with kParseDefaultFlags) | |
template<unsigned parseFlags, typename SourceEncoding> | |
GenericDocument & | Parse (const typename SourceEncoding::Ch *str, size_t length) |
template<unsigned parseFlags> | |
GenericDocument & | Parse (const Ch *str, size_t length) |
GenericDocument & | Parse (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. | |
GenericValue & | operator= (GenericValue &rhs) RAPIDJSON_NOEXCEPT |
Assignment with move semantics. | |
GenericValue & | operator= (StringRefType str) RAPIDJSON_NOEXCEPT |
Assignment of constant string reference (no copy) | |
RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator | |
Assignment with primitive types. | |
RAPIDJSON_FORCEINLINE const Ch * | GetStringPointer () const |
RAPIDJSON_FORCEINLINE const Ch * | SetStringPointer (const Ch *str) |
RAPIDJSON_FORCEINLINE GenericValue * | GetElementsPointer () const |
RAPIDJSON_FORCEINLINE GenericValue * | SetElementsPointer (GenericValue *elements) |
RAPIDJSON_FORCEINLINE Member * | GetMembersPointer () const |
RAPIDJSON_FORCEINLINE Member * | SetMembersPointer (Member *members) |
RAPIDJSON_FORCEINLINE Member * | DoAllocMembers (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 | 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 |
GenericValue () RAPIDJSON_NOEXCEPT | |
Default constructor creates a null value. | |
GenericValue (Type type) RAPIDJSON_NOEXCEPT | |
Constructor with JSON value type. | |
GenericValue (const GenericValue< Encoding, SourceAllocator > &rhs, RAPIDJSON_DEFAULT_ALLOCATOR &allocator, bool copyConstStrings=false) | |
Explicit copy constructor (with allocator) | |
GenericValue (T b, RAPIDJSON_ENABLEIF((internal::IsSame< bool, T >))) 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, RAPIDJSON_DEFAULT_ALLOCATOR &allocator) | |
Constructor for copy-string (i.e. do make a copy of string) | |
GenericValue (const Ch *s, RAPIDJSON_DEFAULT_ALLOCATOR &allocator) | |
Constructor for copy-string (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. | |
Fonctions membres privées | |
GenericDocument (const GenericDocument &) | |
Prohibit copying. | |
GenericDocument & | operator= (const GenericDocument &) |
Prohibit assignment. | |
void | ClearStack () |
void | Destroy () |
Attributs privés | |
Allocator * | allocator_ |
Allocator * | ownAllocator_ |
internal::Stack< StackAllocator > | stack_ |
ParseResult | parseResult_ |
Attributs privés statiques | |
static const size_t | kDefaultStackCapacity = 1024 |
Amis | |
template<typename, typename> | |
class | GenericValue |
void | swap (GenericDocument &a, GenericDocument &b) RAPIDJSON_NOEXCEPT |
free-standing swap function helper | |
Membres hérités additionnels | |
static RAPIDJSON_FORCEINLINE const Ch * | DataString (const Data &data) |
static RAPIDJSON_FORCEINLINE SizeType | DataStringLength (const Data &data) |
Data | data_ |
static const SizeType | kDefaultArrayCapacity |
static const SizeType | kDefaultObjectCapacity |
A document for parsing JSON text as DOM.
Encoding | Encoding for both parsing and string storage. |
Allocator | Allocator for allocating memory for the DOM |
StackAllocator | Allocator for allocating memory for stack during parsing. |
delete
a GenericDocument object via a pointer to a GenericValue. Définition à la ligne 2501 du fichier document.h.
typedef Allocator GenericDocument< Encoding, Allocator, StackAllocator >::AllocatorType |
Allocator type from template parameter.
Définition à la ligne 2505 du fichier document.h.
typedef Encoding::Ch GenericDocument< Encoding, Allocator, StackAllocator >::Ch |
Character type derived from Encoding.
Définition à la ligne 2503 du fichier document.h.
typedef StackAllocator GenericDocument< Encoding, Allocator, StackAllocator >::StackAllocatorType |
StackAllocator type from template parameter.
Définition à la ligne 2506 du fichier document.h.
typedef GenericValue<Encoding, Allocator> GenericDocument< Encoding, Allocator, StackAllocator >::ValueType |
Value type of the document.
Définition à la ligne 2504 du fichier document.h.
|
inlineexplicit |
Constructor.
Creates an empty document of specified type.
type | Mandatory type of object to create. |
allocator | Optional allocator for allocating memory. |
stackCapacity | Optional initial capacity of stack in bytes. |
stackAllocator | Optional allocator for allocating memory for stack. |
Définition à la ligne 2515 du fichier document.h.
|
inline |
Constructor.
Creates an empty document which type is Null.
allocator | Optional allocator for allocating memory. |
stackCapacity | Optional initial capacity of stack in bytes. |
stackAllocator | Optional allocator for allocating memory for stack. |
Définition à la ligne 2528 du fichier document.h.
|
inline |
Définition à la ligne 2550 du fichier document.h.
|
inline |
Définition à la ligne 2823 du fichier document.h.
|
inlineprivate |
Définition à la ligne 2870 du fichier document.h.
|
inlineprivate |
Définition à la ligne 2879 du fichier document.h.
|
inline |
Définition à la ligne 2828 du fichier document.h.
|
inline |
Définition à la ligne 2858 du fichier document.h.
|
inline |
Définition à la ligne 2850 du fichier document.h.
|
inline |
Get the allocator of this document.
Définition à la ligne 2797 du fichier document.h.
|
inline |
Get the position of last parsing error in input, 0 otherwise.
Définition à la ligne 2779 du fichier document.h.
|
inline |
Get the ParseErrorCode of last parsing.
Définition à la ligne 2776 du fichier document.h.
Référencé par Arcane::JSONDocument::parse().
|
inline |
Get the capacity of stack in bytes.
Définition à la ligne 2803 du fichier document.h.
|
inline |
Whether a parse error has occurred in the last parsing.
Définition à la ligne 2773 du fichier document.h.
Référencé par Arcane::JSONDocument::parse().
|
inline |
Définition à la ligne 2824 du fichier document.h.
|
inline |
Définition à la ligne 2826 du fichier document.h.
|
inline |
Définition à la ligne 2848 du fichier document.h.
|
inline |
Définition à la ligne 2822 du fichier document.h.
|
inline |
Implicit conversion to get the last parse result.
Définition à la ligne 2793 du fichier document.h.
|
inline |
Parse JSON text from a read-only string.
parseFlags | Combination of ParseFlag (must not contain kParseInsituFlag). |
str | Read-only zero-terminated string to be parsed. |
Définition à la ligne 2721 du fichier document.h.
|
inline |
Parse JSON text from a read-only string (with kParseDefaultFlags)
str | Read-only zero-terminated string to be parsed. |
Définition à la ligne 2728 du fichier document.h.
|
inline |
Définition à la ligne 2742 du fichier document.h.
|
inline |
Définition à la ligne 2746 du fichier document.h.
|
inline |
Parse JSON text from a read-only string (with Encoding conversion)
parseFlags | Combination of ParseFlag (must not contain kParseInsituFlag). |
SourceEncoding | Transcoding from input Encoding |
str | Read-only zero-terminated string to be parsed. |
Définition à la ligne 2710 du fichier document.h.
Référencé par GenericDocument< UTF8<> >::Parse(), Arcane::JSONDocument::parse(), et GenericDocument< UTF8<> >::ParseStream().
|
inline |
Définition à la ligne 2733 du fichier document.h.
|
inline |
Parse JSON text from a mutable string.
parseFlags | Combination of ParseFlag. |
str | Mutable zero-terminated string to be parsed. |
Définition à la ligne 2687 du fichier document.h.
Référencé par GenericDocument< UTF8<> >::ParseInsitu().
|
inline |
Parse JSON text from a mutable string (with kParseDefaultFlags)
str | Mutable zero-terminated string to be parsed. |
Définition à la ligne 2696 du fichier document.h.
|
inline |
Parse JSON text from an input stream (with Encoding conversion)
parseFlags | Combination of ParseFlag. |
SourceEncoding | Encoding of input stream |
InputStream | Type of input stream, implementing Stream concept |
is | Input stream to be parsed. |
Définition à la ligne 2644 du fichier document.h.
Référencé par GenericDocument< UTF8<> >::Parse(), GenericDocument< UTF8<> >::ParseInsitu(), et GenericDocument< UTF8<> >::ParseStream().
|
inline |
Parse JSON text from an input stream.
parseFlags | Combination of ParseFlag. |
InputStream | Type of input stream, implementing Stream concept |
is | Input stream to be parsed. |
Définition à la ligne 2663 du fichier document.h.
|
inline |
Parse JSON text from an input stream (with kParseDefaultFlags)
is | Input stream to be parsed. |
Définition à la ligne 2673 du fichier document.h.
|
inline |
Populate this document by a generator which produces SAX events.
Generator | A functor with bool f(Handler) prototype. |
g | Generator functor which sends SAX events to the parameter. |
Définition à la ligne 2624 du fichier document.h.
|
inline |
Définition à la ligne 2830 du fichier document.h.
|
inline |
Définition à la ligne 2856 du fichier document.h.
|
inline |
Définition à la ligne 2846 du fichier document.h.
|
inline |
Définition à la ligne 2838 du fichier document.h.
|
inline |
Exchange the contents of this document with those of another.
rhs | Another document. |
Définition à la ligne 2591 du fichier document.h.
|
inline |
Définition à la ligne 2825 du fichier document.h.
|
inline |
Définition à la ligne 2827 du fichier document.h.
|
friend |
Définition à la ligne 2818 du fichier document.h.
|
friend |
free-standing swap function helper
Helper function to enable support for common swap implementation pattern based on std::swap:
Définition à la ligne 2616 du fichier document.h.
|
private |
Définition à la ligne 2884 du fichier document.h.
|
staticprivate |
Définition à la ligne 2883 du fichier document.h.
|
private |
Définition à la ligne 2885 du fichier document.h.
|
private |
Définition à la ligne 2887 du fichier document.h.
|
private |
Définition à la ligne 2886 du fichier document.h.