75 #ifndef JSON_AMALGAMATED_H_INCLUDED 76 # define JSON_AMALGAMATED_H_INCLUDED 77 #define JSON_IS_AMALGAMATION 87 #ifndef JSON_VERSION_H_INCLUDED 88 #define JSON_VERSION_H_INCLUDED 90 #define JSONCPP_VERSION_STRING "1.8.4" 91 #define JSONCPP_VERSION_MAJOR 1 92 #define JSONCPP_VERSION_MINOR 8 93 #define JSONCPP_VERSION_PATCH 4 94 #define JSONCPP_VERSION_QUALIFIER 95 #define JSONCPP_VERSION_HEXA \ 96 ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ 97 (JSONCPP_VERSION_PATCH << 8)) 99 #ifdef JSONCPP_USING_SECURE_MEMORY 100 #undef JSONCPP_USING_SECURE_MEMORY 102 #define JSONCPP_USING_SECURE_MEMORY 0 106 #endif // JSON_VERSION_H_INCLUDED 126 #ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED 127 #define CPPTL_JSON_ALLOCATOR_H_INCLUDED 132 #pragma pack(push, 8) 151 return static_cast<pointer>(::operator
new(n *
sizeof(T)));
162 std::memset(p, 0, n *
sizeof(T));
164 ::operator
delete(p);
172 ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
195 template <
typename T,
typename U>
200 template <
typename T,
typename U>
209 #endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED 229 #ifndef JSON_CONFIG_H_INCLUDED 230 #define JSON_CONFIG_H_INCLUDED 238 #include <type_traits> 252 #ifndef JSON_USE_EXCEPTION 253 #define JSON_USE_EXCEPTION 1 262 #include <cpptl/config.h> 263 #ifndef JSON_USE_CPPTL 264 #define JSON_USE_CPPTL 1 269 #define JSON_API CPPTL_API 270 #elif defined(JSON_DLL_BUILD) 271 #if defined(_MSC_VER) || defined(__MINGW32__) 272 #define JSON_API __declspec(dllexport) 273 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 274 #elif defined(__GNUC__) || defined(__clang__) 275 #define JSON_API __attribute__((visibility("default"))) 276 #endif // if defined(_MSC_VER) 277 #elif defined(JSON_DLL) 278 #if defined(_MSC_VER) || defined(__MINGW32__) 279 #define JSON_API __declspec(dllimport) 280 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 281 #endif // if defined(_MSC_VER) 282 #endif // ifdef JSON_IN_CPPTL 283 #if !defined(JSON_API) 287 #if defined(_MSC_VER) && _MSC_VER < 1800 289 "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities" 292 #if defined(_MSC_VER) && _MSC_VER < 1900 296 msvc_pre1900_c99_snprintf(
char* outBuf,
size_t size,
const char* format, ...);
297 #define jsoncpp_snprintf msvc_pre1900_c99_snprintf 299 #define jsoncpp_snprintf std::snprintf 309 #define JSONCPP_OVERRIDE override 311 #if __cplusplus >= 201103L 312 #define JSONCPP_NOEXCEPT noexcept 313 #define JSONCPP_OP_EXPLICIT explicit 314 #elif defined(_MSC_VER) && _MSC_VER < 1900 315 #define JSONCPP_NOEXCEPT throw() 316 #define JSONCPP_OP_EXPLICIT explicit 317 #elif defined(_MSC_VER) && _MSC_VER >= 1900 318 #define JSONCPP_NOEXCEPT noexcept 319 #define JSONCPP_OP_EXPLICIT explicit 321 #define JSONCPP_NOEXCEPT throw() 322 #define JSONCPP_OP_EXPLICIT 326 #if __has_extension(attribute_deprecated_with_message) 327 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) 329 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc) 330 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) 331 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) 332 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) 333 #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) 334 #endif // GNUC version 335 #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates MSVC) 336 #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) 337 #endif // __clang__ || __GNUC__ || _MSC_VER 339 #if !defined(JSONCPP_DEPRECATED) 340 #define JSONCPP_DEPRECATED(message) 341 #endif // if !defined(JSONCPP_DEPRECATED) 344 #define JSON_USE_INT64_DOUBLE_CONVERSION 1 347 #if !defined(JSON_IS_AMALGAMATION) 349 #include "allocator.h" 352 #endif // if !defined(JSON_IS_AMALGAMATION) 356 typedef unsigned int UInt;
357 #if defined(JSON_NO_INT64) 360 #undef JSON_HAS_INT64 361 #else // if defined(JSON_NO_INT64) 363 #if defined(_MSC_VER) // Microsoft Visual Studio 364 typedef __int64
Int64;
365 typedef unsigned __int64
UInt64;
366 #else // if defined(_MSC_VER) // Other platforms, use long long 367 typedef int64_t
Int64;
369 #endif // if defined(_MSC_VER) 372 #define JSON_HAS_INT64 373 #endif // if defined(JSON_NO_INT64) 375 template <
typename T>
378 std::allocator<T>>::type;
379 using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
380 using IStringStream = std::basic_istringstream<String::value_type,
382 String::allocator_type>;
383 using OStringStream = std::basic_ostringstream<String::value_type,
385 String::allocator_type>;
397 #endif // JSON_CONFIG_H_INCLUDED 417 #ifndef JSON_FORWARDS_H_INCLUDED 418 #define JSON_FORWARDS_H_INCLUDED 420 #if !defined(JSON_IS_AMALGAMATION) 422 #endif // if !defined(JSON_IS_AMALGAMATION) 442 class ValueIteratorBase;
444 class ValueConstIterator;
448 #endif // JSON_FORWARDS_H_INCLUDED 468 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED 469 #define CPPTL_JSON_FEATURES_H_INCLUDED 471 #if !defined(JSON_IS_AMALGAMATION) 472 #include "forwards.h" 473 #endif // if !defined(JSON_IS_AMALGAMATION) 475 #pragma pack(push, 8) 506 bool allowComments_{
true};
510 bool strictRoot_{
false};
513 bool allowDroppedNullPlaceholders_{
false};
516 bool allowNumericKeys_{
false};
523 #endif // CPPTL_JSON_FEATURES_H_INCLUDED 543 #ifndef CPPTL_JSON_H_INCLUDED 544 #define CPPTL_JSON_H_INCLUDED 546 #if !defined(JSON_IS_AMALGAMATION) 547 #include "forwards.h" 548 #endif // if !defined(JSON_IS_AMALGAMATION) 555 #ifndef JSON_USE_CPPTL_SMALLMAP 558 #include <cpptl/smallmap.h> 560 #ifdef JSON_USE_CPPTL 561 #include <cpptl/forwards.h> 567 #if !defined(JSONCPP_NORETURN) 568 #if defined(_MSC_VER) 569 #define JSONCPP_NORETURN __declspec(noreturn) 570 #elif defined(__GNUC__) 571 #define JSONCPP_NORETURN __attribute__((__noreturn__)) 573 #define JSONCPP_NORETURN 579 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 580 #pragma warning(push) 581 #pragma warning(disable : 4251) 582 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 584 #pragma pack(push, 8) 682 operator const char*()
const {
return c_str_; }
684 const char*
c_str()
const {
return c_str_; }
733 #if defined(JSON_HAS_INT64) 736 #endif // defined(JSON_HAS_INT64) 745 static const Value& nullRef;
747 static Value const& nullSingleton();
764 #if defined(JSON_HAS_INT64) 765 static const Int64 minInt64;
771 #endif // defined(JSON_HAS_INT64) 784 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 787 enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy };
788 CZString(ArrayIndex index);
789 CZString(
char const* str,
unsigned length, DuplicationPolicy
allocate);
790 CZString(CZString
const&
other);
791 CZString(CZString&& other);
793 CZString& operator=(
const CZString& other);
794 CZString& operator=(CZString&& other);
796 bool operator<(CZString
const& other)
const;
798 ArrayIndex index()
const;
800 char const* data()
const;
801 unsigned length()
const;
802 bool isStaticString()
const;
805 void swap(CZString& other);
807 struct StringStorage {
808 unsigned policy_ : 2;
809 unsigned length_ : 30;
815 StringStorage storage_;
820 #ifndef JSON_USE_CPPTL_SMALLMAP 823 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
824 #endif // ifndef JSON_USE_CPPTL_SMALLMAP 825 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 846 #if defined(JSON_HAS_INT64) 849 #endif // if defined(JSON_HAS_INT64) 851 Value(
const char* value);
852 Value(
const char* begin,
const char* end);
870 #ifdef JSON_USE_CPPTL 872 Value(
const CppTL::ConstString& value);
905 const char* asCString()
const;
906 #if JSONCPP_USING_SECURE_MEMORY 907 unsigned getCStringLength()
const;
914 bool getString(
char const** begin,
char const** end)
const;
915 #ifdef JSON_USE_CPPTL 916 CppTL::ConstString asConstString()
const;
920 #if defined(JSON_HAS_INT64) 921 Int64 asInt64()
const;
922 UInt64 asUInt64()
const;
923 #endif // if defined(JSON_HAS_INT64) 924 LargestInt asLargestInt()
const;
925 LargestUInt asLargestUInt()
const;
926 float asFloat()
const;
927 double asDouble()
const;
933 bool isInt64()
const;
935 bool isUInt64()
const;
936 bool isIntegral()
const;
937 bool isDouble()
const;
938 bool isNumeric()
const;
939 bool isString()
const;
940 bool isArray()
const;
941 bool isObject()
const;
946 ArrayIndex size()
const;
965 void resize(ArrayIndex newSize);
973 Value& operator[](ArrayIndex index);
981 Value& operator[](
int index);
986 const Value& operator[](ArrayIndex index)
const;
991 const Value& operator[](
int index)
const;
996 Value get(ArrayIndex index,
const Value& defaultValue)
const;
998 bool isValidIndex(ArrayIndex index)
const;
1008 Value& operator[](
const char* key);
1011 const Value& operator[](
const char* key)
const;
1033 #ifdef JSON_USE_CPPTL 1034 Value& operator[](
const CppTL::ConstString& key);
1038 const Value& operator[](
const CppTL::ConstString& key)
const;
1040 Value get(
const char* key,
const Value& defaultValue)
const;
1047 get(
const char* begin,
const char* end,
const Value& defaultValue)
const;
1052 #ifdef JSON_USE_CPPTL 1053 Value get(
const CppTL::ConstString& key,
const Value& defaultValue)
const;
1057 Value const* find(
char const* begin,
char const* end)
const;
1064 Value* demand(
char const* begin,
char const* end);
1070 void removeMember(
const char* key);
1073 void removeMember(
const String& key);
1076 bool removeMember(
const char* key,
Value* removed);
1083 bool removeMember(
String const& key,
Value* removed);
1085 bool removeMember(
const char* begin,
const char* end,
Value* removed);
1092 bool removeIndex(ArrayIndex index,
Value* removed);
1096 bool isMember(
const char* key)
const;
1099 bool isMember(
const String& key)
const;
1101 bool isMember(
const char* begin,
const char* end)
const;
1102 #ifdef JSON_USE_CPPTL 1103 bool isMember(
const CppTL::ConstString& key)
const;
1112 Members getMemberNames()
const;
1122 setComment(
String(comment, strlen(comment)), placement);
1126 setComment(
String(comment, len), placement);
1134 String toStyledString()
const;
1136 const_iterator begin()
const;
1137 const_iterator end()
const;
1144 void setOffsetStart(ptrdiff_t start);
1145 void setOffsetLimit(ptrdiff_t limit);
1146 ptrdiff_t getOffsetStart()
const;
1147 ptrdiff_t getOffsetLimit()
const;
1150 void setType(
ValueType v) { bits_.value_type_ =
static_cast<unsigned char> (v); }
1151 bool isAllocated()
const {
return bits_.allocated_; }
1152 void setIsAllocated(
bool v) { bits_.allocated_ = v; }
1154 void initBasic(
ValueType type,
bool allocated =
false);
1156 void releasePayload();
1157 void dupMeta(
const Value& other);
1159 Value& resolveReference(
const char* key);
1160 Value& resolveReference(
const char* key,
const char* end);
1182 unsigned int value_type_ : 8;
1184 unsigned int allocated_ : 1;
1189 Comments() =
default;
1190 Comments(
const Comments& that);
1191 Comments(Comments&& that);
1192 Comments& operator=(
const Comments& that);
1193 Comments& operator=(Comments&& that);
1199 using Array = std::array<String, numberOfCommentPlacement>;
1200 std::unique_ptr<Array> ptr_;
1223 enum Kind { kindNone = 0, kindIndex, kindKey };
1226 Kind kind_{kindNone};
1249 const Value& resolve(
const Value& root)
const;
1256 typedef std::vector<const PathArgument*> InArgs;
1257 typedef std::vector<PathArgument> Args;
1259 void makePath(
const String& path,
const InArgs& in);
1260 void addPathInArg(
const String& path,
1262 InArgs::const_iterator& itInArg,
1263 PathArgument::Kind kind);
1264 static void invalidPath(
const String& path,
int location);
1305 char const* memberName()
const;
1309 char const* memberName(
char const** end)
const;
1312 Value& deref()
const;
1318 difference_type computeDistance(
const SelfType&
other)
const;
1320 bool isEqual(
const SelfType& other)
const;
1322 void copy(
const SelfType& other);
1325 Value::ObjectValues::iterator current_;
1362 SelfType temp(*
this);
1368 SelfType temp(*
this);
1408 explicit ValueIterator(
const Value::ObjectValues::iterator& current);
1411 SelfType& operator=(
const SelfType&
other);
1414 SelfType temp(*
this);
1420 SelfType temp(*
this);
1446 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1447 #pragma warning(pop) 1448 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1450 #endif // CPPTL_JSON_H_INCLUDED 1470 #ifndef CPPTL_JSON_READER_H_INCLUDED 1471 #define CPPTL_JSON_READER_H_INCLUDED 1473 #if !defined(JSON_IS_AMALGAMATION) 1474 #include "features.h" 1476 #endif // if !defined(JSON_IS_AMALGAMATION) 1485 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1486 #pragma warning(push) 1487 #pragma warning(disable : 4251) 1488 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1490 #pragma pack(push, 8) 1543 parse(const
std::
string& document,
Value& root,
bool collectComments = true);
1563 bool parse(const
char* beginDoc,
1566 bool collectComments = true);
1570 bool parse(
IStream& is,
Value& root,
bool collectComments = true);
1582 String getFormatedErrorMessages() const;
1592 String getFormattedErrorMessages() const;
1609 bool pushError(const
Value& value, const
String& message);
1618 bool pushError(const
Value& value, const
String& message, const
Value& extra);
1628 tokenEndOfStream = 0,
1638 tokenArraySeparator,
1639 tokenMemberSeparator,
1658 typedef std::deque<ErrorInfo> Errors;
1660 bool readToken(Token& token);
1662 bool match(Location pattern,
int patternLength);
1664 bool readCStyleComment();
1665 bool readCppStyleComment();
1669 bool readObject(Token& token);
1670 bool readArray(Token& token);
1671 bool decodeNumber(Token& token);
1672 bool decodeNumber(Token& token,
Value& decoded);
1673 bool decodeString(Token& token);
1674 bool decodeString(Token& token,
String& decoded);
1675 bool decodeDouble(Token& token);
1676 bool decodeDouble(Token& token,
Value& decoded);
1677 bool decodeUnicodeCodePoint(Token& token,
1680 unsigned int& unicode);
1681 bool decodeUnicodeEscapeSequence(Token& token,
1684 unsigned int& unicode);
1685 bool addError(
const String& message, Token& token, Location extra =
nullptr);
1686 bool recoverFromError(TokenType skipUntilToken);
1687 bool addErrorAndRecover(
const String& message,
1689 TokenType skipUntilToken);
1690 void skipUntilSpace();
1691 Value& currentValue();
1694 getLocationLineAndColumn(Location location,
int& line,
int& column)
const;
1695 String getLocationLineAndColumn(Location location)
const;
1697 void skipCommentTokens(Token& token);
1699 static bool containsNewLine(Location begin, Location end);
1700 static String normalizeEOL(Location begin, Location end);
1702 typedef std::stack<Value*> Nodes;
1708 Location current_{};
1709 Location lastValueEnd_{};
1710 Value* lastValue_{};
1713 bool collectComments_{};
1739 virtual bool parse(
char const* beginDoc,
1750 virtual CharReader* newCharReader()
const = 0;
1877 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1878 #pragma warning(pop) 1879 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1881 #endif // CPPTL_JSON_READER_H_INCLUDED 1901 #ifndef JSON_WRITER_H_INCLUDED 1902 #define JSON_WRITER_H_INCLUDED 1904 #if !defined(JSON_IS_AMALGAMATION) 1906 #endif // if !defined(JSON_IS_AMALGAMATION) 1913 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER) 1914 #pragma warning(push) 1915 #pragma warning(disable : 4251) 1916 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1918 #pragma pack(push, 8) 1949 virtual int write(
Value const& root,
OStream* sout) = 0;
2059 #if defined(_MSC_VER) 2060 #pragma warning(push) 2061 #pragma warning(disable : 4996) // Deriving from deprecated class 2069 void enableYAMLCompatibility();
2076 void dropNullPlaceholders();
2078 void omitEndingLineFeed();
2084 void writeValue(
const Value& value);
2087 bool yamlCompatibilityEnabled_{
false};
2088 bool dropNullPlaceholders_{
false};
2089 bool omitEndingLineFeed_{
false};
2091 #if defined(_MSC_VER) 2092 #pragma warning(pop) 2119 #if defined(_MSC_VER) 2120 #pragma warning(push) 2121 #pragma warning(disable : 4996) // Deriving from deprecated class 2137 void writeValue(
const Value& value);
2138 void writeArrayValue(
const Value& value);
2139 bool isMultilineArray(
const Value& value);
2140 void pushValue(
const String& value);
2142 void writeWithIndent(
const String& value);
2145 void writeCommentBeforeValue(
const Value& root);
2146 void writeCommentAfterValueOnSameLine(
const Value& root);
2147 static bool hasCommentForValue(
const Value& value);
2150 typedef std::vector<String> ChildValues;
2152 ChildValues childValues_;
2155 unsigned int rightMargin_{74};
2156 unsigned int indentSize_{3};
2157 bool addChildValues_{
false};
2159 #if defined(_MSC_VER) 2160 #pragma warning(pop) 2188 #if defined(_MSC_VER) 2189 #pragma warning(push) 2190 #pragma warning(disable : 4996) // Deriving from deprecated class 2211 void writeValue(
const Value& value);
2212 void writeArrayValue(
const Value& value);
2213 bool isMultilineArray(
const Value& value);
2214 void pushValue(
const String& value);
2216 void writeWithIndent(
const String& value);
2219 void writeCommentBeforeValue(
const Value& root);
2220 void writeCommentAfterValueOnSameLine(
const Value& root);
2221 static bool hasCommentForValue(
const Value& value);
2224 typedef std::vector<String> ChildValues;
2226 ChildValues childValues_;
2229 unsigned int rightMargin_{74};
2231 bool addChildValues_ : 1;
2234 #if defined(_MSC_VER) 2235 #pragma warning(pop) 2238 #if defined(JSON_HAS_INT64) 2241 #endif // if defined(JSON_HAS_INT64) 2259 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 2260 #pragma warning(pop) 2261 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 2263 #endif // JSON_WRITER_H_INCLUDED 2283 #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED 2284 #define CPPTL_JSON_ASSERTIONS_H_INCLUDED 2289 #if !defined(JSON_IS_AMALGAMATION) 2291 #endif // if !defined(JSON_IS_AMALGAMATION) 2297 #if JSON_USE_EXCEPTION 2300 #define JSON_ASSERT(condition) \ 2302 if (!(condition)) { \ 2303 Json::throwLogicError("assert json failed"); \ 2307 #define JSON_FAIL_MESSAGE(message) \ 2309 OStringStream oss; \ 2311 Json::throwLogicError(oss.str()); \ 2315 #else // JSON_USE_EXCEPTION 2317 #define JSON_ASSERT(condition) assert(condition) 2321 #define JSON_FAIL_MESSAGE(message) \ 2323 OStringStream oss; \ 2325 assert(false && oss.str().c_str()); \ 2331 #define JSON_ASSERT_MESSAGE(condition, message) \ 2332 if (!(condition)) { \ 2333 JSON_FAIL_MESSAGE(message); \ 2336 #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED 2346 #endif //ifndef JSON_AMALGAMATED_H_INCLUDED
void construct(pointer p, Args &&...args)
Definition: json.h:170
String msg_
Definition: json.h:601
T * pointer
Definition: json.h:139
unsigned int UInt
Definition: json-forwards.h:218
unsigned integer value
Definition: json.h:636
double value
Definition: json.h:637
Json::Value settings_
Definition: json.h:1808
static const Value & null
Definition: json.h:744
#define JSONCPP_NORETURN
Definition: json.h:573
ValueIterator iterator
Definition: json.h:729
int difference_type
Definition: json.h:1276
SelfType operator--(int)
Definition: json.h:1367
#define JSON_API
Definition: json.h:284
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string...
Definition: json.h:2192
pointer allocate(size_type n)
Definition: json.h:149
Json::LargestInt LargestInt
Definition: json.h:737
signed integer value
Definition: json.h:635
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: json.h:755
ptrdiff_t offset_start
Definition: json.h:1511
char Char
Definition: json.h:1501
UInt64 LargestUInt
Definition: json-forwards.h:233
pointer operator->() const
Definition: json.h:1437
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
Definition: json.h:751
Json::IStream JSONCPP_ISTREAM
Definition: json-forwards.h:256
void destroy(pointer p)
Definition: json.h:184
Json::Int Int
Definition: json.h:732
Experimental and untested: represents an element of the "path" to access a node.
Definition: json.h:1213
Json::ArrayIndex ArrayIndex
Definition: json.h:739
SelfType & operator++()
Definition: json.h:1378
bool parseFromStream(CharReader::Factory const &, IStream &, Value *root, std::string *errs)
Lightweight wrapper to tag static string.
Definition: json.h:678
ValueConstIterator const_iterator
Definition: json.h:730
const T & const_reference
Definition: json.h:142
unsigned int ArrayIndex
Definition: json-forwards.h:296
const Value & reference
Definition: json.h:1346
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Definition: json.h:762
Represents a JSON value.
Definition: json.h:724
Json::Int64 Int64
Definition: json.h:735
std::basic_istringstream< String::value_type, String::traits_type, String::allocator_type > IStringStream
Definition: json-forwards.h:244
const char * c_str() const
Definition: json.h:684
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
Definition: json.h:483
Json::Value settings_
Definition: json.h:2014
const_pointer address(const_reference x) const
Definition: json.h:179
a comment placed on the line before a value
Definition: json.h:645
String writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience. A StreamWriter will be created from the...
Definition: jsoncpp.cpp:5383
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Definition: json.h:770
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Definition: json.h:768
difference_type operator-(const SelfType &other) const
Definition: json.h:1283
Outputs a Value in JSON format without formatting (not human friendly).
Definition: json.h:2063
Json::IStringStream JSONCPP_ISTRINGSTREAM
Definition: json-forwards.h:254
SelfType & operator--()
Definition: json.h:1425
int difference_type
Definition: json.h:1396
void throwRuntimeError(String const &msg)
used internally
Definition: jsoncpp.cpp:2663
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: json.h:758
#define JSONCPP_USING_SECURE_MEMORY
Definition: json.h:102
reference operator*() const
Definition: json.h:1435
Int64 LargestInt
Definition: json-forwards.h:232
difference_type computeDistance(const SelfType &other) const
Definition: jsoncpp.cpp:2287
std::map< CZString, Value > ObjectValues
Definition: json.h:821
PrecisionType
Type of precision for formatting of real values.
Definition: json.h:654
An error tagged with where in the JSON text it was encountered.
Definition: json.h:1510
Abstract class for writers.
Definition: json.h:2043
Json::OStringStream JSONCPP_OSTRINGSTREAM
Definition: json-forwards.h:255
ValueConstIterator SelfType
Definition: json.h:1348
Json::UInt UInt
Definition: json.h:731
String valueToQuotedString(const char *value)
Definition: jsoncpp.cpp:4483
object value (collection of name/value pairs).
Definition: json.h:641
bool value
Definition: json.h:639
Json::LargestUInt LargestUInt
Definition: json.h:738
Build a CharReader implementation.
Definition: json.h:1766
SelfType operator--(int)
Definition: json.h:1419
const T * const_pointer
Definition: json.h:140
void swap(Value &other)
Swap everything.
Definition: jsoncpp.cpp:2920
ValueType
Type of the value held by a Value object.
Definition: json.h:633
static const UInt defaultRealPrecision
Default precision for real value for string representation.
Definition: json.h:774
T & reference
Definition: json.h:141
root value)
Definition: json.h:649
void deallocate(volatile pointer p, size_type n)
Definition: json.h:161
JSON (JavaScript Object Notation).
Definition: json-forwards.h:216
ValueIteratorBase SelfType
Definition: json.h:1277
a comment just after a value on the same line
Definition: json.h:646
SecureAllocator< U > other
Definition: json.h:192
we set max number of digits after "." in string
Definition: json.h:656
Json::UInt64 UInt64
Definition: json.h:734
SelfType & operator++()
Definition: json.h:1430
base class for Value iterators.
Definition: json.h:1272
Value value_type
Definition: json.h:1394
bool operator==(const SelfType &other) const
Definition: json.h:1279
std::string value_type
Definition: json.h:742
CommentPlacement
Definition: json.h:644
void swap(Value &a, Value &b)
Definition: json.h:1440
typename std::conditional< JSONCPP_USING_SECURE_MEMORY, SecureAllocator< T >, std::allocator< T >>::type Allocator
Definition: json-forwards.h:240
const Value value_type
Definition: json.h:1343
std::size_t size_type
Definition: json.h:143
int Int
Definition: json-forwards.h:217
IStream & operator>>(IStream &, Value &)
Read from 'sin' into 'root'.
Definition: jsoncpp.cpp:2232
Value * pointer
Definition: json.h:1398
Json::String JSONCPP_STRING
Definition: json-forwards.h:253
'null' value
Definition: json.h:634
std::ostream OStream
Definition: json-forwards.h:249
pointer operator->() const
Definition: json.h:1385
ptrdiff_t offset_limit
Definition: json.h:1512
bool operator!=(const SelfType &other) const
Definition: json.h:1281
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: json.h:201
SelfType & operator--()
Definition: json.h:1373
pointer address(reference x) const
Definition: json.h:177
OStream * sout_
Definition: json.h:1939
UTF-8 string value.
Definition: json.h:638
SelfType operator++(int)
Definition: json.h:1413
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
Definition: json.h:760
#define JSONCPP_NOEXCEPT
Definition: json.h:321
String valueToString(Int value)
unsigned int size_t
Definition: json.h:1275
A simple abstract factory.
Definition: json.h:1953
StaticString(const char *czstring)
Definition: json.h:680
std::istream IStream
Definition: json-forwards.h:248
Unserialize a JSON document into a Value.
Definition: json.h:1499
SelfType operator++(int)
Definition: json.h:1361
std::basic_ostringstream< String::value_type, String::traits_type, String::allocator_type > OStringStream
Definition: json-forwards.h:247
uint64_t UInt64
Definition: json-forwards.h:230
std::basic_string< char, std::char_traits< char >, Allocator< char >> String
Definition: json-forwards.h:241
void throwLogicError(String const &msg)
used internally
Definition: jsoncpp.cpp:2666
T value_type
Definition: json.h:138
String message
Definition: json.h:1513
ValueIterator SelfType
Definition: json.h:1399
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: json.h:753
OStream & operator<<(OStream &, const Value &root)
Output using the StyledStreamWriter.
Definition: jsoncpp.cpp:5390
std::bidirectional_iterator_tag iterator_category
Definition: json.h:1274
Build a StreamWriter implementation.
Definition: json.h:1984
Iterator for object and array value.
Definition: json.h:1390
Json::OStream JSONCPP_OSTREAM
Definition: json-forwards.h:257
const Char * Location
Definition: json.h:1502
reference operator*() const
Definition: json.h:1383
we set max number of significant digits in string
Definition: json.h:655
std::vector< String > Members
Definition: json.h:728
Writes a Value in JSON format in a human friendly way.
Definition: json.h:2123
std::ptrdiff_t difference_type
Definition: json.h:144
Experimental and untested: represents a "path" to access a node.
Definition: json.h:1240
SecureAllocator()
Definition: json.h:190
size_type max_size() const
Definition: json.h:175
void setComment(const char *comment, size_t len, CommentPlacement placement)
Comments must be //... or /* ... */.
Definition: json.h:1125
const iterator for object and array value.
Definition: json.h:1339
#define JSONCPP_OP_EXPLICIT
Definition: json.h:322
const Value * pointer
Definition: json.h:1347
#define JSONCPP_DEPRECATED(message)
Definition: json.h:340
unsigned int size_t
Definition: json.h:1395
array value (ordered list)
Definition: json.h:640
int64_t Int64
Definition: json-forwards.h:229
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
Definition: json.h:196
Value & reference
Definition: json.h:1397
SecureAllocator(const SecureAllocator< U > &)
Definition: json.h:191