genericIO
json.h
1 
4 // //////////////////////////////////////////////////////////////////////
5 // Beginning of content of file: LICENSE
6 // //////////////////////////////////////////////////////////////////////
7 
8 /*
9 The JsonCpp library's source code, including accompanying documentation,
10 tests and demonstration applications, are licensed under the following
11 conditions...
12 
13 The author (Baptiste Lepilleur) explicitly disclaims copyright in all
14 jurisdictions which recognize such a disclaimer. In such jurisdictions,
15 this software is released into the Public Domain.
16 
17 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
18 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
19 released under the terms of the MIT License (see below).
20 
21 In jurisdictions which recognize Public Domain property, the user of this
22 software may choose to accept it either as 1) Public Domain, 2) under the
23 conditions of the MIT License (see below), or 3) under the terms of dual
24 Public Domain/MIT License conditions described here, as they choose.
25 
26 The MIT License is about as close to Public Domain as a license can get, and is
27 described in clear, concise terms at:
28 
29  http://en.wikipedia.org/wiki/MIT_License
30 
31 The full text of the MIT License follows:
32 
33 ========================================================================
34 Copyright (c) 2007-2010 Baptiste Lepilleur
35 
36 Permission is hereby granted, free of charge, to any person
37 obtaining a copy of this software and associated documentation
38 files (the "Software"), to deal in the Software without
39 restriction, including without limitation the rights to use, copy,
40 modify, merge, publish, distribute, sublicense, and/or sell copies
41 of the Software, and to permit persons to whom the Software is
42 furnished to do so, subject to the following conditions:
43 
44 The above copyright notice and this permission notice shall be
45 included in all copies or substantial portions of the Software.
46 
47 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
48 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
50 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
51 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
52 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
53 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54 SOFTWARE.
55 ========================================================================
56 (END LICENSE TEXT)
57 
58 The MIT license is compatible with both the GPL and commercial
59 software, affording one all of the rights of Public Domain with the
60 minor nuisance of being required to keep the above copyright notice
61 and license text in the source code. Note also that by accepting the
62 Public Domain "license" you can re-license your copy using whatever
63 license you like.
64 
65 */
66 
67 // //////////////////////////////////////////////////////////////////////
68 // End of content of file: LICENSE
69 // //////////////////////////////////////////////////////////////////////
70 
71 
72 
73 
74 
75 #ifndef JSON_AMALGATED_H_INCLUDED
76 # define JSON_AMALGATED_H_INCLUDED
77 #define JSON_IS_AMALGAMATION
80 
81 // //////////////////////////////////////////////////////////////////////
82 // Beginning of content of file: include/json/version.h
83 // //////////////////////////////////////////////////////////////////////
84 
85 // DO NOT EDIT. This file (and "version") is generated by CMake.
86 // Run CMake configure step to update it.
87 #ifndef JSON_VERSION_H_INCLUDED
88 # define JSON_VERSION_H_INCLUDED
89 
90 # define JSONCPP_VERSION_STRING "1.7.0"
91 # define JSONCPP_VERSION_MAJOR 1
92 # define JSONCPP_VERSION_MINOR 7
93 # define JSONCPP_VERSION_PATCH 0
94 # define JSONCPP_VERSION_QUALIFIER
95 # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
96 
97 #endif // JSON_VERSION_H_INCLUDED
98 
99 // //////////////////////////////////////////////////////////////////////
100 // End of content of file: include/json/version.h
101 // //////////////////////////////////////////////////////////////////////
102 
103 
104 
105 
106 
107 
108 // //////////////////////////////////////////////////////////////////////
109 // Beginning of content of file: include/json/config.h
110 // //////////////////////////////////////////////////////////////////////
111 
112 // Copyright 2007-2010 Baptiste Lepilleur
113 // Distributed under MIT license, or public domain if desired and
114 // recognized in your jurisdiction.
115 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
116 
117 #ifndef JSON_CONFIG_H_INCLUDED
118 #define JSON_CONFIG_H_INCLUDED
119 #include <stddef.h>
120 
122 //# define JSON_IN_CPPTL 1
123 
125 //# define JSON_USE_CPPTL 1
129 //# define JSON_USE_CPPTL_SMALLMAP 1
130 
131 // If non-zero, the library uses exceptions to report bad input instead of C
132 // assertion macros. The default is to use exceptions.
133 #ifndef JSON_USE_EXCEPTION
134 #define JSON_USE_EXCEPTION 1
135 #endif
136 
140 // #define JSON_IS_AMALGAMATION
141 
142 #ifdef JSON_IN_CPPTL
143 #include <cpptl/config.h>
144 #ifndef JSON_USE_CPPTL
145 #define JSON_USE_CPPTL 1
146 #endif
147 #endif
148 
149 #ifdef JSON_IN_CPPTL
150 #define JSON_API CPPTL_API
151 #elif defined(JSON_DLL_BUILD)
152 #if defined(_MSC_VER)
153 #define JSON_API __declspec(dllexport)
154 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
155 #endif // if defined(_MSC_VER)
156 #elif defined(JSON_DLL)
157 #if defined(_MSC_VER)
158 #define JSON_API __declspec(dllimport)
159 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
160 #endif // if defined(_MSC_VER)
161 #endif // ifdef JSON_IN_CPPTL
162 #if !defined(JSON_API)
163 #define JSON_API
164 #endif
165 
166 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
167 // integer
168 // Storages, and 64 bits integer support is disabled.
169 // #define JSON_NO_INT64 1
170 
171 #if defined(_MSC_VER) // MSVC
172 # if _MSC_VER <= 1200 // MSVC 6
173  // Microsoft Visual Studio 6 only support conversion from __int64 to double
174  // (no conversion from unsigned __int64).
175 # define JSON_USE_INT64_DOUBLE_CONVERSION 1
176  // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
177  // characters in the debug information)
178  // All projects I've ever seen with VS6 were using this globally (not bothering
179  // with pragma push/pop).
180 # pragma warning(disable : 4786)
181 # endif // MSVC 6
182 
183 # if _MSC_VER >= 1500 // MSVC 2008
184 # define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
186 # endif
187 
188 #endif // defined(_MSC_VER)
189 
190 
191 #ifndef JSON_HAS_RVALUE_REFERENCES
192 
193 #if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
194 #define JSON_HAS_RVALUE_REFERENCES 1
195 #endif // MSVC >= 2010
196 
197 #ifdef __clang__
198 #if __has_feature(cxx_rvalue_references)
199 #define JSON_HAS_RVALUE_REFERENCES 1
200 #endif // has_feature
201 
202 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
203 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
204 #define JSON_HAS_RVALUE_REFERENCES 1
205 #endif // GXX_EXPERIMENTAL
206 
207 #endif // __clang__ || __GNUC__
208 
209 #endif // not defined JSON_HAS_RVALUE_REFERENCES
210 
211 #ifndef JSON_HAS_RVALUE_REFERENCES
212 #define JSON_HAS_RVALUE_REFERENCES 0
213 #endif
214 
215 #ifdef __clang__
216 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
217 # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
218 # define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
219 # elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
220 # define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
221 # endif // GNUC version
222 #endif // __clang__ || __GNUC__
223 
224 #if !defined(JSONCPP_DEPRECATED)
225 #define JSONCPP_DEPRECATED(message)
226 #endif // if !defined(JSONCPP_DEPRECATED)
227 
228 #if __GNUC__ >= 6
229 # define JSON_USE_INT64_DOUBLE_CONVERSION 1
230 #endif
231 
232 namespace Json {
233 typedef int Int;
234 typedef unsigned int UInt;
235 #if defined(JSON_NO_INT64)
236 typedef int LargestInt;
237 typedef unsigned int LargestUInt;
238 #undef JSON_HAS_INT64
239 #else // if defined(JSON_NO_INT64)
240 // For Microsoft Visual use specific types as long long is not supported
241 #if defined(_MSC_VER) // Microsoft Visual Studio
242 typedef __int64 Int64;
243 typedef unsigned __int64 UInt64;
244 #else // if defined(_MSC_VER) // Other platforms, use long long
245 typedef long long int Int64;
246 typedef unsigned long long int UInt64;
247 #endif // if defined(_MSC_VER)
248 typedef Int64 LargestInt;
249 typedef UInt64 LargestUInt;
250 #define JSON_HAS_INT64
251 #endif // if defined(JSON_NO_INT64)
252 } // end namespace Json
253 
254 #endif // JSON_CONFIG_H_INCLUDED
255 
256 // //////////////////////////////////////////////////////////////////////
257 // End of content of file: include/json/config.h
258 // //////////////////////////////////////////////////////////////////////
259 
260 
261 
262 
263 
264 
265 // //////////////////////////////////////////////////////////////////////
266 // Beginning of content of file: include/json/forwards.h
267 // //////////////////////////////////////////////////////////////////////
268 
269 // Copyright 2007-2010 Baptiste Lepilleur
270 // Distributed under MIT license, or public domain if desired and
271 // recognized in your jurisdiction.
272 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
273 
274 #ifndef JSON_FORWARDS_H_INCLUDED
275 #define JSON_FORWARDS_H_INCLUDED
276 
277 #if !defined(JSON_IS_AMALGAMATION)
278 #include "config.h"
279 #endif // if !defined(JSON_IS_AMALGAMATION)
280 
281 namespace Json {
282 
283 // writer.h
284 class FastWriter;
285 class StyledWriter;
286 
287 // reader.h
288 class Reader;
289 
290 // features.h
291 class Features;
292 
293 // value.h
294 typedef unsigned int ArrayIndex;
295 class StaticString;
296 class Path;
297 class PathArgument;
298 class Value;
299 class ValueIteratorBase;
300 class ValueIterator;
301 class ValueConstIterator;
302 
303 } // namespace Json
304 
305 #endif // JSON_FORWARDS_H_INCLUDED
306 
307 // //////////////////////////////////////////////////////////////////////
308 // End of content of file: include/json/forwards.h
309 // //////////////////////////////////////////////////////////////////////
310 
311 
312 
313 
314 
315 
316 // //////////////////////////////////////////////////////////////////////
317 // Beginning of content of file: include/json/features.h
318 // //////////////////////////////////////////////////////////////////////
319 
320 // Copyright 2007-2010 Baptiste Lepilleur
321 // Distributed under MIT license, or public domain if desired and
322 // recognized in your jurisdiction.
323 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
324 
325 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
326 #define CPPTL_JSON_FEATURES_H_INCLUDED
327 
328 #if !defined(JSON_IS_AMALGAMATION)
329 #include "forwards.h"
330 #endif // if !defined(JSON_IS_AMALGAMATION)
331 
332 namespace Json {
333 
338 class JSON_API Features {
339 public:
346  static Features all();
347 
354  static Features strictMode();
355 
358  Features();
359 
362 
366 
369 
372 };
373 
374 } // namespace Json
375 
376 #endif // CPPTL_JSON_FEATURES_H_INCLUDED
377 
378 // //////////////////////////////////////////////////////////////////////
379 // End of content of file: include/json/features.h
380 // //////////////////////////////////////////////////////////////////////
381 
382 
383 
384 
385 
386 
387 // //////////////////////////////////////////////////////////////////////
388 // Beginning of content of file: include/json/value.h
389 // //////////////////////////////////////////////////////////////////////
390 
391 // Copyright 2007-2010 Baptiste Lepilleur
392 // Distributed under MIT license, or public domain if desired and
393 // recognized in your jurisdiction.
394 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
395 
396 #ifndef CPPTL_JSON_H_INCLUDED
397 #define CPPTL_JSON_H_INCLUDED
398 
399 #if !defined(JSON_IS_AMALGAMATION)
400 #include "forwards.h"
401 #endif // if !defined(JSON_IS_AMALGAMATION)
402 #include <string>
403 #include <vector>
404 #include <exception>
405 
406 #ifndef JSON_USE_CPPTL_SMALLMAP
407 #include <map>
408 #else
409 #include <cpptl/smallmap.h>
410 #endif
411 #ifdef JSON_USE_CPPTL
412 #include <cpptl/forwards.h>
413 #endif
414 
415 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
416 // be used by...
417 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
418 #pragma warning(push)
419 #pragma warning(disable : 4251)
420 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
421 
424 namespace Json {
425 
430 class JSON_API Exception : public std::exception {
431 public:
432  Exception(std::string const& msg);
433  ~Exception() throw() override;
434  char const* what() const throw() override;
435 protected:
436  std::string msg_;
437 };
438 
445 class JSON_API RuntimeError : public Exception {
446 public:
447  RuntimeError(std::string const& msg);
448 };
449 
456 class JSON_API LogicError : public Exception {
457 public:
458  LogicError(std::string const& msg);
459 };
460 
462 void throwRuntimeError(std::string const& msg);
464 void throwLogicError(std::string const& msg);
465 
468 enum ValueType {
469  nullValue = 0,
477 };
478 
485 };
486 
487 //# ifdef JSON_USE_CPPTL
488 // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
489 // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
490 //# endif
491 
506 class JSON_API StaticString {
507 public:
508  explicit StaticString(const char* czstring) : c_str_(czstring) {}
509 
510  operator const char*() const { return c_str_; }
511 
512  const char* c_str() const { return c_str_; }
513 
514 private:
515  const char* c_str_;
516 };
517 
552 class JSON_API Value {
553  friend class ValueIteratorBase;
554 public:
555  typedef std::vector<std::string> Members;
556  typedef ValueIterator iterator;
558  typedef Json::UInt UInt;
559  typedef Json::Int Int;
560 #if defined(JSON_HAS_INT64)
561  typedef Json::UInt64 UInt64;
562  typedef Json::Int64 Int64;
563 #endif // defined(JSON_HAS_INT64)
564  typedef Json::LargestInt LargestInt;
565  typedef Json::LargestUInt LargestUInt;
566  typedef Json::ArrayIndex ArrayIndex;
567 
568  static const Value& null;
569  static const Value& nullRef;
570  static const LargestInt minLargestInt;
573  static const LargestInt maxLargestInt;
575  static const LargestUInt maxLargestUInt;
576 
578  static const Int minInt;
580  static const Int maxInt;
582  static const UInt maxUInt;
583 
584 #if defined(JSON_HAS_INT64)
585  static const Int64 minInt64;
588  static const Int64 maxInt64;
590  static const UInt64 maxUInt64;
591 #endif // defined(JSON_HAS_INT64)
592 
593 private:
594 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
595  class CZString {
596  public:
597  enum DuplicationPolicy {
598  noDuplication = 0,
599  duplicate,
600  duplicateOnCopy
601  };
602  CZString(ArrayIndex index);
603  CZString(char const* str, unsigned length, DuplicationPolicy allocate);
604  CZString(CZString const& other);
605 #if JSON_HAS_RVALUE_REFERENCES
606  CZString(CZString&& other);
607 #endif
608  ~CZString();
609  CZString& operator=(CZString other);
610  bool operator<(CZString const& other) const;
611  bool operator==(CZString const& other) const;
612  ArrayIndex index() const;
613  //const char* c_str() const; ///< \deprecated
614  char const* data() const;
615  unsigned length() const;
616  bool isStaticString() const;
617 
618  private:
619  void swap(CZString& other);
620 
621  struct StringStorage {
622  unsigned policy_: 2;
623  unsigned length_: 30; // 1GB max
624  };
625 
626  char const* cstr_; // actually, a prefixed string, unless policy is noDup
627  union {
628  ArrayIndex index_;
629  StringStorage storage_;
630  };
631  };
632 
633 public:
634 #ifndef JSON_USE_CPPTL_SMALLMAP
635  typedef std::map<CZString, Value> ObjectValues;
636 #else
637  typedef CppTL::SmallMap<CZString, Value> ObjectValues;
638 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
639 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
640 
641 public:
657  Value(ValueType type = nullValue);
658  Value(Int value);
659  Value(UInt value);
660 #if defined(JSON_HAS_INT64)
661  Value(Int64 value);
662  Value(UInt64 value);
663 #endif // if defined(JSON_HAS_INT64)
664  Value(double value);
665  Value(const char* value);
666  Value(const char* begin, const char* end);
667 
682  Value(const StaticString& value);
683  Value(const std::string& value);
684 #ifdef JSON_USE_CPPTL
685  Value(const CppTL::ConstString& value);
686 #endif
687  Value(bool value);
689  Value(const Value& other);
690 #if JSON_HAS_RVALUE_REFERENCES
691  Value(Value&& other);
693 #endif
694  ~Value();
695 
698  Value& operator=(Value other);
700  void swap(Value& other);
702  void swapPayload(Value& other);
703 
704  ValueType type() const;
705 
707  bool operator<(const Value& other) const;
708  bool operator<=(const Value& other) const;
709  bool operator>=(const Value& other) const;
710  bool operator>(const Value& other) const;
711  bool operator==(const Value& other) const;
712  bool operator!=(const Value& other) const;
713  int compare(const Value& other) const;
714 
715  const char* asCString() const;
716  std::string asString() const;
717 
720  bool getString(
721  char const** begin, char const** end) const;
722 #ifdef JSON_USE_CPPTL
723  CppTL::ConstString asConstString() const;
724 #endif
725  Int asInt() const;
726  UInt asUInt() const;
727 #if defined(JSON_HAS_INT64)
728  Int64 asInt64() const;
729  UInt64 asUInt64() const;
730 #endif // if defined(JSON_HAS_INT64)
731  LargestInt asLargestInt() const;
732  LargestUInt asLargestUInt() const;
733  float asFloat() const;
734  double asDouble() const;
735  bool asBool() const;
736 
737  bool isNull() const;
738  bool isBool() const;
739  bool isInt() const;
740  bool isInt64() const;
741  bool isUInt() const;
742  bool isUInt64() const;
743  bool isIntegral() const;
744  bool isDouble() const;
745  bool isNumeric() const;
746  bool isString() const;
747  bool isArray() const;
748  bool isObject() const;
749 
750  bool isConvertibleTo(ValueType other) const;
751 
753  ArrayIndex size() const;
754 
757  bool empty() const;
758 
760  bool operator!() const;
761 
765  void clear();
766 
772  void resize(ArrayIndex size);
773 
780  Value& operator[](ArrayIndex index);
781 
788  Value& operator[](int index);
789 
793  const Value& operator[](ArrayIndex index) const;
794 
798  const Value& operator[](int index) const;
799 
803  Value get(ArrayIndex index, const Value& defaultValue) const;
805  bool isValidIndex(ArrayIndex index) const;
809  Value& append(const Value& value);
810 
814  Value& operator[](const char* key);
817  const Value& operator[](const char* key) const;
820  Value& operator[](const std::string& key);
824  const Value& operator[](const std::string& key) const;
837  Value& operator[](const StaticString& key);
838 #ifdef JSON_USE_CPPTL
839  Value& operator[](const CppTL::ConstString& key);
843  const Value& operator[](const CppTL::ConstString& key) const;
844 #endif
845  Value get(const char* key, const Value& defaultValue) const;
851  Value get(const char* begin, const char* end, const Value& defaultValue) const;
855  Value get(const std::string& key, const Value& defaultValue) const;
856 #ifdef JSON_USE_CPPTL
857  Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
860 #endif
861  Value const* find(char const* begin, char const* end) const;
868  Value const* demand(char const* begin, char const* end);
876  Value removeMember(const char* key);
880  Value removeMember(const std::string& key);
883  bool removeMember(const char* key, Value* removed);
890  bool removeMember(std::string const& key, Value* removed);
892  bool removeMember(const char* begin, const char* end, Value* removed);
899  bool removeIndex(ArrayIndex i, Value* removed);
900 
903  bool isMember(const char* key) const;
906  bool isMember(const std::string& key) const;
908  bool isMember(const char* begin, const char* end) const;
909 #ifdef JSON_USE_CPPTL
910  bool isMember(const CppTL::ConstString& key) const;
912 #endif
913 
919  Members getMemberNames() const;
920 
921  //# ifdef JSON_USE_CPPTL
922  // EnumMemberNames enumMemberNames() const;
923  // EnumValues enumValues() const;
924  //# endif
925 
927  JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.")
928  void setComment(const char* comment, CommentPlacement placement);
930  void setComment(const char* comment, size_t len, CommentPlacement placement);
932  void setComment(const std::string& comment, CommentPlacement placement);
933  bool hasComment(CommentPlacement placement) const;
935  std::string getComment(CommentPlacement placement) const;
936 
937  std::string toStyledString() const;
938 
939  const_iterator begin() const;
940  const_iterator end() const;
941 
942  iterator begin();
943  iterator end();
944 
945  // Accessors for the [start, limit) range of bytes within the JSON text from
946  // which this value was parsed, if any.
947  void setOffsetStart(ptrdiff_t start);
948  void setOffsetLimit(ptrdiff_t limit);
949  ptrdiff_t getOffsetStart() const;
950  ptrdiff_t getOffsetLimit() const;
951 
952 private:
953  void initBasic(ValueType type, bool allocated = false);
954 
955  Value& resolveReference(const char* key);
956  Value& resolveReference(const char* key, const char* end);
957 
958  struct CommentInfo {
959  CommentInfo();
960  ~CommentInfo();
961 
962  void setComment(const char* text, size_t len);
963 
964  char* comment_;
965  };
966 
967  // struct MemberNamesTransform
968  //{
969  // typedef const char *result_type;
970  // const char *operator()( const CZString &name ) const
971  // {
972  // return name.c_str();
973  // }
974  //};
975 
976  union ValueHolder {
977  LargestInt int_;
978  LargestUInt uint_;
979  double real_;
980  bool bool_;
981  char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
982  ObjectValues* map_;
983  } value_;
984  ValueType type_ : 8;
985  unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
986  // If not allocated_, string_ must be null-terminated.
987  CommentInfo* comments_;
988 
989  // [start, limit) byte offsets in the source JSON text from which this Value
990  // was extracted.
991  ptrdiff_t start_;
992  ptrdiff_t limit_;
993 };
994 
998 class JSON_API PathArgument {
999 public:
1000  friend class Path;
1001 
1002  PathArgument();
1003  PathArgument(ArrayIndex index);
1004  PathArgument(const char* key);
1005  PathArgument(const std::string& key);
1006 
1007 private:
1008  enum Kind {
1009  kindNone = 0,
1010  kindIndex,
1011  kindKey
1012  };
1013  std::string key_;
1014  ArrayIndex index_;
1015  Kind kind_;
1016 };
1017 
1029 class JSON_API Path {
1030 public:
1031  Path(const std::string& path,
1032  const PathArgument& a1 = PathArgument(),
1033  const PathArgument& a2 = PathArgument(),
1034  const PathArgument& a3 = PathArgument(),
1035  const PathArgument& a4 = PathArgument(),
1036  const PathArgument& a5 = PathArgument());
1037 
1038  const Value& resolve(const Value& root) const;
1039  Value resolve(const Value& root, const Value& defaultValue) const;
1042  Value& make(Value& root) const;
1043 
1044 private:
1045  typedef std::vector<const PathArgument*> InArgs;
1046  typedef std::vector<PathArgument> Args;
1047 
1048  void makePath(const std::string& path, const InArgs& in);
1049  void addPathInArg(const std::string& path,
1050  const InArgs& in,
1051  InArgs::const_iterator& itInArg,
1052  PathArgument::Kind kind);
1053  void invalidPath(const std::string& path, int location);
1054 
1055  Args args_;
1056 };
1057 
1061 class JSON_API ValueIteratorBase {
1062 public:
1063  typedef std::bidirectional_iterator_tag iterator_category;
1064  typedef unsigned int size_t;
1065  typedef int difference_type;
1066  typedef ValueIteratorBase SelfType;
1067 
1068  bool operator==(const SelfType& other) const { return isEqual(other); }
1069 
1070  bool operator!=(const SelfType& other) const { return !isEqual(other); }
1071 
1072  difference_type operator-(const SelfType& other) const {
1073  return other.computeDistance(*this);
1074  }
1075 
1078  Value key() const;
1079 
1081  UInt index() const;
1082 
1086  std::string name() const;
1087 
1091  JSONCPP_DEPRECATED("Use `key = name();` instead.")
1092  char const* memberName() const;
1096  char const* memberName(char const** end) const;
1097 
1098 protected:
1099  Value& deref() const;
1100 
1101  void increment();
1102 
1103  void decrement();
1104 
1105  difference_type computeDistance(const SelfType& other) const;
1106 
1107  bool isEqual(const SelfType& other) const;
1108 
1109  void copy(const SelfType& other);
1110 
1111 private:
1112  Value::ObjectValues::iterator current_;
1113  // Indicates that iterator is for a null value.
1114  bool isNull_;
1115 
1116 public:
1117  // For some reason, BORLAND needs these at the end, rather
1118  // than earlier. No idea why.
1120  explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
1121 };
1122 
1126 class JSON_API ValueConstIterator : public ValueIteratorBase {
1127  friend class Value;
1128 
1129 public:
1130  typedef const Value value_type;
1131  //typedef unsigned int size_t;
1132  //typedef int difference_type;
1133  typedef const Value& reference;
1134  typedef const Value* pointer;
1135  typedef ValueConstIterator SelfType;
1136 
1138  ValueConstIterator(ValueIterator const& other);
1139 
1140 private:
1143  explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
1144 public:
1145  SelfType& operator=(const ValueIteratorBase& other);
1146 
1147  SelfType operator++(int) {
1148  SelfType temp(*this);
1149  ++*this;
1150  return temp;
1151  }
1152 
1153  SelfType operator--(int) {
1154  SelfType temp(*this);
1155  --*this;
1156  return temp;
1157  }
1158 
1159  SelfType& operator--() {
1160  decrement();
1161  return *this;
1162  }
1163 
1164  SelfType& operator++() {
1165  increment();
1166  return *this;
1167  }
1168 
1169  reference operator*() const { return deref(); }
1170 
1171  pointer operator->() const { return &deref(); }
1172 };
1173 
1176 class JSON_API ValueIterator : public ValueIteratorBase {
1177  friend class Value;
1178 
1179 public:
1180  typedef Value value_type;
1181  typedef unsigned int size_t;
1182  typedef int difference_type;
1183  typedef Value& reference;
1184  typedef Value* pointer;
1185  typedef ValueIterator SelfType;
1186 
1187  ValueIterator();
1188  explicit ValueIterator(const ValueConstIterator& other);
1189  ValueIterator(const ValueIterator& other);
1190 
1191 private:
1194  explicit ValueIterator(const Value::ObjectValues::iterator& current);
1195 public:
1196  SelfType& operator=(const SelfType& other);
1197 
1198  SelfType operator++(int) {
1199  SelfType temp(*this);
1200  ++*this;
1201  return temp;
1202  }
1203 
1204  SelfType operator--(int) {
1205  SelfType temp(*this);
1206  --*this;
1207  return temp;
1208  }
1209 
1210  SelfType& operator--() {
1211  decrement();
1212  return *this;
1213  }
1214 
1215  SelfType& operator++() {
1216  increment();
1217  return *this;
1218  }
1219 
1220  reference operator*() const { return deref(); }
1221 
1222  pointer operator->() const { return &deref(); }
1223 };
1224 
1225 } // namespace Json
1226 
1227 
1228 namespace std {
1230 template<>
1231 inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
1232 }
1233 
1234 
1235 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1236 #pragma warning(pop)
1237 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1238 
1239 #endif // CPPTL_JSON_H_INCLUDED
1240 
1241 // //////////////////////////////////////////////////////////////////////
1242 // End of content of file: include/json/value.h
1243 // //////////////////////////////////////////////////////////////////////
1244 
1245 
1246 
1247 
1248 
1249 
1250 // //////////////////////////////////////////////////////////////////////
1251 // Beginning of content of file: include/json/reader.h
1252 // //////////////////////////////////////////////////////////////////////
1253 
1254 // Copyright 2007-2010 Baptiste Lepilleur
1255 // Distributed under MIT license, or public domain if desired and
1256 // recognized in your jurisdiction.
1257 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
1258 
1259 #ifndef CPPTL_JSON_READER_H_INCLUDED
1260 #define CPPTL_JSON_READER_H_INCLUDED
1261 
1262 #if !defined(JSON_IS_AMALGAMATION)
1263 #include "features.h"
1264 #include "value.h"
1265 #endif // if !defined(JSON_IS_AMALGAMATION)
1266 #include <deque>
1267 #include <iosfwd>
1268 #include <stack>
1269 #include <string>
1270 #include <istream>
1271 
1272 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1273 // be used by...
1274 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1275 #pragma warning(push)
1276 #pragma warning(disable : 4251)
1277 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1278 
1279 namespace Json {
1280 
1286 class JSON_API Reader {
1287 public:
1288  typedef char Char;
1289  typedef const Char* Location;
1290 
1298  ptrdiff_t offset_start;
1299  ptrdiff_t offset_limit;
1300  std::string message;
1301  };
1302 
1306  Reader();
1307 
1311  Reader(const Features& features);
1312 
1327  bool
1328  parse(const std::string& document, Value& root, bool collectComments = true);
1329 
1348  bool parse(const char* beginDoc,
1349  const char* endDoc,
1350  Value& root,
1351  bool collectComments = true);
1352 
1355  bool parse(std::istream& is, Value& root, bool collectComments = true);
1356 
1366  JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
1367  std::string getFormatedErrorMessages() const;
1368 
1377  std::string getFormattedErrorMessages() const;
1378 
1386  std::vector<StructuredError> getStructuredErrors() const;
1387 
1394  bool pushError(const Value& value, const std::string& message);
1395 
1403  bool pushError(const Value& value, const std::string& message, const Value& extra);
1404 
1409  bool good() const;
1410 
1411 private:
1412  enum TokenType {
1413  tokenEndOfStream = 0,
1414  tokenObjectBegin,
1415  tokenObjectEnd,
1416  tokenArrayBegin,
1417  tokenArrayEnd,
1418  tokenString,
1419  tokenNumber,
1420  tokenTrue,
1421  tokenFalse,
1422  tokenNull,
1423  tokenArraySeparator,
1424  tokenMemberSeparator,
1425  tokenComment,
1426  tokenError
1427  };
1428 
1429  class Token {
1430  public:
1431  TokenType type_;
1432  Location start_;
1433  Location end_;
1434  };
1435 
1436  class ErrorInfo {
1437  public:
1438  Token token_;
1439  std::string message_;
1440  Location extra_;
1441  };
1442 
1443  typedef std::deque<ErrorInfo> Errors;
1444 
1445  bool readToken(Token& token);
1446  void skipSpaces();
1447  bool match(Location pattern, int patternLength);
1448  bool readComment();
1449  bool readCStyleComment();
1450  bool readCppStyleComment();
1451  bool readString();
1452  void readNumber();
1453  bool readValue();
1454  bool readObject(Token& token);
1455  bool readArray(Token& token);
1456  bool decodeNumber(Token& token);
1457  bool decodeNumber(Token& token, Value& decoded);
1458  bool decodeString(Token& token);
1459  bool decodeString(Token& token, std::string& decoded);
1460  bool decodeDouble(Token& token);
1461  bool decodeDouble(Token& token, Value& decoded);
1462  bool decodeUnicodeCodePoint(Token& token,
1463  Location& current,
1464  Location end,
1465  unsigned int& unicode);
1466  bool decodeUnicodeEscapeSequence(Token& token,
1467  Location& current,
1468  Location end,
1469  unsigned int& unicode);
1470  bool addError(const std::string& message, Token& token, Location extra = 0);
1471  bool recoverFromError(TokenType skipUntilToken);
1472  bool addErrorAndRecover(const std::string& message,
1473  Token& token,
1474  TokenType skipUntilToken);
1475  void skipUntilSpace();
1476  Value& currentValue();
1477  Char getNextChar();
1478  void
1479  getLocationLineAndColumn(Location location, int& line, int& column) const;
1480  std::string getLocationLineAndColumn(Location location) const;
1481  void addComment(Location begin, Location end, CommentPlacement placement);
1482  void skipCommentTokens(Token& token);
1483 
1484  typedef std::stack<Value*> Nodes;
1485  Nodes nodes_;
1486  Errors errors_;
1487  std::string document_;
1488  Location begin_;
1489  Location end_;
1490  Location current_;
1491  Location lastValueEnd_;
1492  Value* lastValue_;
1493  std::string commentsBefore_;
1494  Features features_;
1495  bool collectComments_;
1496 }; // Reader
1497 
1500 class JSON_API CharReader {
1501 public:
1502  virtual ~CharReader() {}
1520  virtual bool parse(
1521  char const* beginDoc, char const* endDoc,
1522  Value* root, std::string* errs) = 0;
1523 
1524  class JSON_API Factory {
1525  public:
1526  virtual ~Factory() {}
1530  virtual CharReader* newCharReader() const = 0;
1531  }; // Factory
1532 }; // CharReader
1533 
1546 class JSON_API CharReaderBuilder : public CharReader::Factory {
1547 public:
1548  // Note: We use a Json::Value so that we can add data-members to this class
1549  // without a major version bump.
1587 
1589  ~CharReaderBuilder() override;
1590 
1591  CharReader* newCharReader() const override;
1592 
1596  bool validate(Json::Value* invalid) const;
1597 
1600  Value& operator[](std::string key);
1601 
1607  static void setDefaults(Json::Value* settings);
1613  static void strictMode(Json::Value* settings);
1614 };
1615 
1620 bool JSON_API parseFromStream(
1621  CharReader::Factory const&,
1622  std::istream&,
1623  Value* root, std::string* errs);
1624 
1649 JSON_API std::istream& operator>>(std::istream&, Value&);
1650 
1651 } // namespace Json
1652 
1653 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1654 #pragma warning(pop)
1655 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1656 
1657 #endif // CPPTL_JSON_READER_H_INCLUDED
1658 
1659 // //////////////////////////////////////////////////////////////////////
1660 // End of content of file: include/json/reader.h
1661 // //////////////////////////////////////////////////////////////////////
1662 
1663 
1664 
1665 
1666 
1667 
1668 // //////////////////////////////////////////////////////////////////////
1669 // Beginning of content of file: include/json/writer.h
1670 // //////////////////////////////////////////////////////////////////////
1671 
1672 // Copyright 2007-2010 Baptiste Lepilleur
1673 // Distributed under MIT license, or public domain if desired and
1674 // recognized in your jurisdiction.
1675 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
1676 
1677 #ifndef JSON_WRITER_H_INCLUDED
1678 #define JSON_WRITER_H_INCLUDED
1679 
1680 #if !defined(JSON_IS_AMALGAMATION)
1681 #include "value.h"
1682 #endif // if !defined(JSON_IS_AMALGAMATION)
1683 #include <vector>
1684 #include <string>
1685 #include <ostream>
1686 
1687 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1688 // be used by...
1689 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1690 #pragma warning(push)
1691 #pragma warning(disable : 4251)
1692 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1693 
1694 namespace Json {
1695 
1696 class Value;
1697 
1711 class JSON_API StreamWriter {
1712 protected:
1713  std::ostream* sout_; // not owned; will not delete
1714 public:
1715  StreamWriter();
1716  virtual ~StreamWriter();
1723  virtual int write(Value const& root, std::ostream* sout) = 0;
1724 
1727  class JSON_API Factory {
1728  public:
1729  virtual ~Factory();
1733  virtual StreamWriter* newStreamWriter() const = 0;
1734  }; // Factory
1735 }; // StreamWriter
1736 
1740 std::string JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
1741 
1742 
1759 public:
1760  // Note: We use a Json::Value so that we can add data-members to this class
1761  // without a major version bump.
1784 
1786  ~StreamWriterBuilder() override;
1787 
1791  StreamWriter* newStreamWriter() const override;
1792 
1796  bool validate(Json::Value* invalid) const;
1799  Value& operator[](std::string key);
1800 
1806  static void setDefaults(Json::Value* settings);
1807 };
1808 
1812 class JSON_API Writer {
1813 public:
1814  virtual ~Writer();
1815 
1816  virtual std::string write(const Value& root) = 0;
1817 };
1818 
1828 class JSON_API FastWriter : public Writer {
1829 
1830 public:
1831  FastWriter();
1832  ~FastWriter() override {}
1833 
1834  void enableYAMLCompatibility();
1835 
1841  void dropNullPlaceholders();
1842 
1843  void omitEndingLineFeed();
1844 
1845 public: // overridden from Writer
1846  std::string write(const Value& root) override;
1847 
1848 private:
1849  void writeValue(const Value& value);
1850 
1851  std::string document_;
1852  bool yamlCompatiblityEnabled_;
1853  bool dropNullPlaceholders_;
1854  bool omitEndingLineFeed_;
1855 };
1856 
1881 class JSON_API StyledWriter : public Writer {
1882 public:
1883  StyledWriter();
1884  ~StyledWriter() override {}
1885 
1886 public: // overridden from Writer
1891  std::string write(const Value& root) override;
1892 
1893 private:
1894  void writeValue(const Value& value);
1895  void writeArrayValue(const Value& value);
1896  bool isMultineArray(const Value& value);
1897  void pushValue(const std::string& value);
1898  void writeIndent();
1899  void writeWithIndent(const std::string& value);
1900  void indent();
1901  void unindent();
1902  void writeCommentBeforeValue(const Value& root);
1903  void writeCommentAfterValueOnSameLine(const Value& root);
1904  bool hasCommentForValue(const Value& value);
1905  static std::string normalizeEOL(const std::string& text);
1906 
1907  typedef std::vector<std::string> ChildValues;
1908 
1909  ChildValues childValues_;
1910  std::string document_;
1911  std::string indentString_;
1912  unsigned int rightMargin_;
1913  unsigned int indentSize_;
1914  bool addChildValues_;
1915 };
1916 
1943 class JSON_API StyledStreamWriter {
1944 public:
1945  StyledStreamWriter(std::string indentation = "\t");
1946  ~StyledStreamWriter() {}
1947 
1948 public:
1955  void write(std::ostream& out, const Value& root);
1956 
1957 private:
1958  void writeValue(const Value& value);
1959  void writeArrayValue(const Value& value);
1960  bool isMultineArray(const Value& value);
1961  void pushValue(const std::string& value);
1962  void writeIndent();
1963  void writeWithIndent(const std::string& value);
1964  void indent();
1965  void unindent();
1966  void writeCommentBeforeValue(const Value& root);
1967  void writeCommentAfterValueOnSameLine(const Value& root);
1968  bool hasCommentForValue(const Value& value);
1969  static std::string normalizeEOL(const std::string& text);
1970 
1971  typedef std::vector<std::string> ChildValues;
1972 
1973  ChildValues childValues_;
1974  std::ostream* document_;
1975  std::string indentString_;
1976  unsigned int rightMargin_;
1977  std::string indentation_;
1978  bool addChildValues_ : 1;
1979  bool indented_ : 1;
1980 };
1981 
1982 #if defined(JSON_HAS_INT64)
1983 std::string JSON_API valueToString(Int value);
1984 std::string JSON_API valueToString(UInt value);
1985 #endif // if defined(JSON_HAS_INT64)
1986 std::string JSON_API valueToString(LargestInt value);
1987 std::string JSON_API valueToString(LargestUInt value);
1988 std::string JSON_API valueToString(double value);
1989 std::string JSON_API valueToString(bool value);
1990 std::string JSON_API valueToQuotedString(const char* value);
1991 
1994 JSON_API std::ostream& operator<<(std::ostream&, const Value& root);
1995 
1996 } // namespace Json
1997 
1998 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1999 #pragma warning(pop)
2000 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
2001 
2002 #endif // JSON_WRITER_H_INCLUDED
2003 
2004 // //////////////////////////////////////////////////////////////////////
2005 // End of content of file: include/json/writer.h
2006 // //////////////////////////////////////////////////////////////////////
2007 
2008 
2009 
2010 
2011 
2012 
2013 // //////////////////////////////////////////////////////////////////////
2014 // Beginning of content of file: include/json/assertions.h
2015 // //////////////////////////////////////////////////////////////////////
2016 
2017 // Copyright 2007-2010 Baptiste Lepilleur
2018 // Distributed under MIT license, or public domain if desired and
2019 // recognized in your jurisdiction.
2020 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
2021 
2022 #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
2023 #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
2024 
2025 #include <stdlib.h>
2026 #include <sstream>
2027 
2028 #if !defined(JSON_IS_AMALGAMATION)
2029 #include "config.h"
2030 #endif // if !defined(JSON_IS_AMALGAMATION)
2031 
2036 #if JSON_USE_EXCEPTION
2037 
2038 // @todo <= add detail about condition in exception
2039 # define JSON_ASSERT(condition) \
2040  {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
2041 
2042 # define JSON_FAIL_MESSAGE(message) \
2043  { \
2044  std::ostringstream oss; oss << message; \
2045  Json::throwLogicError(oss.str()); \
2046  abort(); \
2047  }
2048 
2049 #else // JSON_USE_EXCEPTION
2050 
2051 # define JSON_ASSERT(condition) assert(condition)
2052 
2053 // The call to assert() will show the failure message in debug builds. In
2054 // release builds we abort, for a core-dump or debugger.
2055 # define JSON_FAIL_MESSAGE(message) \
2056  { \
2057  std::ostringstream oss; oss << message; \
2058  assert(false && oss.str().c_str()); \
2059  abort(); \
2060  }
2061 
2062 
2063 #endif
2064 
2065 #define JSON_ASSERT_MESSAGE(condition, message) \
2066  if (!(condition)) { \
2067  JSON_FAIL_MESSAGE(message); \
2068  }
2069 
2070 #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
2071 
2072 // //////////////////////////////////////////////////////////////////////
2073 // End of content of file: include/json/assertions.h
2074 // //////////////////////////////////////////////////////////////////////
2075 
2076 
2077 
2078 
2079 
2080 #endif //ifndef JSON_AMALGATED_H_INCLUDED
Outputs a Value in JSON format without formatting (not human friendly).
Definition: json.h:1828
A simple abstract factory.
Definition: json.h:1727
Writes a Value in JSON format in a human friendly way.
Definition: json.h:1881
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Definition: json.h:588
static const Value & null
We regret this reference to a global instance; prefer the simpler Value().
Definition: json.h:568
base class for Value iterators.
Definition: json.h:1061
array value (ordered list)
Definition: json.h:475
bool JSON_API parseFromStream(CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
Definition: jsoncpp.cpp:2196
unsigned integer value
Definition: json.h:471
Json::Value settings_
Definition: json.h:1586
void throwLogicError(std::string const &msg)
used internally
Definition: jsoncpp.cpp:2596
root value)
Definition: json.h:484
Definition: json.h:1711
Definition: json.h:456
object value (collection of name/value pairs).
Definition: json.h:476
JSON_API std::istream & operator>>(std::istream &, Value &)
Read from &#39;sin&#39; into &#39;root&#39;.
Definition: jsoncpp.cpp:2210
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
Definition: json.h:580
Definition: json.h:1228
Lightweight wrapper to tag static string.
Definition: json.h:506
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Definition: json.h:582
An error tagged with where in the JSON text it was encountered.
Definition: json.h:1297
const iterator for object and array value.
Definition: json.h:1126
Experimental and untested: represents an element of the "path" to access a node.
Definition: json.h:998
&#39;null&#39; value
Definition: json.h:469
bool allowComments_
true if comments are allowed. Default: true.
Definition: json.h:361
CommentPlacement
Definition: json.h:479
static const Value & nullRef
Definition: json.h:569
bool allowNumericKeys_
true if numeric object key are allowed. Default: false.
Definition: json.h:371
JSON (JavaScript Object Notation).
Definition: json.h:232
bool allowDroppedNullPlaceholders_
true if dropped null placeholders are allowed. Default: false.
Definition: json.h:368
void swap(Value &other)
Swap everything.
Definition: jsoncpp.cpp:2902
Experimental and untested: represents a "path" to access a node.
Definition: json.h:1029
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Definition: json.h:590
double value
Definition: json.h:472
void throwRuntimeError(std::string const &msg)
used internally
Definition: jsoncpp.cpp:2592
Definition: json.h:1500
Json::Value settings_
Definition: json.h:1783
Abstract class for writers.
Definition: json.h:1812
Represents a JSON value.
Definition: json.h:552
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: json.h:578
Definition: json.h:445
Definition: json.h:482
Unserialize a JSON document into a Value.
Definition: json.h:1286
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string...
Definition: json.h:1943
Iterator for object and array value.
Definition: json.h:1176
ValueType
Type of the value held by a Value object.
Definition: json.h:468
bool strictRoot_
Definition: json.h:365
std::string JSON_API 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:5180
bool value
Definition: json.h:474
signed integer value
Definition: json.h:470
Build a CharReader implementation.
Definition: json.h:1546
Definition: json.h:1524
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
Definition: json.h:338
a comment placed on the line before a value
Definition: json.h:480
UTF-8 string value.
Definition: json.h:473
a comment just after a value on the same line
Definition: json.h:481
JSON_API std::ostream & operator<<(std::ostream &, const Value &root)
Output using the StyledStreamWriter.
Definition: jsoncpp.cpp:5187
Build a StreamWriter implementation.
Definition: json.h:1758
Definition: json.h:430
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: json.h:573
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: json.h:575