15 #ifndef RAPIDJSON_DOCUMENT_H_
16 #define RAPIDJSON_DOCUMENT_H_
27 RAPIDJSON_DIAG_OFF(4127)
28 #elif defined(__GNUC__)
30 RAPIDJSON_DIAG_OFF(effc++)
36 #ifndef RAPIDJSON_HAS_STDSTRING
37 #ifdef RAPIDJSON_DOXYGEN_RUNNING
38 #define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation
40 #define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default
52 #endif // !defined(RAPIDJSON_HAS_STDSTRING)
54 #if RAPIDJSON_HAS_STDSTRING
56 #endif // RAPIDJSON_HAS_STDSTRING
58 #ifndef RAPIDJSON_NOMEMBERITERATORCLASS
62 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
69 template <
typename Encoding,
typename Allocator>
78 template <
typename Encoding,
typename Allocator>
87 #ifndef RAPIDJSON_NOMEMBERITERATORCLASS
108 template <
bool Const,
typename Encoding,
typename Allocator>
110 :
public std::iterator<std::random_access_iterator_tag
111 , typename internal::MaybeAddConst<Const,GenericMember<Encoding,Allocator> >::Type> {
118 typedef std::iterator<std::random_access_iterator_tag,ValueType>
BaseType;
203 #else // RAPIDJSON_NOMEMBERITERATORCLASS
207 template <
bool Const,
typename Encoding,
typename Allocator>
211 template <
typename Encoding,
typename Allocator>
217 template <
typename Encoding,
typename Allocator>
223 #endif // RAPIDJSON_NOMEMBERITERATORCLASS
255 template<
typename CharType>
319 operator const Ch *()
const {
return s; }
344 template<
typename CharType>
364 template<
typename CharType>
369 #if RAPIDJSON_HAS_STDSTRING
382 template<
typename CharType>
392 template <
typename T,
typename Encoding =
void,
typename Allocator =
void>
397 : IsBaseOf<GenericValue<typename T::EncodingType, typename T::AllocatorType>, T>
::Type {};
417 template <
typename Encoding,
typename Allocator = MemoryPoolAllocator<> >
424 typedef typename Encoding::Ch
Ch;
438 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
457 static const unsigned defaultFlags[7] = {
462 flags_ = defaultFlags[type];
476 template<
typename SourceAllocator >
485 #ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen
486 template <
typename T>
487 explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame<T,bool>))) RAPIDJSON_NOEXCEPT
506 if (!(u & 0x80000000))
550 #if RAPIDJSON_HAS_STDSTRING
561 if (Allocator::kNeedFree) {
570 for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)
576 Allocator::Free(const_cast<Ch*>(
data_.
s.
str));
600 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
603 return *
this = rhs.Move();
629 template <
typename T>
642 template <
typename SourceAllocator>
659 other.RawAssign(temp);
665 GenericValue& Move() RAPIDJSON_NOEXCEPT {
return *
this; }
675 template <
typename SourceAllocator>
678 if (GetType() != rhs.GetType())
685 for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) {
686 typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name);
687 if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value)
696 if ((*
this)[i] != rhs[i])
704 if (IsDouble() || rhs.IsDouble()) {
705 double a = GetDouble();
706 double b = rhs.GetDouble();
707 return a >= b && a <= b;
720 #if RAPIDJSON_HAS_STDSTRING
735 template <
typename SourceAllocator>
739 bool operator!=(
const Ch* rhs)
const {
return !(*
this == rhs); }
816 template <
typename T>
821 template <
typename T>
833 template <
typename SourceAllocator>
835 MemberIterator member = FindMember(name);
836 if (member != MemberEnd())
837 return member->value;
844 template <
typename SourceAllocator>
847 #if RAPIDJSON_HAS_STDSTRING
874 bool HasMember(
const Ch* name)
const {
return FindMember(name) != MemberEnd(); }
876 #if RAPIDJSON_HAS_STDSTRING
885 bool HasMember(
const std::basic_string<Ch>& name)
const {
return FindMember(name) != MemberEnd(); }
897 template <
typename SourceAllocator>
912 MemberIterator FindMember(
const Ch* name) {
914 return FindMember(n);
917 ConstMemberIterator FindMember(
const Ch* name)
const {
return const_cast<GenericValue&
>(*this).FindMember(name); }
932 template <
typename SourceAllocator>
936 MemberIterator member = MemberBegin();
937 for ( ; member != MemberEnd(); ++member)
944 #if RAPIDJSON_HAS_STDSTRING
952 MemberIterator FindMember(
const std::basic_string<Ch>& name) {
return FindMember(
StringRef(name)); }
953 ConstMemberIterator FindMember(
const std::basic_string<Ch>& name)
const {
return FindMember(
StringRef(name)); }
971 if (o.size >= o.capacity) {
972 if (o.capacity == 0) {
974 o.members =
reinterpret_cast<Member*
>(allocator.Malloc(o.capacity *
sizeof(Member)));
978 o.capacity += (oldCapacity + 1) / 2;
979 o.members =
reinterpret_cast<Member*
>(allocator.Realloc(o.members, oldCapacity *
sizeof(Member), o.capacity *
sizeof(Member)));
982 o.members[o.size].name.RawAssign(name);
983 o.members[o.size].value.RawAssign(value);
999 return AddMember(name, v, allocator);
1002 #if RAPIDJSON_HAS_STDSTRING
1014 return AddMember(name, v, allocator);
1035 template <
typename T>
1037 AddMember(
GenericValue& name, T value, Allocator& allocator) {
1039 return AddMember(name, v, allocator);
1042 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
1044 return AddMember(name, value, allocator);
1047 return AddMember(name, value, allocator);
1050 return AddMember(name, value, allocator);
1054 return AddMember(n, value, allocator);
1056 #endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
1071 return AddMember(n, value, allocator);
1083 GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) {
1085 return AddMember(name, v, allocator);
1105 template <
typename T>
1107 AddMember(StringRefType name, T value, Allocator& allocator) {
1109 return AddMember(n, value, allocator);
1116 void RemoveAllMembers() {
1118 for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)
1131 bool RemoveMember(
const Ch* name) {
1133 return RemoveMember(n);
1136 #if RAPIDJSON_HAS_STDSTRING
1137 bool RemoveMember(
const std::basic_string<Ch>& name) {
return RemoveMember(
GenericValue(
StringRef(name))); }
1140 template <
typename SourceAllocator>
1142 MemberIterator m = FindMember(name);
1143 if (m != MemberEnd()) {
1159 MemberIterator RemoveMember(MemberIterator m) {
1187 MemberIterator EraseMember(ConstMemberIterator pos) {
1188 return EraseMember(pos, pos +1);
1200 MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) {
1208 MemberIterator pos = MemberBegin() + (first - MemberBegin());
1209 for (MemberIterator itr = pos; itr != last; ++itr)
1211 std::memmove(&*pos, &*last, (MemberEnd() - last) *
sizeof(Member));
1265 ConstValueIterator Begin()
const {
return const_cast<GenericValue&
>(*this).Begin(); }
1268 ConstValueIterator End()
const {
return const_cast<GenericValue&
>(*this).End(); }
1303 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
1305 return PushBack(value, allocator);
1307 #endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
1318 GenericValue& PushBack(StringRefType value, Allocator& allocator) {
1319 return (*this).template PushBack<StringRefType>(value, allocator);
1339 template <
typename T>
1341 PushBack(T value, Allocator& allocator) {
1343 return PushBack(v, allocator);
1364 ValueIterator Erase(ConstValueIterator pos) {
1365 return Erase(pos, pos + 1);
1376 ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) {
1383 ValueIterator pos = Begin() + (first - Begin());
1384 for (ValueIterator itr = pos; itr != last; ++itr)
1385 itr->~GenericValue();
1386 std::memmove(pos, last, (End() - last) *
sizeof(
GenericValue));
1401 double GetDouble()
const {
1463 #if RAPIDJSON_HAS_STDSTRING
1471 GenericValue& SetString(
const std::basic_string<Ch>& s, Allocator& allocator) {
return SetString(s.data(),
SizeType(s.size()), allocator); }
1483 template <
typename Handler>
1484 bool Accept(Handler& handler)
const {
1488 case kTrueType:
return handler.Bool(
true);
1491 if (!handler.StartObject())
1493 for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) {
1495 if (!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.flags_ &
kCopyFlag) != 0))
1497 if (!m->value.Accept(handler))
1503 if (!handler.StartArray())
1506 if (!v->Accept(handler))
1511 return handler.String(GetString(), GetStringLength(), (
flags_ &
kCopyFlag) != 0);
1515 if (IsInt())
return handler.Int(
data_.
n.
i.
i);
1516 else if (IsUint())
return handler.Uint(
data_.
n.
u.
u);
1517 else if (IsInt64())
return handler.Int64(
data_.
n.
i64);
1518 else if (IsUint64())
return handler.Uint64(
data_.
n.
u64);
1519 else return handler.Double(
data_.
n.
d);
1524 template <
typename,
typename>
friend class GenericValue;
1532 kInt64Flag = 0x1000,
1534 kDoubleFlag = 0x4000,
1536 kCopyFlag = 0x200000,
1537 kInlineStrFlag = 0x400000,
1586 #if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN
1646 data_.
o.
members = (Member*)allocator.Malloc(count *
sizeof(Member));
1647 std::memcpy(
data_.
o.
members, members, count *
sizeof(Member));
1671 str = (Ch *)allocator.Malloc((s.
length + 1) *
sizeof(Ch));
1674 std::memcpy(str, s, s.
length *
sizeof(Ch));
1685 template <
typename SourceAllocator>
1690 const SizeType len1 = GetStringLength();
1691 const SizeType len2 = rhs.GetStringLength();
1692 if(len1 != len2) {
return false; }
1694 const Ch*
const str1 = GetString();
1695 const Ch*
const str2 = rhs.GetString();
1696 if(str1 == str2) {
return true; }
1698 return (std::memcmp(str1, str2,
sizeof(Ch) * len1) == 0);
1719 template <
typename Encoding,
typename Allocator = MemoryPoolAllocator<>,
typename StackAllocator = CrtAllocator>
1722 typedef typename Encoding::Ch
Ch;
1738 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
1741 : ValueType(
std::move(rhs)),
1748 rhs.ownAllocator_ = 0;
1757 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
1770 stack_ = std::move(rhs.stack_);
1774 rhs.ownAllocator_ = 0;
1791 template <
unsigned parseFlags,
typename SourceEncoding,
typename InputStream>
1793 ValueType::SetNull();
1796 parseResult_ = reader.template Parse<parseFlags>(is, *
this);
1810 template <
unsigned parseFlags,
typename InputStream>
1812 return ParseStream<parseFlags, Encoding, InputStream>(is);
1820 template <
typename InputStream>
1822 return ParseStream<kParseDefaultFlags, Encoding, InputStream>(is);
1834 template <
unsigned parseFlags>
1837 return ParseStream<parseFlags | kParseInsituFlag>(s);
1845 return ParseInsitu<kParseDefaultFlags>(str);
1857 template <
unsigned parseFlags,
typename SourceEncoding>
1861 return ParseStream<parseFlags, SourceEncoding>(s);
1868 template <
unsigned parseFlags>
1870 return Parse<parseFlags, Encoding>(str);
1877 return Parse<kParseDefaultFlags>(str);
1946 ValueType* elements =
stack_.template Pop<ValueType>(elementCount);
1958 if (Allocator::kNeedFree)
1981 template <
typename Encoding,
typename Allocator>
1982 template <
typename SourceAllocator>
1986 switch (rhs.GetType()) {
2010 #if defined(_MSC_VER) || defined(__GNUC__)
2014 #endif // RAPIDJSON_DOCUMENT_H_
GenericMemberIterator()
Default constructor (singular value)
Definition: document.h:139
void SetLength(SizeType len)
Definition: document.h:1580
GenericValue< Encoding, Allocator > name
name of member (must be a string)
Definition: document.h:80
GenericStringRef< CharType > StringRef(const CharType *str)
Mark a character pointer as constant string.
Definition: document.h:345
struct GenericValue::Number::I i
Iterator operator--(int)
Definition: document.h:164
Definition: document.h:1536
Definition: document.h:1547
static const size_t kDefaultStackCapacity
Definition: document.h:1970
GenericValue * ValueIterator
Value iterator for iterating in array.
Definition: document.h:428
bool EndArray(SizeType elementCount)
Definition: document.h:1945
Allocator AllocatorType
Allocator type from template parameter.
Definition: document.h:1724
SizeType GetLength() const
Definition: document.h:1581
GenericValue & operator=(StringRefType str) RAPIDJSON_NOEXCEPT
Assignment of constant string reference (no copy)
Definition: document.h:612
const GenericValue * ConstValueIterator
Constant value iterator for iterating in array.
Definition: document.h:429
GenericValue< Encoding, Allocator > ValueType
Value type of the document.
Definition: document.h:1723
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:322
void SetObjectRaw(Member *members, SizeType count, Allocator &allocator)
Initialize this value as object with initial data, without calling destructor.
Definition: document.h:1643
Definition: document.h:393
Definition: document.h:1532
bool String(const Ch *str, SizeType length, bool copy)
Definition: document.h:1925
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:344
size_t Offset() const
Get the error offset, if IsError(), 0 otherwise.
Definition: error.h:111
BaseType::pointer Pointer
Pointer to (const) GenericMember.
Definition: document.h:129
Definition: document.h:1555
ClearStackOnExit(GenericDocument &d)
Definition: document.h:1904
Definition: document.h:1587
#define RAPIDJSON_UINT64_C2(high32, low32)
Construct a 64-bit literal by a pair of 32-bit integer.
Definition: rapidjson.h:261
Definition: document.h:1548
Member * members
Definition: document.h:1611
object
Definition: rapidjson.h:646
Definition: document.h:1903
Pointer ptr_
raw pointer
Definition: document.h:200
~ClearStackOnExit()
Definition: document.h:1905
GenericValue(Type type) RAPIDJSON_NOEXCEPT
Constructor with JSON value type.
Definition: document.h:456
void SetArrayRaw(GenericValue *values, SizeType count, Allocator &allocator)
Definition: document.h:1631
Read-only string stream.
Definition: rapidjson.h:571
void RawAssign(GenericValue &rhs) RAPIDJSON_NOEXCEPT
Assignment without calling destructor.
Definition: document.h:1679
GenericDocument & operator=(const GenericDocument &)
Prohibit assignment.
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:119
static const SizeType kDefaultArrayCapacity
Definition: document.h:1558
GenericValue< Encoding, Allocator > value
value of member.
Definition: document.h:81
const Ch * str
Definition: document.h:1562
(Constant) member iterator for a JSON object value
Definition: document.h:109
const Ch *const s
plain CharType pointer
Definition: document.h:321
void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT
Initialize this value as constant string, without calling destructor.
Definition: document.h:1655
array
Definition: rapidjson.h:647
Definition: document.h:1552
GenericMemberIterator Iterator
Iterator type itself.
Definition: document.h:122
int i
Definition: document.h:1588
GenericMemberIterator(Pointer p)
Internal constructor from plain pointer.
Definition: document.h:198
Data data_
Definition: document.h:1701
Encoding::Ch Ch
Character type derived from Encoding.
Definition: document.h:1722
SizeType capacity
Definition: document.h:1613
GenericDocument & ParseStream(InputStream &is)
Parse JSON text from an input stream.
Definition: document.h:1811
internal::Stack< StackAllocator > stack_
Definition: document.h:1973
~GenericValue()
Destructor.
Definition: document.h:560
bool Bool(bool b)
Definition: document.h:1918
std::iterator< std::random_access_iterator_tag, ValueType > BaseType
Definition: document.h:118
#define RAPIDJSON_STATIC_ASSERT(x)
(Internal) macro to check for conditions at compile-time
Definition: rapidjson.h:375
GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT
Constructor for uint64_t value.
Definition: document.h:525
bool operator!=(ConstIterator that) const
Definition: document.h:179
ParseErrorCode GetParseError() const
Get the ParseErrorCode of last parsing.
Definition: document.h:1888
Definition: document.h:1549
false
Definition: rapidjson.h:644
arena_t NULL
Definition: jemalloc_internal.h:624
#define false
Definition: CascPort.h:18
GenericValue(const Ch *s, SizeType length, Allocator &allocator)
Constructor for copy-string (i.e. do make a copy of string)
Definition: document.h:545
Definition: document.h:1533
Definition: document.h:1541
GenericMemberIterator< true, Encoding, Allocator > ConstIterator
Constant iterator type.
Definition: document.h:124
bool StringEqual(const GenericValue< Encoding, SourceAllocator > &rhs) const
Definition: document.h:1686
Result of parsing (wraps ParseErrorCode)
Definition: error.h:101
GenericValue(const Ch *s, SizeType length) RAPIDJSON_NOEXCEPT
Constructor for constant string (i.e. do not make a copy of string)
Definition: document.h:539
GenericValue< Encoding, Allocator > ValueType
Value type of itself.
Definition: document.h:430
void Clear()
Definition: stack.h:84
bool operator<(ConstIterator that) const
Definition: document.h:182
signed __int64 int64_t
Definition: stdint.h:89
GenericDocument & ParseStream(InputStream &is)
Parse JSON text from an input stream (with kParseDefaultFlags)
Definition: document.h:1821
Pointer operator->() const
Definition: document.h:189
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:116
Definition: document.h:1530
internal::MaybeAddConst< Const, PlainType >::Type ValueType
Definition: document.h:117
Definition: document.h:1551
bool StartObject()
Definition: document.h:1933
SizeType size
Definition: document.h:1618
bool StartArray()
Definition: document.h:1943
Definition: document.h:1553
GenericValue(double d) RAPIDJSON_NOEXCEPT
Constructor for double value.
Definition: document.h:536
A document for parsing JSON text as DOM.
Definition: document.h:1720
Allocator AllocatorType
Allocator type from template parameter.
Definition: document.h:423
ShortString ss
Definition: document.h:1624
Represents a JSON value. Use Value for UTF8 encoding and default allocator.
Definition: document.h:70
Definition: document.h:1576
Definition: document.h:1531
A read-write string stream.
Definition: rapidjson.h:605
~GenericDocument()
Definition: document.h:1753
Definition: document.h:1537
bool operator==(ConstIterator that) const
Definition: document.h:178
GenericMemberIterator< true, Encoding, Allocator >::Iterator ConstMemberIterator
Constant member iterator for iterating in object.
Definition: document.h:427
Definition: document.h:1622
Ch str[MaxChars]
Definition: document.h:1577
#define true
Definition: CascPort.h:17
ClearStackOnExit & operator=(const ClearStackOnExit &)
GenericStringRef< Ch > StringRefType
Reference to a constant string.
Definition: document.h:425
Iterator & operator--()
Definition: document.h:162
Definition: document.h:1534
GenericDocument(Allocator *allocator=0, size_t stackCapacity=kDefaultStackCapacity, StackAllocator *stackAllocator=0)
Constructor.
Definition: document.h:1731
Definition: document.h:1543
Reference operator[](DifferenceType n) const
Definition: document.h:190
bool EndObject(SizeType memberCount)
Definition: document.h:1937
Array a
Definition: document.h:1627
SizeType capacity
Definition: document.h:1619
string
Definition: rapidjson.h:648
Allocator * ownAllocator_
Definition: document.h:1972
SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.
Definition: reader.h:374
GenericStringRef(const CharType *str)
Explicitly create string reference from const character pointer.
Definition: document.h:305
Number n
Definition: document.h:1625
char padding[4]
Definition: document.h:1589
ParseResult parseResult_
Definition: document.h:1974
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition: document.h:1706
Definition: document.h:1550
bool Double(double d)
Definition: document.h:1923
GenericMemberIterator< false, Encoding, Allocator >::Iterator MemberIterator
Member iterator for iterating in object.
Definition: document.h:426
Encoding EncodingType
Encoding type from template parameter.
Definition: document.h:422
bool Null()
Definition: document.h:1917
double d
Definition: document.h:1607
RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer< T >),(GenericValue &)) operator
Assignment with primitive types.
unsigned hashcode
reserved
Definition: document.h:1564
ParseErrorCode
Error code of parsing.
Definition: error.h:59
unsigned __int64 uint64_t
Definition: stdint.h:90
Iterator & operator++()
Definition: document.h:161
char padding2[4]
Definition: document.h:1593
bool operator<=(ConstIterator that) const
Definition: document.h:180
GenericDocument & ParseInsitu(Ch *str)
Parse JSON text from a mutable string.
Definition: document.h:1835
GenericStringRef(const CharType(&str)[N]) RAPIDJSON_NOEXCEPT
Create string reference from const character array.
Definition: document.h:283
bool Int(int i)
Definition: document.h:1919
ParseErrorCode Code() const
Get the error code.
Definition: error.h:109
bool operator>(ConstIterator that) const
Definition: document.h:183
bool operator!=(const CoordPair< LIMIT > &p1, const CoordPair< LIMIT > &p2)
Definition: GridDefines.h:166
Allocator & GetAllocator()
Get the allocator of this document.
Definition: document.h:1896
static bool Usable(SizeType len)
Definition: document.h:1579
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
Definition: document.h:1978
Iterator operator++(int)
Definition: document.h:163
bool operator==(const CoordPair< LIMIT > &p1, const CoordPair< LIMIT > &p2)
Definition: GridDefines.h:160
const SizeType length
length of the string (excluding the trailing NULL terminator)
Definition: document.h:322
number
Definition: rapidjson.h:649
#define RAPIDJSON_NEW(x)
! customization point for global new
Definition: rapidjson.h:480
size_t GetSize() const
Definition: stack.h:129
Name-value pair in a JSON object value.
Definition: document.h:79
bool Int64(int64_t i)
Definition: document.h:1921
GenericValue & operator=(GenericValue &rhs) RAPIDJSON_NOEXCEPT
Assignment with move semantics.
Definition: document.h:593
Iterator & operator+=(DifferenceType n)
Definition: document.h:172
Definition: document.h:1546
void SetStringRaw(StringRefType s, Allocator &allocator)
Initialize this value as copy string with initial data, without calling destructor.
Definition: document.h:1662
#define RAPIDJSON_DELETE(x)
! customization point for global delete
Definition: rapidjson.h:484
Definition: document.h:1545
String s
Definition: document.h:1623
G3D::int16 & operator[](int i)
Definition: Vector2int16.h:51
GenericDocument & ParseInsitu(Ch *str)
Parse JSON text from a mutable string (with kParseDefaultFlags)
Definition: document.h:1844
Definition: document.h:1616
Definition: document.h:1585
Allocator & GetAllocator()
Definition: stack.h:127
CharType Ch
character type of the string
Definition: document.h:257
Definition: document.h:1575
DifferenceType operator-(ConstIterator that) const
Distance.
Definition: document.h:194
Definition: document.h:1540
GenericStringRef operator=(const GenericStringRef &)
Disallow copy-assignment.
Definition: document.h:1529
Definition: document.h:390
bool IsError() const
Whether the result is an error.
Definition: error.h:116
GenericStringRef< CharType > StringRef(const CharType *str)
Mark a character pointer as constant string.
Definition: document.h:345
Definition: document.h:1610
GenericMember< Encoding, Allocator > PlainType
Definition: document.h:116
void ShrinkToFit()
Definition: stack.h:86
Reference operator*() const
Definition: document.h:188
Definition: document.h:1528
uint64_t u64
Definition: document.h:1606
SizeType size
Definition: document.h:1612
size_t GetCapacity() const
Definition: stack.h:130
Definition: document.h:1561
size_t GetErrorOffset() const
Get the position of last parsing error in input, 0 otherwise.
Definition: document.h:1891
bool operator>=(ConstIterator that) const
Definition: document.h:181
GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT
Constructor for int64_t value.
Definition: document.h:511
Definition: document.h:1542
Encoding::Ch Ch
Character type derived from Encoding.
Definition: document.h:424
GenericValue(const Ch *s, Allocator &allocator)
Constructor for copy-string (i.e. do make a copy of string)
Definition: document.h:548
Iterator operator-(DifferenceType n) const
Definition: document.h:170
Definition: document.h:1535
Definition: document.h:1544
Definition: document.h:1591
GenericMember< Encoding, Allocator > Member
Name-value pair in an object.
Definition: document.h:421
bool Uint64(uint64_t i)
Definition: document.h:1922
GenericDocument & d_
Definition: document.h:1909
GenericDocument & Parse(const Ch *str)
Parse JSON text from a read-only string.
Definition: document.h:1869
true
Definition: rapidjson.h:645
unsigned u
Definition: document.h:1592
GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame< T, bool >))) RAPIDJSON_NOEXCEPT
Constructor for boolean value.
Definition: document.h:487
bool Uint(unsigned i)
Definition: document.h:1920
GenericValue(int i) RAPIDJSON_NOEXCEPT
Constructor for int value.
Definition: document.h:497
SizeType StrLen(const Ch *s)
Custom strlen() which works on different character types.
Definition: strfunc.h:30
Reference to a constant string (not taking a copy)
Definition: document.h:256
Definition: document.h:400
const FieldDescriptor value
Definition: descriptor.h:1522
void ClearStack()
Definition: document.h:1957
BaseType::difference_type DifferenceType
Signed integer type (e.g. ptrdiff_t)
Definition: document.h:133
#define const
Definition: zconf.h:217
GenericMemberIterator< false, Encoding, Allocator > NonConstIterator
Non-constant iterator type.
Definition: document.h:126
Definition: document.h:1576
GenericMemberIterator(const NonConstIterator &it)
Iterator conversions to more const.
Definition: document.h:157
Iterator operator+(DifferenceType n) const
Definition: document.h:169
int64_t i64
Definition: document.h:1605
Allocator * allocator_
Definition: document.h:1971
Type
Type of JSON value.
Definition: rapidjson.h:642
static const SizeType kDefaultObjectCapacity
Definition: document.h:1559
unsigned flags_
Definition: document.h:1702
BaseType::reference Reference
Reference to (const) GenericMember.
Definition: document.h:131
SizeType length
Definition: document.h:1563
GenericDocument & Parse(const Ch *str)
Parse JSON text from a read-only string (with kParseDefaultFlags)
Definition: document.h:1876
GenericStringRef(const CharType *str, SizeType len)
Create constant string reference from pointer and length.
Definition: document.h:315
GenericValue * elements
Definition: document.h:1617
Definition: document.h:1576
size_t GetStackCapacity() const
Get the capacity of stack in bytes.
Definition: document.h:1899
struct GenericValue::Number::U u
Data
Definition: molten_core.h:69
In-situ(destructive) parsing.
Definition: reader.h:138
void Destroy()
Definition: document.h:1966
Iterator & operator-=(DifferenceType n)
Definition: document.h:173
GenericDocument & Parse(const Ch *str)
Parse JSON text from a read-only string (with Encoding conversion)
Definition: document.h:1858
GenericValue() RAPIDJSON_NOEXCEPT
Default constructor creates a null value.
Definition: document.h:436
bool HasParseError() const
Whether a parse error has occured in the last parsing.
Definition: document.h:1885
GenericDocument & ParseStream(InputStream &is)
Parse JSON text from an input stream (with Encoding conversion)
Definition: document.h:1792
null
Definition: rapidjson.h:643
GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT
Constructor for constant string (i.e. do not make a copy of string)
Definition: document.h:542
Object o
Definition: document.h:1626
GenericValue(unsigned u) RAPIDJSON_NOEXCEPT
Constructor for unsigned value.
Definition: document.h:504
bool Key(const Ch *str, SizeType length, bool copy)
Definition: document.h:1935