json_fwd.hpp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. // __ _____ _____ _____
  2. // __| | __| | | | JSON for Modern C++
  3. // | | |__ | | | | | | version 3.11.2
  4. // |_____|_____|_____|_|___| https://github.com/nlohmann/json
  5. //
  6. // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
  7. // SPDX-License-Identifier: MIT
  8. #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
  9. #define INCLUDE_NLOHMANN_JSON_FWD_HPP_
  10. #include <cstdint> // int64_t, uint64_t
  11. #include <map> // map
  12. #include <memory> // allocator
  13. #include <string> // string
  14. #include <vector> // vector
  15. // #include <nlohmann/detail/abi_macros.hpp>
  16. // __ _____ _____ _____
  17. // __| | __| | | | JSON for Modern C++
  18. // | | |__ | | | | | | version 3.11.2
  19. // |_____|_____|_____|_|___| https://github.com/nlohmann/json
  20. //
  21. // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
  22. // SPDX-License-Identifier: MIT
  23. // This file contains all macro definitions affecting or depending on the ABI
  24. #ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
  25. #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
  26. #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 2
  27. #warning "Already included a different version of the library!"
  28. #endif
  29. #endif
  30. #endif
  31. #define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
  32. #define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
  33. #define NLOHMANN_JSON_VERSION_PATCH 2 // NOLINT(modernize-macro-to-enum)
  34. #ifndef JSON_DIAGNOSTICS
  35. #define JSON_DIAGNOSTICS 0
  36. #endif
  37. #ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
  38. #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
  39. #endif
  40. #if JSON_DIAGNOSTICS
  41. #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag
  42. #else
  43. #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS
  44. #endif
  45. #if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
  46. #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp
  47. #else
  48. #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
  49. #endif
  50. #ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
  51. #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
  52. #endif
  53. // Construct the namespace ABI tags component
  54. #define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
  55. #define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
  56. NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
  57. #define NLOHMANN_JSON_ABI_TAGS \
  58. NLOHMANN_JSON_ABI_TAGS_CONCAT( \
  59. NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
  60. NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
  61. // Construct the namespace version component
  62. #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
  63. _v ## major ## _ ## minor ## _ ## patch
  64. #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
  65. NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
  66. #if NLOHMANN_JSON_NAMESPACE_NO_VERSION
  67. #define NLOHMANN_JSON_NAMESPACE_VERSION
  68. #else
  69. #define NLOHMANN_JSON_NAMESPACE_VERSION \
  70. NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
  71. NLOHMANN_JSON_VERSION_MINOR, \
  72. NLOHMANN_JSON_VERSION_PATCH)
  73. #endif
  74. // Combine namespace components
  75. #define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
  76. #define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
  77. NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
  78. #ifndef NLOHMANN_JSON_NAMESPACE
  79. #define NLOHMANN_JSON_NAMESPACE \
  80. nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
  81. NLOHMANN_JSON_ABI_TAGS, \
  82. NLOHMANN_JSON_NAMESPACE_VERSION)
  83. #endif
  84. #ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
  85. #define NLOHMANN_JSON_NAMESPACE_BEGIN \
  86. namespace nlohmann \
  87. { \
  88. inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
  89. NLOHMANN_JSON_ABI_TAGS, \
  90. NLOHMANN_JSON_NAMESPACE_VERSION) \
  91. {
  92. #endif
  93. #ifndef NLOHMANN_JSON_NAMESPACE_END
  94. #define NLOHMANN_JSON_NAMESPACE_END \
  95. } /* namespace (inline namespace) NOLINT(readability/namespace) */ \
  96. } // namespace nlohmann
  97. #endif
  98. /*!
  99. @brief namespace for Niels Lohmann
  100. @see https://github.com/nlohmann
  101. @since version 1.0.0
  102. */
  103. NLOHMANN_JSON_NAMESPACE_BEGIN
  104. /*!
  105. @brief default JSONSerializer template argument
  106. This serializer ignores the template arguments and uses ADL
  107. ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl))
  108. for serialization.
  109. */
  110. template<typename T = void, typename SFINAE = void>
  111. struct adl_serializer;
  112. /// a class to store JSON values
  113. /// @sa https://json.nlohmann.me/api/basic_json/
  114. template<template<typename U, typename V, typename... Args> class ObjectType =
  115. std::map,
  116. template<typename U, typename... Args> class ArrayType = std::vector,
  117. class StringType = std::string, class BooleanType = bool,
  118. class NumberIntegerType = std::int64_t,
  119. class NumberUnsignedType = std::uint64_t,
  120. class NumberFloatType = double,
  121. template<typename U> class AllocatorType = std::allocator,
  122. template<typename T, typename SFINAE = void> class JSONSerializer =
  123. adl_serializer,
  124. class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError
  125. class CustomBaseClass = void>
  126. class basic_json;
  127. /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document
  128. /// @sa https://json.nlohmann.me/api/json_pointer/
  129. template<typename RefStringType>
  130. class json_pointer;
  131. /*!
  132. @brief default specialization
  133. @sa https://json.nlohmann.me/api/json/
  134. */
  135. using json = basic_json<>;
  136. /// @brief a minimal map-like container that preserves insertion order
  137. /// @sa https://json.nlohmann.me/api/ordered_map/
  138. template<class Key, class T, class IgnoredLess, class Allocator>
  139. struct ordered_map;
  140. /// @brief specialization that maintains the insertion order of object keys
  141. /// @sa https://json.nlohmann.me/api/ordered_json/
  142. using ordered_json = basic_json<nlohmann::ordered_map>;
  143. NLOHMANN_JSON_NAMESPACE_END
  144. #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_