JsonCpp project page | Classes | Namespace | JsonCpp home page

value.h
Go to the documentation of this file.
1 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
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 // Required for boost integration, e. g. BOOST_TEST
194 typedef std::string value_type;
195
196 static const Value& null;
197 static const Value& nullRef;
198 static Value const& nullSingleton();
199
201 static const LargestInt minLargestInt;
203 static const LargestInt maxLargestInt;
205 static const LargestUInt maxLargestUInt;
206
208 static const Int minInt;
210 static const Int maxInt;
212 static const UInt maxUInt;
213
214 #if defined(JSON_HAS_INT64)
215 static const Int64 minInt64;
218 static const Int64 maxInt64;
220 static const UInt64 maxUInt64;
221 #endif // defined(JSON_HAS_INT64)
222
223 private:
224 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
225 class CZString {
226 public:
227 enum DuplicationPolicy {
228 noDuplication = 0,
229 duplicate,
230 duplicateOnCopy
231 };
232 CZString(ArrayIndex index);
233 CZString(char const* str, unsigned length, DuplicationPolicy allocate);
234 CZString(CZString const& other);
235 #if JSON_HAS_RVALUE_REFERENCES
236 CZString(CZString&& other);
237 #endif
238 ~CZString();
239 CZString& operator=(const CZString& other);
240
241 #if JSON_HAS_RVALUE_REFERENCES
242 CZString& operator=(CZString&& other);
243 #endif
244
245 bool operator<(CZString const& other) const;
246 bool operator==(CZString const& other) const;
247 ArrayIndex index() const;
248 //const char* c_str() const; ///< \deprecated
249 char const* data() const;
250 unsigned length() const;
251 bool isStaticString() const;
252
253 private:
254 void swap(CZString& other);
255
256 struct StringStorage {
257 unsigned policy_: 2;
258 unsigned length_: 30; // 1GB max
259 };
260
261 char const* cstr_; // actually, a prefixed string, unless policy is noDup
262 union {
263 ArrayIndex index_;
264 StringStorage storage_;
265 };
266 };
267
268 public:
269 #ifndef JSON_USE_CPPTL_SMALLMAP
270 typedef std::map<CZString, Value> ObjectValues;
271 #else
272 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
273 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
274 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
275
276 public:
292 Value(ValueType type = nullValue);
293 Value(Int value);
294 Value(UInt value);
295 #if defined(JSON_HAS_INT64)
296 Value(Int64 value);
297 Value(UInt64 value);
298 #endif // if defined(JSON_HAS_INT64)
299 Value(double value);
300 Value(const char* value);
301 Value(const char* begin, const char* end);
302
317 Value(const StaticString& value);
318 Value(const JSONCPP_STRING& value);
319 #ifdef JSON_USE_CPPTL
320 Value(const CppTL::ConstString& value);
321 #endif
322 Value(bool value);
324 Value(const Value& other);
325 #if JSON_HAS_RVALUE_REFERENCES
326 Value(Value&& other);
328 #endif
329 ~Value();
330
333 Value& operator=(Value other);
334
336 void swap(Value& other);
338 void swapPayload(Value& other);
339
341 void copy(const Value& other);
343 void copyPayload(const Value& other);
344
345 ValueType type() const;
346
348 bool operator<(const Value& other) const;
349 bool operator<=(const Value& other) const;
350 bool operator>=(const Value& other) const;
351 bool operator>(const Value& other) const;
352 bool operator==(const Value& other) const;
353 bool operator!=(const Value& other) const;
354 int compare(const Value& other) const;
355
356 const char* asCString() const;
357 #if JSONCPP_USING_SECURE_MEMORY
358 unsigned getCStringLength() const; //Allows you to understand the length of the CString
359 #endif
360 JSONCPP_STRING asString() const;
361
364 bool getString(
365 char const** begin, char const** end) const;
366 #ifdef JSON_USE_CPPTL
367 CppTL::ConstString asConstString() const;
368 #endif
369 Int asInt() const;
370 UInt asUInt() const;
371 #if defined(JSON_HAS_INT64)
372 Int64 asInt64() const;
373 UInt64 asUInt64() const;
374 #endif // if defined(JSON_HAS_INT64)
375 LargestInt asLargestInt() const;
376 LargestUInt asLargestUInt() const;
377 float asFloat() const;
378 double asDouble() const;
379 bool asBool() const;
380
381 bool isNull() const;
382 bool isBool() const;
383 bool isInt() const;
384 bool isInt64() const;
385 bool isUInt() const;
386 bool isUInt64() const;
387 bool isIntegral() const;
388 bool isDouble() const;
389 bool isNumeric() const;
390 bool isString() const;
391 bool isArray() const;
392 bool isObject() const;
393
394 bool isConvertibleTo(ValueType other) const;
395
397 ArrayIndex size() const;
398
401 bool empty() const;
402
404 explicit operator bool() const;
405
409 void clear();
410
416 void resize(ArrayIndex size);
417
424 Value& operator[](ArrayIndex index);
425
432 Value& operator[](int index);
433
437 const Value& operator[](ArrayIndex index) const;
438
442 const Value& operator[](int index) const;
443
447 Value get(ArrayIndex index, const Value& defaultValue) const;
449 bool isValidIndex(ArrayIndex index) const;
453 Value& append(const Value& value);
454
455 #if JSON_HAS_RVALUE_REFERENCES
456 Value& append(Value&& value);
457 #endif
458
462 Value& operator[](const char* key);
465 const Value& operator[](const char* key) const;
468 Value& operator[](const JSONCPP_STRING& key);
472 const Value& operator[](const JSONCPP_STRING& key) const;
485 Value& operator[](const StaticString& key);
486 #ifdef JSON_USE_CPPTL
487 Value& operator[](const CppTL::ConstString& key);
491 const Value& operator[](const CppTL::ConstString& key) const;
492 #endif
493 Value get(const char* key, const Value& defaultValue) const;
499 Value get(const char* begin, const char* end, const Value& defaultValue) const;
503 Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
504 #ifdef JSON_USE_CPPTL
505 Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
508 #endif
509 Value const* find(char const* begin, char const* end) const;
516 Value const* demand(char const* begin, char const* end);
524 void removeMember(const char* key);
528 void removeMember(const JSONCPP_STRING& key);
531 bool removeMember(const char* key, Value* removed);
538 bool removeMember(JSONCPP_STRING const& key, Value* removed);
540 bool removeMember(const char* begin, const char* end, Value* removed);
547 bool removeIndex(ArrayIndex i, Value* removed);
548
551 bool isMember(const char* key) const;
554 bool isMember(const JSONCPP_STRING& key) const;
556 bool isMember(const char* begin, const char* end) const;
557 #ifdef JSON_USE_CPPTL
558 bool isMember(const CppTL::ConstString& key) const;
560 #endif
561
567 Members getMemberNames() const;
568
569 //# ifdef JSON_USE_CPPTL
570 // EnumMemberNames enumMemberNames() const;
571 // EnumValues enumValues() const;
572 //# endif
573
575 JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
576 void setComment(const char* comment, CommentPlacement placement);
578 void setComment(const char* comment, size_t len, CommentPlacement placement);
580 void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
581 bool hasComment(CommentPlacement placement) const;
583 JSONCPP_STRING getComment(CommentPlacement placement) const;
584
585 JSONCPP_STRING toStyledString() const;
586
587 const_iterator begin() const;
588 const_iterator end() const;
589
590 iterator begin();
591 iterator end();
592
593 // Accessors for the [start, limit) range of bytes within the JSON text from
594 // which this value was parsed, if any.
595 void setOffsetStart(ptrdiff_t start);
596 void setOffsetLimit(ptrdiff_t limit);
597 ptrdiff_t getOffsetStart() const;
598 ptrdiff_t getOffsetLimit() const;
599
600 private:
601 void initBasic(ValueType type, bool allocated = false);
602
603 Value& resolveReference(const char* key);
604 Value& resolveReference(const char* key, const char* end);
605
606 struct CommentInfo {
607 CommentInfo();
608 ~CommentInfo();
609
610 void setComment(const char* text, size_t len);
611
612 char* comment_;
613 };
614
615 // struct MemberNamesTransform
616 //{
617 // typedef const char *result_type;
618 // const char *operator()( const CZString &name ) const
619 // {
620 // return name.c_str();
621 // }
622 //};
623
624 union ValueHolder {
625 LargestInt int_;
626 LargestUInt uint_;
627 double real_;
628 bool bool_;
629 char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
630 ObjectValues* map_;
631 } value_;
632 ValueType type_ : 8;
633 unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
634 // If not allocated_, string_ must be null-terminated.
635 CommentInfo* comments_;
636
637 // [start, limit) byte offsets in the source JSON text from which this Value
638 // was extracted.
639 ptrdiff_t start_;
640 ptrdiff_t limit_;
641 };
642
646 class JSON_API PathArgument {
647 public:
648 friend class Path;
649
650 PathArgument();
651 PathArgument(ArrayIndex index);
652 PathArgument(const char* key);
653 PathArgument(const JSONCPP_STRING& key);
654
655 private:
656 enum Kind {
657 kindNone = 0,
658 kindIndex,
659 kindKey
660 };
661 JSONCPP_STRING key_;
662 ArrayIndex index_;
663 Kind kind_;
664 };
665
677 class JSON_API Path {
678 public:
679 Path(const JSONCPP_STRING& path,
680 const PathArgument& a1 = PathArgument(),
681 const PathArgument& a2 = PathArgument(),
682 const PathArgument& a3 = PathArgument(),
683 const PathArgument& a4 = PathArgument(),
684 const PathArgument& a5 = PathArgument());
685
686 const Value& resolve(const Value& root) const;
687 Value resolve(const Value& root, const Value& defaultValue) const;
690 Value& make(Value& root) const;
691
692 private:
693 typedef std::vector<const PathArgument*> InArgs;
694 typedef std::vector<PathArgument> Args;
695
696 void makePath(const JSONCPP_STRING& path, const InArgs& in);
697 void addPathInArg(const JSONCPP_STRING& path,
698 const InArgs& in,
699 InArgs::const_iterator& itInArg,
700 PathArgument::Kind kind);
701 void invalidPath(const JSONCPP_STRING& path, int location);
702
703 Args args_;
704 };
705
709 class JSON_API ValueIteratorBase {
710 public:
711 typedef std::bidirectional_iterator_tag iterator_category;
712 typedef unsigned int size_t;
713 typedef int difference_type;
714 typedef ValueIteratorBase SelfType;
715
716 bool operator==(const SelfType& other) const { return isEqual(other); }
717
718 bool operator!=(const SelfType& other) const { return !isEqual(other); }
719
720 difference_type operator-(const SelfType& other) const {
721 return other.computeDistance(*this);
722 }
723
726 Value key() const;
727
729 UInt index() const;
730
734 JSONCPP_STRING name() const;
735
739 JSONCPP_DEPRECATED("Use `key = name();` instead.")
740 char const* memberName() const;
744 char const* memberName(char const** end) const;
745
746 protected:
747 Value& deref() const;
748
749 void increment();
750
751 void decrement();
752
753 difference_type computeDistance(const SelfType& other) const;
754
755 bool isEqual(const SelfType& other) const;
756
757 void copy(const SelfType& other);
758
759 private:
760 Value::ObjectValues::iterator current_;
761 // Indicates that iterator is for a null value.
762 bool isNull_;
763
764 public:
765 // For some reason, BORLAND needs these at the end, rather
766 // than earlier. No idea why.
767 ValueIteratorBase();
768 explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
769 };
770
774 class JSON_API ValueConstIterator : public ValueIteratorBase {
775 friend class Value;
776
777 public:
778 typedef const Value value_type;
779 //typedef unsigned int size_t;
780 //typedef int difference_type;
781 typedef const Value& reference;
782 typedef const Value* pointer;
783 typedef ValueConstIterator SelfType;
784
785 ValueConstIterator();
786 ValueConstIterator(ValueIterator const& other);
787
788 private:
791 explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
792 public:
793 SelfType& operator=(const ValueIteratorBase& other);
794
795 SelfType operator++(int) {
796 SelfType temp(*this);
797 ++*this;
798 return temp;
799 }
800
801 SelfType operator--(int) {
802 SelfType temp(*this);
803 --*this;
804 return temp;
805 }
806
807 SelfType& operator--() {
808 decrement();
809 return *this;
810 }
811
812 SelfType& operator++() {
813 increment();
814 return *this;
815 }
816
817 reference operator*() const { return deref(); }
818
819 pointer operator->() const { return &deref(); }
820 };
821
824 class JSON_API ValueIterator : public ValueIteratorBase {
825 friend class Value;
826
827 public:
828 typedef Value value_type;
829 typedef unsigned int size_t;
830 typedef int difference_type;
831 typedef Value& reference;
832 typedef Value* pointer;
833 typedef ValueIterator SelfType;
834
835 ValueIterator();
836 explicit ValueIterator(const ValueConstIterator& other);
837 ValueIterator(const ValueIterator& other);
838
839 private:
842 explicit ValueIterator(const Value::ObjectValues::iterator& current);
843 public:
844 SelfType& operator=(const SelfType& other);
845
846 SelfType operator++(int) {
847 SelfType temp(*this);
848 ++*this;
849 return temp;
850 }
851
852 SelfType operator--(int) {
853 SelfType temp(*this);
854 --*this;
855 return temp;
856 }
857
858 SelfType& operator--() {
859 decrement();
860 return *this;
861 }
862
863 SelfType& operator++() {
864 increment();
865 return *this;
866 }
867
868 reference operator*() const { return deref(); }
869
870 pointer operator->() const { return &deref(); }
871 };
872
873 } // namespace Json
874
875
876 namespace std {
878 template<>
879 inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
880 }
881
882 #pragma pack(pop)
883
884 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
885 #pragma warning(pop)
886 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
887
888 #endif // CPPTL_JSON_H_INCLUDED
JSONCPP_OVERRIDE
#define JSONCPP_OVERRIDE
Definition: config.h:94
JSONCPP_DEPRECATED
#define JSONCPP_DEPRECATED(message)
Definition: config.h:135
Json::LargestInt
Int64 LargestInt
Definition: config.h:168
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 amalgamated 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:218
Json::ArrayIndex
unsigned int ArrayIndex
Definition: forwards.h:23
Json::ValueIteratorBase::operator!=
bool operator!=(const SelfType &other) const
Definition: value.h:718
Json::ValueIteratorBase
base class for Value iterators.
Definition: value.h:709
Json::arrayValue
array value (ordered list)
Definition: value.h:100
Json::ValueIteratorBase::difference_type
int difference_type
Definition: value.h:713
Json::UInt64
unsigned __int64 UInt64
Definition: config.h:163
Json::ValueConstIterator::operator*
reference operator*() const
Definition: value.h:817
Json::uintValue
unsigned integer value
Definition: value.h:96
JSONCPP_STRING
#define JSONCPP_STRING
Definition: config.h:179
Json::ValueIteratorBase::operator==
bool operator==(const SelfType &other) const
Definition: value.h:716
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:778
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:210
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:196
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:212
Json::ValueConstIterator::operator->
pointer operator->() const
Definition: value.h:819
Json::Value::nullRef
static const Value & nullRef
just a kludge for binary-compatibility; same as null
Definition: value.h:197
Json::Value::LargestUInt
Json::LargestUInt LargestUInt
Definition: value.h:190
Json::ValueIterator::operator->
pointer operator->() const
Definition: value.h:870
Json::ValueConstIterator
const iterator for object and array value.
Definition: value.h:774
Json::ValueIterator::size_t
unsigned int size_t
Definition: value.h:829
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:646
Json::Value::minLargestInt
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
Definition: value.h:201
Json::ValueConstIterator::operator--
SelfType & operator--()
Definition: value.h:807
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:858
Json::ValueIterator::value_type
Value value_type
Definition: value.h:828
Json::StaticString::StaticString
StaticString(const char *czstring)
Definition: value.h:133
JSONCPP_NOEXCEPT
#define JSONCPP_NOEXCEPT
Definition: config.h:95
Json::Value::value_type
std::string value_type
Definition: value.h:194
Json::ValueConstIterator::SelfType
ValueConstIterator SelfType
Definition: value.h:783
Json::LargestUInt
UInt64 LargestUInt
Definition: config.h:169
Json::ValueIterator::difference_type
int difference_type
Definition: value.h:830
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:714
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:833
Json::Value::swap
void swap(Value &other)
Swap everything.
Definition: json_value.cpp:542
Json::Path
Experimental and untested: represents a "path" to access a node.
Definition: value.h:677
Json::ValueConstIterator::operator--
SelfType operator--(int)
Definition: value.h:801
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:220
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:852
Json::Value::UInt
Json::UInt UInt
Definition: value.h:183
Json::ValueIterator::operator++
SelfType & operator++()
Definition: value.h:863
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:832
Json::Value
Represents a JSON value.
Definition: value.h:177
Json::ValueIteratorBase::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition: value.h:711
Json::ValueIterator::operator*
reference operator*() const
Definition: value.h:868
Json::Value::iterator
ValueIterator iterator
Definition: value.h:181
Json::ValueConstIterator::pointer
const Value * pointer
Definition: value.h:782
Json::Value::minInt
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: value.h:208
Json::RuntimeError
Exceptions which the user cannot easily avoid.
Definition: value.h:70
Json::ValueConstIterator::reference
const Value & reference
Definition: value.h:781
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:154
Json::ValueIterator
Iterator for object and array value.
Definition: value.h:824
Json::ValueConstIterator::operator++
SelfType & operator++()
Definition: value.h:812
Json::Int64
__int64 Int64
Definition: config.h:162
Json::ValueConstIterator::operator++
SelfType operator++(int)
Definition: value.h:795
Json::ValueIteratorBase::operator-
difference_type operator-(const SelfType &other) const
Definition: value.h:720
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:846
Json::ValueIteratorBase::size_t
unsigned int size_t
Definition: value.h:712
Json::operator!=
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:90
Json::Int
int Int
Definition: config.h:153
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:879
Json::Exception
Base class for all exceptions we throw.
Definition: value.h:55
Json::ValueIterator::reference
Value & reference
Definition: value.h:831
Json::Value::maxLargestInt
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: value.h:203
Json::Value::maxLargestUInt
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: value.h:205