IN2OSM
1.0.1
|
A document for parsing JSON text as DOM. More...
#include <document.h>
Classes | |
struct | ClearStackOnExit |
Public Types | |
typedef Encoding::Ch | Ch |
Character type derived from Encoding. More... | |
typedef GenericValue< Encoding, Allocator > | ValueType |
Value type of the document. More... | |
typedef Allocator | AllocatorType |
Allocator type from template parameter. More... | |
enum | { kBoolFlag = 0x0008, kNumberFlag = 0x0010, kIntFlag = 0x0020, kUintFlag = 0x0040, kInt64Flag = 0x0080, kUint64Flag = 0x0100, kDoubleFlag = 0x0200, kStringFlag = 0x0400, kCopyFlag = 0x0800, kInlineStrFlag = 0x1000, kNullFlag = kNullType, kTrueFlag = kTrueType | kBoolFlag, kFalseFlag = kFalseType | kBoolFlag, kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag, kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, kConstStringFlag = kStringType | kStringFlag, kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, kObjectFlag = kObjectType, kArrayFlag = kArrayType, kTypeMask = 0x07 } |
typedef GenericMember< Encoding, Allocator > | Member |
Name-value pair in an object. More... | |
typedef Encoding | EncodingType |
Encoding type from template parameter. More... | |
typedef GenericStringRef< Ch > | StringRefType |
Reference to a constant string. More... | |
typedef GenericMemberIterator< false, Encoding, Allocator >::Iterator | MemberIterator |
Member iterator for iterating in object. More... | |
typedef GenericMemberIterator< true, Encoding, Allocator >::Iterator | ConstMemberIterator |
Constant member iterator for iterating in object. More... | |
typedef GenericValue * | ValueIterator |
Value iterator for iterating in array. More... | |
typedef const GenericValue * | ConstValueIterator |
Constant value iterator for iterating in array. More... | |
typedef GenericArray< false, ValueType > | Array |
typedef GenericArray< true, ValueType > | ConstArray |
typedef GenericObject< false, ValueType > | Object |
typedef GenericObject< true, ValueType > | ConstObject |
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 () | |
GenericDocument & | Swap (GenericDocument &rhs) RAPIDJSON_NOEXCEPT |
Exchange the contents of this document with those of another. More... | |
template<typename Generator > | |
GenericDocument & | Populate (Generator &g) |
Populate this document by a generator which produces SAX events. More... | |
Allocator & | GetAllocator () |
Get the allocator of this document. More... | |
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) |
template<typename T > | |
RAPIDJSON_DISABLEIF_RETURN ((internal::IsPointer< T >),(GenericValue &)) operator | |
Assignment with primitive types. More... | |
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) |
void | SetArrayRaw (GenericValue *values, SizeType count, Allocator &allocator) |
void | SetObjectRaw (Member *members, SizeType count, Allocator &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, Allocator &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... | |
template<typename SourceAllocator > | |
bool | StringEqual (const GenericValue< Encoding, SourceAllocator > &rhs) const |
Parse from stream | |
template<unsigned parseFlags, typename SourceEncoding , typename InputStream > | |
GenericDocument & | ParseStream (InputStream &is) |
Parse JSON text from an input stream (with Encoding conversion) More... | |
template<unsigned parseFlags, typename InputStream > | |
GenericDocument & | ParseStream (InputStream &is) |
Parse JSON text from an input stream. More... | |
template<typename InputStream > | |
GenericDocument & | ParseStream (InputStream &is) |
Parse JSON text from an input stream (with kParseDefaultFlags) More... | |
Parse in-place from mutable string | |
template<unsigned parseFlags> | |
GenericDocument & | ParseInsitu (Ch *str) |
Parse JSON text from a mutable string. More... | |
GenericDocument & | ParseInsitu (Ch *str) |
Parse JSON text from a mutable string (with kParseDefaultFlags) More... | |
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) More... | |
template<unsigned parseFlags> | |
GenericDocument & | Parse (const Ch *str) |
Parse JSON text from a read-only string. More... | |
GenericDocument & | Parse (const Ch *str) |
Parse JSON text from a read-only string (with kParseDefaultFlags) More... | |
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. 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... | |
operator ParseResult () const | |
Implicit conversion to get the last parse result. More... | |
Public Attributes | |
Data | data_ |
Static Public Attributes | |
static const SizeType | kDefaultArrayCapacity = 16 |
static const SizeType | kDefaultObjectCapacity = 16 |
Private Member Functions | |
GenericDocument (const GenericDocument &) | |
Prohibit copying. More... | |
GenericDocument & | operator= (const GenericDocument &) |
Prohibit assignment. More... | |
void | ClearStack () |
void | Destroy () |
Private Attributes | |
Allocator * | allocator_ |
Allocator * | ownAllocator_ |
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... | |
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. Definition at line 57 of file document.h.
typedef Allocator AllocatorType |
Allocator type from template parameter.
Definition at line 2128 of file document.h.
|
inherited |
Definition at line 591 of file document.h.
typedef Encoding::Ch Ch |
Character type derived from Encoding.
Definition at line 2126 of file document.h.
|
inherited |
Definition at line 592 of file document.h.
|
inherited |
Constant member iterator for iterating in object.
Definition at line 587 of file document.h.
|
inherited |
Definition at line 594 of file document.h.
|
inherited |
Constant value iterator for iterating in array.
Definition at line 589 of file document.h.
|
inherited |
Encoding type from template parameter.
Definition at line 582 of file document.h.
|
inherited |
Name-value pair in an object.
Definition at line 581 of file document.h.
|
inherited |
Member iterator for iterating in object.
Definition at line 586 of file document.h.
|
inherited |
Definition at line 593 of file document.h.
|
inherited |
Reference to a constant string.
Definition at line 585 of file document.h.
|
inherited |
Value iterator for iterating in array.
Definition at line 588 of file document.h.
typedef GenericValue<Encoding, Allocator> ValueType |
Value type of the document.
Definition at line 2127 of file document.h.
|
inherited |
Definition at line 1911 of file 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. |
Definition at line 2137 of file 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. |
Definition at line 2150 of file document.h.
|
inline |
Definition at line 2172 of file document.h.
|
private |
Prohibit copying.
|
inline |
Definition at line 2438 of file document.h.
|
inlineprivate |
Definition at line 2485 of file document.h.
|
inlineprivate |
Definition at line 2494 of file document.h.
|
inline |
Definition at line 2443 of file document.h.
|
inline |
Definition at line 2473 of file document.h.
|
inline |
Definition at line 2465 of file document.h.
|
inline |
|
inlineinherited |
Definition at line 2028 of file document.h.
|
inline |
Get the position of last parsing error in input, 0 otherwise.
Definition at line 2394 of file document.h.
|
inlineinherited |
Definition at line 2030 of file document.h.
|
inline |
|
inline |
|
inlineinherited |
Definition at line 2026 of file document.h.
|
inline |
|
inline |
Definition at line 2439 of file document.h.
|
inline |
Definition at line 2441 of file document.h.
Definition at line 2463 of file document.h.
|
inline |
Definition at line 2437 of file document.h.
|
inline |
Implicit conversion to get the last parse result.
Definition at line 2408 of file document.h.
|
private |
Prohibit assignment.
|
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. |
Definition at line 2325 of file 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. |
Definition at line 2336 of file document.h.
|
inline |
Parse JSON text from a read-only string (with kParseDefaultFlags)
str | Read-only zero-terminated string to be parsed. |
Definition at line 2343 of file document.h.
|
inline |
Definition at line 2348 of file document.h.
|
inline |
Definition at line 2357 of file document.h.
|
inline |
Definition at line 2361 of file document.h.
|
inline |
Parse JSON text from a mutable string.
parseFlags | Combination of ParseFlag. |
str | Mutable zero-terminated string to be parsed. |
Definition at line 2302 of file document.h.
|
inline |
Parse JSON text from a mutable string (with kParseDefaultFlags)
str | Mutable zero-terminated string to be parsed. |
Definition at line 2311 of file 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. |
Definition at line 2259 of file document.h.
|
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. |
Definition at line 2278 of file document.h.
|
inline |
Parse JSON text from an input stream (with kParseDefaultFlags)
InputStream | Type of input stream, implementing Stream concept |
is | Input stream to be parsed. |
Definition at line 2288 of file 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. |
Definition at line 2239 of file document.h.
|
inherited |
Assignment with primitive types.
T | Either Type, int , unsigned , int64_t , uint64_t |
value | The value to be assigned. |
T
explicitly disallows all pointer types, especially (const
) Ch*. This helps avoiding implicitly referencing character strings with insufficient lifetime, use SetString(const Ch*, Allocator&) (for copying) or StringRef() (to explicitly mark the pointer as constant) instead. All other pointer types would implicitly convert to bool
, use SetBool() instead.Set boolean value
|
inlineinherited |
Assignment without calling destructor.
Definition at line 2084 of file document.h.
Definition at line 2445 of file document.h.
|
inlineinherited |
Definition at line 2034 of file document.h.
|
inlineinherited |
Definition at line 2029 of file document.h.
Definition at line 2031 of file document.h.
Initialize this value as object with initial data, without calling destructor.
Definition at line 2047 of file document.h.
Definition at line 2027 of file document.h.
|
inlineinherited |
Initialize this value as constant string, without calling destructor.
Definition at line 2060 of file document.h.
|
inlineinherited |
Initialize this value as copy string with initial data, without calling destructor.
Definition at line 2067 of file document.h.
|
inline |
Definition at line 2471 of file document.h.
|
inline |
Definition at line 2461 of file document.h.
Definition at line 2453 of file document.h.
|
inlineinherited |
Definition at line 2091 of file document.h.
|
inline |
Exchange the contents of this document with those of another.
rhs | Another document. |
Definition at line 2206 of file document.h.
|
inline |
Definition at line 2440 of file document.h.
|
inline |
Definition at line 2442 of file document.h.
|
friend |
Definition at line 2433 of file document.h.
|
friend |
free-standing swap function helper
Helper function to enable support for common swap implementation pattern based on std::swap:
Definition at line 2231 of file document.h.
|
private |
Definition at line 2499 of file document.h.
|
inherited |
Definition at line 2106 of file document.h.
|
staticinherited |
Definition at line 1942 of file document.h.
|
staticinherited |
Definition at line 1943 of file document.h.
|
staticprivate |
Definition at line 2498 of file document.h.
|
private |
Definition at line 2500 of file document.h.
|
private |
Definition at line 2502 of file document.h.
|
private |
Definition at line 2501 of file document.h.