Compare commits

...
Author SHA1 Message Date
Niels Lohmann 1e50d65882 Match json_default_base in both its current and 3.12.0 namespace
Since #5238, json_default_base lives directly in the (inline, ABI-tagged)
library namespace, e.g. nlohmann::json_abi_v3_12_0::json_default_base, and
no longer in detail. The fallback entries only named
<ns>::detail::json_default_base, so they would not match anything built
from the current headers or any later release. Emit an entry for both
names: the non-detail one for current code, the detail one for users of
3.12.0 (the version in #4972).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-09-27 18:21:00 +02:00
Niels Lohmann 63c212bf8e Merge branch 'develop' into natvis-json-default-base
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-09-27 16:39:00 +02:00
Niels Lohmann 055158bbfa Document the json_default_base natvis fallback and regenerate natvis
Explain why a visualizer on the empty base class works, fix the
indentation of the new entry, and regenerate nlohmann_json.natvis from
the template (now covering all ABI tag combinations on develop).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-09-27 14:52:34 +02:00
Mihnea Magheru 1a5d52404e Add a type in the natvis template for detail::json_default_base
Signed-off-by: Mihnea Magheru <sakuntalle@yahoo.com>
2026-09-27 14:51:37 +02:00
2 changed files with 5702 additions and 0 deletions
+5676
View File
File diff suppressed because it is too large Load Diff
@@ -36,5 +36,31 @@
</Expand> </Expand>
</Type> </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 %} {% endfor %}
</AutoVisualizer> </AutoVisualizer>