1 /// Json-cpp amalgamated forward header (http://jsoncpp.sourceforge.net/).
2 /// It is intended to be used with #include "json/json-forwards.h"
3 /// This header provides forward declaration for all JsonCpp types.
5 // //////////////////////////////////////////////////////////////////////
6 // Beginning of content of file: LICENSE
7 // //////////////////////////////////////////////////////////////////////
10 The JsonCpp library's source code, including accompanying documentation,
11 tests and demonstration applications, are licensed under the following
14 Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
15 jurisdictions which recognize such a disclaimer. In such jurisdictions,
16 this software is released into the Public Domain.
18 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
19 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
20 The JsonCpp Authors, and is released under the terms of the MIT License (see below).
22 In jurisdictions which recognize Public Domain property, the user of this
23 software may choose to accept it either as 1) Public Domain, 2) under the
24 conditions of the MIT License (see below), or 3) under the terms of dual
25 Public Domain/MIT License conditions described here, as they choose.
27 The MIT License is about as close to Public Domain as a license can get, and is
28 described in clear, concise terms at:
30 http://en.wikipedia.org/wiki/MIT_License
32 The full text of the MIT License follows:
34 ========================================================================
35 Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
37 Permission is hereby granted, free of charge, to any person
38 obtaining a copy of this software and associated documentation
39 files (the "Software"), to deal in the Software without
40 restriction, including without limitation the rights to use, copy,
41 modify, merge, publish, distribute, sublicense, and/or sell copies
42 of the Software, and to permit persons to whom the Software is
43 furnished to do so, subject to the following conditions:
45 The above copyright notice and this permission notice shall be
46 included in all copies or substantial portions of the Software.
48 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
49 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
51 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
52 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
53 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
54 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56 ========================================================================
59 The MIT license is compatible with both the GPL and commercial
60 software, affording one all of the rights of Public Domain with the
61 minor nuisance of being required to keep the above copyright notice
62 and license text in the source code. Note also that by accepting the
63 Public Domain "license" you can re-license your copy using whatever
68 // //////////////////////////////////////////////////////////////////////
69 // End of content of file: LICENSE
70 // //////////////////////////////////////////////////////////////////////
76 #ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED
77 # define JSON_FORWARD_AMALGAMATED_H_INCLUDED
78 /// If defined, indicates that the source file is amalgamated
79 /// to prevent private header inclusion.
80 #define JSON_IS_AMALGAMATION
82 // //////////////////////////////////////////////////////////////////////
83 // Beginning of content of file: include/json/config.h
84 // //////////////////////////////////////////////////////////////////////
86 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
87 // Distributed under MIT license, or public domain if desired and
88 // recognized in your jurisdiction.
89 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
91 #ifndef JSON_CONFIG_H_INCLUDED
92 #define JSON_CONFIG_H_INCLUDED
94 #include <string> //typedef String
95 #include <stdint.h> //typedef int64_t, uint64_t
97 /// If defined, indicates that json library is embedded in CppTL library.
98 //# define JSON_IN_CPPTL 1
100 /// If defined, indicates that json may leverage CppTL library
101 //# define JSON_USE_CPPTL 1
102 /// If defined, indicates that cpptl vector based map should be used instead of
104 /// as Value container.
105 //# define JSON_USE_CPPTL_SMALLMAP 1
107 // If non-zero, the library uses exceptions to report bad input instead of C
108 // assertion macros. The default is to use exceptions.
109 #ifndef JSON_USE_EXCEPTION
110 #define JSON_USE_EXCEPTION 1
113 /// If defined, indicates that the source file is amalgamated
114 /// to prevent private header inclusion.
115 /// Remarks: it is automatically defined in the generated amalgamated header.
116 // #define JSON_IS_AMALGAMATION
119 #include <cpptl/config.h>
120 #ifndef JSON_USE_CPPTL
121 #define JSON_USE_CPPTL 1
126 #define JSON_API CPPTL_API
127 #elif defined(JSON_DLL_BUILD)
128 #if defined(_MSC_VER) || defined(__MINGW32__)
129 #define JSON_API __declspec(dllexport)
130 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
131 #endif // if defined(_MSC_VER)
132 #elif defined(JSON_DLL)
133 #if defined(_MSC_VER) || defined(__MINGW32__)
134 #define JSON_API __declspec(dllimport)
135 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
136 #endif // if defined(_MSC_VER)
137 #endif // ifdef JSON_IN_CPPTL
138 #if !defined(JSON_API)
142 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
144 // Storages, and 64 bits integer support is disabled.
145 // #define JSON_NO_INT64 1
147 #if defined(_MSC_VER) // MSVC
148 # if _MSC_VER <= 1200 // MSVC 6
149 // Microsoft Visual Studio 6 only support conversion from __int64 to double
150 // (no conversion from unsigned __int64).
151 # define JSON_USE_INT64_DOUBLE_CONVERSION 1
152 // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
153 // characters in the debug information)
154 // All projects I've ever seen with VS6 were using this globally (not bothering
155 // with pragma push/pop).
156 # pragma warning(disable : 4786)
159 # if _MSC_VER >= 1500 // MSVC 2008
160 /// Indicates that the following function is deprecated.
161 # define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
164 #endif // defined(_MSC_VER)
166 // In c++11 the override keyword allows you to explicitly define that a function
167 // is intended to override the base-class version. This makes the code more
168 // managable and fixes a set of common hard-to-find bugs.
169 #if __cplusplus >= 201103L
170 # define JSONCPP_OVERRIDE override
171 # define JSONCPP_NOEXCEPT noexcept
172 #elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
173 # define JSONCPP_OVERRIDE override
174 # define JSONCPP_NOEXCEPT throw()
175 #elif defined(_MSC_VER) && _MSC_VER >= 1900
176 # define JSONCPP_OVERRIDE override
177 # define JSONCPP_NOEXCEPT noexcept
179 # define JSONCPP_OVERRIDE
180 # define JSONCPP_NOEXCEPT throw()
183 #ifndef JSON_HAS_RVALUE_REFERENCES
185 #if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
186 #define JSON_HAS_RVALUE_REFERENCES 1
187 #endif // MSVC >= 2010
190 #if __has_feature(cxx_rvalue_references)
191 #define JSON_HAS_RVALUE_REFERENCES 1
192 #endif // has_feature
194 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
195 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
196 #define JSON_HAS_RVALUE_REFERENCES 1
197 #endif // GXX_EXPERIMENTAL
199 #endif // __clang__ || __GNUC__
201 #endif // not defined JSON_HAS_RVALUE_REFERENCES
203 #ifndef JSON_HAS_RVALUE_REFERENCES
204 #define JSON_HAS_RVALUE_REFERENCES 0
208 # if __has_extension(attribute_deprecated_with_message)
209 # define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
211 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
212 # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
213 # define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
214 # elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
215 # define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
216 # endif // GNUC version
217 #endif // __clang__ || __GNUC__
219 #if !defined(JSONCPP_DEPRECATED)
220 #define JSONCPP_DEPRECATED(message)
221 #endif // if !defined(JSONCPP_DEPRECATED)
224 # define JSON_USE_INT64_DOUBLE_CONVERSION 1
227 #if !defined(JSON_IS_AMALGAMATION)
229 # include "version.h"
231 # if JSONCPP_USING_SECURE_MEMORY
232 # include "allocator.h" //typedef Allocator
235 #endif // if !defined(JSON_IS_AMALGAMATION)
239 typedef unsigned int UInt
;
240 #if defined(JSON_NO_INT64)
241 typedef int LargestInt
;
242 typedef unsigned int LargestUInt
;
243 #undef JSON_HAS_INT64
244 #else // if defined(JSON_NO_INT64)
245 // For Microsoft Visual use specific types as long long is not supported
246 #if defined(_MSC_VER) // Microsoft Visual Studio
247 typedef __int64 Int64
;
248 typedef unsigned __int64 UInt64
;
249 #else // if defined(_MSC_VER) // Other platforms, use long long
250 typedef int64_t Int64
;
251 typedef uint64_t UInt64
;
252 #endif // if defined(_MSC_VER)
253 typedef Int64 LargestInt
;
254 typedef UInt64 LargestUInt
;
255 #define JSON_HAS_INT64
256 #endif // if defined(JSON_NO_INT64)
257 #if JSONCPP_USING_SECURE_MEMORY
258 #define JSONCPP_STRING std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >
259 #define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
260 #define JSONCPP_OSTREAM std::basic_ostream<char, std::char_traits<char>>
261 #define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
262 #define JSONCPP_ISTREAM std::istream
264 #define JSONCPP_STRING std::string
265 #define JSONCPP_OSTRINGSTREAM std::ostringstream
266 #define JSONCPP_OSTREAM std::ostream
267 #define JSONCPP_ISTRINGSTREAM std::istringstream
268 #define JSONCPP_ISTREAM std::istream
269 #endif // if JSONCPP_USING_SECURE_MEMORY
270 } // end namespace Json
272 #endif // JSON_CONFIG_H_INCLUDED
274 // //////////////////////////////////////////////////////////////////////
275 // End of content of file: include/json/config.h
276 // //////////////////////////////////////////////////////////////////////
283 // //////////////////////////////////////////////////////////////////////
284 // Beginning of content of file: include/json/forwards.h
285 // //////////////////////////////////////////////////////////////////////
287 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
288 // Distributed under MIT license, or public domain if desired and
289 // recognized in your jurisdiction.
290 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
292 #ifndef JSON_FORWARDS_H_INCLUDED
293 #define JSON_FORWARDS_H_INCLUDED
295 #if !defined(JSON_IS_AMALGAMATION)
297 #endif // if !defined(JSON_IS_AMALGAMATION)
312 typedef unsigned int ArrayIndex
;
317 class ValueIteratorBase
;
319 class ValueConstIterator
;
323 #endif // JSON_FORWARDS_H_INCLUDED
325 // //////////////////////////////////////////////////////////////////////
326 // End of content of file: include/json/forwards.h
327 // //////////////////////////////////////////////////////////////////////
333 #endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED