JsonCpp - JSON data format manipulation library

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 #include <exception>
15
16 #ifndef JSON_USE_CPPTL_SMALLMAP
17 #include <map>
18 #else
19 #include <cpptl/smallmap.h>
20 #endif
21 #ifdef JSON_USE_CPPTL
22 #include <cpptl/forwards.h>
23 #endif
24
25 //Conditional NORETURN attribute on the throw functions would:
26 // a) suppress false positives from static code analysis
27 // b) possibly improve optimization opportunities.
28 #if !defined(JSONCPP_NORETURN)
29 # if defined(_MSC_VER)
30 # define JSONCPP_NORETURN __declspec(noreturn)
31 # elif defined(__GNUC__)
32 # define JSONCPP_NORETURN __attribute__ ((__noreturn__))
33 # else
34 # define JSONCPP_NORETURN
35 # endif
36 #endif
37
38 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
39 // be used by...
40 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
41 #pragma warning(push)
42 #pragma warning(disable : 4251)
43 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
44
45 #pragma pack(push, 8)
46
49 namespace Json {
50
55 class JSON_API Exception : public std::exception {
56 public:
57 Exception(JSONCPP_STRING const& msg);
58 ~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
59 char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
60 protected:
61 JSONCPP_STRING msg_;
62 };
63
70 class JSON_API RuntimeError : public Exception {
71 public:
72 RuntimeError(JSONCPP_STRING const& msg);
73 };
74
81 class JSON_API LogicError : public Exception {
82 public:
83 LogicError(JSONCPP_STRING const& msg);
84 };
85
87 JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg);
89 JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg);
90
93 enum ValueType {
94 nullValue = 0,
95 intValue,
96 uintValue,
97 realValue,
98 stringValue,
99 booleanValue,
100 arrayValue,
101 objectValue
102 };
103
104 enum CommentPlacement {
105 commentBefore = 0,
106 commentAfterOnSameLine,
107 commentAfter,
108 numberOfCommentPlacement
110 };
111
112 //# ifdef JSON_USE_CPPTL
113 // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
114 // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
115 //# endif
116
131 class JSON_API StaticString {
132 public:
133 explicit StaticString(const char* czstring) : c_str_(czstring) {}
134
135 operator const char*() const { return c_str_; }
136
137 const char* c_str() const { return c_str_; }
138
139 private:
140 const char* c_str_;
141 };
142
177 class JSON_API Value {
178 friend class ValueIteratorBase;
179 public:
180 typedef std::vector<JSONCPP_STRING> Members;
181 typedef ValueIterator iterator;
182 typedef ValueConstIterator const_iterator;
183 typedef Json::UInt UInt;
184 typedef Json::Int Int;
185 #if defined(JSON_HAS_INT64)
186 typedef Json::UInt64 UInt64;
187 typedef Json::Int64 Int64;
188 #endif // defined(JSON_HAS_INT64)
189 typedef Json::LargestInt LargestInt;
190 typedef Json::LargestUInt LargestUInt;
191 typedef Json::ArrayIndex ArrayIndex;
192
193 static const Value& null;
194 static const Value& nullRef;
195 static Value const& nullSingleton();
196
198 static const LargestInt minLargestInt;
200 static const LargestInt maxLargestInt;
202 static const LargestUInt maxLargestUInt;
203
205 static const Int minInt;
207 static const Int maxInt;
209 static const UInt maxUInt;
210
211 #if defined(JSON_HAS_INT64)
212 static const Int64 minInt64;
215 static const Int64 maxInt64;
217 static const UInt64 maxUInt64;
218 #endif // defined(JSON_HAS_INT64)
219
220 private:
221 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
222 class CZString {
223 public:
224 enum DuplicationPolicy {
225 noDuplication = 0,
226 duplicate,
227 duplicateOnCopy
228 };
229 CZString(ArrayIndex index);
230 CZString(char const* str, unsigned length, DuplicationPolicy allocate);
231 CZString(CZString const& other);
232 #if JSON_HAS_RVALUE_REFERENCES
233 CZString(CZString&& other);
234 #endif
235 ~CZString();
236 CZString& operator=(CZString other);
237 bool operator<(CZString const& other) const;
238 bool operator==(CZString const& other) const;
239 ArrayIndex index() const;
240 //const char* c_str() const; ///< \deprecated
241 char const* data() const;
242 unsigned length() const;
243 bool isStaticString() const;
244
245 private:
246 void swap(CZString& other);
247
248 struct StringStorage {
249 unsigned policy_: 2;
250 unsigned length_: 30; // 1GB max
251 };
252
253 char const* cstr_; // actually, a prefixed string, unless policy is noDup
254 union {
255 ArrayIndex index_;
256 StringStorage storage_;
257 };
258 };
259
260 public:
261 #ifndef JSON_USE_CPPTL_SMALLMAP
262 typedef std::map<CZString, Value> ObjectValues;
263 #else
264 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
265 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
266 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
267
268 public:
284 Value(ValueType type = nullValue);
285 Value(Int value);
286 Value(UInt value);
287 #if defined(JSON_HAS_INT64)
288 Value(Int64 value);
289 Value(UInt64 value);
290 #endif // if defined(JSON_HAS_INT64)
291 Value(double value);
292 Value(const char* value);
293 Value(const char* begin, const char* end);
294
309 Value(const StaticString& value);
310 Value(const JSONCPP_STRING& value);
311 #ifdef JSON_USE_CPPTL
312 Value(const CppTL::ConstString& value);
313 #endif
314 Value(bool value);
316 Value(const Value& other);
317 #if JSON_HAS_RVALUE_REFERENCES
318 Value(Value&& other);
320 #endif
321 ~Value();
322
325 Value& operator=(Value other);
327 void swap(Value& other);
329 void swapPayload(Value& other);
330
331 ValueType type() const;
332
334 bool operator<(const Value& other) const;
335 bool operator<=(const Value& other) const;
336 bool operator>=(const Value& other) const;
337 bool operator>(const Value& other) const;
338 bool operator==(const Value& other) const;
339 bool operator!=(const Value& other) const;
340 int compare(const Value& other) const;
341
342 const char* asCString() const;
343 #if JSONCPP_USING_SECURE_MEMORY
344 unsigned getCStringLength() const; //Allows you to understand the length of the CString
345 #endif
346 JSONCPP_STRING asString() const;
347
350 bool getString(
351 char const** begin, char const** end) const;
352 #ifdef JSON_USE_CPPTL
353 CppTL::ConstString asConstString() const;
354 #endif
355 Int asInt() const;
356 UInt asUInt() const;
357 #if defined(JSON_HAS_INT64)
358 Int64 asInt64() const;
359 UInt64 asUInt64() const;
360 #endif // if defined(JSON_HAS_INT64)
361 LargestInt asLargestInt() const;
362 LargestUInt asLargestUInt() const;
363 float asFloat() const;
364 double asDouble() const;
365 bool asBool() const;
366
367 bool isNull() const;
368 bool isBool() const;
369 bool isInt() const;
370 bool isInt64() const;
371 bool isUInt() const;
372 bool isUInt64() const;
373 bool isIntegral() const;
374 bool isDouble() const;
375 bool isNumeric() const;
376 bool isString() const;
377 bool isArray() const;
378 bool isObject() const;
379
380 bool isConvertibleTo(ValueType other) const;
381
383 ArrayIndex size() const;
384
387 bool empty() const;
388
390 bool operator!() const;
391
395 void clear();
396
402 void resize(ArrayIndex size);
403
410 Value& operator[](ArrayIndex index);
411
418 Value& operator[](int index);
419
423 const Value& operator[](ArrayIndex index) const;
424
428 const Value& operator[](int index) const;
429
433 Value get(ArrayIndex index, const Value& defaultValue) const;
435 bool isValidIndex(ArrayIndex index) const;
439 Value& append(const Value& value);
440
444 Value& operator[](const char* key);
447 const Value& operator[](const char* key) const;
450 Value& operator[](const JSONCPP_STRING& key);
454 const Value& operator[](const JSONCPP_STRING& key) const;
467 Value& operator[](const StaticString& key);
468 #ifdef JSON_USE_CPPTL
469 Value& operator[](const CppTL::ConstString& key);
473 const Value& operator[](const CppTL::ConstString& key) const;
474 #endif
475 Value get(const char* key, const Value& defaultValue) const;
481 Value get(const char* begin, const char* end, const Value& defaultValue) const;
485 Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
486 #ifdef JSON_USE_CPPTL
487 Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
490 #endif
491 Value const* find(char const* begin, char const* end) const;
498 Value const* demand(char const* begin, char const* end);
506 Value removeMember(const char* key);
510 Value removeMember(const JSONCPP_STRING& key);
513 bool removeMember(const char* key, Value* removed);
520 bool removeMember(JSONCPP_STRING const& key, Value* removed);
522 bool removeMember(const char* begin, const char* end, Value* removed);
529 bool removeIndex(ArrayIndex i, Value* removed);
530
533 bool isMember(const char* key) const;
536 bool isMember(const JSONCPP_STRING& key) const;
538 bool isMember(const char* begin, const char* end) const;
539 #ifdef JSON_USE_CPPTL
540 bool isMember(const CppTL::ConstString& key) const;
542 #endif
543
549 Members getMemberNames() const;
550
551 //# ifdef JSON_USE_CPPTL
552 // EnumMemberNames enumMemberNames() const;
553 // EnumValues enumValues() const;
554 //# endif
555
557 JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
558 void setComment(const char* comment, CommentPlacement placement);
560 void setComment(const char* comment, size_t len, CommentPlacement placement);
562 void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
563 bool hasComment(CommentPlacement placement) const;
565 JSONCPP_STRING getComment(CommentPlacement placement) const;
566
567 JSONCPP_STRING toStyledString() const;
568
569 const_iterator begin() const;
570 const_iterator end() const;
571
572 iterator begin();
573 iterator end();
574
575 // Accessors for the [start, limit) range of bytes within the JSON text from
576 // which this value was parsed, if any.
577 void setOffsetStart(ptrdiff_t start);
578 void setOffsetLimit(ptrdiff_t limit);
579 ptrdiff_t getOffsetStart() const;
580 ptrdiff_t getOffsetLimit() const;
581
582 private:
583 void initBasic(ValueType type, bool allocated = false);
584
585 Value& resolveReference(const char* key);
586 Value& resolveReference(const char* key, const char* end);
587
588 struct CommentInfo {
589 CommentInfo();
590 ~CommentInfo();
591
592 void setComment(const char* text, size_t len);
593
594 char* comment_;
595 };
596
597 // struct MemberNamesTransform
598 //{
599 // typedef const char *result_type;
600 // const char *operator()( const CZString &name ) const
601 // {
602 // return name.c_str();
603 // }
604 //};
605
606 union ValueHolder {
607 LargestInt int_;
608 LargestUInt uint_;
609 double real_;
610 bool bool_;
611 char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
612 ObjectValues* map_;
613 } value_;
614 ValueType type_ : 8;
615 unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
616 // If not allocated_, string_ must be null-terminated.
617 CommentInfo* comments_;
618
619 // [start, limit) byte offsets in the source JSON text from which this Value
620 // was extracted.
621 ptrdiff_t start_;
622 ptrdiff_t limit_;
623 };
624
628 class JSON_API PathArgument {
629 public:
630 friend class Path;
631
632 PathArgument();
633 PathArgument(ArrayIndex index);
634 PathArgument(const char* key);
635 PathArgument(const JSONCPP_STRING& key);
636
637 private:
638 enum Kind {
639 kindNone = 0,
640 kindIndex,
641 kindKey
642 };
643 JSONCPP_STRING key_;
644 ArrayIndex index_;
645 Kind kind_;
646 };
647
659 class JSON_API Path {
660 public:
661 Path(const JSONCPP_STRING& path,
662 const PathArgument& a1 = PathArgument(),
663 const PathArgument& a2 = PathArgument(),
664 const PathArgument& a3 = PathArgument(),
665 const PathArgument& a4 = PathArgument(),
666 const PathArgument& a5 = PathArgument());
667
668 const Value& resolve(const Value& root) const;
669 Value resolve(const Value& root, const Value& defaultValue) const;
672 Value& make(Value& root) const;
673
674 private:
675 typedef std::vector<const PathArgument*> InArgs;
676 typedef std::vector<PathArgument> Args;
677
678 void makePath(const JSONCPP_STRING& path, const InArgs& in);
679 void addPathInArg(const JSONCPP_STRING& path,
680 const InArgs& in,
681 InArgs::const_iterator& itInArg,
682 PathArgument::Kind kind);
683 void invalidPath(const JSONCPP_STRING& path, int location);
684
685 Args args_;
686 };
687
691 class JSON_API ValueIteratorBase {
692 public:
693 typedef std::bidirectional_iterator_tag iterator_category;
694 typedef unsigned int size_t;
695 typedef int difference_type;
696 typedef ValueIteratorBase SelfType;
697
698 bool operator==(const SelfType& other) const { return isEqual(other); }
699
700 bool operator!=(const SelfType& other) const { return !isEqual(other); }
701
702 difference_type operator-(const SelfType& other) const {
703 return other.computeDistance(*this);
704 }
705
708 Value key() const;
709
711 UInt index() const;
712
716 JSONCPP_STRING name() const;
717
721 JSONCPP_DEPRECATED("Use `key = name();` instead.")
722 char const* memberName() const;
726 char const* memberName(char const** end) const;
727
728 protected:
729 Value& deref() const;
730
731 void increment();
732
733 void decrement();
734
735 difference_type computeDistance(const SelfType& other) const;
736
737 bool isEqual(const SelfType& other) const;
738
739 void copy(const SelfType& other);
740
741 private:
742 Value::ObjectValues::iterator current_;
743 // Indicates that iterator is for a null value.
744 bool isNull_;
745
746 public:
747 // For some reason, BORLAND needs these at the end, rather
748 // than earlier. No idea why.
749 ValueIteratorBase();
750 explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
751 };
752
756 class JSON_API ValueConstIterator : public ValueIteratorBase {
757 friend class Value;
758
759 public:
760 typedef const Value value_type;
761 //typedef unsigned int size_t;
762 //typedef int difference_type;
763 typedef const Value& reference;
764 typedef const Value* pointer;
765 typedef ValueConstIterator SelfType;
766
767 ValueConstIterator();
768 ValueConstIterator(ValueIterator const& other);
769
770 private:
773 explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
774 public:
775 SelfType& operator=(const ValueIteratorBase& other);
776
777 SelfType operator++(int) {
778 SelfType temp(*this);
779 ++*this;
780 return temp;
781 }
782
783 SelfType operator--(int) {
784 SelfType temp(*this);
785 --*this;
786 return temp;
787 }
788
789 SelfType& operator--() {
790 decrement();
791 return *this;
792 }
793
794 SelfType& operator++() {
795 increment();
796 return *this;
797 }
798
799 reference operator*() const { return deref(); }
800
801 pointer operator->() const { return &deref(); }
802 };
803
806 class JSON_API ValueIterator : public ValueIteratorBase {
807 friend class Value;
808
809 public:
810 typedef Value value_type;
811 typedef unsigned int size_t;
812 typedef int difference_type;
813 typedef Value& reference;
814 typedef Value* pointer;
815 typedef ValueIterator SelfType;
816
817 ValueIterator();
818 explicit ValueIterator(const ValueConstIterator& other);
819 ValueIterator(const ValueIterator& other);
820
821 private:
824 explicit ValueIterator(const Value::ObjectValues::iterator& current);
825 public:
826 SelfType& operator=(const SelfType& other);
827
828 SelfType operator++(int) {
829 SelfType temp(*this);
830 ++*this;
831 return temp;
832 }
833
834 SelfType operator--(int) {
835 SelfType temp(*this);
836 --*this;
837 return temp;
838 }
839
840 SelfType& operator--() {
841 decrement();
842 return *this;
843 }
844
845 SelfType& operator++() {
846 increment();
847 return *this;
848 }
849
850 reference operator*() const { return deref(); }
851
852 pointer operator->() const { return &deref(); }
853 };
854
855 } // namespace Json
856
857
858 namespace std {
860 template<>
861 inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
862 }
863
864 #pragma pack(pop)
865
866 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
867 #pragma warning(pop)
868 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
869
870 #endif // CPPTL_JSON_H_INCLUDED
JSONCPP_OVERRIDE
#define JSONCPP_OVERRIDE
Definition: config.h:94
JSONCPP_DEPRECATED
#define JSONCPP_DEPRECATED(message)
Definition: config.h:132
Json::LargestInt
Int64 LargestInt
Definition: config.h:165
Json::ValueIteratorBase::computeDistance
difference_type computeDistance(const SelfType &other) const
Definition: json_valueiterator.inl:39
JSON_API
#define JSON_API
If defined, indicates that the source file is amalgated to prevent private header inclusion...
Definition: config.h:54
Json::Value::maxInt64
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Definition: value.h:215
Json::ArrayIndex
unsigned int ArrayIndex
Definition: forwards.h:23
Json::ValueIteratorBase::operator!=
bool operator!=(const SelfType &other) const
Definition: value.h:700
Json::ValueIteratorBase
base class for Value iterators.
Definition: value.h:691
Json::arrayValue
array value (ordered list)
Definition: value.h:100
Json::ValueIteratorBase::difference_type
int difference_type
Definition: value.h:695
Json::UInt64
unsigned __int64 UInt64
Definition: config.h:160
Json::ValueConstIterator::operator*
reference operator*() const
Definition: value.h:799
Json::uintValue
unsigned integer value
Definition: value.h:96
JSONCPP_STRING
#define JSONCPP_STRING
Definition: config.h:176
Json::ValueIteratorBase::operator==
bool operator==(const SelfType &other) const
Definition: value.h:698
Json::numberOfCommentPlacement
root value)
Definition: value.h:109
Json::Value::ArrayIndex
Json::ArrayIndex ArrayIndex
Definition: value.h:191
Json::LogicError
Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
Definition: value.h:81
Json::ValueConstIterator::value_type
const Value value_type
Definition: value.h:760
Json::objectValue
object value (collection of name/value pairs).
Definition: value.h:101
forwards.h
Json::Value::maxInt
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
Definition: value.h:207
std
STL namespace.
Json::Value::null
static const Value & null
We regret this reference to a global instance; prefer the simpler Value().
Definition: value.h:193
Json::StaticString
Lightweight wrapper to tag static string.
Definition: value.h:131
Json::Value::maxUInt
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Definition: value.h:209
Json::ValueConstIterator::operator->
pointer operator->() const
Definition: value.h:801
Json::Value::nullRef
static const Value & nullRef
just a kludge for binary-compatibility; same as null
Definition: value.h:194
Json::Value::LargestUInt
Json::LargestUInt LargestUInt
Definition: value.h:190
Json::ValueIterator::operator->
pointer operator->() const
Definition: value.h:852
Json::ValueConstIterator
const iterator for object and array value.
Definition: value.h:756
Json::ValueIterator::size_t
unsigned int size_t
Definition: value.h:811
JSONCPP_NORETURN
#define JSONCPP_NORETURN
Definition: value.h:30
Json::PathArgument
Experimental and untested: represents an element of the "path" to access a node.
Definition: value.h:628
Json::Value::minLargestInt
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
Definition: value.h:198
Json::ValueConstIterator::operator--
SelfType & operator--()
Definition: value.h:789
Json::nullValue
&#39;null&#39; value
Definition: value.h:94
Json::CommentPlacement
CommentPlacement
Definition: value.h:104
Json::ValueIterator::operator--
SelfType & operator--()
Definition: value.h:840
Json::ValueIterator::value_type
Value value_type
Definition: value.h:810
Json::StaticString::StaticString
StaticString(const char *czstring)
Definition: value.h:133
JSONCPP_NOEXCEPT
#define JSONCPP_NOEXCEPT
Definition: config.h:95
Json::ValueConstIterator::SelfType
ValueConstIterator SelfType
Definition: value.h:765
Json::LargestUInt
UInt64 LargestUInt
Definition: config.h:166
Json::ValueIterator::difference_type
int difference_type
Definition: value.h:812
Json::Value::const_iterator
ValueConstIterator const_iterator
Definition: value.h:182
Json::Exception::msg_
std::string msg_
Definition: value.h:61
Json
JSON (JavaScript Object Notation).
Definition: allocator.h:14
Json::ValueIteratorBase::SelfType
ValueIteratorBase SelfType
Definition: value.h:696
Json::operator==
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:85
Json::Value::Int64
Json::Int64 Int64
Definition: value.h:187
Json::ValueIterator::SelfType
ValueIterator SelfType
Definition: value.h:815
Json::Value::swap
void swap(Value &other)
Swap everything.
Definition: json_value.cpp:526
Json::Path
Experimental and untested: represents a "path" to access a node.
Definition: value.h:659
Json::ValueConstIterator::operator--
SelfType operator--(int)
Definition: value.h:783
Json::Value::LargestInt
Json::LargestInt LargestInt
Definition: value.h:189
Json::Value::maxUInt64
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Definition: value.h:217
Json::StaticString::c_str
const char * c_str() const
Definition: value.h:137
Json::realValue
double value
Definition: value.h:97
Json::ValueIterator::operator--
SelfType operator--(int)
Definition: value.h:834
Json::Value::UInt
Json::UInt UInt
Definition: value.h:183
Json::ValueIterator::operator++
SelfType & operator++()
Definition: value.h:845
Json::Value::UInt64
Json::UInt64 UInt64
Definition: value.h:186
Json::Value::Int
Json::Int Int
Definition: value.h:184
Json::ValueIterator::pointer
Value * pointer
Definition: value.h:814
Json::Value
Represents a JSON value.
Definition: value.h:177
Json::ValueIteratorBase::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition: value.h:693
Json::ValueIterator::operator*
reference operator*() const
Definition: value.h:850
Json::Value::iterator
ValueIterator iterator
Definition: value.h:181
Json::ValueConstIterator::pointer
const Value * pointer
Definition: value.h:764
Json::Value::minInt
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: value.h:205
Json::RuntimeError
Exceptions which the user cannot easily avoid.
Definition: value.h:70
Json::ValueConstIterator::reference
const Value & reference
Definition: value.h:763
Json::commentAfter
a comment on the line after a value (only make sense for
Definition: value.h:107
Json::UInt
unsigned int UInt
Definition: config.h:151
Json::ValueIterator
Iterator for object and array value.
Definition: value.h:806
Json::ValueConstIterator::operator++
SelfType & operator++()
Definition: value.h:794
Json::Int64
__int64 Int64
Definition: config.h:159
Json::ValueConstIterator::operator++
SelfType operator++(int)
Definition: value.h:777
Json::ValueIteratorBase::operator-
difference_type operator-(const SelfType &other) const
Definition: value.h:702
Json::ValueType
ValueType
used internally
Definition: value.h:93
Json::Value::Members
std::vector< std::string > Members
Definition: value.h:180
Json::booleanValue
bool value
Definition: value.h:99
Json::intValue
signed integer value
Definition: value.h:95
Json::ValueIterator::operator++
SelfType operator++(int)
Definition: value.h:828
Json::ValueIteratorBase::size_t
unsigned int size_t
Definition: value.h:694
Json::operator!=
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:90
Json::Int
int Int
Definition: config.h:150
Json::commentBefore
a comment placed on the line before a value
Definition: value.h:105
Json::stringValue
UTF-8 string value.
Definition: value.h:98
Json::commentAfterOnSameLine
a comment just after a value on the same line
Definition: value.h:106
std::swap
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
Definition: value.h:861
Json::Exception
Base class for all exceptions we throw.
Definition: value.h:55
Json::ValueIterator::reference
Value & reference
Definition: value.h:813
Json::Value::maxLargestInt
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: value.h:200
Json::Value::maxLargestUInt
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: value.h:202