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 <array>
13 #include <exception>
14 #include <memory>
15 #include <string>
16 #include <vector>
17
18 #ifndef JSON_USE_CPPTL_SMALLMAP
19 #include <map>
20 #else
21 #include <cpptl/smallmap.h>
22 #endif
23 #ifdef JSON_USE_CPPTL
24 #include <cpptl/forwards.h>
25 #endif
26
27 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
28 // be used by...
29 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
30 #pragma warning(push)
31 #pragma warning(disable : 4251)
32 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
33
34 #pragma pack(push, 8)
35
38 namespace Json {
39
40 #if JSON_USE_EXCEPTION
41
45 class JSON_API Exception : public std::exception {
46 public:
47 Exception(String msg);
48 ~Exception() JSONCPP_NOEXCEPT override;
49 char const* what() const JSONCPP_NOEXCEPT override;
50
51 protected:
52 String msg_;
53 };
54
61 class JSON_API RuntimeError : public Exception {
62 public:
63 RuntimeError(String const& msg);
64 };
65
72 class JSON_API LogicError : public Exception {
73 public:
74 LogicError(String const& msg);
75 };
76 #endif
77
79 [[noreturn]] void throwRuntimeError(String const& msg);
81 [[noreturn]] void throwLogicError(String const& msg);
82
85 enum ValueType {
86 nullValue = 0,
87 intValue,
88 uintValue,
89 realValue,
90 stringValue,
91 booleanValue,
92 arrayValue,
93 objectValue
94 };
95
96 enum CommentPlacement {
97 commentBefore = 0,
98 commentAfterOnSameLine,
99 commentAfter,
100 numberOfCommentPlacement
102 };
103
106 enum PrecisionType {
107 significantDigits = 0,
108 decimalPlaces
109 };
110
111 //# ifdef JSON_USE_CPPTL
112 // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
113 // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
114 //# endif
115
130 class JSON_API StaticString {
131 public:
132 explicit StaticString(const char* czstring) : c_str_(czstring) {}
133
134 operator const char*() const { return c_str_; }
135
136 const char* c_str() const { return c_str_; }
137
138 private:
139 const char* c_str_;
140 };
141
176 class JSON_API Value {
177 friend class ValueIteratorBase;
178
179 public:
180 typedef std::vector<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 #if JSON_USE_NULLREF
197 // Binary compatibility kludges, do not use.
198 static const Value& null;
199 static const Value& nullRef;
200 #endif
201
202 // null and nullRef are deprecated, use this instead.
203 static Value const& nullSingleton();
204
206 static const LargestInt minLargestInt;
208 static const LargestInt maxLargestInt;
210 static const LargestUInt maxLargestUInt;
211
213 static const Int minInt;
215 static const Int maxInt;
217 static const UInt maxUInt;
218
219 #if defined(JSON_HAS_INT64)
220 static const Int64 minInt64;
223 static const Int64 maxInt64;
225 static const UInt64 maxUInt64;
226 #endif // defined(JSON_HAS_INT64)
227
229 static const UInt defaultRealPrecision;
230
231 // Workaround for bug in the NVIDIAs CUDA 9.1 nvcc compiler
232 // when using gcc and clang backend compilers. CZString
233 // cannot be defined as private. See issue #486
234 #ifdef __NVCC__
235 public:
236 #else
237 private:
238 #endif
239 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
240 class CZString {
241 public:
242 enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy };
243 CZString(ArrayIndex index);
244 CZString(char const* str, unsigned length, DuplicationPolicy allocate);
245 CZString(CZString const& other);
246 CZString(CZString&& other);
247 ~CZString();
248 CZString& operator=(const CZString& other);
249 CZString& operator=(CZString&& other);
250
251 bool operator<(CZString const& other) const;
252 bool operator==(CZString const& other) const;
253 ArrayIndex index() const;
254 // const char* c_str() const; ///< \deprecated
255 char const* data() const;
256 unsigned length() const;
257 bool isStaticString() const;
258
259 private:
260 void swap(CZString& other);
261
262 struct StringStorage {
263 unsigned policy_ : 2;
264 unsigned length_ : 30; // 1GB max
265 };
266
267 char const* cstr_; // actually, a prefixed string, unless policy is noDup
268 union {
269 ArrayIndex index_;
270 StringStorage storage_;
271 };
272 };
273
274 public:
275 #ifndef JSON_USE_CPPTL_SMALLMAP
276 typedef std::map<CZString, Value> ObjectValues;
277 #else
278 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
279 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
280 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
281
282 public:
298 Value(ValueType type = nullValue);
299 Value(Int value);
300 Value(UInt value);
301 #if defined(JSON_HAS_INT64)
302 Value(Int64 value);
303 Value(UInt64 value);
304 #endif // if defined(JSON_HAS_INT64)
305 Value(double value);
306 Value(const char* value);
307 Value(const char* begin, const char* end);
308
323 Value(const StaticString& value);
324 Value(const String& value);
325 #ifdef JSON_USE_CPPTL
327 Value(const CppTL::ConstString& value);
328 #endif
329 Value(bool value);
330 Value(const Value& other);
331 Value(Value&& other);
332 ~Value();
333
336 Value& operator=(const Value& other);
337 Value& operator=(Value&& other);
338
340 void swap(Value& other);
342 void swapPayload(Value& other);
343
345 void copy(const Value& other);
347 void copyPayload(const Value& other);
348
349 ValueType type() const;
350
352 bool operator<(const Value& other) const;
353 bool operator<=(const Value& other) const;
354 bool operator>=(const Value& other) const;
355 bool operator>(const Value& other) const;
356 bool operator==(const Value& other) const;
357 bool operator!=(const Value& other) const;
358 int compare(const Value& other) const;
359
360 const char* asCString() const;
361 #if JSONCPP_USING_SECURE_MEMORY
362 unsigned getCStringLength() const; // Allows you to understand the length of
363 // the CString
364 #endif
365 String asString() const;
366
369 bool getString(char const** begin, char const** end) const;
370 #ifdef JSON_USE_CPPTL
371 CppTL::ConstString asConstString() const;
372 #endif
373 Int asInt() const;
374 UInt asUInt() const;
375 #if defined(JSON_HAS_INT64)
376 Int64 asInt64() const;
377 UInt64 asUInt64() const;
378 #endif // if defined(JSON_HAS_INT64)
379 LargestInt asLargestInt() const;
380 LargestUInt asLargestUInt() const;
381 float asFloat() const;
382 double asDouble() const;
383 bool asBool() const;
384
385 bool isNull() const;
386 bool isBool() const;
387 bool isInt() const;
388 bool isInt64() const;
389 bool isUInt() const;
390 bool isUInt64() const;
391 bool isIntegral() const;
392 bool isDouble() const;
393 bool isNumeric() const;
394 bool isString() const;
395 bool isArray() const;
396 bool isObject() const;
397
398 bool isConvertibleTo(ValueType other) const;
399
401 ArrayIndex size() const;
402
405 bool empty() const;
406
408 JSONCPP_OP_EXPLICIT operator bool() const;
409
413 void clear();
414
420 void resize(ArrayIndex newSize);
421
428 Value& operator[](ArrayIndex index);
429
436 Value& operator[](int index);
437
441 const Value& operator[](ArrayIndex index) const;
442
446 const Value& operator[](int index) const;
447
451 Value get(ArrayIndex index, const Value& defaultValue) const;
453 bool isValidIndex(ArrayIndex index) const;
457 Value& append(const Value& value);
458 Value& append(Value&& value);
459
463 Value& operator[](const char* key);
466 const Value& operator[](const char* key) const;
469 Value& operator[](const String& key);
473 const Value& operator[](const String& key) const;
487 Value& operator[](const StaticString& key);
488 #ifdef JSON_USE_CPPTL
489 Value& operator[](const CppTL::ConstString& key);
493 const Value& operator[](const CppTL::ConstString& key) const;
494 #endif
495 Value get(const char* key, const Value& defaultValue) const;
501 Value
502 get(const char* begin, const char* end, const Value& defaultValue) const;
506 Value get(const String& key, const Value& defaultValue) const;
507 #ifdef JSON_USE_CPPTL
508 Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
511 #endif
512 Value const* find(char const* begin, char const* end) const;
519 Value* demand(char const* begin, char const* end);
525 void removeMember(const char* key);
528 void removeMember(const String& key);
531 bool removeMember(const char* key, Value* removed);
538 bool removeMember(String const& key, Value* removed);
540 bool removeMember(const char* begin, const char* end, Value* removed);
547 bool removeIndex(ArrayIndex index, Value* removed);
548
551 bool isMember(const char* key) const;
554 bool isMember(const 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(String const&) instead.")
576 void setComment(const char* comment, CommentPlacement placement) {
577 setComment(String(comment, strlen(comment)), placement);
578 }
580 void setComment(const char* comment, size_t len, CommentPlacement placement) {
581 setComment(String(comment, len), placement);
582 }
584 void setComment(String comment, CommentPlacement placement);
585 bool hasComment(CommentPlacement placement) const;
587 String getComment(CommentPlacement placement) const;
588
589 String toStyledString() const;
590
591 const_iterator begin() const;
592 const_iterator end() const;
593
594 iterator begin();
595 iterator end();
596
597 // Accessors for the [start, limit) range of bytes within the JSON text from
598 // which this value was parsed, if any.
599 void setOffsetStart(ptrdiff_t start);
600 void setOffsetLimit(ptrdiff_t limit);
601 ptrdiff_t getOffsetStart() const;
602 ptrdiff_t getOffsetLimit() const;
603
604 private:
605 void setType(ValueType v) {
606 bits_.value_type_ = static_cast<unsigned char>(v);
607 }
608 bool isAllocated() const { return bits_.allocated_; }
609 void setIsAllocated(bool v) { bits_.allocated_ = v; }
610
611 void initBasic(ValueType type, bool allocated = false);
612 void dupPayload(const Value& other);
613 void releasePayload();
614 void dupMeta(const Value& other);
615
616 Value& resolveReference(const char* key);
617 Value& resolveReference(const char* key, const char* end);
618
619 // struct MemberNamesTransform
620 //{
621 // typedef const char *result_type;
622 // const char *operator()( const CZString &name ) const
623 // {
624 // return name.c_str();
625 // }
626 //};
627
628 union ValueHolder {
629 LargestInt int_;
630 LargestUInt uint_;
631 double real_;
632 bool bool_;
633 char* string_; // if allocated_, ptr to { unsigned, char[] }.
634 ObjectValues* map_;
635 } value_;
636
637 struct {
638 // Really a ValueType, but types should agree for bitfield packing.
639 unsigned int value_type_ : 8;
640 // Unless allocated_, string_ must be null-terminated.
641 unsigned int allocated_ : 1;
642 } bits_;
643
644 class Comments {
645 public:
646 Comments() = default;
647 Comments(const Comments& that);
648 Comments(Comments&& that);
649 Comments& operator=(const Comments& that);
650 Comments& operator=(Comments&& that);
651 bool has(CommentPlacement slot) const;
652 String get(CommentPlacement slot) const;
653 void set(CommentPlacement slot, String s);
654
655 private:
656 using Array = std::array<String, numberOfCommentPlacement>;
657 std::unique_ptr<Array> ptr_;
658 };
659 Comments comments_;
660
661 // [start, limit) byte offsets in the source JSON text from which this Value
662 // was extracted.
663 ptrdiff_t start_;
664 ptrdiff_t limit_;
665 };
666
670 class JSON_API PathArgument {
671 public:
672 friend class Path;
673
674 PathArgument();
675 PathArgument(ArrayIndex index);
676 PathArgument(const char* key);
677 PathArgument(const String& key);
678
679 private:
680 enum Kind { kindNone = 0, kindIndex, kindKey };
681 String key_;
682 ArrayIndex index_{};
683 Kind kind_{kindNone};
684 };
685
697 class JSON_API Path {
698 public:
699 Path(const String& path,
700 const PathArgument& a1 = PathArgument(),
701 const PathArgument& a2 = PathArgument(),
702 const PathArgument& a3 = PathArgument(),
703 const PathArgument& a4 = PathArgument(),
704 const PathArgument& a5 = PathArgument());
705
706 const Value& resolve(const Value& root) const;
707 Value resolve(const Value& root, const Value& defaultValue) const;
710 Value& make(Value& root) const;
711
712 private:
713 typedef std::vector<const PathArgument*> InArgs;
714 typedef std::vector<PathArgument> Args;
715
716 void makePath(const String& path, const InArgs& in);
717 void addPathInArg(const String& path,
718 const InArgs& in,
719 InArgs::const_iterator& itInArg,
720 PathArgument::Kind kind);
721 static void invalidPath(const String& path, int location);
722
723 Args args_;
724 };
725
729 class JSON_API ValueIteratorBase {
730 public:
731 typedef std::bidirectional_iterator_tag iterator_category;
732 typedef unsigned int size_t;
733 typedef int difference_type;
734 typedef ValueIteratorBase SelfType;
735
736 bool operator==(const SelfType& other) const { return isEqual(other); }
737
738 bool operator!=(const SelfType& other) const { return !isEqual(other); }
739
740 difference_type operator-(const SelfType& other) const {
741 return other.computeDistance(*this);
742 }
743
746 Value key() const;
747
750 UInt index() const;
751
755 String name() const;
756
761 JSONCPP_DEPRECATED("Use `key = name();` instead.")
762 char const* memberName() const;
766 char const* memberName(char const** end) const;
767
768 protected:
769 Value& deref() const;
770
771 void increment();
772
773 void decrement();
774
775 difference_type computeDistance(const SelfType& other) const;
776
777 bool isEqual(const SelfType& other) const;
778
779 void copy(const SelfType& other);
780
781 private:
782 Value::ObjectValues::iterator current_;
783 // Indicates that iterator is for a null value.
784 bool isNull_{true};
785
786 public:
787 // For some reason, BORLAND needs these at the end, rather
788 // than earlier. No idea why.
789 ValueIteratorBase();
790 explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
791 };
792
796 class JSON_API ValueConstIterator : public ValueIteratorBase {
797 friend class Value;
798
799 public:
800 typedef const Value value_type;
801 // typedef unsigned int size_t;
802 // typedef int difference_type;
803 typedef const Value& reference;
804 typedef const Value* pointer;
805 typedef ValueConstIterator SelfType;
806
807 ValueConstIterator();
808 ValueConstIterator(ValueIterator const& other);
809
810 private:
813 explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
814
815 public:
816 SelfType& operator=(const ValueIteratorBase& other);
817
818 SelfType operator++(int) {
819 SelfType temp(*this);
820 ++*this;
821 return temp;
822 }
823
824 SelfType operator--(int) {
825 SelfType temp(*this);
826 --*this;
827 return temp;
828 }
829
830 SelfType& operator--() {
831 decrement();
832 return *this;
833 }
834
835 SelfType& operator++() {
836 increment();
837 return *this;
838 }
839
840 reference operator*() const { return deref(); }
841
842 pointer operator->() const { return &deref(); }
843 };
844
847 class JSON_API ValueIterator : public ValueIteratorBase {
848 friend class Value;
849
850 public:
851 typedef Value value_type;
852 typedef unsigned int size_t;
853 typedef int difference_type;
854 typedef Value& reference;
855 typedef Value* pointer;
856 typedef ValueIterator SelfType;
857
858 ValueIterator();
859 explicit ValueIterator(const ValueConstIterator& other);
860 ValueIterator(const ValueIterator& other);
861
862 private:
865 explicit ValueIterator(const Value::ObjectValues::iterator& current);
866
867 public:
868 SelfType& operator=(const SelfType& other);
869
870 SelfType operator++(int) {
871 SelfType temp(*this);
872 ++*this;
873 return temp;
874 }
875
876 SelfType operator--(int) {
877 SelfType temp(*this);
878 --*this;
879 return temp;
880 }
881
882 SelfType& operator--() {
883 decrement();
884 return *this;
885 }
886
887 SelfType& operator++() {
888 increment();
889 return *this;
890 }
891
892 reference operator*() const { return deref(); }
893
894 pointer operator->() const { return &deref(); }
895 };
896
897 inline void swap(Value& a, Value& b) { a.swap(b); }
898
899 } // namespace Json
900
901 #pragma pack(pop)
902
903 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
904 #pragma warning(pop)
905 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
906
907 #endif // CPPTL_JSON_H_INCLUDED
Json::ValueIteratorBase::operator!=
bool operator!=(const SelfType &other) const
Definition: value.h:738
Json::ValueConstIterator::operator->
pointer operator->() const
Definition: value.h:842
Json::Value::minInt
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: value.h:213
Json::ValueType
ValueType
Type of the value held by a Value object.
Definition: value.h:85
Json::Value::maxLargestInt
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: value.h:208
Json::numberOfCommentPlacement
root value)
Definition: value.h:101
Json::ArrayIndex
unsigned int ArrayIndex
Definition: forwards.h:29
Json::Value::maxLargestUInt
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: value.h:210
Json::ValueIterator::reference
Value & reference
Definition: value.h:854
Json::Value::Int64
Json::Int64 Int64
Definition: value.h:187
JSONCPP_OP_EXPLICIT
#define JSONCPP_OP_EXPLICIT
Definition: config.h:98
Json::uintValue
unsigned integer value
Definition: value.h:88
Json::significantDigits
we set max number of significant digits in string
Definition: value.h:107
Json::LargestUInt
UInt64 LargestUInt
Definition: config.h:154
JSONCPP_NOEXCEPT
#define JSONCPP_NOEXCEPT
Definition: config.h:97
Json::commentAfterOnSameLine
a comment just after a value on the same line
Definition: value.h:98
Json::ValueConstIterator
const iterator for object and array value.
Definition: value.h:796
Json::Int
int Int
Definition: config.h:138
Json::ValueIterator::operator*
reference operator*() const
Definition: value.h:892
forwards.h
Json::ValueIteratorBase::operator==
bool operator==(const SelfType &other) const
Definition: value.h:736
Json::commentBefore
a comment placed on the line before a value
Definition: value.h:97
Json::LogicError
Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
Definition: value.h:72
Json::stringValue
UTF-8 string value.
Definition: value.h:90
Json::ValueIterator
Iterator for object and array value.
Definition: value.h:847
Json::ValueIteratorBase::difference_type
int difference_type
Definition: value.h:733
Json::ValueIterator::operator--
SelfType & operator--()
Definition: value.h:882
Json::operator==
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:76
Json::Int64
__int64 Int64
Definition: config.h:147
Json::ValueIteratorBase::computeDistance
difference_type computeDistance(const SelfType &other) const
Definition: json_valueiterator.inl:31
Json::Value::iterator
ValueIterator iterator
Definition: value.h:181
Json::ValueIterator::operator++
SelfType & operator++()
Definition: value.h:887
Json::Path
Experimental and untested: represents a "path" to access a node.
Definition: value.h:697
Json::LargestInt
Int64 LargestInt
Definition: config.h:153
Json::UInt
unsigned int UInt
Definition: config.h:139
Json::commentAfter
a comment on the line after a value (only make sense for
Definition: value.h:99
Json::intValue
signed integer value
Definition: value.h:87
Json::ValueConstIterator::operator++
SelfType operator++(int)
Definition: value.h:818
Json::decimalPlaces
we set max number of digits after "." in string
Definition: value.h:108
Json::operator!=
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:81
Json::UInt64
unsigned __int64 UInt64
Definition: config.h:148
Json::ValueIterator::operator--
SelfType operator--(int)
Definition: value.h:876
Json::ValueIterator::value_type
Value value_type
Definition: value.h:851
Json::Exception::msg_
String msg_
Definition: value.h:52
Json::arrayValue
array value (ordered list)
Definition: value.h:92
Json::PrecisionType
PrecisionType
Type of precision for formatting of real values.
Definition: value.h:106
Json::ValueIteratorBase::SelfType
ValueIteratorBase SelfType
Definition: value.h:734
Json::ValueConstIterator::SelfType
ValueConstIterator SelfType
Definition: value.h:805
Json::Value::maxInt
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
Definition: value.h:215
Json::Value::Int
Json::Int Int
Definition: value.h:184
Json::Value::swap
void swap(Value &other)
Swap everything.
Definition: json_value.cpp:496
Json::Value
Represents a JSON value.
Definition: value.h:176
Json::Exception
Base class for all exceptions we throw.
Definition: value.h:45
Json::throwRuntimeError
void throwRuntimeError(String const &msg)
used internally
Definition: json_value.cpp:235
Json::StaticString::StaticString
StaticString(const char *czstring)
Definition: value.h:132
Json::Value::value_type_
unsigned int value_type_
Definition: value.h:639
Json::Value::value_type
std::string value_type
Definition: value.h:194
Json::PathArgument
Experimental and untested: represents an element of the "path" to access a node.
Definition: value.h:670
Json::Value::defaultRealPrecision
static const UInt defaultRealPrecision
Default precision for real value for string representation.
Definition: value.h:229
Json::throwLogicError
void throwLogicError(String const &msg)
used internally
Definition: json_value.cpp:238
Json::CommentPlacement
CommentPlacement
Definition: value.h:96
JSONCPP_DEPRECATED
#define JSONCPP_DEPRECATED(message)
Definition: config.h:119
Json::ValueIteratorBase::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition: value.h:731
Json::ValueIterator::size_t
unsigned int size_t
Definition: value.h:852
Json::Value::LargestInt
Json::LargestInt LargestInt
Definition: value.h:189
Json::swap
void swap(Value &a, Value &b)
Definition: value.h:897
Json
JSON (JavaScript Object Notation).
Definition: allocator.h:14
JSON_API
#define JSON_API
If defined, indicates that the source file is amalgamated to prevent private header inclusion.
Definition: config.h:66
Json::Value::minLargestInt
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
Definition: value.h:206
Json::Value::UInt
Json::UInt UInt
Definition: value.h:183
Json::ValueConstIterator::value_type
const typedef Value value_type
Definition: value.h:800
Json::Value::const_iterator
ValueConstIterator const_iterator
Definition: value.h:182
Json::ValueIteratorBase
base class for Value iterators.
Definition: value.h:729
Json::objectValue
object value (collection of name/value pairs).
Definition: value.h:93
Json::ValueConstIterator::operator++
SelfType & operator++()
Definition: value.h:835
Json::StaticString::c_str
const char * c_str() const
Definition: value.h:136
Json::Value::maxInt64
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Definition: value.h:223
Json::Value::nullRef
static const Value & nullRef
Definition: value.h:199
Json::String
std::basic_string< char, std::char_traits< char >, Allocator< char > > String
Definition: config.h:162
Json::Value::LargestUInt
Json::LargestUInt LargestUInt
Definition: value.h:190
Json::Value::allocated_
unsigned int allocated_
Definition: value.h:641
Json::Value::ArrayIndex
Json::ArrayIndex ArrayIndex
Definition: value.h:191
Json::ValueConstIterator::operator--
SelfType & operator--()
Definition: value.h:830
Json::ValueConstIterator::reference
const typedef Value & reference
Definition: value.h:803
Json::Value::setComment
void setComment(const char *comment, size_t len, CommentPlacement placement)
Comments must be //... or /* ... *‍/.
Definition: value.h:580
Json::ValueIterator::SelfType
ValueIterator SelfType
Definition: value.h:856
Json::ValueIterator::difference_type
int difference_type
Definition: value.h:853
Json::ValueConstIterator::operator*
reference operator*() const
Definition: value.h:840
Json::Value::maxUInt64
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Definition: value.h:225
Json::ValueConstIterator::pointer
const typedef Value * pointer
Definition: value.h:804
Json::booleanValue
bool value
Definition: value.h:91
Json::nullValue
'null' value
Definition: value.h:86
Json::ValueIteratorBase::operator-
difference_type operator-(const SelfType &other) const
Definition: value.h:740
Json::ValueIterator::operator->
pointer operator->() const
Definition: value.h:894
Json::StaticString
Lightweight wrapper to tag static string.
Definition: value.h:130
Json::realValue
double value
Definition: value.h:89
Json::Value::Members
std::vector< String > Members
Definition: value.h:180
Json::ValueIterator::operator++
SelfType operator++(int)
Definition: value.h:870
Json::ValueIterator::pointer
Value * pointer
Definition: value.h:855
Json::ValueIteratorBase::size_t
unsigned int size_t
Definition: value.h:732
Json::ValueConstIterator::operator--
SelfType operator--(int)
Definition: value.h:824
Json::Value::UInt64
Json::UInt64 UInt64
Definition: value.h:186
Json::Value::maxUInt
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Definition: value.h:217
Json::RuntimeError
Exceptions which the user cannot easily avoid.
Definition: value.h:61