15 #ifndef RAPIDJSON_POINTER_H_ 16 #define RAPIDJSON_POINTER_H_ 20 #include "internal/itoa.h" 25 RAPIDJSON_DIAG_OFF(
switch-
enum)
26 #elif defined(_MSC_VER) 28 RAPIDJSON_DIAG_OFF(4512)
67 template <
typename ValueType,
typename Allocator = CrtAllocator>
71 typedef typename ValueType::Ch
Ch;
106 Parse(source, internal::StrLen(source));
109 #if RAPIDJSON_HAS_STDSTRING 117 Parse(source.c_str(), source.size());
129 Parse(source, length);
203 internal::Swap(
tokens_, other.tokens_);
238 Ch *p = r.CopyFromRaw(*
this, 1, token.
length + 1);
239 std::memcpy(p, token.
name, (token.
length + 1) *
sizeof(Ch));
255 return Append(token, allocator);
264 template <
typename T>
266 Append(T*
name, Allocator* allocator = 0)
const {
267 return Append(name, internal::StrLen(name), allocator);
270 #if RAPIDJSON_HAS_STDSTRING 278 return Append(name.c_str(),
static_cast<SizeType>(name.size()), allocator);
290 char* end =
sizeof(
SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer);
294 if (
sizeof(Ch) == 1) {
295 Token token = {
reinterpret_cast<Ch*
>(buffer), length, index };
296 return Append(token, allocator);
300 for (
size_t i = 0; i <=
length; i++)
301 name[i] = static_cast<Ch>(buffer[i]);
303 return Append(token, allocator);
314 if (token.IsString())
315 return Append(token.GetString(), token.GetStringLength(), allocator);
319 return Append(static_cast<SizeType>(token.GetUint64()), allocator);
338 Allocator& GetAllocator() {
return *
allocator_; }
347 size_t GetTokenCount()
const {
return tokenCount_; }
378 bool operator!=(
const GenericPointer& rhs)
const {
return !(*
this == rhs); }
417 template<
typename OutputStream>
418 bool Stringify(OutputStream& os)
const {
419 return Stringify<false, OutputStream>(os);
427 template<
typename OutputStream>
428 bool StringifyUriFragment(OutputStream& os)
const {
429 return Stringify<true, OutputStream>(os);
452 ValueType& Create(ValueType& root,
typename ValueType::AllocatorType& allocator,
bool* alreadyExist = 0)
const {
454 ValueType* v = &root;
457 if (v->IsArray() && t->name[0] ==
'-' && t->length == 1) {
458 v->PushBack(ValueType().Move(), allocator);
459 v = &((*v)[v->Size() - 1]);
463 if (t->index == kPointerInvalidIndex) {
468 if (!v->IsArray() && !v->IsObject())
473 if (t->index >= v->Size()) {
474 v->Reserve(t->index + 1, allocator);
475 while (t->index >= v->Size())
476 v->PushBack(ValueType().Move(), allocator);
479 v = &((*v)[t->index]);
483 if (m == v->MemberEnd()) {
484 v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator);
496 *alreadyExist = exist;
507 template <
typename stackAllocator>
509 return Create(document, document.
GetAllocator(), alreadyExist);
534 UriType GetUri(ValueType& root,
const UriType& rootUri,
size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0)
const {
535 static const Ch kIdString[] = {
'i',
'd',
'\0' };
536 static const ValueType kIdValue(kIdString, 2);
537 UriType base = UriType(rootUri, allocator);
539 ValueType* v = &root;
541 switch (v->GetType()) {
545 typename ValueType::MemberIterator m = v->FindMember(kIdValue);
546 if (m != v->MemberEnd() && (m->value).IsString()) {
547 UriType here = UriType(m->value, allocator).Resolve(base, allocator);
551 if (m == v->MemberEnd())
557 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
559 v = &((*v)[t->index]);
566 if (unresolvedTokenIndex)
567 *unresolvedTokenIndex =
static_cast<size_t>(t -
tokens_);
568 return UriType(allocator);
573 UriType GetUri(
const ValueType& root,
const UriType& rootUri,
size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0)
const {
574 return GetUri(const_cast<ValueType&>(root), rootUri, unresolvedTokenIndex, allocator);
595 ValueType* Get(ValueType& root,
size_t* unresolvedTokenIndex = 0)
const {
597 ValueType* v = &root;
599 switch (v->GetType()) {
603 if (m == v->MemberEnd())
609 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
611 v = &((*v)[t->index]);
618 if (unresolvedTokenIndex)
619 *unresolvedTokenIndex =
static_cast<size_t>(t -
tokens_);
630 const ValueType* Get(
const ValueType& root,
size_t* unresolvedTokenIndex = 0)
const {
631 return Get(const_cast<ValueType&>(root), unresolvedTokenIndex);
649 ValueType& GetWithDefault(ValueType& root,
const ValueType& defaultValue,
typename ValueType::AllocatorType& allocator)
const {
651 ValueType& v = Create(root, allocator, &alreadyExist);
652 return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
656 ValueType& GetWithDefault(ValueType& root,
const Ch* defaultValue,
typename ValueType::AllocatorType& allocator)
const {
658 ValueType& v = Create(root, allocator, &alreadyExist);
659 return alreadyExist ? v : v.SetString(defaultValue, allocator);
662 #if RAPIDJSON_HAS_STDSTRING 663 ValueType& GetWithDefault(ValueType& root,
const std::basic_string<Ch>& defaultValue,
typename ValueType::AllocatorType& allocator)
const {
666 ValueType& v = Create(root, allocator, &alreadyExist);
667 return alreadyExist ? v : v.SetString(defaultValue, allocator);
675 template <
typename T>
677 GetWithDefault(ValueType& root, T defaultValue,
typename ValueType::AllocatorType& allocator)
const {
678 return GetWithDefault(root, ValueType(defaultValue).Move(), allocator);
682 template <
typename stackAllocator>
684 return GetWithDefault(document, defaultValue, document.
GetAllocator());
688 template <
typename stackAllocator>
690 return GetWithDefault(document, defaultValue, document.
GetAllocator());
693 #if RAPIDJSON_HAS_STDSTRING 694 template <
typename stackAllocator>
697 return GetWithDefault(document, defaultValue, document.
GetAllocator());
705 template <
typename T,
typename stackAllocator>
708 return GetWithDefault(document, defaultValue, document.
GetAllocator());
726 ValueType& Set(ValueType& root, ValueType& value,
typename ValueType::AllocatorType& allocator)
const {
727 return Create(root, allocator) = value;
731 ValueType& Set(ValueType& root,
const ValueType& value,
typename ValueType::AllocatorType& allocator)
const {
732 return Create(root, allocator).CopyFrom(value, allocator);
736 ValueType& Set(ValueType& root,
const Ch* value,
typename ValueType::AllocatorType& allocator)
const {
737 return Create(root, allocator) = ValueType(value, allocator).Move();
740 #if RAPIDJSON_HAS_STDSTRING 741 ValueType& Set(ValueType& root,
const std::basic_string<Ch>& value,
typename ValueType::AllocatorType& allocator)
const {
743 return Create(root, allocator) = ValueType(value, allocator).Move();
751 template <
typename T>
753 Set(ValueType& root, T value,
typename ValueType::AllocatorType& allocator)
const {
754 return Create(root, allocator) = ValueType(value).Move();
758 template <
typename stackAllocator>
760 return Create(document) = value;
764 template <
typename stackAllocator>
766 return Create(document).CopyFrom(value, document.
GetAllocator());
770 template <
typename stackAllocator>
772 return Create(document) = ValueType(value, document.
GetAllocator()).Move();
775 #if RAPIDJSON_HAS_STDSTRING 776 template <
typename stackAllocator>
779 return Create(document) = ValueType(value, document.
GetAllocator()).Move();
787 template <
typename T,
typename stackAllocator>
790 return Create(document) = value;
808 ValueType&
Swap(ValueType& root, ValueType& value,
typename ValueType::AllocatorType& allocator)
const {
809 return Create(root, allocator).
Swap(value);
813 template <
typename stackAllocator>
815 return Create(document).
Swap(value);
827 bool Erase(ValueType& root)
const {
832 ValueType* v = &root;
835 switch (v->GetType()) {
839 if (m == v->MemberEnd())
845 if (t->index == kPointerInvalidIndex || t->index >= v->Size())
847 v = &((*v)[t->index]);
854 switch (v->GetType()) {
858 if (last->
index == kPointerInvalidIndex || last->
index >= v->Size())
860 v->Erase(v->Begin() + last->
index);
875 Ch* CopyFromRaw(
const GenericPointer& rhs,
size_t extraToken = 0,
size_t extraNameBufferSize = 0) {
881 nameBufferSize += t->length;
889 if (nameBufferSize > 0) {
912 bool NeedPercentEncode(Ch c)
const {
913 return !((c >=
'0' && c <= '9') || (c >=
'A' && c <='Z') || (c >=
'a' && c <=
'z') || c ==
'-' || c ==
'.' || c ==
'_' || c ==
'~');
917 #ifndef __clang__ // -Wdocumentation 924 void Parse(
const Ch* source,
size_t length) {
935 for (
const Ch* s = source; s != source +
length; s++)
944 bool uriFragment =
false;
945 if (source[i] ==
'#') {
950 if (i != length && source[i] !=
'/') {
960 bool isNumber =
true;
962 while (i < length && source[i] !=
'/') {
967 PercentDecodeStream is(&source[i], source + length);
969 Ch* begin = os.PutBegin();
970 if (!
Transcoder<
UTF8<>, EncodingType>().Validate(is, os) || !is.IsValid()) {
974 size_t len = os.PutEnd(begin);
985 else if (NeedPercentEncode(c)) {
997 if (c ==
'0') c =
'~';
998 else if (c ==
'1') c =
'/';
1012 if (c < '0' || c >
'9')
1023 if (isNumber && token->
length > 1 && token->
name[0] ==
'0')
1029 for (
size_t j = 0; j < token->
length; j++) {
1039 token->
index = isNumber ? n : kPointerInvalidIndex;
1062 template<
bool uriFragment,
typename OutputStream>
1063 bool Stringify(OutputStream& os)
const {
1071 for (
size_t j = 0; j < t->length; j++) {
1077 else if (c ==
'/') {
1081 else if (uriFragment && NeedPercentEncode(c)) {
1087 j += source.Tell() - 1;
1102 class PercentDecodeStream {
1104 typedef typename ValueType::Ch
Ch;
1111 PercentDecodeStream(
const Ch* source,
const Ch* end) : src_(source), head_(source), end_(end), valid_(
true) {}
1114 if (*src_ !=
'%' || src_ + 3 > end_) {
1120 for (
int j = 0; j < 2; j++) {
1121 c =
static_cast<Ch
>(c << 4);
1123 if (h >=
'0' && h <=
'9') c =
static_cast<Ch
>(c + h -
'0');
1124 else if (h >=
'A' && h <=
'F') c =
static_cast<Ch
>(c + h -
'A' + 10);
1125 else if (h >=
'a' && h <=
'f') c =
static_cast<Ch
>(c + h -
'a' + 10);
1135 size_t Tell()
const {
return static_cast<size_t>(src_ - head_); }
1136 bool IsValid()
const {
return valid_; }
1146 template <
typename OutputStream>
1151 unsigned char u =
static_cast<unsigned char>(c);
1152 static const char hexDigits[16] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' };
1154 os_.Put(static_cast<typename OutputStream::Ch>(hexDigits[u >> 4]));
1155 os_.Put(static_cast<typename OutputStream::Ch>(hexDigits[u & 15]));
1178 template <
typename T>
1180 return pointer.Create(root, a);
1183 template <
typename T,
typename CharType,
size_t N>
1184 typename T::ValueType& CreateValueByPointer(T& root,
const CharType(&source)[N],
typename T::AllocatorType& a) {
1190 template <
typename DocumentType>
1192 return pointer.Create(document);
1195 template <
typename DocumentType,
typename CharType,
size_t N>
1196 typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document,
const CharType(&source)[N]) {
1202 template <
typename T>
1204 return pointer.Get(root, unresolvedTokenIndex);
1207 template <
typename T>
1209 return pointer.Get(root, unresolvedTokenIndex);
1212 template <
typename T,
typename CharType,
size_t N>
1213 typename T::ValueType* GetValueByPointer(T& root,
const CharType (&source)[N],
size_t* unresolvedTokenIndex = 0) {
1217 template <
typename T,
typename CharType,
size_t N>
1218 const typename T::ValueType* GetValueByPointer(
const T& root,
const CharType(&source)[N],
size_t* unresolvedTokenIndex = 0) {
1224 template <
typename T>
1225 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const typename T::ValueType& defaultValue,
typename T::AllocatorType& a) {
1226 return pointer.GetWithDefault(root, defaultValue, a);
1229 template <
typename T>
1230 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const typename T::Ch* defaultValue,
typename T::AllocatorType& a) {
1231 return pointer.GetWithDefault(root, defaultValue, a);
1234 #if RAPIDJSON_HAS_STDSTRING 1235 template <
typename T>
1236 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const std::basic_string<typename T::Ch>& defaultValue,
typename T::AllocatorType& a) {
1237 return pointer.GetWithDefault(root, defaultValue, a);
1241 template <
typename T,
typename T2>
1244 return pointer.GetWithDefault(root, defaultValue, a);
1247 template <
typename T,
typename CharType,
size_t N>
1248 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const CharType(&source)[N],
const typename T::ValueType& defaultValue,
typename T::AllocatorType& a) {
1252 template <
typename T,
typename CharType,
size_t N>
1253 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const CharType(&source)[N],
const typename T::Ch* defaultValue,
typename T::AllocatorType& a) {
1257 #if RAPIDJSON_HAS_STDSTRING 1258 template <
typename T,
typename CharType,
size_t N>
1259 typename T::ValueType& GetValueByPointerWithDefault(T& root,
const CharType(&source)[N],
const std::basic_string<typename T::Ch>& defaultValue,
typename T::AllocatorType& a) {
1264 template <
typename T,
typename CharType,
size_t N,
typename T2>
1266 GetValueByPointerWithDefault(T& root,
const CharType(&source)[N], T2 defaultValue,
typename T::AllocatorType& a) {
1272 template <
typename DocumentType>
1274 return pointer.GetWithDefault(document, defaultValue);
1277 template <
typename DocumentType>
1279 return pointer.GetWithDefault(document, defaultValue);
1282 #if RAPIDJSON_HAS_STDSTRING 1283 template <
typename DocumentType>
1285 return pointer.GetWithDefault(document, defaultValue);
1289 template <
typename DocumentType,
typename T2>
1292 return pointer.GetWithDefault(document, defaultValue);
1295 template <
typename DocumentType,
typename CharType,
size_t N>
1296 typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::ValueType& defaultValue) {
1300 template <
typename DocumentType,
typename CharType,
size_t N>
1301 typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::Ch* defaultValue) {
1305 #if RAPIDJSON_HAS_STDSTRING 1306 template <
typename DocumentType,
typename CharType,
size_t N>
1307 typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N],
const std::basic_string<typename DocumentType::Ch>& defaultValue) {
1312 template <
typename DocumentType,
typename CharType,
size_t N,
typename T2>
1314 GetValueByPointerWithDefault(DocumentType& document,
const CharType(&source)[N], T2 defaultValue) {
1320 template <
typename T>
1322 return pointer.Set(root, value, a);
1325 template <
typename T>
1327 return pointer.Set(root, value, a);
1330 template <
typename T>
1332 return pointer.Set(root, value, a);
1335 #if RAPIDJSON_HAS_STDSTRING 1336 template <
typename T>
1337 typename T::ValueType& SetValueByPointer(T& root,
const GenericPointer<typename T::ValueType>& pointer,
const std::basic_string<typename T::Ch>& value,
typename T::AllocatorType& a) {
1338 return pointer.Set(root, value, a);
1342 template <
typename T,
typename T2>
1345 return pointer.Set(root, value, a);
1348 template <
typename T,
typename CharType,
size_t N>
1349 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
typename T::ValueType& value,
typename T::AllocatorType& a) {
1353 template <
typename T,
typename CharType,
size_t N>
1354 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
const typename T::ValueType& value,
typename T::AllocatorType& a) {
1358 template <
typename T,
typename CharType,
size_t N>
1359 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
const typename T::Ch* value,
typename T::AllocatorType& a) {
1363 #if RAPIDJSON_HAS_STDSTRING 1364 template <
typename T,
typename CharType,
size_t N>
1365 typename T::ValueType& SetValueByPointer(T& root,
const CharType(&source)[N],
const std::basic_string<typename T::Ch>& value,
typename T::AllocatorType& a) {
1370 template <
typename T,
typename CharType,
size_t N,
typename T2>
1372 SetValueByPointer(T& root,
const CharType(&source)[N], T2 value,
typename T::AllocatorType& a) {
1378 template <
typename DocumentType>
1380 return pointer.Set(document, value);
1383 template <
typename DocumentType>
1385 return pointer.Set(document, value);
1388 template <
typename DocumentType>
1390 return pointer.Set(document, value);
1393 #if RAPIDJSON_HAS_STDSTRING 1394 template <
typename DocumentType>
1396 return pointer.Set(document, value);
1400 template <
typename DocumentType,
typename T2>
1403 return pointer.Set(document, value);
1406 template <
typename DocumentType,
typename CharType,
size_t N>
1407 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
typename DocumentType::ValueType& value) {
1411 template <
typename DocumentType,
typename CharType,
size_t N>
1412 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::ValueType& value) {
1416 template <
typename DocumentType,
typename CharType,
size_t N>
1417 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
const typename DocumentType::Ch* value) {
1421 #if RAPIDJSON_HAS_STDSTRING 1422 template <
typename DocumentType,
typename CharType,
size_t N>
1423 typename DocumentType::ValueType& SetValueByPointer(DocumentType& document,
const CharType(&source)[N],
const std::basic_string<typename DocumentType::Ch>& value) {
1428 template <
typename DocumentType,
typename CharType,
size_t N,
typename T2>
1430 SetValueByPointer(DocumentType& document,
const CharType(&source)[N], T2 value) {
1436 template <
typename T>
1438 return pointer.
Swap(root, value, a);
1441 template <
typename T,
typename CharType,
size_t N>
1442 typename T::ValueType& SwapValueByPointer(T& root,
const CharType(&source)[N],
typename T::ValueType& value,
typename T::AllocatorType& a) {
1446 template <
typename DocumentType>
1448 return pointer.
Swap(document, value);
1451 template <
typename DocumentType,
typename CharType,
size_t N>
1452 typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document,
const CharType(&source)[N],
typename DocumentType::ValueType& value) {
1458 template <
typename T>
1460 return pointer.Erase(root);
1463 template <
typename T,
typename CharType,
size_t N>
1464 bool EraseValueByPointer(T& root,
const CharType(&source)[N]) {
1472 #if defined(__clang__) || defined(_MSC_VER) 1476 #endif // RAPIDJSON_POINTER_H_ GenericPointer(const Token *tokens, size_t tokenCount)
Constructor with user-supplied tokens.
Definition: pointer.h:154
Invalid escape.
Definition: error.h:261
Encoding conversion.
Definition: encodings.h:658
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:415
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:437
object
Definition: rapidjson.h:733
Read-only string stream.
Definition: fwd.h:47
Ch * nameBuffer_
A buffer containing all names in tokens.
Definition: pointer.h:1163
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:124
array
Definition: rapidjson.h:734
ValueType::EncodingType EncodingType
Encoding type from Value.
Definition: pointer.h:70
Invalid percent encoding in URI fragment.
Definition: error.h:262
GenericPointer Append(const Token &token, Allocator *allocator=0) const
Append a token and return a new Pointer.
Definition: pointer.h:235
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:128
PointerParseErrorCode parseErrorCode_
Parsing error code.
Definition: pointer.h:1167
Represents a JSON value. Use Value for UTF8 encoding and default allocator.
Definition: document.h:66
GenericPointer(const GenericPointer &rhs)
Copy constructor.
Definition: pointer.h:157
Token * tokens_
A list of tokens.
Definition: pointer.h:1164
SizeType index
A valid array index, if it is not equal to kPointerInvalidIndex.
Definition: pointer.h:91
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:121
A token is the basic units of internal representation.
Definition: pointer.h:88
A document for parsing JSON text as DOM.
Definition: document.h:69
A token must begin with a '/'.
Definition: error.h:260
A read-write string stream.
Definition: fwd.h:52
SizeType length
Length of the name.
Definition: pointer.h:90
GenericPointer(const Ch *source, Allocator *allocator=0)
Constructor that parses a string or URI fragment representation.
Definition: pointer.h:105
size_t parseErrorOffset_
Offset in code unit when parsing fail.
Definition: pointer.h:1166
UTF-8 encoding.
Definition: encodings.h:96
#define RAPIDJSON_NEW(TypeName)
! customization point for global new
Definition: rapidjson.h:712
friend void swap(GenericPointer &a, GenericPointer &b) RAPIDJSON_NOEXCEPT
free-standing swap function helper
Definition: pointer.h:222
Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator.
Definition: fwd.h:126
GenericPointer & operator=(const GenericPointer &rhs)
Assignment operator.
Definition: pointer.h:174
A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence.
Definition: pointer.h:1147
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:253
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 & GetAllocator()
Get the allocator of this document.
Definition: document.h:2795
size_t tokenCount_
Number of tokens in tokens_.
Definition: pointer.h:1165
#define RAPIDJSON_DELETE(x)
! customization point for global delete
Definition: rapidjson.h:716
GenericPointer(const GenericPointer &rhs, Allocator *allocator)
Copy constructor.
Definition: pointer.h:162
ValueType::Ch Ch
Character type from Value.
Definition: pointer.h:71
const Ch * name
Name of the token. It has null character at the end but it can contain null character.
Definition: pointer.h:89
PointerParseErrorCode
Error code of JSON pointer parsing.
Definition: error.h:257
GenericPointer & Swap(GenericPointer &other) RAPIDJSON_NOEXCEPT
Swap the content of this pointer with an other.
Definition: pointer.h:199
Reference to a constant string (not taking a copy)
Definition: document.h:346
Definition: document.h:509
The parse is successful.
Definition: error.h:258
Allocator * allocator_
The current allocator. It is either user-supplied or equal to ownAllocator_.
Definition: pointer.h:1161
Type
Type of JSON value.
Definition: rapidjson.h:729
A character must percent encoded in URI fragment.
Definition: error.h:263
Allocator * ownAllocator_
Allocator owned by this Pointer.
Definition: pointer.h:1162
GenericPointer(Allocator *allocator=0)
Default constructor.
Definition: pointer.h:98
~GenericPointer()
Destructor.
Definition: pointer.h:167