Merge branch 'develop' into claude/todo-191-plan-508110

Regenerate tools/api_checker/api_surface.json with the CI libclang
(18.1.1 on Linux) and point the new ordered_map links in
features/performance.md to api/ordered_map/index.md.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-10 04:01:42 +02:00
commit 522e7465b0
165 files changed
+41602 -4447

No files matched your search

+43 -25
View File
@@ -172,7 +172,7 @@
"name": "accept",
"pretty_signature": "nlohmann::basic_json::accept",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, accept(ptr, ptr + len)) static bool accept(detail::span_input_adapter&& i, const bool ignore_comments = false, const bool ignore_trailing_commas = false)",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, accept(ptr, ptr + len)) static bool accept(detail::span_input_adapter&& i, const bool ignore_comments = false, const bool ignore_trailing_commas = false) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -316,7 +316,7 @@
"name": "at",
"pretty_signature": "nlohmann::basic_json::at",
"scope": "nlohmann::basic_json",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) const_reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr) const",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) const_reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr) const #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -325,7 +325,7 @@
"name": "at",
"pretty_signature": "nlohmann::basic_json::at",
"scope": "nlohmann::basic_json",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr)",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -640,7 +640,7 @@
"name": "contains",
"pretty_signature": "nlohmann::basic_json::contains",
"scope": "nlohmann::basic_json",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) bool contains(const typename ::nlohmann::json_pointer<BasicJsonType>& ptr) const",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) bool contains(const typename ::nlohmann::json_pointer<BasicJsonType>& ptr) const #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -922,6 +922,15 @@
"signature": "template<typename IteratorType, typename SentinelType = IteratorType, detail::enable_if_t<detail::can_compare_ne<IteratorType, SentinelType>::value, int> = 0> JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bjdata(IteratorType first, SentinelType last, const bool strict = true, const bool allow_exceptions = true, const error_handler_t error_handler = error_handler_t::keep)",
"tier": "callable"
},
{
"identity_name": "from_bjdata",
"kind": "FUNCTION_TEMPLATE",
"name": "from_bjdata",
"pretty_signature": "nlohmann::basic_json::from_bjdata",
"scope": "nlohmann::basic_json",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.13.0, from_bjdata(ptr, ptr + len)) static basic_json from_bjdata(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
"identity_name": "from_bon8",
"kind": "FUNCTION_TEMPLATE",
@@ -940,13 +949,22 @@
"signature": "template<typename IteratorType, typename SentinelType = IteratorType, detail::enable_if_t<detail::can_compare_ne<IteratorType, SentinelType>::value, int> = 0> JSON_HEDLEY_WARN_UNUSED_RESULT static basic_json from_bon8(IteratorType first, SentinelType last, const bool strict = true, const bool allow_exceptions = true)",
"tier": "callable"
},
{
"identity_name": "from_bon8",
"kind": "FUNCTION_TEMPLATE",
"name": "from_bon8",
"pretty_signature": "nlohmann::basic_json::from_bon8",
"scope": "nlohmann::basic_json",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.13.0, from_bon8(ptr, ptr + len)) static basic_json from_bon8(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
"identity_name": "from_bson",
"kind": "CXX_METHOD",
"name": "from_bson",
"pretty_signature": "nlohmann::basic_json::from_bson",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) static basic_json from_bson(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true)",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) static basic_json from_bson(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -973,7 +991,7 @@
"name": "from_bson",
"pretty_signature": "nlohmann::basic_json::from_bson",
"scope": "nlohmann::basic_json",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) static basic_json from_bson(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true)",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) static basic_json from_bson(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -982,7 +1000,7 @@
"name": "from_cbor",
"pretty_signature": "nlohmann::basic_json::from_cbor",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) static basic_json from_cbor(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error)",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) static basic_json from_cbor(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1009,7 +1027,7 @@
"name": "from_cbor",
"pretty_signature": "nlohmann::basic_json::from_cbor",
"scope": "nlohmann::basic_json",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) static basic_json from_cbor(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error)",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) static basic_json from_cbor(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1018,7 +1036,7 @@
"name": "from_msgpack",
"pretty_signature": "nlohmann::basic_json::from_msgpack",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) static basic_json from_msgpack(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true)",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) static basic_json from_msgpack(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1045,7 +1063,7 @@
"name": "from_msgpack",
"pretty_signature": "nlohmann::basic_json::from_msgpack",
"scope": "nlohmann::basic_json",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) static basic_json from_msgpack(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true)",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) static basic_json from_msgpack(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1054,7 +1072,7 @@
"name": "from_ubjson",
"pretty_signature": "nlohmann::basic_json::from_ubjson",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) static basic_json from_ubjson(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true)",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) static basic_json from_ubjson(detail::span_input_adapter&& i, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1081,7 +1099,7 @@
"name": "from_ubjson",
"pretty_signature": "nlohmann::basic_json::from_ubjson",
"scope": "nlohmann::basic_json",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) static basic_json from_ubjson(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true)",
"signature": "template<typename T> JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) static basic_json from_ubjson(const T* ptr, std::size_t len, const bool strict = true, const bool allow_exceptions = true) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1450,7 +1468,7 @@
"name": "iterator_wrapper",
"pretty_signature": "nlohmann::basic_json::iterator_wrapper",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) static iteration_proxy<const_iterator> iterator_wrapper(const_reference ref) noexcept",
"signature": "JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) static iteration_proxy<const_iterator> iterator_wrapper(const_reference ref) noexcept #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1459,7 +1477,7 @@
"name": "iterator_wrapper",
"pretty_signature": "nlohmann::basic_json::iterator_wrapper",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) static iteration_proxy<iterator> iterator_wrapper(reference ref) noexcept",
"signature": "JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) static iteration_proxy<iterator> iterator_wrapper(reference ref) noexcept #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1711,7 +1729,7 @@
"name": "operator[]",
"pretty_signature": "nlohmann::basic_json::operator[]",
"scope": "nlohmann::basic_json",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) const_reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr) const",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) const_reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr) const #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1720,7 +1738,7 @@
"name": "operator[]",
"pretty_signature": "nlohmann::basic_json::operator[]",
"scope": "nlohmann::basic_json",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr)",
"signature": "template<typename BasicJsonType, detail::enable_if_t<detail::is_basic_json<BasicJsonType>::value, int> = 0> JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1765,7 +1783,7 @@
"name": "parse",
"pretty_signature": "nlohmann::basic_json::parse",
"scope": "nlohmann::basic_json",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, parse(ptr, ptr + len)) static basic_json parse(detail::span_input_adapter&& i, parser_callback_t cb = nullptr, const bool allow_exceptions = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false)",
"signature": "JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, parse(ptr, ptr + len)) static basic_json parse(detail::span_input_adapter&& i, parser_callback_t cb = nullptr, const bool allow_exceptions = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1936,7 +1954,7 @@
"name": "sax_parse",
"pretty_signature": "nlohmann::basic_json::sax_parse",
"scope": "nlohmann::basic_json",
"signature": "template <typename InputType, typename SAX> JSON_HEDLEY_NON_NULL(2) static bool sax_parse(InputType&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false)",
"signature": "template <typename InputType, typename SAX> JSON_HEDLEY_NON_NULL(2) static bool sax_parse(InputType&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error)",
"tier": "callable"
},
{
@@ -1945,7 +1963,7 @@
"name": "sax_parse",
"pretty_signature": "nlohmann::basic_json::sax_parse",
"scope": "nlohmann::basic_json",
"signature": "template <typename SAX> JSON_HEDLEY_DEPRECATED_FOR(3.8.0, sax_parse(ptr, ptr + len, ...)) JSON_HEDLEY_NON_NULL(2) static bool sax_parse(detail::span_input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false)",
"signature": "template <typename SAX> JSON_HEDLEY_DEPRECATED_FOR(3.8.0, sax_parse(ptr, ptr + len, ...)) JSON_HEDLEY_NON_NULL(2) static bool sax_parse(detail::span_input_adapter&& i, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -1954,7 +1972,7 @@
"name": "sax_parse",
"pretty_signature": "nlohmann::basic_json::sax_parse",
"scope": "nlohmann::basic_json",
"signature": "template<class IteratorType, class SAX, class SentinelType = IteratorType, detail::enable_if_t<detail::can_compare_ne<IteratorType, SentinelType>::value, int> = 0> JSON_HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, SentinelType last, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false)",
"signature": "template<class IteratorType, class SAX, class SentinelType = IteratorType, detail::enable_if_t<detail::can_compare_ne<IteratorType, SentinelType>::value, int> = 0> JSON_HEDLEY_NON_NULL(3) static bool sax_parse(IteratorType first, SentinelType last, SAX* sax, input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, const bool ignore_trailing_commas = false, const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error)",
"tier": "callable"
},
{
@@ -2260,7 +2278,7 @@
"name": "value",
"pretty_signature": "nlohmann::basic_json::value",
"scope": "nlohmann::basic_json",
"signature": "template < class ValueType, class BasicJsonType, class ReturnType = typename value_return_type<ValueType>::type, detail::enable_if_t < detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value, int > = 0 > JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) ReturnType value(const ::nlohmann::json_pointer<BasicJsonType>& ptr, ValueType && default_value) const",
"signature": "template < class ValueType, class BasicJsonType, class ReturnType = typename value_return_type<ValueType>::type, detail::enable_if_t < detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value, int > = 0 > JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) ReturnType value(const ::nlohmann::json_pointer<BasicJsonType>& ptr, ValueType && default_value) const #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -2269,7 +2287,7 @@
"name": "value",
"pretty_signature": "nlohmann::basic_json::value",
"scope": "nlohmann::basic_json",
"signature": "template < class ValueType, class BasicJsonType, detail::enable_if_t < detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value, int > = 0 > JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) ValueType value(const ::nlohmann::json_pointer<BasicJsonType>& ptr, const ValueType& default_value) const",
"signature": "template < class ValueType, class BasicJsonType, detail::enable_if_t < detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value, int > = 0 > JSON_HEDLEY_DEPRECATED_FOR(3.11.0, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) ValueType value(const ::nlohmann::json_pointer<BasicJsonType>& ptr, const ValueType& default_value) const #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
@@ -2518,10 +2536,10 @@
{
"identity_name": "operator string_t",
"kind": "CONVERSION_FUNCTION",
"name": "operator nlohmann::json_pointer::string_t_helper<type-parameter-0-0>::type",
"pretty_signature": "nlohmann::json_pointer::operator nlohmann::json_pointer::string_t_helper<type-parameter-0-0>::type",
"name": "operator typename string_t_helper<type-parameter-0-0>::type",
"pretty_signature": "nlohmann::json_pointer::operator typename string_t_helper<type-parameter-0-0>::type",
"scope": "nlohmann::json_pointer",
"signature": "JSON_HEDLEY_DEPRECATED_FOR(3.11.0, to_string()) operator string_t() const",
"signature": "JSON_HEDLEY_DEPRECATED_FOR(3.11.0, to_string()) operator string_t() const #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete;",
"tier": "callable"
},
{
+21
View File
@@ -0,0 +1,21 @@
# check_build_options
Checks that the Meson build and the pkg-config files offer the same options as the CMake target, so that a new CMake
option is not forgotten in one of them.
The compile definitions of the CMake target (`target_compile_definitions` in [`CMakeLists.txt`](../../CMakeLists.txt))
are the reference. When you add an option there, also add it to
- the pkg-config block in `CMakeLists.txt` (`NLOHMANN_JSON_PKGCONFIG_CFLAGS`),
- [`meson_options.txt`](../../meson_options.txt), named without the `JSON_` prefix and with the same default,
- [`meson.build`](../../meson.build) (`json_defines`), and
- the list of Meson options in
[`docs/mkdocs/docs/integration/package_managers.md`](../../docs/mkdocs/docs/integration/package_managers.md).
Run the check with
```shell
make check_build_options
```
It needs only Python 3 and runs in the `ci_meson_install` CI job.
+144
View File
@@ -0,0 +1,144 @@
#!/usr/bin/env python3
"""Check that the Meson build and the pkg-config files offer the CMake options.
The compile definitions of the CMake target (target_compile_definitions in
CMakeLists.txt) are the reference. For every option used there, the script
checks that
- the CMake pkg-config file adds the same definition under the same condition,
- meson_options.txt has a boolean option of the same name without the "JSON_"
prefix and with the same default,
- meson.build adds the same definition under the same condition, and
- the Meson section of the package manager documentation lists the option.
Meson's MultipleHeaders option selects the include directory and adds no
definition; it is the only Meson option without a definition.
"""
import argparse
import os
import re
import sys
REPO_ROOT = os.path.normpath(os.path.join(sys.path[0], '..', '..'))
DOCS = os.path.join('docs', 'mkdocs', 'docs', 'integration', 'package_managers.md')
# Meson options that add no compile definition, with their default
MESON_ONLY = {'MultipleHeaders': 'false'}
def read(root, path):
with open(os.path.join(root, path), encoding='utf-8') as f:
return f.read()
def cmake_target_definitions(cmake):
"""Return {option: (definition, add_if_on)} from target_compile_definitions."""
block = re.search(r'target_compile_definitions\(\s*\$\{NLOHMANN_JSON_TARGET_NAME\}\s*INTERFACE(.*?)\n\)', cmake, re.S)
if not block:
sys.exit('CMakeLists.txt: target_compile_definitions of the target not found')
result = {}
for line in block.group(1).split('\n'):
line = line.strip()
if not line:
continue
m = re.fullmatch(r'\$<\$<NOT:\$<BOOL:\$\{JSON_(\w+)\}>>:(\w+=\w+)>', line)
if m:
result[m.group(1)] = (m.group(2), False)
continue
m = re.fullmatch(r'\$<\$<BOOL:\$\{JSON_(\w+)\}>:(\w+=\w+)>', line)
if m:
result[m.group(1)] = (m.group(2), True)
continue
sys.exit(f'CMakeLists.txt: unexpected line in target_compile_definitions: {line}')
return result
def cmake_defaults(cmake):
"""Return {option: 'true'/'false'} for the option() calls of the form JSON_<name>."""
return {m.group(1): 'true' if m.group(2) == 'ON' else 'false'
for m in re.finditer(r'^option\(JSON_(\w+)\s+"[^"]*"\s+(ON|OFF)\)', cmake, re.M)}
def cmake_pkgconfig_definitions(cmake):
"""Return {option: (definition, add_if_on)} from the pkg-config block."""
return {m.group(2): (m.group(3), m.group(1) is None)
for m in re.finditer(r'if \((NOT )?JSON_(\w+)\)\s*\n\s*string\(APPEND NLOHMANN_JSON_PKGCONFIG_CFLAGS " -D(\w+=\w+)"\)', cmake)}
def meson_options(options):
"""Return {option: default} for the boolean options in meson_options.txt."""
result = {}
for block in re.findall(r'option\((.*?)\)', options, re.S):
name = re.search(r"'(\w+)'", block).group(1)
kind = re.search(r"type\s*:\s*'(\w+)'", block)
value = re.search(r'value\s*:\s*(\w+)', block)
result[name] = value.group(1) if kind and kind.group(1) == 'boolean' and value else None
return result
def meson_definitions(meson):
"""Return {option: (definition, add_if_on)} from meson.build."""
return {m.group(2): (m.group(3), m.group(1) is None)
for m in re.finditer(r"if (not )?get_option\('(\w+)'\)\s*\n\s*json_defines \+= '(\w+=\w+)'", meson)}
def describe(definition):
name, add_if_on = definition
return f'{name} if {"enabled" if add_if_on else "disabled"}'
def compare(errors, where, expected, actual):
for option, definition in expected.items():
if option not in actual:
errors.append(f'{where}: no definition for option {option} (expected {describe(definition)})')
elif actual[option] != definition:
errors.append(f'{where}: option {option} adds {describe(actual[option])}, expected {describe(definition)}')
for option in actual.keys() - expected.keys():
errors.append(f'{where}: definition for option {option}, which the CMake target does not have')
def main():
parser = argparse.ArgumentParser(description=__doc__.split('\n')[0])
parser.add_argument('root', nargs='?', default=REPO_ROOT, help='repository root (default: %(default)s)')
root = parser.parse_args().root
cmake = read(root, 'CMakeLists.txt')
reference = cmake_target_definitions(cmake)
defaults = cmake_defaults(cmake)
errors = []
compare(errors, 'CMakeLists.txt (pkg-config)', reference, cmake_pkgconfig_definitions(cmake))
compare(errors, 'meson.build', reference, meson_definitions(read(root, 'meson.build')))
options = meson_options(read(root, 'meson_options.txt'))
for option in reference:
if option not in defaults:
errors.append(f'CMakeLists.txt: no option(JSON_{option} ... ON|OFF)')
elif option not in options:
errors.append(f'meson_options.txt: option {option} missing')
elif options[option] != defaults[option]:
errors.append(f'meson_options.txt: option {option} must be boolean with value {defaults[option]} as in CMake')
for option, default in MESON_ONLY.items():
if options.get(option) != default:
errors.append(f'meson_options.txt: option {option} must be boolean with value {default}')
for option in options.keys() - reference.keys() - MESON_ONLY.keys():
errors.append(f'meson_options.txt: option {option} has no counterpart in the CMake target')
docs = read(root, DOCS)
for option in sorted(set(options) & (reference.keys() | MESON_ONLY.keys())):
if f'`{option}`' not in docs:
errors.append(f'{DOCS}: Meson option {option} not listed')
for error in errors:
print(error, file=sys.stderr)
if errors:
print('The Meson build and the pkg-config files must offer the options of the CMake target; see '
'tools/check_build_options/README.md.', file=sys.stderr)
return 1
print(f'OK: {len(reference)} options with compile definitions agree between CMake, pkg-config, and Meson.')
return 0
if __name__ == '__main__':
sys.exit(main())
@@ -36,5 +36,31 @@
</Expand>
</Type>
<!-- Fallback for when the basic_json entry above does not match: json_default_base is the (empty) default
base class of basic_json, and base class visualizers are inherited by derived types and evaluated
against the derived object, so m_data is accessible here. The class lives in {{ ns }} after
3.12.0 (#5238) and in {{ ns }}::detail up to 3.12.0, so both names are listed. -->
{% for default_base in ['json_default_base', 'detail::json_default_base'] %}
<Type Name="{{ ns }}::{{ default_base }}">
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::null">null</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::object">{*(m_data.m_value.object)}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::array">{*(m_data.m_value.array)}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::string">{*(m_data.m_value.string)}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::boolean">{m_data.m_value.boolean}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::number_integer">{m_data.m_value.number_integer}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::number_unsigned">{m_data.m_value.number_unsigned}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::number_float">{m_data.m_value.number_float}</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::discarded">discarded</DisplayString>
<Expand>
<ExpandedItem Condition="m_data.m_type == {{ ns }}::detail::value_t::object">
*(m_data.m_value.object),view(simple)
</ExpandedItem>
<ExpandedItem Condition="m_data.m_type == {{ ns }}::detail::value_t::array">
*(m_data.m_value.array),view(simple)
</ExpandedItem>
</Expand>
</Type>
{% endfor %}
{% endfor %}
</AutoVisualizer>