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
13// Conditional NORETURN attribute on the throw functions would:
14// a) suppress false positives from static code analysis
15// b) possibly improve optimization opportunities.
16#if !defined(JSONCPP_NORETURN)
17#if defined(_MSC_VER) && _MSC_VER == 1800
18#define JSONCPP_NORETURN __declspec(noreturn)
19#else
20#define JSONCPP_NORETURN [[noreturn]]
21#endif
22#endif
23
24#include <array>
25#include <exception>
26#include <memory>
27#include <string>
28#include <vector>
29
30#ifndef JSON_USE_CPPTL_SMALLMAP
31#include <map>
32#else
33#include <cpptl/smallmap.h>
34#endif
35#ifdef JSON_USE_CPPTL
36#include <cpptl/forwards.h>
37#endif
38
39// Disable warning C4251: <data member>: <type> needs to have dll-interface to
40// be used by...
41#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
42#pragma warning(push)
43#pragma warning(disable : 4251)
44#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
45
46#pragma pack(push, 8)
47
50namespace Json {
51
52#if JSON_USE_EXCEPTION
57class JSON_API Exception : public std::exception {
58public:
59 Exception(String msg);
61 char const* what() const JSONCPP_NOEXCEPT override;
62
63protected:
64 String msg_;
65};
66
74public:
75 RuntimeError(String const& msg);
76};
77
85public:
86 LogicError(String const& msg);
87};
88#endif
89
91JSONCPP_NORETURN void throwRuntimeError(String const& msg);
93JSONCPP_NORETURN void throwLogicError(String const& msg);
94
107
115
122
123//# ifdef JSON_USE_CPPTL
124// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
125// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
126//# endif
127
143public:
144 explicit StaticString(const char* czstring) : c_str_(czstring) {}
145
146 operator const char*() const { return c_str_; }
147
148 const char* c_str() const { return c_str_; }
149
150private:
151 const char* c_str_;
152};
153
189 friend class ValueIteratorBase;
190
191public:
192 typedef std::vector<String> Members;
196 typedef Json::Int Int;
197#if defined(JSON_HAS_INT64)
200#endif // defined(JSON_HAS_INT64)
204
205 // Required for boost integration, e. g. BOOST_TEST
206 typedef std::string value_type;
207
208#if JSON_USE_NULLREF
209 // Binary compatibility kludges, do not use.
210 static const Value& null;
211 static const Value& nullRef;
212#endif
213
214 // null and nullRef are deprecated, use this instead.
215 static Value const& nullSingleton();
216
218 static constexpr LargestInt minLargestInt =
219 LargestInt(~(LargestUInt(-1) / 2));
221 static constexpr LargestInt maxLargestInt = LargestInt(LargestUInt(-1) / 2);
223 static constexpr LargestUInt maxLargestUInt = LargestUInt(-1);
224
226 static constexpr Int minInt = Int(~(UInt(-1) / 2));
228 static constexpr Int maxInt = Int(UInt(-1) / 2);
230 static constexpr UInt maxUInt = UInt(-1);
231
232#if defined(JSON_HAS_INT64)
234 static constexpr Int64 minInt64 = Int64(~(UInt64(-1) / 2));
236 static constexpr Int64 maxInt64 = Int64(UInt64(-1) / 2);
238 static constexpr UInt64 maxUInt64 = UInt64(-1);
239#endif // defined(JSON_HAS_INT64)
241 static constexpr UInt defaultRealPrecision = 17;
242 // The constant is hard-coded because some compiler have trouble
243 // converting Value::maxUInt64 to a double correctly (AIX/xlC).
244 // Assumes that UInt64 is a 64 bits integer.
245 static constexpr double maxUInt64AsDouble = 18446744073709551615.0;
246// Workaround for bug in the NVIDIAs CUDA 9.1 nvcc compiler
247// when using gcc and clang backend compilers. CZString
248// cannot be defined as private. See issue #486
249#ifdef __NVCC__
250public:
251#else
252private:
253#endif
254#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
255 class CZString {
256 public:
257 enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy };
258 CZString(ArrayIndex index);
259 CZString(char const* str, unsigned length, DuplicationPolicy allocate);
260 CZString(CZString const& other);
261 CZString(CZString&& other);
262 ~CZString();
263 CZString& operator=(const CZString& other);
264 CZString& operator=(CZString&& other);
265
266 bool operator<(CZString const& other) const;
267 bool operator==(CZString const& other) const;
268 ArrayIndex index() const;
269 // const char* c_str() const; ///< \deprecated
270 char const* data() const;
271 unsigned length() const;
272 bool isStaticString() const;
273
274 private:
275 void swap(CZString& other);
276
277 struct StringStorage {
278 unsigned policy_ : 2;
279 unsigned length_ : 30; // 1GB max
280 };
281
282 char const* cstr_; // actually, a prefixed string, unless policy is noDup
283 union {
284 ArrayIndex index_;
285 StringStorage storage_;
286 };
287 };
288
289public:
290#ifndef JSON_USE_CPPTL_SMALLMAP
291 typedef std::map<CZString, Value> ObjectValues;
292#else
293 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
294#endif // ifndef JSON_USE_CPPTL_SMALLMAP
295#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
296
297public:
314 Value(ValueType type = nullValue);
315 Value(Int value);
316 Value(UInt value);
317#if defined(JSON_HAS_INT64)
318 Value(Int64 value);
319 Value(UInt64 value);
320#endif // if defined(JSON_HAS_INT64)
321 Value(double value);
322 Value(const char* value);
323 Value(const char* begin, const char* end);
341 Value(const StaticString& value);
342 Value(const String& value);
343#ifdef JSON_USE_CPPTL
344 Value(const CppTL::ConstString& value);
345#endif
346 Value(bool value);
347 Value(const Value& other);
348 Value(Value&& other);
349 ~Value();
350
353 Value& operator=(const Value& other);
354 Value& operator=(Value&& other);
355
357 void swap(Value& other);
359 void swapPayload(Value& other);
360
362 void copy(const Value& other);
364 void copyPayload(const Value& other);
365
366 ValueType type() const;
367
369 bool operator<(const Value& other) const;
370 bool operator<=(const Value& other) const;
371 bool operator>=(const Value& other) const;
372 bool operator>(const Value& other) const;
373 bool operator==(const Value& other) const;
374 bool operator!=(const Value& other) const;
375 int compare(const Value& other) const;
376
377 const char* asCString() const;
378#if JSONCPP_USING_SECURE_MEMORY
379 unsigned getCStringLength() const; // Allows you to understand the length of
380 // the CString
381#endif
382 String asString() const;
386 bool getString(char const** begin, char const** end) const;
387#ifdef JSON_USE_CPPTL
388 CppTL::ConstString asConstString() const;
389#endif
390 Int asInt() const;
391 UInt asUInt() const;
392#if defined(JSON_HAS_INT64)
393 Int64 asInt64() const;
394 UInt64 asUInt64() const;
395#endif // if defined(JSON_HAS_INT64)
396 LargestInt asLargestInt() const;
397 LargestUInt asLargestUInt() const;
398 float asFloat() const;
399 double asDouble() const;
400 bool asBool() const;
401
402 bool isNull() const;
403 bool isBool() const;
404 bool isInt() const;
405 bool isInt64() const;
406 bool isUInt() const;
407 bool isUInt64() const;
408 bool isIntegral() const;
409 bool isDouble() const;
410 bool isNumeric() const;
411 bool isString() const;
412 bool isArray() const;
413 bool isObject() const;
414
416 template <typename T> T as() const = delete;
417 template <typename T> bool is() const = delete;
418
419 bool isConvertibleTo(ValueType other) const;
420
422 ArrayIndex size() const;
423
426 bool empty() const;
427
429 JSONCPP_OP_EXPLICIT operator bool() const;
430
434 void clear();
435
441 void resize(ArrayIndex newSize);
442
444
449 Value& operator[](ArrayIndex index);
450 Value& operator[](int index);
452
454
457 const Value& operator[](ArrayIndex index) const;
458 const Value& operator[](int index) const;
460
463 Value get(ArrayIndex index, const Value& defaultValue) const;
465 bool isValidIndex(ArrayIndex index) const;
469 Value& append(const Value& value);
470 Value& append(Value&& value);
472 bool insert(ArrayIndex index, Value newValue);
473
477 Value& operator[](const char* key);
480 const Value& operator[](const char* key) const;
483 Value& operator[](const String& key);
487 const Value& operator[](const String& key) const;
500 Value& operator[](const StaticString& key);
501#ifdef JSON_USE_CPPTL
503 Value& operator[](const CppTL::ConstString& key);
506 const Value& operator[](const CppTL::ConstString& key) const;
507#endif
510 Value get(const char* key, const Value& defaultValue) const;
514 Value get(const char* begin, const char* end,
515 const Value& defaultValue) const;
519 Value get(const String& key, const Value& defaultValue) const;
520#ifdef JSON_USE_CPPTL
523 Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
524#endif
528 Value const* find(char const* begin, char const* end) const;
532 Value* demand(char const* begin, char const* end);
538 void removeMember(const char* key);
541 void removeMember(const String& key);
544 bool removeMember(const char* key, Value* removed);
551 bool removeMember(String const& key, Value* removed);
553 bool removeMember(const char* begin, const char* end, Value* removed);
560 bool removeIndex(ArrayIndex index, Value* removed);
561
564 bool isMember(const char* key) const;
567 bool isMember(const String& key) const;
569 bool isMember(const char* begin, const char* end) const;
570#ifdef JSON_USE_CPPTL
572 bool isMember(const CppTL::ConstString& key) const;
573#endif
574
580 Members getMemberNames() const;
581
582 //# ifdef JSON_USE_CPPTL
583 // EnumMemberNames enumMemberNames() const;
584 // EnumValues enumValues() const;
585 //# endif
586
588 JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
589 void setComment(const char* comment, CommentPlacement placement) {
590 setComment(String(comment, strlen(comment)), placement);
591 }
593 void setComment(const char* comment, size_t len, CommentPlacement placement) {
594 setComment(String(comment, len), placement);
595 }
597 void setComment(String comment, CommentPlacement placement);
598 bool hasComment(CommentPlacement placement) const;
600 String getComment(CommentPlacement placement) const;
601
602 String toStyledString() const;
603
604 const_iterator begin() const;
605 const_iterator end() const;
606
607 iterator begin();
608 iterator end();
609
610 // Accessors for the [start, limit) range of bytes within the JSON text from
611 // which this value was parsed, if any.
612 void setOffsetStart(ptrdiff_t start);
613 void setOffsetLimit(ptrdiff_t limit);
614 ptrdiff_t getOffsetStart() const;
615 ptrdiff_t getOffsetLimit() const;
616
617private:
618 void setType(ValueType v) {
619 bits_.value_type_ = static_cast<unsigned char>(v);
620 }
621 bool isAllocated() const { return bits_.allocated_; }
622 void setIsAllocated(bool v) { bits_.allocated_ = v; }
623
624 void initBasic(ValueType type, bool allocated = false);
625 void dupPayload(const Value& other);
626 void releasePayload();
627 void dupMeta(const Value& other);
628
629 Value& resolveReference(const char* key);
630 Value& resolveReference(const char* key, const char* end);
631
632 // struct MemberNamesTransform
633 //{
634 // typedef const char *result_type;
635 // const char *operator()( const CZString &name ) const
636 // {
637 // return name.c_str();
638 // }
639 //};
640
641 union ValueHolder {
642 LargestInt int_;
643 LargestUInt uint_;
644 double real_;
645 bool bool_;
646 char* string_; // if allocated_, ptr to { unsigned, char[] }.
647 ObjectValues* map_;
648 } value_;
649
650 struct {
651 // Really a ValueType, but types should agree for bitfield packing.
652 unsigned int value_type_ : 8;
653 // Unless allocated_, string_ must be null-terminated.
654 unsigned int allocated_ : 1;
655 } bits_;
656
657 class Comments {
658 public:
659 Comments() = default;
660 Comments(const Comments& that);
661 Comments(Comments&& that);
662 Comments& operator=(const Comments& that);
663 Comments& operator=(Comments&& that);
664 bool has(CommentPlacement slot) const;
665 String get(CommentPlacement slot) const;
666 void set(CommentPlacement slot, String comment);
667
668 private:
669 using Array = std::array<String, numberOfCommentPlacement>;
670 std::unique_ptr<Array> ptr_;
671 };
672 Comments comments_;
673
674 // [start, limit) byte offsets in the source JSON text from which this Value
675 // was extracted.
676 ptrdiff_t start_;
677 ptrdiff_t limit_;
678};
679
680template <> inline bool Value::as<bool>() const { return asBool(); }
681template <> inline bool Value::is<bool>() const { return isBool(); }
682
683template <> inline Int Value::as<Int>() const { return asInt(); }
684template <> inline bool Value::is<Int>() const { return isInt(); }
685
686template <> inline UInt Value::as<UInt>() const { return asUInt(); }
687template <> inline bool Value::is<UInt>() const { return isUInt(); }
688
689#if defined(JSON_HAS_INT64)
690template <> inline Int64 Value::as<Int64>() const { return asInt64(); }
691template <> inline bool Value::is<Int64>() const { return isInt64(); }
692
693template <> inline UInt64 Value::as<UInt64>() const { return asUInt64(); }
694template <> inline bool Value::is<UInt64>() const { return isUInt64(); }
695#endif
696
697template <> inline double Value::as<double>() const { return asDouble(); }
698template <> inline bool Value::is<double>() const { return isDouble(); }
699
700template <> inline String Value::as<String>() const { return asString(); }
701template <> inline bool Value::is<String>() const { return isString(); }
702
705template <> inline float Value::as<float>() const { return asFloat(); }
706template <> inline const char* Value::as<const char*>() const {
707 return asCString();
708}
709#ifdef JSON_USE_CPPTL
710template <> inline CppTL::ConstString Value::as<CppTL::ConstString>() const {
711 return asConstString();
712}
713#endif
714
719public:
720 friend class Path;
721
724 PathArgument(const char* key);
725 PathArgument(String key);
726
727private:
728 enum Kind { kindNone = 0, kindIndex, kindKey };
729 String key_;
730 ArrayIndex index_{};
731 Kind kind_{kindNone};
732};
733
746public:
747 Path(const String& path, const PathArgument& a1 = PathArgument(),
748 const PathArgument& a2 = PathArgument(),
749 const PathArgument& a3 = PathArgument(),
750 const PathArgument& a4 = PathArgument(),
751 const PathArgument& a5 = PathArgument());
752
753 const Value& resolve(const Value& root) const;
754 Value resolve(const Value& root, const Value& defaultValue) const;
757 Value& make(Value& root) const;
758
759private:
760 typedef std::vector<const PathArgument*> InArgs;
761 typedef std::vector<PathArgument> Args;
762
763 void makePath(const String& path, const InArgs& in);
764 void addPathInArg(const String& path, const InArgs& in,
765 InArgs::const_iterator& itInArg, PathArgument::Kind kind);
766 static void invalidPath(const String& path, int location);
767
768 Args args_;
769};
770
775public:
776 typedef std::bidirectional_iterator_tag iterator_category;
777 typedef unsigned int size_t;
778 typedef int difference_type;
780
781 bool operator==(const SelfType& other) const { return isEqual(other); }
782
783 bool operator!=(const SelfType& other) const { return !isEqual(other); }
784
785 difference_type operator-(const SelfType& other) const {
786 return other.computeDistance(*this);
787 }
788
791 Value key() const;
792
795 UInt index() const;
796
800 String name() const;
801
806 JSONCPP_DEPRECATED("Use `key = name();` instead.")
807 char const* memberName() const;
811 char const* memberName(char const** end) const;
812
813protected:
820 const Value& deref() const;
821 Value& deref();
822
823 void increment();
824
825 void decrement();
826
827 difference_type computeDistance(const SelfType& other) const;
828
829 bool isEqual(const SelfType& other) const;
830
831 void copy(const SelfType& other);
832
833private:
834 Value::ObjectValues::iterator current_;
835 // Indicates that iterator is for a null value.
836 bool isNull_{true};
837
838public:
839 // For some reason, BORLAND needs these at the end, rather
840 // than earlier. No idea why.
842 explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
843};
844
849 friend class Value;
850
851public:
852 typedef const Value value_type;
853 // typedef unsigned int size_t;
854 // typedef int difference_type;
855 typedef const Value& reference;
856 typedef const Value* pointer;
858
860 ValueConstIterator(ValueIterator const& other);
861
862private:
865 explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
866
867public:
868 SelfType& operator=(const ValueIteratorBase& other);
869
871 SelfType temp(*this);
872 ++*this;
873 return temp;
874 }
875
877 SelfType temp(*this);
878 --*this;
879 return temp;
880 }
881
883 decrement();
884 return *this;
885 }
886
888 increment();
889 return *this;
890 }
891
892 reference operator*() const { return deref(); }
893
894 pointer operator->() const { return &deref(); }
895};
896
900 friend class Value;
901
902public:
904 typedef unsigned int size_t;
905 typedef int difference_type;
906 typedef Value& reference;
907 typedef Value* pointer;
909
911 explicit ValueIterator(const ValueConstIterator& other);
913
914private:
917 explicit ValueIterator(const Value::ObjectValues::iterator& current);
918
919public:
920 SelfType& operator=(const SelfType& other);
921
923 SelfType temp(*this);
924 ++*this;
925 return temp;
926 }
927
929 SelfType temp(*this);
930 --*this;
931 return temp;
932 }
933
935 decrement();
936 return *this;
937 }
938
940 increment();
941 return *this;
942 }
943
949 reference operator*() { return deref(); }
950 pointer operator->() { return &deref(); }
951};
952
953inline void swap(Value& a, Value& b) { a.swap(b); }
954
955} // namespace Json
956
957#pragma pack(pop)
958
959#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
960#pragma warning(pop)
961#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
962
963#endif // CPPTL_JSON_H_INCLUDED
Base class for all exceptions we throw.
Definition: value.h:57
~Exception() override
Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
Definition: value.h:84
Experimental and untested: represents an element of the "path" to access a node.
Definition: value.h:718
Experimental and untested: represents a "path" to access a node.
Definition: value.h:745
Exceptions which the user cannot easily avoid.
Definition: value.h:73
Lightweight wrapper to tag static string.
Definition: value.h:142
const char * c_str() const
Definition: value.h:148
StaticString(const char *czstring)
Definition: value.h:144
const iterator for object and array value.
Definition: value.h:848
ValueConstIterator SelfType
Definition: value.h:857
SelfType & operator--()
Definition: value.h:882
pointer operator->() const
Definition: value.h:894
const Value * pointer
Definition: value.h:856
SelfType operator--(int)
Definition: value.h:876
SelfType & operator++()
Definition: value.h:887
const Value value_type
Definition: value.h:852
const Value & reference
Definition: value.h:855
SelfType operator++(int)
Definition: value.h:870
reference operator*() const
Definition: value.h:892
Represents a JSON value.
Definition: value.h:188
Json::UInt UInt
Definition: value.h:195
Json::ArrayIndex ArrayIndex
Definition: value.h:203
Json::Int64 Int64
Definition: value.h:199
Json::LargestInt LargestInt
Definition: value.h:201
static const Value & null
Definition: value.h:210
void setComment(const char *comment, size_t len, CommentPlacement placement)
Comments must be //... or /* ... *‍/.
Definition: value.h:593
T as() const =delete
The as<T> and is<T> member function templates and specializations.
ValueIterator iterator
Definition: value.h:193
std::vector< String > Members
Definition: value.h:192
Json::LargestUInt LargestUInt
Definition: value.h:202
Json::UInt64 UInt64
Definition: value.h:198
std::string value_type
Definition: value.h:206
void swap(Value &other)
Swap everything.
Definition: json_value.cpp:470
static const Value & nullRef
Definition: value.h:211
Json::Int Int
Definition: value.h:196
unsigned int value_type_
Definition: value.h:652
unsigned int allocated_
Definition: value.h:654
bool is() const =delete
ValueConstIterator const_iterator
Definition: value.h:194
base class for Value iterators.
Definition: value.h:774
std::bidirectional_iterator_tag iterator_category
Definition: value.h:776
bool operator==(const SelfType &other) const
Definition: value.h:781
difference_type operator-(const SelfType &other) const
Definition: value.h:785
ValueIteratorBase SelfType
Definition: value.h:779
unsigned int size_t
Definition: value.h:777
bool operator!=(const SelfType &other) const
Definition: value.h:783
difference_type computeDistance(const SelfType &other) const
Iterator for object and array value.
Definition: value.h:899
SelfType operator--(int)
Definition: value.h:928
reference operator*()
Definition: value.h:949
ValueIterator SelfType
Definition: value.h:908
Value value_type
Definition: value.h:903
unsigned int size_t
Definition: value.h:904
SelfType & operator--()
Definition: value.h:934
SelfType & operator++()
Definition: value.h:939
ValueIterator(const ValueIterator &other)
pointer operator->()
Definition: value.h:950
SelfType operator++(int)
Definition: value.h:922
Value * pointer
Definition: value.h:907
Value & reference
Definition: value.h:906
#define JSON_API
If defined, indicates that the source file is amalgamated to prevent private header inclusion.
Definition: config.h:66
#define JSONCPP_OP_EXPLICIT
Definition: config.h:98
#define JSONCPP_DEPRECATED(message)
Definition: config.h:119
#define JSONCPP_NOEXCEPT
Definition: config.h:97
JSON (JavaScript Object Notation).
Definition: allocator.h:14
int Int
Definition: config.h:138
Int64 LargestInt
Definition: config.h:153
std::basic_string< char, std::char_traits< char >, Allocator< char > > String
Definition: config.h:162
CommentPlacement
Definition: value.h:108
@ commentAfterOnSameLine
a comment just after a value on the same line
Definition: value.h:110
@ commentBefore
a comment placed on the line before a value
Definition: value.h:109
@ numberOfCommentPlacement
root value)
Definition: value.h:113
@ commentAfter
a comment on the line after a value (only make sense for
Definition: value.h:111
ValueType
Type of the value held by a Value object.
Definition: value.h:97
@ booleanValue
bool value
Definition: value.h:103
@ nullValue
'null' value
Definition: value.h:98
@ stringValue
UTF-8 string value.
Definition: value.h:102
@ realValue
double value
Definition: value.h:101
@ arrayValue
array value (ordered list)
Definition: value.h:104
@ intValue
signed integer value
Definition: value.h:99
@ objectValue
object value (collection of name/value pairs).
Definition: value.h:105
@ uintValue
unsigned integer value
Definition: value.h:100
unsigned int UInt
Definition: config.h:139
unsigned int ArrayIndex
Definition: forwards.h:29
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:76
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: allocator.h:81
__int64 Int64
Definition: config.h:147
unsigned __int64 UInt64
Definition: config.h:148
UInt64 LargestUInt
Definition: config.h:154
PrecisionType
Type of precision for formatting of real values.
Definition: value.h:118
@ decimalPlaces
we set max number of digits after "." in string
Definition: value.h:120
@ significantDigits
we set max number of significant digits in string
Definition: value.h:119
void swap(Value &a, Value &b)
Definition: value.h:953
#define JSONCPP_NORETURN
Definition: value.h:18