1
0

json_fwd.hpp 6.5 KB

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