json-forwards.h 11 KB

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