15 #ifndef RAPIDJSON_POINTER_H_ 16 #define RAPIDJSON_POINTER_H_ 20 #include "internal/itoa.h" 24 RAPIDJSON_DIAG_OFF(
switch-
enum)
25 #elif defined(_MSC_VER) 27 RAPIDJSON_DIAG_OFF(4512)
32 static const SizeType kPointerInvalidIndex = ~SizeType(0);
79 template <
typename ValueType,
typename Allocator = CrtAllocator>
83 typedef typename ValueType::Ch
Ch;
118 Parse(source, internal::StrLen(source));
121 #if RAPIDJSON_HAS_STDSTRING 129 Parse(source.c_str(), source.size());
141 Parse(source, length);
215 internal::Swap(
tokens_, other.tokens_);
250 Ch *p = r.CopyFromRaw(*
this, 1, token.
length + 1);
251 std::memcpy(p, token.
name, (token.
length + 1) *
sizeof(Ch));
267 return Append(token, allocator);
276 template <
typename T>
278 Append(T*
name, Allocator* allocator = 0)
const {
279 return Append(name, internal::StrLen(name), allocator);
282 #if RAPIDJSON_HAS_STDSTRING 290 return Append(name.c_str(),
static_cast<SizeType
>(name.size()), allocator);
302 char* end =
sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer);
303 SizeType
length =
static_cast<SizeType
>(end - buffer);
306 if (
sizeof(Ch) == 1) {
307 Token token = {
reinterpret_cast<Ch*
>(buffer), length, index };
308 return Append(token, allocator);
312 for (
size_t i = 0; i <=
length; i++)
313 name[i] = static_cast<Ch>(buffer[i]);
315 return Append(token, allocator);
326 if (token.IsString())
327 return Append(token.GetString(), token.GetStringLength(), allocator);
331 return Append(static_cast<SizeType>(token.GetUint64()), allocator);
350 Allocator& GetAllocator() {
return *
allocator_; }
359 size_t GetTokenCount()
const {
return tokenCount_; }
390 bool operator!=(
const GenericPointer& rhs)
const {
return !(*
this == rhs); }
429 template<
typename OutputStream>
430 bool Stringify(OutputStream& os)
const {
431 return Stringify<false, OutputStream>(os);
439 template<
typename OutputStream>
440 bool StringifyUriFragment(OutputStream& os)
const {
441 return Stringify<true, OutputStream>(os);
464 ValueType& Create(ValueType& root,
typename ValueType::AllocatorType& allocator,
bool* alreadyExist = 0)
const {
466 ValueType* v = &root;
469 if (v->IsArray() && t->name[0] ==
'-' && t->length == 1) {
470 v->PushBack(ValueType().Move(), allocator);
471 v = &((*v)[v->Size() - 1]);
475 if (t->index == kPointerInvalidIndex) {
480 if (!v->IsArray() && !v->IsObject())
485 if (t->index >= v->Size()) {
486 v->Reserve(t->index + 1, allocator);
487 while (t->index >= v->Size())
488 v->PushBack(ValueType().Move(), allocator);
491 v = &((*v)[t->index]);
495 if (m == v->MemberEnd()) {
496 v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator);
508 *alreadyExist = exist;
519 template <
typename stackAllocator>
521 return Create(document, document.
GetAllocator(), alreadyExist);
546 UriType GetUri(ValueType& root,
const UriType& rootUri,
size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0)
const {
547 static const Ch kIdString[] = {
'i',
'd',
'\0' };
548 static const ValueType kIdValue(kIdString, 2);
549 UriType base = UriType(rootUri, allocator);
551 ValueType* v = &root;
553 switch (v->GetType()) {
557 typename ValueType::MemberIterator m = v->FindMember(kIdValue);
558 if (m != v->MemberEnd() && (m->value).IsString()) {
559 UriType here = UriType(m->value, allocator).Resolve(base, allocator);
563 if (m == v->MemberEnd())
569 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
571 v = &((*v)[t->index]);
578 if (unresolvedTokenIndex)
579 *unresolvedTokenIndex =
static_cast<size_t>(t -
tokens_);
580 return UriType(allocator);
585 UriType GetUri(
const ValueType& root,
const UriType& rootUri,
size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0)
const {
586 return GetUri(const_cast<ValueType&>(root), rootUri, unresolvedTokenIndex, allocator);
607 ValueType* Get(ValueType& root,
size_t* unresolvedTokenIndex = 0)
const {
609 ValueType* v = &root;
611 switch (v->GetType()) {
615 if (m == v->MemberEnd())
621 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
623 v = &((*v)[t->index]);
630 if (unresolvedTokenIndex)
631 *unresolvedTokenIndex =
static_cast<size_t>(t -
tokens_);
642 const ValueType* Get(
const ValueType& root,
size_t* unresolvedTokenIndex = 0)
const {
643 return Get(const_cast<ValueType&>(root), unresolvedTokenIndex);
661 ValueType& GetWithDefault(ValueType& root,
const ValueType& defaultValue,
typename ValueType::AllocatorType& allocator)
const {
663 ValueType& v = Create(root, allocator, &alreadyExist);
664 return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
668 ValueType& GetWithDefault(ValueType& root,
const Ch* defaultValue,
typename ValueType::AllocatorType& allocator)
const {
670 ValueType& v = Create(root, allocator, &alreadyExist);
671 return alreadyExist ? v : v.SetString(defaultValue, allocator);
674 #if RAPIDJSON_HAS_STDSTRING 675 ValueType& GetWithDefault(ValueType& root,
const std::basic_string<Ch>& defaultValue,
typename ValueType::AllocatorType& allocator)
const {
678 ValueType& v = Create(root, allocator, &alreadyExist);
679 return alreadyExist ? v : v.SetString(defaultValue, allocator);
687 template <
typename T>
689 GetWithDefault(ValueType& root, T defaultValue,
typename ValueType::AllocatorType& allocator)
const {
690 return GetWithDefault(root, ValueType(defaultValue).Move(), allocator);
694 template <
typename stackAllocator>
696 return GetWithDefault(document, defaultValue, document.
GetAllocator());
700 template <
typename stackAllocator>
702 return GetWithDefault(document, defaultValue, document.
GetAllocator());
705 #if RAPIDJSON_HAS_STDSTRING 706 template <
typename stackAllocator>
709 return GetWithDefault(document, defaultValue, document.
GetAllocator());
717 template <
typename T,
typename stackAllocator>
720 return GetWithDefault(document, defaultValue, document.
GetAllocator());
738 ValueType& Set(ValueType& root, ValueType&
value,
typename ValueType::AllocatorType& allocator)
const {
739 return Create(root, allocator) = value;
743 ValueType& Set(ValueType& root,
const ValueType& value,
typename ValueType::AllocatorType& allocator)
const {
744 return Create(root, allocator).CopyFrom(value, allocator);
748 ValueType& Set(ValueType& root,
const Ch* value,
typename ValueType::AllocatorType& allocator)
const {
749 return Create(root, allocator) = ValueType(value, allocator).Move();
752 #if RAPIDJSON_HAS_STDSTRING 753 ValueType& Set(ValueType& root,
const std::basic_string<Ch>& value,
typename ValueType::AllocatorType& allocator)
const {
755 return Create(root, allocator) = ValueType(value, allocator).Move();
763 template <
typename T>
765 Set(ValueType& root, T value,
typename ValueType::AllocatorType& allocator)
const {
766 return Create(root, allocator) = ValueType(value).Move();
770 template <
typename stackAllocator>
772 return Create(document) = value;
776 template <
typename stackAllocator>
778 return Create(document).CopyFrom(value, document.
GetAllocator());
782 template <
typename stackAllocator>
784 return Create(document) = ValueType(value, document.
GetAllocator()).Move();
787 #if RAPIDJSON_HAS_STDSTRING 788 template <
typename stackAllocator>
791 return Create(document) = ValueType(value, document.
GetAllocator()).Move();
799 template <
typename T,
typename stackAllocator>
802 return Create(document) = value;
820 ValueType&
Swap(ValueType& root, ValueType& value,
typename ValueType::AllocatorType& allocator)
const {
821 return Create(root, allocator).
Swap(value);
825 template <
typename stackAllocator>
827 return Create(document).
Swap(value);
839 bool Erase(ValueType& root)
const {
844 ValueType* v = &root;
847 switch (v->GetType()) {
851 if (m == v->MemberEnd())
857 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
859 v = &((*v)[t->index]);
866 switch (v->GetType()) {
870 if (last->
index == kPointerInvalidIndex || last->
index >= v->Size())
872 v->Erase(v->Begin() + last->
index);
887 Ch* CopyFromRaw(
const GenericPointer& rhs,
size_t extraToken = 0,
size_t extraNameBufferSize = 0) {
893 nameBufferSize += t->length;
901 if (nameBufferSize > 0) {
918 bool NeedPercentEncode(Ch c)
const {
919 return !((c >=
'0' && c <= '9') || (c >=
'A' && c <='Z') || (c >=
'a' && c <=
'z') || c ==
'-' || c ==
'.' || c ==
'_' || c ==
'~');
923 #ifndef __clang__ // -Wdocumentation 930 void Parse(
const Ch* source,
size_t length) {
941 for (
const Ch* s = source; s != source +
length; s++)
950 bool uriFragment =
false;
951 if (source[i] ==
'#') {
956 if (i != length && source[i] !=
'/') {
966 bool isNumber =
true;
968 while (i < length && source[i] !=
'/') {
973 PercentDecodeStream is(&source[i], source + length);
975 Ch* begin = os.PutBegin();
976 if (!
Transcoder<
UTF8<>, EncodingType>().Validate(is, os) || !is.IsValid()) {
980 size_t len = os.PutEnd(begin);
991 else if (NeedPercentEncode(c)) {
1003 if (c ==
'0') c =
'~';
1004 else if (c ==
'1') c =
'/';
1018 if (c < '0' || c >
'9')
1023 token->
length =
static_cast<SizeType
>(name - token->
name);
1029 if (isNumber && token->
length > 1 && token->
name[0] ==
'0')
1035 for (
size_t j = 0; j < token->
length; j++) {
1036 SizeType m = n * 10 +
static_cast<SizeType
>(token->
name[j] -
'0');
1045 token->
index = isNumber ? n : kPointerInvalidIndex;
1068 template<
bool uriFragment,
typename OutputStream>
1069 bool Stringify(OutputStream& os)
const {
1077 for (
size_t j = 0; j < t->length; j++) {
1083 else if (c ==
'/') {
1087 else if (uriFragment && NeedPercentEncode(c)) {
1093 j += source.Tell() - 1;
1108 class PercentDecodeStream {
1110 typedef typename ValueType::Ch
Ch;
1117 PercentDecodeStream(
const Ch* source,
const Ch* end) : src_(source), head_(source), end_(end), valid_(
true) {}
1120 if (*src_ !=
'%' || src_ + 3 > end_) {
1126 for (
int j = 0; j < 2; j++) {
1127 c =
static_cast<Ch
>(c << 4);
1129 if (h >=
'0' && h <=
'9') c =
static_cast<Ch
>(c + h -
'0');
1130 else if (h >=
'A' && h <=
'F') c =
static_cast<Ch
>(c + h -
'A' + 10);
1131 else if (h >=
'a' && h <=
'f') c =
static_cast<Ch
>(c + h -
'a' + 10);
1141 size_t Tell()
const {
return static_cast<size_t>(src_ - head_); }
1142 bool IsValid()
const {
return valid_; }
1152 template <
typename OutputStream>
1157 unsigned char u =
static_cast<unsigned char>(c);
1158 static const char hexDigits[16] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' };
1160 os_.Put(static_cast<typename OutputStream::Ch>(hexDigits[u >> 4]));
1161 os_.Put(static_cast<typename OutputStream::Ch>(hexDigits[u & 15]));
1184 template <
typename T>
1186 return pointer.Create(root, a);
1189 template <
typename T,
typename CharType,
size_t N>
1190 typename T::ValueType& CreateValueByPointer(T& root,
const CharType(&source)[N],
typename T::AllocatorType& a) {
1196 template <
typename DocumentType>
1198 return pointer.Create(document);
1201 template <
typename DocumentType,
typename CharType,
size_t N>
1202 typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document,
const CharType(&source)[N]) {
1208 template <
typename T>
1210 return pointer.Get(root, unresolvedTokenIndex);
1213 template <
typename T>
1215 return pointer.Get(root, unresolvedTokenIndex);
1218 template <
typename T,
typename CharType,
size_t N>
1219 typename T::ValueType* GetValueByPointer(T& root,
const CharType (&source)[N],
size_t* unresolvedTokenIndex = 0) {
1223 template <
typename T,
typename CharType,
size_t N>
1224 const typename T::ValueType* GetValueByPointer(
const T& root,
const CharType(&source)[N],
size_t* unresolvedTokenIndex = 0) {
1230 template <
typename T>
1231 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const typename T::ValueType& defaultValue,
typename T::AllocatorType& a) {
1232 return pointer.GetWithDefault(root, defaultValue, a);
1235 template <
typename T>
1236 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const typename T::Ch* defaultValue,
typename T::AllocatorType& a) {
1237 return pointer.GetWithDefault(root, defaultValue, a);
1240 #if RAPIDJSON_HAS_STDSTRING 1241 template <
typename T>
1242 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const std::basic_string<typename T::Ch>& defaultValue,
typename T::AllocatorType& a) {
1243 return pointer.GetWithDefault(root, defaultValue, a);
1247 template <
typename T,
typename T2>
1250 return pointer.GetWithDefault(root, defaultValue, a);
1253 template <
typename T,
typename CharType,
size_t N>
1254 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const CharType(&source)[N],
const typename T::ValueType& defaultValue,
typename T::AllocatorType& a) {
1258 template <
typename T,
typename CharType,
size_t N>
1259 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const CharType(&source)[N],
const typename T::Ch* defaultValue,
typename T::AllocatorType& a) {
1263 #if RAPIDJSON_HAS_STDSTRING 1264 template <
typename T,
typename CharType,
size_t N>
1265 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const CharType(&source)[N],
const std::basic_string<typename T::Ch>& defaultValue,
typename T::AllocatorType& a) {
1270 template <
typename T,
typename CharType,
size_t N,
typename T2>
1272 GetValueByPointerWithDefault(T& root,
const CharType(&source)[N], T2 defaultValue,
typename T::AllocatorType& a) {
1278 template <
typename DocumentType>
1280 return pointer.GetWithDefault(document, defaultValue);
1283 template <
typename DocumentType>
1285 return pointer.GetWithDefault(document, defaultValue);
1288 #if RAPIDJSON_HAS_STDSTRING 1289 template <
typename DocumentType>
1291 return pointer.GetWithDefault(document, defaultValue);
1295 template <
typename DocumentType,
typename T2>
1298 return pointer.GetWithDefault(document, defaultValue);
1301 template <
typename DocumentType,
typename CharType,
size_t N>
1302 typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::ValueType& defaultValue) {
1306 template <
typename DocumentType,
typename CharType,
size_t N>
1307 typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::Ch* defaultValue) {
1311 #if RAPIDJSON_HAS_STDSTRING 1312 template <
typename DocumentType,
typename CharType,
size_t N>
1313 typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N],
const std::basic_string<typename DocumentType::Ch>& defaultValue) {
1318 template <
typename DocumentType,
typename CharType,
size_t N,
typename T2>
1320 GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N], T2 defaultValue) {
1326 template <
typename T>
1328 return pointer.Set(root, value, a);
1331 template <
typename T>
1333 return pointer.Set(root, value, a);
1336 template <
typename T>
1338 return pointer.Set(root, value, a);
1341 #if RAPIDJSON_HAS_STDSTRING 1342 template <
typename T>
1343 typename T::ValueType& SetValueByPointer(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const std::basic_string<typename T::Ch>& value,
typename T::AllocatorType& a) {
1344 return pointer.Set(root, value, a);
1348 template <
typename T,
typename T2>
1351 return pointer.Set(root, value, a);
1354 template <
typename T,
typename CharType,
size_t N>
1355 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
typename T::ValueType& value,
typename T::AllocatorType& a) {
1359 template <
typename T,
typename CharType,
size_t N>
1360 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
const typename T::ValueType& value,
typename T::AllocatorType& a) {
1364 template <
typename T,
typename CharType,
size_t N>
1365 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
const typename T::Ch* value,
typename T::AllocatorType& a) {
1369 #if RAPIDJSON_HAS_STDSTRING 1370 template <
typename T,
typename CharType,
size_t N>
1371 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
const std::basic_string<typename T::Ch>& value,
typename T::AllocatorType& a) {
1376 template <
typename T,
typename CharType,
size_t N,
typename T2>
1378 SetValueByPointer(T& root,
const CharType(&source)[N], T2 value,
typename T::AllocatorType& a) {
1384 template <
typename DocumentType>
1386 return pointer.Set(document, value);
1389 template <
typename DocumentType>
1391 return pointer.Set(document, value);
1394 template <
typename DocumentType>
1396 return pointer.Set(document, value);
1399 #if RAPIDJSON_HAS_STDSTRING 1400 template <
typename DocumentType>
1402 return pointer.Set(document, value);
1406 template <
typename DocumentType,
typename T2>
1409 return pointer.Set(document, value);
1412 template <
typename DocumentType,
typename CharType,
size_t N>
1413 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
typename DocumentType::ValueType& value) {
1417 template <
typename DocumentType,
typename CharType,
size_t N>
1418 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::ValueType& value) {
1422 template <
typename DocumentType,
typename CharType,
size_t N>
1423 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::Ch* value) {
1427 #if RAPIDJSON_HAS_STDSTRING 1428 template <
typename DocumentType,
typename CharType,
size_t N>
1429 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
const std::basic_string<typename DocumentType::Ch>& value) {
1434 template <
typename DocumentType,
typename CharType,
size_t N,
typename T2>
1436 SetValueByPointer(DocumentType& document,
const CharType(&source)[N], T2 value) {
1442 template <
typename T>
1444 return pointer.
Swap(root, value, a);
1447 template <
typename T,
typename CharType,
size_t N>
1448 typename T::ValueType& SwapValueByPointer(T& root,
const CharType(&source)[N],
typename T::ValueType& value,
typename T::AllocatorType& a) {
1452 template <
typename DocumentType>
1454 return pointer.
Swap(document, value);
1457 template <
typename DocumentType,
typename CharType,
size_t N>
1458 typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document,
const CharType(&source)[N],
typename DocumentType::ValueType& value) {
1464 template <
typename T>
1466 return pointer.Erase(root);
1469 template <
typename T,
typename CharType,
size_t N>
1470 bool EraseValueByPointer(T& root,
const CharType(&source)[N]) {
1478 #if defined(__clang__) || defined(_MSC_VER) 1482 #endif // RAPIDJSON_POINTER_H_ PointerParseErrorCode
Error code of parsing.
Definition: pointer.h:38
GenericPointer(const Ch *source, Allocator *allocator=0)
Constructor that parses a string or URI fragment representation.
Definition: pointer.h:117
SizeType length
Length of the name.
Definition: pointer.h:102
A token is the basic units of internal representation.
Definition: pointer.h:100
GenericPointer(const Ch *source, size_t length, Allocator *allocator=0)
Constructor that parses a string or URI fragment representation, with length of the source string...
Definition: pointer.h:140
Token * tokens_
A list of tokens.
Definition: pointer.h:1170
Invalid percent encoding in URI fragment.
Definition: pointer.h:43
~GenericPointer()
Destructor.
Definition: pointer.h:179
size_t tokenCount_
Number of tokens in tokens_.
Definition: pointer.h:1171
GenericPointer(const GenericPointer &rhs, Allocator *allocator)
Copy constructor.
Definition: pointer.h:174
Represents a JSON value. Use Value for UTF8 encoding and default allocator.
Definition: document.h:66
GenericPointer(const Token *tokens, size_t tokenCount)
Constructor with user-supplied tokens.
Definition: pointer.h:166
GenericPointer & Swap(GenericPointer &other) RAPIDJSON_NOEXCEPT
Swap the content of this pointer with an other.
Definition: pointer.h:211
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:121
ValueType::EncodingType EncodingType
Encoding type from Value.
Definition: pointer.h:82
The parse is successful.
Definition: pointer.h:39
Allocator & GetAllocator()
Get the allocator of this document.
Definition: document.h:2782
Encoding conversion.
Definition: encodings.h:658
ValueType::Ch Ch
Character type from Value.
Definition: pointer.h:83
A contiguous memory buffer with an optional growing ability.
Definition: core.h:778
Definition: document.h:509
size_t parseErrorOffset_
Offset in code unit when parsing fail.
Definition: pointer.h:1172
Reference to a constant string (not taking a copy)
Definition: document.h:346
SizeType index
A valid array index, if it is not equal to kPointerInvalidIndex.
Definition: pointer.h:103
Read-only string stream.
Definition: fwd.h:47
A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence.
Definition: pointer.h:1153
Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator.
Definition: fwd.h:126
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:124
GenericPointer Append(const Ch *name, SizeType length, Allocator *allocator=0) const
Append a name token with length, and return a new Pointer.
Definition: pointer.h:265
Ch * nameBuffer_
A buffer containing all names in tokens.
Definition: pointer.h:1169
A character must percent encoded in URI fragment.
Definition: pointer.h:44
Allocator * ownAllocator_
Allocator owned by this Pointer.
Definition: pointer.h:1168
GenericPointer(const GenericPointer &rhs)
Copy constructor.
Definition: pointer.h:169
GenericPointer Append(const Token &token, Allocator *allocator=0) const
Append a token and return a new Pointer.
Definition: pointer.h:247
A token must begin with a '/'.
Definition: pointer.h:41
PointerParseErrorCode parseErrorCode_
Parsing error code.
Definition: pointer.h:1173
friend void swap(GenericPointer &a, GenericPointer &b) RAPIDJSON_NOEXCEPT
free-standing swap function helper
Definition: pointer.h:234
GenericPointer(Allocator *allocator=0)
Default constructor.
Definition: pointer.h:110
A read-write string stream.
Definition: fwd.h:52
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:437
Invalid escape.
Definition: pointer.h:42
RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr< internal::IsSame< typename internal::RemoveConst< T >::Type, Ch > >),(GenericPointer)) Append(T *name
Append a name token without length, and return a new Pointer.
Allocator * allocator_
The current allocator. It is either user-supplied or equal to ownAllocator_.
Definition: pointer.h:1167
const Ch * name
Name of the token. It has null character at the end but it can contain null character.
Definition: pointer.h:101
A document for parsing JSON text as DOM.
Definition: document.h:69
GenericPointer & operator=(const GenericPointer &rhs)
Assignment operator.
Definition: pointer.h:186
UTF-8 encoding.
Definition: encodings.h:96