json.h
Go to the documentation of this file.
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.6.5"
91 # define JSONCPP_VERSION_MAJOR 1
92 # define JSONCPP_VERSION_MINOR 6
93 # define JSONCPP_VERSION_PATCH 5
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 
121 //# define JSON_IN_CPPTL 1
122 
124 //# define JSON_USE_CPPTL 1
128 //# define JSON_USE_CPPTL_SMALLMAP 1
129 
130 // If non-zero, the library uses exceptions to report bad input instead of C
131 // assertion macros. The default is to use exceptions.
132 #ifndef JSON_USE_EXCEPTION
133 #define JSON_USE_EXCEPTION 1
134 #endif
135 
139 // #define JSON_IS_AMALGAMATION
140 
141 #ifdef JSON_IN_CPPTL
142 #include <cpptl/config.h>
143 #ifndef JSON_USE_CPPTL
144 #define JSON_USE_CPPTL 1
145 #endif
146 #endif
147 
148 #ifdef JSON_IN_CPPTL
149 #define JSON_API CPPTL_API
150 #elif defined(JSON_DLL_BUILD)
151 #if defined(_MSC_VER)
152 #define JSON_API __declspec(dllexport)
153 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
154 #endif // if defined(_MSC_VER)
155 #elif defined(JSON_DLL)
156 #if defined(_MSC_VER)
157 #define JSON_API __declspec(dllimport)
158 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
159 #endif // if defined(_MSC_VER)
160 #endif // ifdef JSON_IN_CPPTL
161 #if !defined(JSON_API)
162 #define JSON_API
163 #endif
164 
165 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
166 // integer
167 // Storages, and 64 bits integer support is disabled.
168 // #define JSON_NO_INT64 1
169 
170 #if defined(_MSC_VER) // MSVC
171 # if _MSC_VER <= 1200 // MSVC 6
172  // Microsoft Visual Studio 6 only support conversion from __int64 to double
173  // (no conversion from unsigned __int64).
174 # define JSON_USE_INT64_DOUBLE_CONVERSION 1
175  // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
176  // characters in the debug information)
177  // All projects I've ever seen with VS6 were using this globally (not bothering
178  // with pragma push/pop).
179 # pragma warning(disable : 4786)
180 # endif // MSVC 6
181 
182 # if _MSC_VER >= 1500 // MSVC 2008
183 # define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
185 # endif
186 
187 #endif // defined(_MSC_VER)
188 
189 
190 #ifndef JSON_HAS_RVALUE_REFERENCES
191 
192 #if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
193 #define JSON_HAS_RVALUE_REFERENCES 1
194 #endif // MSVC >= 2010
195 
196 #ifdef __clang__
197 #if __has_feature(cxx_rvalue_references)
198 #define JSON_HAS_RVALUE_REFERENCES 1
199 #endif // has_feature
200 
201 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
202 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
203 #define JSON_HAS_RVALUE_REFERENCES 1
204 #endif // GXX_EXPERIMENTAL
205 
206 #endif // __clang__ || __GNUC__
207 
208 #endif // not defined JSON_HAS_RVALUE_REFERENCES
209 
210 #ifndef JSON_HAS_RVALUE_REFERENCES
211 #define JSON_HAS_RVALUE_REFERENCES 0
212 #endif
213 
214 #ifdef __clang__
215 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
216 # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
217 # define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
218 # elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
219 # define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
220 # endif // GNUC version
221 #endif // __clang__ || __GNUC__
222 
223 #if !defined(JSONCPP_DEPRECATED)
224 #define JSONCPP_DEPRECATED(message)
225 #endif // if !defined(JSONCPP_DEPRECATED)
226 
227 namespace Json {
228 typedef int Int;
229 typedef unsigned int UInt;
230 #if defined(JSON_NO_INT64)
231 typedef int LargestInt;
232 typedef unsigned int LargestUInt;
233 #undef JSON_HAS_INT64
234 #else // if defined(JSON_NO_INT64)
235 // For Microsoft Visual use specific types as long long is not supported
236 #if defined(_MSC_VER) // Microsoft Visual Studio
237 typedef __int64 Int64;
238 typedef unsigned __int64 UInt64;
239 #else // if defined(_MSC_VER) // Other platforms, use long long
240 typedef long long int Int64;
241 typedef unsigned long long int UInt64;
242 #endif // if defined(_MSC_VER)
245 #define JSON_HAS_INT64
246 #endif // if defined(JSON_NO_INT64)
247 } // end namespace Json
248 
249 #endif // JSON_CONFIG_H_INCLUDED
250 
251 // //////////////////////////////////////////////////////////////////////
252 // End of content of file: include/json/config.h
253 // //////////////////////////////////////////////////////////////////////
254 
255 
256 
257 
258 
259 
260 // //////////////////////////////////////////////////////////////////////
261 // Beginning of content of file: include/json/forwards.h
262 // //////////////////////////////////////////////////////////////////////
263 
264 // Copyright 2007-2010 Baptiste Lepilleur
265 // Distributed under MIT license, or public domain if desired and
266 // recognized in your jurisdiction.
267 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
268 
269 #ifndef JSON_FORWARDS_H_INCLUDED
270 #define JSON_FORWARDS_H_INCLUDED
271 
272 #if !defined(JSON_IS_AMALGAMATION)
273 #include "config.h"
274 #endif // if !defined(JSON_IS_AMALGAMATION)
275 
276 namespace Json {
277 
278 // writer.h
279 class FastWriter;
280 class StyledWriter;
281 
282 // reader.h
283 class Reader;
284 
285 // features.h
286 class Features;
287 
288 // value.h
289 typedef unsigned int ArrayIndex;
290 class StaticString;
291 class Path;
292 class PathArgument;
293 class Value;
294 class ValueIteratorBase;
295 class ValueIterator;
296 class ValueConstIterator;
297 
298 } // namespace Json
299 
300 #endif // JSON_FORWARDS_H_INCLUDED
301 
302 // //////////////////////////////////////////////////////////////////////
303 // End of content of file: include/json/forwards.h
304 // //////////////////////////////////////////////////////////////////////
305 
306 
307 
308 
309 
310 
311 // //////////////////////////////////////////////////////////////////////
312 // Beginning of content of file: include/json/features.h
313 // //////////////////////////////////////////////////////////////////////
314 
315 // Copyright 2007-2010 Baptiste Lepilleur
316 // Distributed under MIT license, or public domain if desired and
317 // recognized in your jurisdiction.
318 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
319 
320 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
321 #define CPPTL_JSON_FEATURES_H_INCLUDED
322 
323 #if !defined(JSON_IS_AMALGAMATION)
324 #include "forwards.h"
325 #endif // if !defined(JSON_IS_AMALGAMATION)
326 
327 namespace Json {
328 
334 public:
341  static Features all();
342 
349  static Features strictMode();
350 
353  Features();
354 
357 
361 
364 
367 };
368 
369 } // namespace Json
370 
371 #endif // CPPTL_JSON_FEATURES_H_INCLUDED
372 
373 // //////////////////////////////////////////////////////////////////////
374 // End of content of file: include/json/features.h
375 // //////////////////////////////////////////////////////////////////////
376 
377 
378 
379 
380 
381 
382 // //////////////////////////////////////////////////////////////////////
383 // Beginning of content of file: include/json/value.h
384 // //////////////////////////////////////////////////////////////////////
385 
386 // Copyright 2007-2010 Baptiste Lepilleur
387 // Distributed under MIT license, or public domain if desired and
388 // recognized in your jurisdiction.
389 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
390 
391 #ifndef CPPTL_JSON_H_INCLUDED
392 #define CPPTL_JSON_H_INCLUDED
393 
394 #if !defined(JSON_IS_AMALGAMATION)
395 #include "forwards.h"
396 #endif // if !defined(JSON_IS_AMALGAMATION)
397 #include <string>
398 #include <vector>
399 #include <exception>
400 
401 #ifndef JSON_USE_CPPTL_SMALLMAP
402 #include <map>
403 #else
404 #include <cpptl/smallmap.h>
405 #endif
406 #ifdef JSON_USE_CPPTL
407 #include <cpptl/forwards.h>
408 #endif
409 
410 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
411 // be used by...
412 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
413 #pragma warning(push)
414 #pragma warning(disable : 4251)
415 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
416 
419 namespace Json {
420 
425 class JSON_API Exception : public std::exception {
426 public:
427  Exception(std::string const& msg);
428  ~Exception() throw() override;
429  char const* what() const throw() override;
430 protected:
432 };
433 
441 public:
442  RuntimeError(std::string const& msg);
443 };
444 
451 class JSON_API LogicError : public Exception {
452 public:
453  LogicError(std::string const& msg);
454 };
455 
457 void throwRuntimeError(std::string const& msg);
459 void throwLogicError(std::string const& msg);
460 
463 enum ValueType {
464  nullValue = 0,
472 };
473 
480 };
481 
482 //# ifdef JSON_USE_CPPTL
483 // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
484 // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
485 //# endif
486 
502 public:
503  explicit StaticString(const char* czstring) : c_str_(czstring) {}
504 
505  operator const char*() const { return c_str_; }
506 
507  const char* c_str() const { return c_str_; }
508 
509 private:
510  const char* c_str_;
511 };
512 
548  friend class ValueIteratorBase;
549 public:
550  typedef std::vector<std::string> Members;
553  typedef Json::UInt UInt;
554  typedef Json::Int Int;
555 #if defined(JSON_HAS_INT64)
558 #endif // defined(JSON_HAS_INT64)
562 
563  static const Value& null;
564  static const Value& nullRef;
565  static const LargestInt minLargestInt;
568  static const LargestInt maxLargestInt;
571 
573  static const Int minInt;
575  static const Int maxInt;
577  static const UInt maxUInt;
578 
579 #if defined(JSON_HAS_INT64)
580  static const Int64 minInt64;
583  static const Int64 maxInt64;
585  static const UInt64 maxUInt64;
586 #endif // defined(JSON_HAS_INT64)
587 
588 private:
589 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
590  class CZString {
591  public:
593  noDuplication = 0,
595  duplicateOnCopy
596  };
598  CZString(char const* str, unsigned length, DuplicationPolicy allocate);
599  CZString(CZString const& other);
600 #if JSON_HAS_RVALUE_REFERENCES
601  CZString(CZString&& other);
602 #endif
603  ~CZString();
604  CZString& operator=(CZString other);
605  bool operator<(CZString const& other) const;
606  bool operator==(CZString const& other) const;
607  ArrayIndex index() const;
608  //const char* c_str() const; ///< \deprecated
609  char const* data() const;
610  unsigned length() const;
611  bool isStaticString() const;
612 
613  private:
614  void swap(CZString& other);
615 
616  struct StringStorage {
617  unsigned policy_: 2;
618  unsigned length_: 30; // 1GB max
619  };
620 
621  char const* cstr_; // actually, a prefixed string, unless policy is noDup
622  union {
625  };
626  };
627 
628 public:
629 #ifndef JSON_USE_CPPTL_SMALLMAP
630  typedef std::map<CZString, Value> ObjectValues;
631 #else
632  typedef CppTL::SmallMap<CZString, Value> ObjectValues;
633 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
634 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
635 
636 public:
653  Value(Int value);
654  Value(UInt value);
655 #if defined(JSON_HAS_INT64)
656  Value(Int64 value);
657  Value(UInt64 value);
658 #endif // if defined(JSON_HAS_INT64)
659  Value(double value);
660  Value(const char* value);
661  Value(const char* begin, const char* end);
662 
677  Value(const StaticString& value);
678  Value(const std::string& value);
679 #ifdef JSON_USE_CPPTL
680  Value(const CppTL::ConstString& value);
681 #endif
682  Value(bool value);
684  Value(const Value& other);
685 #if JSON_HAS_RVALUE_REFERENCES
686  Value(Value&& other);
688 #endif
689  ~Value();
690 
693  Value& operator=(Value other);
695  void swap(Value& other);
697  void swapPayload(Value& other);
698 
699  ValueType type() const;
700 
702  bool operator<(const Value& other) const;
703  bool operator<=(const Value& other) const;
704  bool operator>=(const Value& other) const;
705  bool operator>(const Value& other) const;
706  bool operator==(const Value& other) const;
707  bool operator!=(const Value& other) const;
708  int compare(const Value& other) const;
709 
710  const char* asCString() const;
711  std::string asString() const;
712 
715  bool getString(
716  char const** begin, char const** end) const;
717 #ifdef JSON_USE_CPPTL
718  CppTL::ConstString asConstString() const;
719 #endif
720  Int asInt() const;
721  UInt asUInt() const;
722 #if defined(JSON_HAS_INT64)
723  Int64 asInt64() const;
724  UInt64 asUInt64() const;
725 #endif // if defined(JSON_HAS_INT64)
726  LargestInt asLargestInt() const;
727  LargestUInt asLargestUInt() const;
728  float asFloat() const;
729  double asDouble() const;
730  bool asBool() const;
731 
732  bool isNull() const;
733  bool isBool() const;
734  bool isInt() const;
735  bool isInt64() const;
736  bool isUInt() const;
737  bool isUInt64() const;
738  bool isIntegral() const;
739  bool isDouble() const;
740  bool isNumeric() const;
741  bool isString() const;
742  bool isArray() const;
743  bool isObject() const;
744 
745  bool isConvertibleTo(ValueType other) const;
746 
748  ArrayIndex size() const;
749 
752  bool empty() const;
753 
755  bool operator!() const;
756 
760  void clear();
761 
767  void resize(ArrayIndex size);
768 
775  Value& operator[](ArrayIndex index);
776 
783  Value& operator[](int index);
784 
788  const Value& operator[](ArrayIndex index) const;
789 
793  const Value& operator[](int index) const;
794 
798  Value get(ArrayIndex index, const Value& defaultValue) const;
800  bool isValidIndex(ArrayIndex index) const;
804  Value& append(const Value& value);
805 
809  Value& operator[](const char* key);
812  const Value& operator[](const char* key) const;
815  Value& operator[](const std::string& key);
819  const Value& operator[](const std::string& key) const;
832  Value& operator[](const StaticString& key);
833 #ifdef JSON_USE_CPPTL
834  Value& operator[](const CppTL::ConstString& key);
838  const Value& operator[](const CppTL::ConstString& key) const;
839 #endif
840  Value get(const char* key, const Value& defaultValue) const;
846  Value get(const char* begin, const char* end, const Value& defaultValue) const;
850  Value get(const std::string& key, const Value& defaultValue) const;
851 #ifdef JSON_USE_CPPTL
852  Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
855 #endif
856  Value const* find(char const* begin, char const* end) const;
863  Value const* demand(char const* begin, char const* end);
871  Value removeMember(const char* key);
875  Value removeMember(const std::string& key);
878  bool removeMember(const char* key, Value* removed);
885  bool removeMember(std::string const& key, Value* removed);
887  bool removeMember(const char* begin, const char* end, Value* removed);
894  bool removeIndex(ArrayIndex i, Value* removed);
895 
898  bool isMember(const char* key) const;
901  bool isMember(const std::string& key) const;
903  bool isMember(const char* begin, const char* end) const;
904 #ifdef JSON_USE_CPPTL
905  bool isMember(const CppTL::ConstString& key) const;
907 #endif
908 
914  Members getMemberNames() const;
915 
916  //# ifdef JSON_USE_CPPTL
917  // EnumMemberNames enumMemberNames() const;
918  // EnumValues enumValues() const;
919  //# endif
920 
922  JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.")
923  void setComment(const char* comment, CommentPlacement placement);
925  void setComment(const char* comment, size_t len, CommentPlacement placement);
927  void setComment(const std::string& comment, CommentPlacement placement);
928  bool hasComment(CommentPlacement placement) const;
930  std::string getComment(CommentPlacement placement) const;
931 
932  std::string toStyledString() const;
933 
936 
937  iterator begin();
938  iterator end();
939 
940  // Accessors for the [start, limit) range of bytes within the JSON text from
941  // which this value was parsed, if any.
942  void setOffsetStart(size_t start);
943  void setOffsetLimit(size_t limit);
944  size_t getOffsetStart() const;
945  size_t getOffsetLimit() const;
946 
947 private:
948  void initBasic(ValueType type, bool allocated = false);
949 
950  Value& resolveReference(const char* key);
951  Value& resolveReference(const char* key, const char* end);
952 
953  struct CommentInfo {
954  CommentInfo();
955  ~CommentInfo();
956 
957  void setComment(const char* text, size_t len);
958 
959  char* comment_;
960  };
961 
962  // struct MemberNamesTransform
963  //{
964  // typedef const char *result_type;
965  // const char *operator()( const CZString &name ) const
966  // {
967  // return name.c_str();
968  // }
969  //};
970 
971  union ValueHolder {
974  double real_;
975  bool bool_;
976  char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
978  } value_;
980  unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
981  // If not allocated_, string_ must be null-terminated.
983 
984  // [start, limit) byte offsets in the source JSON text from which this Value
985  // was extracted.
986  size_t start_;
987  size_t limit_;
988 };
989 
994 public:
995  friend class Path;
996 
997  PathArgument();
999  PathArgument(const char* key);
1000  PathArgument(const std::string& key);
1001 
1002 private:
1003  enum Kind {
1004  kindNone = 0,
1006  kindKey
1007  };
1011 };
1012 
1025 public:
1026  Path(const std::string& path,
1027  const PathArgument& a1 = PathArgument(),
1028  const PathArgument& a2 = PathArgument(),
1029  const PathArgument& a3 = PathArgument(),
1030  const PathArgument& a4 = PathArgument(),
1031  const PathArgument& a5 = PathArgument());
1032 
1033  const Value& resolve(const Value& root) const;
1034  Value resolve(const Value& root, const Value& defaultValue) const;
1037  Value& make(Value& root) const;
1038 
1039 private:
1040  typedef std::vector<const PathArgument*> InArgs;
1041  typedef std::vector<PathArgument> Args;
1042 
1043  void makePath(const std::string& path, const InArgs& in);
1044  void addPathInArg(const std::string& path,
1045  const InArgs& in,
1046  InArgs::const_iterator& itInArg,
1047  PathArgument::Kind kind);
1048  void invalidPath(const std::string& path, int location);
1049 
1051 };
1052 
1057 public:
1058  typedef std::bidirectional_iterator_tag iterator_category;
1059  typedef unsigned int size_t;
1060  typedef int difference_type;
1062 
1063  bool operator==(const SelfType& other) const { return isEqual(other); }
1064 
1065  bool operator!=(const SelfType& other) const { return !isEqual(other); }
1066 
1067  difference_type operator-(const SelfType& other) const {
1068  return other.computeDistance(*this);
1069  }
1070 
1073  Value key() const;
1074 
1076  UInt index() const;
1077 
1081  std::string name() const;
1082 
1086  JSONCPP_DEPRECATED("Use `key = name();` instead.")
1087  char const* memberName() const;
1091  char const* memberName(char const** end) const;
1092 
1093 protected:
1094  Value& deref() const;
1095 
1096  void increment();
1097 
1098  void decrement();
1099 
1100  difference_type computeDistance(const SelfType& other) const;
1101 
1102  bool isEqual(const SelfType& other) const;
1103 
1104  void copy(const SelfType& other);
1105 
1106 private:
1107  Value::ObjectValues::iterator current_;
1108  // Indicates that iterator is for a null value.
1109  bool isNull_;
1110 
1111 public:
1112  // For some reason, BORLAND needs these at the end, rather
1113  // than earlier. No idea why.
1115  explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
1116 };
1117 
1122  friend class Value;
1123 
1124 public:
1125  typedef const Value value_type;
1126  //typedef unsigned int size_t;
1127  //typedef int difference_type;
1128  typedef const Value& reference;
1129  typedef const Value* pointer;
1131 
1133  ValueConstIterator(ValueIterator const& other);
1134 
1135 private:
1138  explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
1139 public:
1140  SelfType& operator=(const ValueIteratorBase& other);
1141 
1143  SelfType temp(*this);
1144  ++*this;
1145  return temp;
1146  }
1147 
1149  SelfType temp(*this);
1150  --*this;
1151  return temp;
1152  }
1153 
1155  decrement();
1156  return *this;
1157  }
1158 
1160  increment();
1161  return *this;
1162  }
1163 
1164  reference operator*() const { return deref(); }
1165 
1166  pointer operator->() const { return &deref(); }
1167 };
1168 
1172  friend class Value;
1173 
1174 public:
1176  typedef unsigned int size_t;
1177  typedef int difference_type;
1178  typedef Value& reference;
1179  typedef Value* pointer;
1181 
1182  ValueIterator();
1183  explicit ValueIterator(const ValueConstIterator& other);
1184  ValueIterator(const ValueIterator& other);
1185 
1186 private:
1189  explicit ValueIterator(const Value::ObjectValues::iterator& current);
1190 public:
1191  SelfType& operator=(const SelfType& other);
1192 
1194  SelfType temp(*this);
1195  ++*this;
1196  return temp;
1197  }
1198 
1200  SelfType temp(*this);
1201  --*this;
1202  return temp;
1203  }
1204 
1206  decrement();
1207  return *this;
1208  }
1209 
1211  increment();
1212  return *this;
1213  }
1214 
1215  reference operator*() const { return deref(); }
1216 
1217  pointer operator->() const { return &deref(); }
1218 };
1219 
1220 } // namespace Json
1221 
1222 
1223 namespace std {
1225 template<>
1226 inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
1227 }
1228 
1229 
1230 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1231 #pragma warning(pop)
1232 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1233 
1234 #endif // CPPTL_JSON_H_INCLUDED
1235 
1236 // //////////////////////////////////////////////////////////////////////
1237 // End of content of file: include/json/value.h
1238 // //////////////////////////////////////////////////////////////////////
1239 
1240 
1241 
1242 
1243 
1244 
1245 // //////////////////////////////////////////////////////////////////////
1246 // Beginning of content of file: include/json/reader.h
1247 // //////////////////////////////////////////////////////////////////////
1248 
1249 // Copyright 2007-2010 Baptiste Lepilleur
1250 // Distributed under MIT license, or public domain if desired and
1251 // recognized in your jurisdiction.
1252 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
1253 
1254 #ifndef CPPTL_JSON_READER_H_INCLUDED
1255 #define CPPTL_JSON_READER_H_INCLUDED
1256 
1257 #if !defined(JSON_IS_AMALGAMATION)
1258 #include "features.h"
1259 #include "value.h"
1260 #endif // if !defined(JSON_IS_AMALGAMATION)
1261 #include <deque>
1262 #include <iosfwd>
1263 #include <stack>
1264 #include <string>
1265 #include <istream>
1266 
1267 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1268 // be used by...
1269 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1270 #pragma warning(push)
1271 #pragma warning(disable : 4251)
1272 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1273 
1274 namespace Json {
1275 
1282 public:
1283  typedef char Char;
1284  typedef const Char* Location;
1285 
1296  };
1297 
1301  Reader();
1302 
1306  Reader(const Features& features);
1307 
1322  bool
1323  parse(const std::string& document, Value& root, bool collectComments = true);
1324 
1343  bool parse(const char* beginDoc,
1344  const char* endDoc,
1345  Value& root,
1346  bool collectComments = true);
1347 
1350  bool parse(std::istream& is, Value& root, bool collectComments = true);
1351 
1361  JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
1362  std::string getFormatedErrorMessages() const;
1363 
1372  std::string getFormattedErrorMessages() const;
1373 
1381  std::vector<StructuredError> getStructuredErrors() const;
1382 
1389  bool pushError(const Value& value, const std::string& message);
1390 
1398  bool pushError(const Value& value, const std::string& message, const Value& extra);
1399 
1404  bool good() const;
1405 
1406 private:
1407  enum TokenType {
1408  tokenEndOfStream = 0,
1421  tokenError
1422  };
1423 
1424  class Token {
1425  public:
1427  Location start_;
1428  Location end_;
1429  };
1430 
1431  class ErrorInfo {
1432  public:
1435  Location extra_;
1436  };
1437 
1438  typedef std::deque<ErrorInfo> Errors;
1439 
1440  bool readToken(Token& token);
1441  void skipSpaces();
1442  bool match(Location pattern, int patternLength);
1443  bool readComment();
1444  bool readCStyleComment();
1445  bool readCppStyleComment();
1446  bool readString();
1447  void readNumber();
1448  bool readValue();
1449  bool readObject(Token& token);
1450  bool readArray(Token& token);
1451  bool decodeNumber(Token& token);
1452  bool decodeNumber(Token& token, Value& decoded);
1453  bool decodeString(Token& token);
1454  bool decodeString(Token& token, std::string& decoded);
1455  bool decodeDouble(Token& token);
1456  bool decodeDouble(Token& token, Value& decoded);
1457  bool decodeUnicodeCodePoint(Token& token,
1458  Location& current,
1459  Location end,
1460  unsigned int& unicode);
1461  bool decodeUnicodeEscapeSequence(Token& token,
1462  Location& current,
1463  Location end,
1464  unsigned int& unicode);
1465  bool addError(const std::string& message, Token& token, Location extra = 0);
1466  bool recoverFromError(TokenType skipUntilToken);
1467  bool addErrorAndRecover(const std::string& message,
1468  Token& token,
1469  TokenType skipUntilToken);
1470  void skipUntilSpace();
1471  Value& currentValue();
1472  Char getNextChar();
1473  void
1474  getLocationLineAndColumn(Location location, int& line, int& column) const;
1475  std::string getLocationLineAndColumn(Location location) const;
1476  void addComment(Location begin, Location end, CommentPlacement placement);
1477  void skipCommentTokens(Token& token);
1478 
1479  typedef std::stack<Value*> Nodes;
1483  Location begin_;
1484  Location end_;
1485  Location current_;
1486  Location lastValueEnd_;
1491 }; // Reader
1492 
1496 public:
1497  virtual ~CharReader() {}
1515  virtual bool parse(
1516  char const* beginDoc, char const* endDoc,
1517  Value* root, std::string* errs) = 0;
1518 
1520  public:
1521  virtual ~Factory() {}
1525  virtual CharReader* newCharReader() const = 0;
1526  }; // Factory
1527 }; // CharReader
1528 
1542 public:
1543  // Note: We use a Json::Value so that we can add data-members to this class
1544  // without a major version bump.
1582 
1584  ~CharReaderBuilder() override;
1585 
1586  CharReader* newCharReader() const override;
1587 
1591  bool validate(Json::Value* invalid) const;
1592 
1595  Value& operator[](std::string key);
1596 
1602  static void setDefaults(Json::Value* settings);
1608  static void strictMode(Json::Value* settings);
1609 };
1610 
1616  CharReader::Factory const&,
1617  std::istream&,
1618  Value* root, std::string* errs);
1619 
1644 JSON_API std::istream& operator>>(std::istream&, Value&);
1645 
1646 } // namespace Json
1647 
1648 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1649 #pragma warning(pop)
1650 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1651 
1652 #endif // CPPTL_JSON_READER_H_INCLUDED
1653 
1654 // //////////////////////////////////////////////////////////////////////
1655 // End of content of file: include/json/reader.h
1656 // //////////////////////////////////////////////////////////////////////
1657 
1658 
1659 
1660 
1661 
1662 
1663 // //////////////////////////////////////////////////////////////////////
1664 // Beginning of content of file: include/json/writer.h
1665 // //////////////////////////////////////////////////////////////////////
1666 
1667 // Copyright 2007-2010 Baptiste Lepilleur
1668 // Distributed under MIT license, or public domain if desired and
1669 // recognized in your jurisdiction.
1670 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
1671 
1672 #ifndef JSON_WRITER_H_INCLUDED
1673 #define JSON_WRITER_H_INCLUDED
1674 
1675 #if !defined(JSON_IS_AMALGAMATION)
1676 #include "value.h"
1677 #endif // if !defined(JSON_IS_AMALGAMATION)
1678 #include <vector>
1679 #include <string>
1680 #include <ostream>
1681 
1682 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1683 // be used by...
1684 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1685 #pragma warning(push)
1686 #pragma warning(disable : 4251)
1687 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1688 
1689 namespace Json {
1690 
1691 class Value;
1692 
1707 protected:
1708  std::ostream* sout_; // not owned; will not delete
1709 public:
1710  StreamWriter();
1711  virtual ~StreamWriter();
1718  virtual int write(Value const& root, std::ostream* sout) = 0;
1719 
1723  public:
1724  virtual ~Factory();
1728  virtual StreamWriter* newStreamWriter() const = 0;
1729  }; // Factory
1730 }; // StreamWriter
1731 
1736 
1737 
1754 public:
1755  // Note: We use a Json::Value so that we can add data-members to this class
1756  // without a major version bump.
1779 
1781  ~StreamWriterBuilder() override;
1782 
1786  StreamWriter* newStreamWriter() const override;
1787 
1791  bool validate(Json::Value* invalid) const;
1794  Value& operator[](std::string key);
1795 
1801  static void setDefaults(Json::Value* settings);
1802 };
1803 
1808 public:
1809  virtual ~Writer();
1810 
1811  virtual std::string write(const Value& root) = 0;
1812 };
1813 
1823 class JSON_API FastWriter : public Writer {
1824 
1825 public:
1826  FastWriter();
1827  ~FastWriter() override {}
1828 
1829  void enableYAMLCompatibility();
1830 
1836  void dropNullPlaceholders();
1837 
1838  void omitEndingLineFeed();
1839 
1840 public: // overridden from Writer
1841  std::string write(const Value& root) override;
1842 
1843 private:
1844  void writeValue(const Value& value);
1845 
1850 };
1851 
1876 class JSON_API StyledWriter : public Writer {
1877 public:
1878  StyledWriter();
1879  ~StyledWriter() override {}
1880 
1881 public: // overridden from Writer
1886  std::string write(const Value& root) override;
1887 
1888 private:
1889  void writeValue(const Value& value);
1890  void writeArrayValue(const Value& value);
1891  bool isMultineArray(const Value& value);
1892  void pushValue(const std::string& value);
1893  void writeIndent();
1894  void writeWithIndent(const std::string& value);
1895  void indent();
1896  void unindent();
1897  void writeCommentBeforeValue(const Value& root);
1898  void writeCommentAfterValueOnSameLine(const Value& root);
1899  bool hasCommentForValue(const Value& value);
1900  static std::string normalizeEOL(const std::string& text);
1901 
1902  typedef std::vector<std::string> ChildValues;
1903 
1910 };
1911 
1939 public:
1940  StyledStreamWriter(std::string indentation = "\t");
1942 
1943 public:
1950  void write(std::ostream& out, const Value& root);
1951 
1952 private:
1953  void writeValue(const Value& value);
1954  void writeArrayValue(const Value& value);
1955  bool isMultineArray(const Value& value);
1956  void pushValue(const std::string& value);
1957  void writeIndent();
1958  void writeWithIndent(const std::string& value);
1959  void indent();
1960  void unindent();
1961  void writeCommentBeforeValue(const Value& root);
1962  void writeCommentAfterValueOnSameLine(const Value& root);
1963  bool hasCommentForValue(const Value& value);
1964  static std::string normalizeEOL(const std::string& text);
1965 
1966  typedef std::vector<std::string> ChildValues;
1967 
1969  std::ostream* document_;
1974  bool indented_ : 1;
1975 };
1976 
1977 #if defined(JSON_HAS_INT64)
1980 #endif // if defined(JSON_HAS_INT64)
1986 
1989 JSON_API std::ostream& operator<<(std::ostream&, const Value& root);
1990 
1991 } // namespace Json
1992 
1993 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1994 #pragma warning(pop)
1995 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1996 
1997 #endif // JSON_WRITER_H_INCLUDED
1998 
1999 // //////////////////////////////////////////////////////////////////////
2000 // End of content of file: include/json/writer.h
2001 // //////////////////////////////////////////////////////////////////////
2002 
2003 
2004 
2005 
2006 
2007 
2008 // //////////////////////////////////////////////////////////////////////
2009 // Beginning of content of file: include/json/assertions.h
2010 // //////////////////////////////////////////////////////////////////////
2011 
2012 // Copyright 2007-2010 Baptiste Lepilleur
2013 // Distributed under MIT license, or public domain if desired and
2014 // recognized in your jurisdiction.
2015 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
2016 
2017 #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
2018 #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
2019 
2020 #include <stdlib.h>
2021 #include <sstream>
2022 
2023 #if !defined(JSON_IS_AMALGAMATION)
2024 #include "config.h"
2025 #endif // if !defined(JSON_IS_AMALGAMATION)
2026 
2031 #if JSON_USE_EXCEPTION
2032 
2033 // @todo <= add detail about condition in exception
2034 # define JSON_ASSERT(condition) \
2035  {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
2036 
2037 # define JSON_FAIL_MESSAGE(message) \
2038  { \
2039  std::ostringstream oss; oss << message; \
2040  Json::throwLogicError(oss.str()); \
2041  abort(); \
2042  }
2043 
2044 #else // JSON_USE_EXCEPTION
2045 
2046 # define JSON_ASSERT(condition) assert(condition)
2047 
2048 // The call to assert() will show the failure message in debug builds. In
2049 // release builds we abort, for a core-dump or debugger.
2050 # define JSON_FAIL_MESSAGE(message) \
2051  { \
2052  std::ostringstream oss; oss << message; \
2053  assert(false && oss.str().c_str()); \
2054  abort(); \
2055  }
2056 
2057 
2058 #endif
2059 
2060 #define JSON_ASSERT_MESSAGE(condition, message) \
2061  if (!(condition)) { \
2062  JSON_FAIL_MESSAGE(message); \
2063  }
2064 
2065 #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
2066 
2067 // //////////////////////////////////////////////////////////////////////
2068 // End of content of file: include/json/assertions.h
2069 // //////////////////////////////////////////////////////////////////////
2070 
2071 
2072 
2073 
2074 
2075 #endif //ifndef JSON_AMALGATED_H_INCLUDED
Json::CharReaderBuilder::settings_
Json::Value settings_
Definition: json.h:1581
Json::ValueConstIterator::operator++
SelfType & operator++()
Definition: json.h:1159
Json::RuntimeError
Definition: json.h:440
Json::CharReaderBuilder
Build a CharReader implementation.
Definition: json.h:1541
Json::UInt64
unsigned long long int UInt64
Definition: json.h:241
Json::StreamWriterBuilder
Build a StreamWriter implementation.
Definition: json.h:1753
forwards.h
Json::Value::LargestUInt
Json::LargestUInt LargestUInt
Definition: json.h:560
name
GLuint const GLchar * name
Definition: glcorearb.h:3055
Json::Path::args_
Args args_
Definition: json.h:1050
Json::ValueIterator
Iterator for object and array value.
Definition: json.h:1171
Json::StaticString::c_str_
const char * c_str_
Definition: json.h:510
Json::Reader::tokenFalse
@ tokenFalse
Definition: json.h:1416
Json::CommentPlacement
CommentPlacement
Definition: json.h:474
Json::ValueConstIterator::operator->
pointer operator->() const
Definition: json.h:1166
Json::writeString
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:5169
benchmarks.python.py_benchmark.const
const
Definition: py_benchmark.py:14
Json::StreamWriter::sout_
std::ostream * sout_
Definition: json.h:1708
end
GLuint GLuint end
Definition: glcorearb.h:2858
Json::ValueIterator::pointer
Value * pointer
Definition: json.h:1179
parse
size_t parse(void *closure, const void *hd, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: php/ext/google/protobuf/upb.c:11625
Json::Reader::Token::start_
Location start_
Definition: json.h:1427
Json::ValueIteratorBase::size_t
unsigned int size_t
Definition: json.h:1059
Json::Features::allowDroppedNullPlaceholders_
bool allowDroppedNullPlaceholders_
true if dropped null placeholders are allowed. Default: false.
Definition: json.h:363
Json::ValueIterator::operator++
SelfType operator++(int)
Definition: json.h:1193
indent
static int indent(upb_textprinter *p)
Definition: php/ext/google/protobuf/upb.c:8400
length
GLenum GLuint GLenum GLsizei length
Definition: glcorearb.h:2695
Json::Reader::Token
Definition: json.h:1424
Json::Value::type_
ValueType type_
Definition: json.h:979
Json::Reader::current_
Location current_
Definition: json.h:1485
get
ROSCPP_DECL bool get(const std::string &key, bool &b)
Json::Value::CZString::StringStorage
Definition: json.h:616
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json.h:470
Json::booleanValue
@ booleanValue
bool value
Definition: json.h:469
Json::Value::ObjectValues
std::map< CZString, Value > ObjectValues
Definition: json.h:630
Json::StaticString::StaticString
StaticString(const char *czstring)
Definition: json.h:503
Json::CharReader::~CharReader
virtual ~CharReader()
Definition: json.h:1497
Json::StyledWriter::~StyledWriter
~StyledWriter() override
Definition: json.h:1879
Json::Reader::nodes_
Nodes nodes_
Definition: json.h:1480
Json::Path
Experimental and untested: represents a "path" to access a node.
Definition: json.h:1024
Json::PathArgument::key_
std::string key_
Definition: json.h:1008
Json::PathArgument::kindIndex
@ kindIndex
Definition: json.h:1005
Json::Value::const_iterator
ValueConstIterator const_iterator
Definition: json.h:552
Json::Value::limit_
size_t limit_
Definition: json.h:987
Json::Features::strictRoot_
bool strictRoot_
Definition: json.h:360
Json::Features
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
Definition: json.h:333
Json::LargestInt
Int64 LargestInt
Definition: json.h:243
Json::Reader::Char
char Char
Definition: json.h:1283
Json::FastWriter::dropNullPlaceholders_
bool dropNullPlaceholders_
Definition: json.h:1848
Json::numberOfCommentPlacement
@ numberOfCommentPlacement
root value)
Definition: json.h:479
zmq::operator>
bool operator>(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
Definition: zmq.hpp:2158
Json::ValueIteratorBase::operator==
bool operator==(const SelfType &other) const
Definition: json.h:1063
Json::realValue
@ realValue
double value
Definition: json.h:467
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
Json::Reader::features_
Features features_
Definition: json.h:1489
Value
Definition: struct.pb.h:304
Json::Value::start_
size_t start_
Definition: json.h:986
JSON_API
#define JSON_API
Definition: json.h:162
Json::Reader::tokenComment
@ tokenComment
Definition: json.h:1420
zmq::operator<
bool operator<(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
Definition: zmq.hpp:2154
zmq::operator>=
bool operator>=(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
Definition: zmq.hpp:2166
Json::Features::allowComments_
bool allowComments_
true if comments are allowed. Default: true.
Definition: json.h:356
Json::Value::CZString::storage_
StringStorage storage_
Definition: json.h:624
Json::Reader::ErrorInfo
Definition: json.h:1431
Json::Value::maxInt
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
Definition: json.h:575
Json::Value::CZString::duplicate
@ duplicate
Definition: json.h:594
Json::Value::maxUInt
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Definition: json.h:577
Json::Reader
Unserialize a JSON document into a Value.
Definition: json.h:1281
Json::ValueIterator::difference_type
int difference_type
Definition: json.h:1177
Json::Reader::collectComments_
bool collectComments_
Definition: json.h:1490
Json::Value::maxInt64
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Definition: json.h:583
Json::Value::UInt
Json::UInt UInt
Definition: json.h:553
Json::Reader::ErrorInfo::extra_
Location extra_
Definition: json.h:1435
Json::Reader::tokenTrue
@ tokenTrue
Definition: json.h:1415
Json::Exception
Definition: json.h:425
Json::StyledStreamWriter::indented_
bool indented_
Definition: json.h:1974
Json::StyledWriter::indentString_
std::string indentString_
Definition: json.h:1906
Json::FastWriter::omitEndingLineFeed_
bool omitEndingLineFeed_
Definition: json.h:1849
Json::StyledStreamWriter::rightMargin_
int rightMargin_
Definition: json.h:1971
validate
ROSCPP_DECL bool validate(const std::string &name, std::string &error)
b
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:3228
Json::StyledWriter::ChildValues
std::vector< std::string > ChildValues
Definition: json.h:1902
Json::Value::nullRef
static const Value & nullRef
Definition: json.h:564
Json::Reader::tokenMemberSeparator
@ tokenMemberSeparator
Definition: json.h:1419
Json::StyledWriter::indentSize_
int indentSize_
Definition: json.h:1908
resolve
ROSCPP_DECL std::string resolve(const std::string &name, bool remap=true)
Json::operator<<
JSON_API std::ostream & operator<<(std::ostream &, const Value &root)
Output using the StyledStreamWriter.
Definition: jsoncpp.cpp:5176
Json::ValueConstIterator::operator--
SelfType operator--(int)
Definition: json.h:1148
Json::Value::CZString::index_
ArrayIndex index_
Definition: json.h:623
begin
static size_t begin(const upb_table *t)
Definition: php/ext/google/protobuf/upb.c:4898
Json::StyledWriter::document_
std::string document_
Definition: json.h:1905
Json::Value::ValueHolder::map_
ObjectValues * map_
Definition: json.h:977
Json::uintValue
@ uintValue
unsigned integer value
Definition: json.h:466
Json::Reader::lastValueEnd_
Location lastValueEnd_
Definition: json.h:1486
Json::StyledStreamWriter::document_
std::ostream * document_
Definition: json.h:1969
Json::StaticString::c_str
const char * c_str() const
Definition: json.h:507
Json::Reader::Token::type_
TokenType type_
Definition: json.h:1426
Json
JSON (JavaScript Object Notation).
Definition: json.h:227
Json::Reader::ErrorInfo::token_
Token token_
Definition: json.h:1433
mingw.root
def root(location=None, arch=None, version=None, threading=None, exceptions=None, revision=None, log=EmptyLogger())
Definition: mingw.py:172
Json::Reader::document_
std::string document_
Definition: json.h:1482
Json::CharReader::Factory::~Factory
virtual ~Factory()
Definition: json.h:1521
path
GLsizei const GLchar ** path
Definition: glcorearb.h:3658
Json::Value::CZString::StringStorage::policy_
unsigned policy_
Definition: json.h:617
Json::Reader::Nodes
std::stack< Value * > Nodes
Definition: json.h:1479
Json::Features::allowNumericKeys_
bool allowNumericKeys_
true if numeric object key are allowed. Default: false.
Definition: json.h:366
Json::Reader::end_
Location end_
Definition: json.h:1484
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json.h:471
Json::ValueIterator::operator++
SelfType & operator++()
Definition: json.h:1210
Json::Value::Int
Json::Int Int
Definition: json.h:554
Json::Value::maxLargestUInt
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
Definition: json.h:570
Json::ValueIterator::operator*
reference operator*() const
Definition: json.h:1215
start
GLuint start
Definition: glcorearb.h:2858
operator==
bool operator==(const in6_addr a, const in6_addr b)
Json::Reader::StructuredError
An error tagged with where in the JSON text it was encountered.
Definition: json.h:1292
update_failure_list.str
str
Definition: update_failure_list.py:41
Json::ValueIteratorBase::operator!=
bool operator!=(const SelfType &other) const
Definition: json.h:1065
Json::StyledWriter
Writes a Value in JSON format in a human friendly way.
Definition: json.h:1876
Json::ArrayIndex
unsigned int ArrayIndex
Definition: json.h:286
Json::Reader::tokenObjectBegin
@ tokenObjectBegin
Definition: json.h:1409
Json::StreamWriter
Definition: json.h:1706
Json::ValueConstIterator
const iterator for object and array value.
Definition: json.h:1121
Json::Reader::commentsBefore_
std::string commentsBefore_
Definition: json.h:1488
std::swap
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
Definition: json.h:1226
Json::ValueIteratorBase
base class for Value iterators.
Definition: json.h:1056
size
#define size
Definition: glcorearb.h:2944
Json::Value::CommentInfo::comment_
char * comment_
Definition: json.h:959
Json::valueToString
std::string JSON_API valueToString(Int value)
Json::StyledStreamWriter
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
Definition: json.h:1938
Json::Value::ValueHolder::real_
double real_
Definition: json.h:974
Json::StyledStreamWriter::~StyledStreamWriter
~StyledStreamWriter()
Definition: json.h:1941
Json::commentBefore
@ commentBefore
a comment placed on the line before a value
Definition: json.h:475
Json::Value::iterator
ValueIterator iterator
Definition: json.h:551
Json::LogicError
Definition: json.h:451
Json::Int
int Int
Definition: json.h:228
Json::parseFromStream
bool JSON_API parseFromStream(CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
Definition: jsoncpp.cpp:2191
Json::Path::InArgs
std::vector< const PathArgument * > InArgs
Definition: json.h:1040
Json::Reader::tokenNumber
@ tokenNumber
Definition: json.h:1414
Json::ValueConstIterator::value_type
const typedef Value value_type
Definition: json.h:1125
Json::Reader::StructuredError::offset_start
size_t offset_start
Definition: json.h:1293
Json::stringValue
@ stringValue
UTF-8 string value.
Definition: json.h:468
Json::ValueType
ValueType
Type of the value held by a Value object.
Definition: json.h:463
Json::Reader::begin_
Location begin_
Definition: json.h:1483
key
const SETUP_TEARDOWN_TESTCONTEXT char * key
Definition: test_wss_transport.cpp:10
Json::ValueIterator::operator--
SelfType & operator--()
Definition: json.h:1205
Json::ValueConstIterator::operator*
reference operator*() const
Definition: json.h:1164
Json::Value::Int64
Json::Int64 Int64
Definition: json.h:557
Json::ValueIterator::size_t
unsigned int size_t
Definition: json.h:1176
Json::commentAfter
@ commentAfter
Definition: json.h:477
location
GLint location
Definition: glcorearb.h:3074
Json::LargestUInt
UInt64 LargestUInt
Definition: json.h:244
Json::UInt
unsigned int UInt
Definition: json.h:229
Json::Reader::TokenType
TokenType
Definition: json.h:1407
Json::CharReader
Definition: json.h:1495
void
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
Json::ValueIterator::operator--
SelfType operator--(int)
Definition: json.h:1199
Json::ValueIterator::SelfType
ValueIterator SelfType
Definition: json.h:1180
i
int i
Definition: gmock-matchers_test.cc:764
Json::Value::minInt
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Definition: json.h:573
value_
int value_
Definition: gmock-matchers_test.cc:571
Json::Reader::Location
const typedef Char * Location
Definition: json.h:1284
Json::Reader::tokenArrayBegin
@ tokenArrayBegin
Definition: json.h:1411
type
GLenum type
Definition: glcorearb.h:2695
Json::ValueIteratorBase::operator-
difference_type operator-(const SelfType &other) const
Definition: json.h:1067
Json::ValueIteratorBase::difference_type
int difference_type
Definition: json.h:1060
Json::Value::maxLargestInt
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
Definition: json.h:568
Json::Reader::Token::end_
Location end_
Definition: json.h:1428
Json::ValueIteratorBase::computeDistance
difference_type computeDistance(const SelfType &other) const
Definition: jsoncpp.cpp:2272
Json::Reader::tokenObjectEnd
@ tokenObjectEnd
Definition: json.h:1410
len
int len
Definition: php/ext/google/protobuf/map.c:206
JSONCPP_DEPRECATED
#define JSONCPP_DEPRECATED(message)
Definition: json.h:224
Json::Reader::errors_
Errors errors_
Definition: json.h:1481
Json::StyledStreamWriter::ChildValues
std::vector< std::string > ChildValues
Definition: json.h:1966
Json::ValueIterator::operator->
pointer operator->() const
Definition: json.h:1217
Json::Value::CZString::DuplicationPolicy
DuplicationPolicy
Definition: json.h:592
Json::Reader::tokenArrayEnd
@ tokenArrayEnd
Definition: json.h:1412
Json::PathArgument
Experimental and untested: represents an element of the "path" to access a node.
Definition: json.h:993
append
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
Json::PathArgument::kind_
Kind kind_
Definition: json.h:1010
pointer
GLenum GLvoid ** pointer
Definition: glcorearb.h:3079
Json::operator>>
JSON_API std::istream & operator>>(std::istream &, Value &)
Read from 'sin' into 'root'.
Definition: jsoncpp.cpp:2205
Json::Value::CZString
Definition: json.h:590
Json::CharReader::Factory
Definition: json.h:1519
Json::StreamWriter::Factory
A simple abstract factory.
Definition: json.h:1722
Json::Reader::StructuredError::message
std::string message
Definition: json.h:1295
Json::ValueConstIterator::operator--
SelfType & operator--()
Definition: json.h:1154
Json::Value::maxUInt64
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Definition: json.h:585
size
GLsizeiptr size
Definition: glcorearb.h:2943
Json::ValueConstIterator::operator++
SelfType operator++(int)
Definition: json.h:1142
Json::StaticString
Lightweight wrapper to tag static string.
Definition: json.h:501
zmq::operator!=
bool operator!=(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
Definition: zmq.hpp:2150
std
Json::intValue
@ intValue
signed integer value
Definition: json.h:465
Json::ValueConstIterator::pointer
const typedef Value * pointer
Definition: json.h:1129
Json::StyledWriter::addChildValues_
bool addChildValues_
Definition: json.h:1909
Json::Value::ArrayIndex
Json::ArrayIndex ArrayIndex
Definition: json.h:561
Json::PathArgument::Kind
Kind
Definition: json.h:1003
Json::ValueIterator::reference
Value & reference
Definition: json.h:1178
Json::FastWriter
Outputs a Value in JSON format without formatting (not human friendly).
Definition: json.h:1823
Json::nullValue
@ nullValue
'null' value
Definition: json.h:464
Json::valueToQuotedString
std::string JSON_API valueToQuotedString(const char *value)
Definition: jsoncpp.cpp:4139
Json::Value::ValueHolder::int_
LargestInt int_
Definition: json.h:972
Json::Reader::lastValue_
Value * lastValue_
Definition: json.h:1487
Json::Value::CZString::cstr_
char const * cstr_
Definition: json.h:621
Json::Value::ValueHolder::bool_
bool bool_
Definition: json.h:975
Json::Value::ValueHolder::string_
char * string_
Definition: json.h:976
Json::Value::allocated_
unsigned int allocated_
Definition: json.h:980
Json::Value::Members
std::vector< std::string > Members
Definition: json.h:550
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: glcorearb.h:2879
Json::Exception::msg_
std::string msg_
Definition: json.h:431
Json::ValueConstIterator::reference
const typedef Value & reference
Definition: json.h:1128
Json::StyledWriter::rightMargin_
int rightMargin_
Definition: json.h:1907
google::protobuf::operator!
bool operator!(const uint128 &val)
Definition: int128.h:195
Json::Reader::ErrorInfo::message_
std::string message_
Definition: json.h:1434
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
Json::Value::ValueHolder
Definition: json.h:971
Json::StyledStreamWriter::addChildValues_
bool addChildValues_
Definition: json.h:1973
Json::PathArgument::index_
ArrayIndex index_
Definition: json.h:1009
Json::ValueConstIterator::SelfType
ValueConstIterator SelfType
Definition: json.h:1130
Json::throwRuntimeError
void throwRuntimeError(std::string const &msg)
used internally
Definition: jsoncpp.cpp:2584
Json::ValueIteratorBase::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition: json.h:1058
Json::StyledStreamWriter::indentation_
std::string indentation_
Definition: json.h:1972
false
#define false
Definition: cJSON.c:70
Json::normalizeEOL
static std::string normalizeEOL(Reader::Location begin, Reader::Location end)
Definition: jsoncpp.cpp:556
Json::StyledStreamWriter::childValues_
ChildValues childValues_
Definition: json.h:1968
index
GLuint index
Definition: glcorearb.h:3055
Json::Writer
Abstract class for writers.
Definition: json.h:1807
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:3228
Json::StreamWriterBuilder::settings_
Json::Value settings_
Definition: json.h:1778
Json::StyledStreamWriter::indentString_
std::string indentString_
Definition: json.h:1970
Json::ValueIteratorBase::SelfType
ValueIteratorBase SelfType
Definition: json.h:1061
Json::commentAfterOnSameLine
@ commentAfterOnSameLine
a comment just after a value on the same line
Definition: json.h:476
Json::Reader::tokenNull
@ tokenNull
Definition: json.h:1417
Json::Int64
long long int Int64
Definition: json.h:240
Json::Reader::tokenString
@ tokenString
Definition: json.h:1413
Json::Value::CommentInfo
Definition: json.h:953
Json::Value::LargestInt
Json::LargestInt LargestInt
Definition: json.h:559
message
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glcorearb.h:2695
Json::StyledWriter::childValues_
ChildValues childValues_
Definition: json.h:1904
Json::FastWriter::~FastWriter
~FastWriter() override
Definition: json.h:1827
Json::Path::Args
std::vector< PathArgument > Args
Definition: json.h:1041
Json::FastWriter::yamlCompatiblityEnabled_
bool yamlCompatiblityEnabled_
Definition: json.h:1847
Json::Reader::StructuredError::offset_limit
size_t offset_limit
Definition: json.h:1294
Json::Value
Represents a JSON value.
Definition: json.h:547
Json::Value::ValueHolder::uint_
LargestUInt uint_
Definition: json.h:973
Json::ValueIterator::value_type
Value value_type
Definition: json.h:1175
Value::operator=
Value & operator=(const Value &from)
Definition: struct.pb.h:316
Json::FastWriter::document_
std::string document_
Definition: json.h:1846
Json::Value::UInt64
Json::UInt64 UInt64
Definition: json.h:556
Json::throwLogicError
void throwLogicError(std::string const &msg)
used internally
Definition: jsoncpp.cpp:2588
Json::Value::CZString::StringStorage::length_
unsigned length_
Definition: json.h:618
Json::Reader::Errors
std::deque< ErrorInfo > Errors
Definition: json.h:1438
zmq::operator<=
bool operator<=(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
Definition: zmq.hpp:2162
Json::Value::comments_
CommentInfo * comments_
Definition: json.h:982
Json::Reader::tokenArraySeparator
@ tokenArraySeparator
Definition: json.h:1418
Value
struct Value Value
Definition: php/ext/google/protobuf/protobuf.h:667


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:55