JsonCpp project page JsonCpp home page

value.h
Go to the documentation of this file.
1 // Copyright 2007-2010 Baptiste Lepilleur
2 // Distributed under MIT license, or public domain if desired and
3 // recognized in your jurisdiction.
4 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5 
6 #ifndef CPPTL_JSON_H_INCLUDED
7 #define CPPTL_JSON_H_INCLUDED
8 
9 #if !defined(JSON_IS_AMALGAMATION)
10 #include "forwards.h"
11 #endif // if !defined(JSON_IS_AMALGAMATION)
12 #include <string>
13 #include <vector>
14 
15 #ifndef JSON_USE_CPPTL_SMALLMAP
16 #include <map>
17 #else
18 #include <cpptl/smallmap.h>
19 #endif
20 #ifdef JSON_USE_CPPTL
21 #include <cpptl/forwards.h>
22 #endif
23 
24 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
25 // be used by...
26 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
27 #pragma warning(push)
28 #pragma warning(disable : 4251)
29 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
30 
33 namespace Json {
34 
37 enum ValueType {
38  nullValue = 0,
46 };
47 
54 };
55 
56 //# ifdef JSON_USE_CPPTL
57 // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
58 // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
59 //# endif
60 
76 public:
77  explicit StaticString(const char* czstring) : str_(czstring) {}
78 
79  operator const char*() const { return str_; }
80 
81  const char* c_str() const { return str_; }
82 
83 private:
84  const char* str_;
85 };
86 
117  friend class ValueIteratorBase;
118 #ifdef JSON_VALUE_USE_INTERNAL_MAP
119  friend class ValueInternalLink;
120  friend class ValueInternalMap;
121 #endif
122 public:
123  typedef std::vector<std::string> Members;
126  typedef Json::UInt UInt;
127  typedef Json::Int Int;
128 #if defined(JSON_HAS_INT64)
131 #endif // defined(JSON_HAS_INT64)
135 
136  static const Value& null;
138  static const LargestInt minLargestInt;
140  static const LargestInt maxLargestInt;
143 
145  static const Int minInt;
147  static const Int maxInt;
149  static const UInt maxUInt;
150 
151 #if defined(JSON_HAS_INT64)
152  static const Int64 minInt64;
155  static const Int64 maxInt64;
157  static const UInt64 maxUInt64;
158 #endif // defined(JSON_HAS_INT64)
159 
160 private:
161 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
162 #ifndef JSON_VALUE_USE_INTERNAL_MAP
163  class CZString {
164  public:
165  enum DuplicationPolicy {
166  noDuplication = 0,
167  duplicate,
168  duplicateOnCopy
169  };
170  CZString(ArrayIndex index);
171  CZString(const char* cstr, DuplicationPolicy allocate);
172  CZString(const CZString& other);
173  ~CZString();
174  CZString& operator=(CZString other);
175  bool operator<(const CZString& other) const;
176  bool operator==(const CZString& other) const;
177  ArrayIndex index() const;
178  const char* c_str() const;
179  bool isStaticString() const;
180 
181  private:
182  void swap(CZString& other);
183  const char* cstr_;
184  ArrayIndex index_;
185  };
186 
187 public:
188 #ifndef JSON_USE_CPPTL_SMALLMAP
189  typedef std::map<CZString, Value> ObjectValues;
190 #else
191  typedef CppTL::SmallMap<CZString, Value> ObjectValues;
192 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
193 #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
194 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
195 
196 public:
212  Value(ValueType type = nullValue);
213  Value(Int value);
214  Value(UInt value);
215 #if defined(JSON_HAS_INT64)
216  Value(Int64 value);
217  Value(UInt64 value);
218 #endif // if defined(JSON_HAS_INT64)
219  Value(double value);
220  Value(const char* value);
221  Value(const char* beginValue, const char* endValue);
232  Value(const StaticString& value);
233  Value(const std::string& value);
234 #ifdef JSON_USE_CPPTL
235  Value(const CppTL::ConstString& value);
236 #endif
237  Value(bool value);
238  Value(const Value& other);
239  ~Value();
240 
241  Value& operator=(Value other);
245  void swap(Value& other);
246 
247  ValueType type() const;
248 
249  bool operator<(const Value& other) const;
250  bool operator<=(const Value& other) const;
251  bool operator>=(const Value& other) const;
252  bool operator>(const Value& other) const;
253 
254  bool operator==(const Value& other) const;
255  bool operator!=(const Value& other) const;
256 
257  int compare(const Value& other) const;
258 
259  const char* asCString() const;
260  std::string asString() const;
261 #ifdef JSON_USE_CPPTL
262  CppTL::ConstString asConstString() const;
263 #endif
264  Int asInt() const;
265  UInt asUInt() const;
266 #if defined(JSON_HAS_INT64)
267  Int64 asInt64() const;
268  UInt64 asUInt64() const;
269 #endif // if defined(JSON_HAS_INT64)
270  LargestInt asLargestInt() const;
271  LargestUInt asLargestUInt() const;
272  float asFloat() const;
273  double asDouble() const;
274  bool asBool() const;
275 
276  bool isNull() const;
277  bool isBool() const;
278  bool isInt() const;
279  bool isInt64() const;
280  bool isUInt() const;
281  bool isUInt64() const;
282  bool isIntegral() const;
283  bool isDouble() const;
284  bool isNumeric() const;
285  bool isString() const;
286  bool isArray() const;
287  bool isObject() const;
288 
289  bool isConvertibleTo(ValueType other) const;
290 
292  ArrayIndex size() const;
293 
296  bool empty() const;
297 
299  bool operator!() const;
300 
304  void clear();
305 
311  void resize(ArrayIndex size);
312 
319  Value& operator[](ArrayIndex index);
320 
327  Value& operator[](int index);
328 
332  const Value& operator[](ArrayIndex index) const;
333 
337  const Value& operator[](int index) const;
338 
342  Value get(ArrayIndex index, const Value& defaultValue) const;
344  bool isValidIndex(ArrayIndex index) const;
348  Value& append(const Value& value);
349 
351  Value& operator[](const char* key);
354  const Value& operator[](const char* key) const;
356  Value& operator[](const std::string& key);
359  const Value& operator[](const std::string& key) const;
372  Value& operator[](const StaticString& key);
373 #ifdef JSON_USE_CPPTL
374  Value& operator[](const CppTL::ConstString& key);
378  const Value& operator[](const CppTL::ConstString& key) const;
379 #endif
380  Value get(const char* key, const Value& defaultValue) const;
383  Value get(const std::string& key, const Value& defaultValue) const;
384 #ifdef JSON_USE_CPPTL
385  Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
387 #endif
388  Value removeMember(const char* key);
396  Value removeMember(const std::string& key);
397 
399  bool isMember(const char* key) const;
401  bool isMember(const std::string& key) const;
402 #ifdef JSON_USE_CPPTL
403  bool isMember(const CppTL::ConstString& key) const;
405 #endif
406 
412  Members getMemberNames() const;
413 
414  //# ifdef JSON_USE_CPPTL
415  // EnumMemberNames enumMemberNames() const;
416  // EnumValues enumValues() const;
417  //# endif
418 
420  void setComment(const char* comment, CommentPlacement placement);
422  void setComment(const std::string& comment, CommentPlacement placement);
423  bool hasComment(CommentPlacement placement) const;
425  std::string getComment(CommentPlacement placement) const;
426 
427  std::string toStyledString() const;
428 
429  const_iterator begin() const;
430  const_iterator end() const;
431 
432  iterator begin();
433  iterator end();
434 
435  // Accessors for the [start, limit) range of bytes within the JSON text from
436  // which this value was parsed, if any.
437  void setOffsetStart(size_t start);
438  void setOffsetLimit(size_t limit);
439  size_t getOffsetStart() const;
440  size_t getOffsetLimit() const;
441 
442 private:
443  void initBasic(ValueType type, bool allocated = false);
444 
445  Value& resolveReference(const char* key, bool isStatic);
446 
447 #ifdef JSON_VALUE_USE_INTERNAL_MAP
448  inline bool isItemAvailable() const { return itemIsUsed_ == 0; }
449 
450  inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; }
451 
452  inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; }
453 
454  inline void setMemberNameIsStatic(bool isStatic) {
455  memberNameIsStatic_ = isStatic ? 1 : 0;
456  }
457 #endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP
458 
459 private:
460  struct CommentInfo {
461  CommentInfo();
462  ~CommentInfo();
463 
464  void setComment(const char* text);
465 
466  char* comment_;
467  };
468 
469  // struct MemberNamesTransform
470  //{
471  // typedef const char *result_type;
472  // const char *operator()( const CZString &name ) const
473  // {
474  // return name.c_str();
475  // }
476  //};
477 
478  union ValueHolder {
479  LargestInt int_;
480  LargestUInt uint_;
481  double real_;
482  bool bool_;
483  char* string_;
484 #ifdef JSON_VALUE_USE_INTERNAL_MAP
485  ValueInternalArray* array_;
486  ValueInternalMap* map_;
487 #else
488  ObjectValues* map_;
489 #endif
490  } value_;
491  ValueType type_ : 8;
492  int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
493 #ifdef JSON_VALUE_USE_INTERNAL_MAP
494  unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
495  int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
496 #endif
497  CommentInfo* comments_;
498 
499  // [start, limit) byte offsets in the source JSON text from which this Value
500  // was extracted.
501  size_t start_;
502  size_t limit_;
503 };
504 
509 public:
510  friend class Path;
511 
512  PathArgument();
513  PathArgument(ArrayIndex index);
514  PathArgument(const char* key);
515  PathArgument(const std::string& key);
516 
517 private:
518  enum Kind {
519  kindNone = 0,
520  kindIndex,
521  kindKey
522  };
523  std::string key_;
524  ArrayIndex index_;
525  Kind kind_;
526 };
527 
539 class JSON_API Path {
540 public:
541  Path(const std::string& path,
542  const PathArgument& a1 = PathArgument(),
543  const PathArgument& a2 = PathArgument(),
544  const PathArgument& a3 = PathArgument(),
545  const PathArgument& a4 = PathArgument(),
546  const PathArgument& a5 = PathArgument());
547 
548  const Value& resolve(const Value& root) const;
549  Value resolve(const Value& root, const Value& defaultValue) const;
552  Value& make(Value& root) const;
553 
554 private:
555  typedef std::vector<const PathArgument*> InArgs;
556  typedef std::vector<PathArgument> Args;
557 
558  void makePath(const std::string& path, const InArgs& in);
559  void addPathInArg(const std::string& path,
560  const InArgs& in,
561  InArgs::const_iterator& itInArg,
562  PathArgument::Kind kind);
563  void invalidPath(const std::string& path, int location);
564 
565  Args args_;
566 };
567 
568 #ifdef JSON_VALUE_USE_INTERNAL_MAP
569 
615 public:
616  virtual ~ValueMapAllocator();
617  virtual ValueInternalMap* newMap() = 0;
618  virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) = 0;
619  virtual void destructMap(ValueInternalMap* map) = 0;
620  virtual ValueInternalLink* allocateMapBuckets(unsigned int size) = 0;
621  virtual void releaseMapBuckets(ValueInternalLink* links) = 0;
622  virtual ValueInternalLink* allocateMapLink() = 0;
623  virtual void releaseMapLink(ValueInternalLink* link) = 0;
624 };
625 
630 public:
631  enum {
632  itemPerLink = 6
633  }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture.
635  flagAvailable = 0,
636  flagUsed = 1
637  };
638 
640 
642 
643  Value items_[itemPerLink];
644  char* keys_[itemPerLink];
647 };
648 
667  friend class ValueIteratorBase;
668  friend class Value;
669 
670 public:
671  typedef unsigned int HashKey;
672  typedef unsigned int BucketIndex;
673 
674 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
675  struct IteratorState {
676  IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {}
677  ValueInternalMap* map_;
678  ValueInternalLink* link_;
679  BucketIndex itemIndex_;
680  BucketIndex bucketIndex_;
681  };
682 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
683 
685  ValueInternalMap(const ValueInternalMap& other);
686  ValueInternalMap& operator=(ValueInternalMap other);
687  ~ValueInternalMap();
688 
689  void swap(ValueInternalMap& other);
690 
691  BucketIndex size() const;
692 
693  void clear();
694 
695  bool reserveDelta(BucketIndex growth);
696 
697  bool reserve(BucketIndex newItemCount);
698 
699  const Value* find(const char* key) const;
700 
701  Value* find(const char* key);
702 
703  Value& resolveReference(const char* key, bool isStatic);
704 
705  void remove(const char* key);
706 
707  void doActualRemove(ValueInternalLink* link,
708  BucketIndex index,
709  BucketIndex bucketIndex);
710 
711  ValueInternalLink*& getLastLinkInBucket(BucketIndex bucketIndex);
712 
713  Value& setNewItem(const char* key,
714  bool isStatic,
715  ValueInternalLink* link,
716  BucketIndex index);
717 
718  Value& unsafeAdd(const char* key, bool isStatic, HashKey hashedKey);
719 
720  HashKey hash(const char* key) const;
721 
722  int compare(const ValueInternalMap& other) const;
723 
724 private:
725  void makeBeginIterator(IteratorState& it) const;
726  void makeEndIterator(IteratorState& it) const;
727  static bool equals(const IteratorState& x, const IteratorState& other);
728  static void increment(IteratorState& iterator);
729  static void incrementBucket(IteratorState& iterator);
730  static void decrement(IteratorState& iterator);
731  static const char* key(const IteratorState& iterator);
732  static const char* key(const IteratorState& iterator, bool& isStatic);
733  static Value& value(const IteratorState& iterator);
734  static int distance(const IteratorState& x, const IteratorState& y);
735 
736 private:
737  ValueInternalLink* buckets_;
738  ValueInternalLink* tailLink_;
739  BucketIndex bucketsSize_;
740  BucketIndex itemCount_;
741 };
742 
758  friend class Value;
759  friend class ValueIteratorBase;
760 
761 public:
762  enum {
763  itemsPerPage = 8
764  }; // should be a power of 2 for fast divide and modulo.
766  typedef unsigned int PageIndex;
767 
768 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
769  struct IteratorState // Must be a POD
770  {
771  IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {}
772  ValueInternalArray* array_;
773  Value** currentPageIndex_;
774  unsigned int currentItemIndex_;
775  };
776 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
777 
780  ValueInternalArray& operator=(ValueInternalArray other);
782  void swap(ValueInternalArray& other);
783 
784  void clear();
785  void resize(ArrayIndex newSize);
786 
787  Value& resolveReference(ArrayIndex index);
788 
789  Value* find(ArrayIndex index) const;
790 
791  ArrayIndex size() const;
792 
793  int compare(const ValueInternalArray& other) const;
794 
795 private:
796  static bool equals(const IteratorState& x, const IteratorState& other);
797  static void increment(IteratorState& iterator);
798  static void decrement(IteratorState& iterator);
799  static Value& dereference(const IteratorState& iterator);
800  static Value& unsafeDereference(const IteratorState& iterator);
801  static int distance(const IteratorState& x, const IteratorState& y);
802  static ArrayIndex indexOf(const IteratorState& iterator);
803  void makeBeginIterator(IteratorState& it) const;
804  void makeEndIterator(IteratorState& it) const;
805  void makeIterator(IteratorState& it, ArrayIndex index) const;
806 
807  void makeIndexValid(ArrayIndex index);
808 
809  Value** pages_;
810  ArrayIndex size_;
811  PageIndex pageCount_;
812 };
813 
878 public:
879  virtual ~ValueArrayAllocator();
880  virtual ValueInternalArray* newArray() = 0;
881  virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) = 0;
882  virtual void destructArray(ValueInternalArray* array) = 0;
895  virtual void
896  reallocateArrayPageIndex(Value**& indexes,
897  ValueInternalArray::PageIndex& indexCount,
898  ValueInternalArray::PageIndex minNewIndexCount) = 0;
899  virtual void
900  releaseArrayPageIndex(Value** indexes,
901  ValueInternalArray::PageIndex indexCount) = 0;
902  virtual Value* allocateArrayPage() = 0;
903  virtual void releaseArrayPage(Value* value) = 0;
904 };
905 #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
906 
911 public:
912  typedef std::bidirectional_iterator_tag iterator_category;
913  typedef unsigned int size_t;
914  typedef int difference_type;
916 
918 #ifndef JSON_VALUE_USE_INTERNAL_MAP
919  explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
920 #else
921  ValueIteratorBase(const ValueInternalArray::IteratorState& state);
922  ValueIteratorBase(const ValueInternalMap::IteratorState& state);
923 #endif
924 
925  bool operator==(const SelfType& other) const { return isEqual(other); }
926 
927  bool operator!=(const SelfType& other) const { return !isEqual(other); }
928 
929  difference_type operator-(const SelfType& other) const {
930  return computeDistance(other);
931  }
932 
935  Value key() const;
936 
938  UInt index() const;
939 
942  const char* memberName() const;
943 
944 protected:
945  Value& deref() const;
946 
947  void increment();
948 
949  void decrement();
950 
951  difference_type computeDistance(const SelfType& other) const;
952 
953  bool isEqual(const SelfType& other) const;
954 
955  void copy(const SelfType& other);
956 
957 private:
958 #ifndef JSON_VALUE_USE_INTERNAL_MAP
959  Value::ObjectValues::iterator current_;
960  // Indicates that iterator is for a null value.
961  bool isNull_;
962 #else
963  union {
964  ValueInternalArray::IteratorState array_;
965  ValueInternalMap::IteratorState map_;
966  } iterator_;
967  bool isArray_;
968 #endif
969 };
970 
975  friend class Value;
976 
977 public:
978  typedef const Value value_type;
979  typedef unsigned int size_t;
980  typedef int difference_type;
981  typedef const Value& reference;
982  typedef const Value* pointer;
984 
986 
987 private:
990 #ifndef JSON_VALUE_USE_INTERNAL_MAP
991  explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
992 #else
993  ValueConstIterator(const ValueInternalArray::IteratorState& state);
994  ValueConstIterator(const ValueInternalMap::IteratorState& state);
995 #endif
996 public:
997  SelfType& operator=(const ValueIteratorBase& other);
998 
1000  SelfType temp(*this);
1001  ++*this;
1002  return temp;
1003  }
1004 
1006  SelfType temp(*this);
1007  --*this;
1008  return temp;
1009  }
1010 
1012  decrement();
1013  return *this;
1014  }
1015 
1017  increment();
1018  return *this;
1019  }
1020 
1021  reference operator*() const { return deref(); }
1022 
1023  pointer operator->() const { return &deref(); }
1024 };
1025 
1029  friend class Value;
1030 
1031 public:
1033  typedef unsigned int size_t;
1034  typedef int difference_type;
1035  typedef Value& reference;
1036  typedef Value* pointer;
1038 
1039  ValueIterator();
1040  ValueIterator(const ValueConstIterator& other);
1041  ValueIterator(const ValueIterator& other);
1042 
1043 private:
1046 #ifndef JSON_VALUE_USE_INTERNAL_MAP
1047  explicit ValueIterator(const Value::ObjectValues::iterator& current);
1048 #else
1049  ValueIterator(const ValueInternalArray::IteratorState& state);
1050  ValueIterator(const ValueInternalMap::IteratorState& state);
1051 #endif
1052 public:
1053  SelfType& operator=(const SelfType& other);
1054 
1056  SelfType temp(*this);
1057  ++*this;
1058  return temp;
1059  }
1060 
1062  SelfType temp(*this);
1063  --*this;
1064  return temp;
1065  }
1066 
1068  decrement();
1069  return *this;
1070  }
1071 
1073  increment();
1074  return *this;
1075  }
1076 
1077  reference operator*() const { return deref(); }
1078 
1079  pointer operator->() const { return &deref(); }
1080 };
1081 
1082 } // namespace Json
1083 
1084 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1085 #pragma warning(pop)
1086 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1087 
1088 #endif // CPPTL_JSON_H_INCLUDED
Int64 LargestInt
Definition: config.h:106
Experimental: do not use.
Definition: value.h:877
pointer operator->() const
Definition: value.h:1079
#define JSON_API
If defined, indicates that the source file is amalgated to prevent private header inclusion...
Definition: config.h:62
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Definition: value.h:155
unsigned int ArrayIndex
Definition: forwards.h:23
static const Value & null
Definition: value.h:136
reference operator*() const
Definition: value.h:1021
std::vector< std::string > Members
Definition: value.h:123
unsigned int HashKey
Definition: value.h:671
base class for Value iterators.
Definition: value.h:910
array value (ordered list)
Definition: value.h:44
unsigned __int64 UInt64
Definition: config.h:101
unsigned integer value
Definition: value.h:40
unsigned int PageIndex
Definition: value.h:766
Json::ArrayIndex ArrayIndex
Definition: value.h:134
const Value value_type
Definition: value.h:978
object value (collection of name/value pairs).
Definition: value.h:45
Value::ArrayIndex ArrayIndex
Definition: value.h:765
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
Definition: value.h:147
Lightweight wrapper to tag static string.
Definition: value.h:75
ValueInternalMap::IteratorState map_
Definition: value.h:965
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Definition: value.h:149
Json::LargestUInt LargestUInt
Definition: value.h:133
bool operator!=(const SelfType &other) const
Definition: value.h:927
const iterator for object and array value.
Definition: value.h:974
unsigned int size_t
Definition: value.h:1033
Experimental and untested: represents an element of the &quot;path&quot; to access a node.
Definition: value.h:508
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
Definition: value.h:138
SelfType & operator--()
Definition: value.h:1011
&#39;null&#39; value
Definition: value.h:38
CommentPlacement
Definition: value.h:48
SelfType & operator--()
Definition: value.h:1067
StaticString(const char *czstring)
Definition: value.h:77
ValueConstIterator SelfType
Definition: value.h:983
UInt64 LargestUInt
Definition: config.h:107
ValueConstIterator const_iterator
Definition: value.h:125
Allocator to customize Value internal map.
Definition: value.h:614
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
Definition: json_reader.cpp:50
ValueIteratorBase SelfType
Definition: value.h:915
Json::Int64 Int64
Definition: value.h:130
ValueIterator SelfType
Definition: value.h:1037
Experimental and untested: represents a &quot;path&quot; to access a node.
Definition: value.h:539
SelfType operator--(int)
Definition: value.h:1005
Json::LargestInt LargestInt
Definition: value.h:132
const char * c_str() const
Definition: value.h:81
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Definition: value.h:157
double value
Definition: value.h:41
unsigned int BucketIndex
Definition: value.h:672
A simplified deque implementation used internally by Value.
Definition: value.h:757
SelfType operator--(int)
Definition: value.h:1061
Json::UInt UInt
Definition: value.h:126
SelfType & operator++()
Definition: value.h:1072
Json::UInt64 UInt64
Definition: value.h:129
Json::Int Int
Definition: value.h:127
Value * pointer
Definition: value.h:1036
Represents a JSON value.
Definition: value.h:116
std::bidirectional_iterator_tag iterator_category
Definition: value.h:912
ValueIterator iterator
Definition: value.h:124
const Value * pointer
Definition: value.h:982
difference_type operator-(const SelfType &other) const
Definition: value.h:929
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: value.h:145
reference operator*() const
Definition: value.h:1077
const Value & reference
Definition: value.h:981
a comment on the line after a value (only make sense for
Definition: value.h:51
unsigned int UInt
Definition: config.h:92
Iterator for object and array value.
Definition: value.h:1028
SelfType & operator++()
Definition: value.h:1016
A linked page based hash-table implementation used internally by Value.
Definition: value.h:666
__int64 Int64
Definition: config.h:100
SelfType operator++(int)
Definition: value.h:999
ValueType
Type of the value held by a Value object.
Definition: value.h:37
bool value
Definition: value.h:43
signed integer value
Definition: value.h:39
SelfType operator++(int)
Definition: value.h:1055
unsigned int size_t
Definition: value.h:913
int Int
Definition: config.h:91
a comment placed on the line before a value
Definition: value.h:49
UTF-8 string value.
Definition: value.h:42
ValueInternalArray::IteratorState array_
Definition: value.h:964
a comment just after a value on the same line
Definition: value.h:50
unsigned int size_t
Definition: value.h:979
bool operator==(const SelfType &other) const
Definition: value.h:925
pointer operator->() const
Definition: value.h:1023
Value & reference
Definition: value.h:1035
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: value.h:140
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: value.h:142