<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="QJsonDocument">
<DisplayString Condition="!d._Mypair._Myval2">empty</DisplayString>
<Expand>
<ExpandedItem Condition="d._Mypair._Myval2">
((Qt6Cored.dll!QJsonDocumentPrivate*)(d._Mypair._Myval2))->value
</ExpandedItem>
</Expand>
</Type>
<Type Name="QJsonArray">
<Intrinsic Name="cbor" Expression="(Qt6Cored.dll!QCborContainerPrivate*)a.d"></Intrinsic>
<Expand>
<ExpandedItem>cbor(),view(arr)</ExpandedItem>
</Expand>
</Type>
<Type Name="QCborArray">
<Intrinsic Name="cbor" Expression="(Qt6Cored.dll!QCborContainerPrivate*)d.d"></Intrinsic>
<Expand>
<ExpandedItem>cbor(),view(arr)</ExpandedItem>
</Expand>
</Type>
<Type Name="QJsonObject">
<Intrinsic Name="cbor" Expression="(Qt6Cored.dll!QCborContainerPrivate*)o.d"></Intrinsic>
<DisplayString Condition="!cbor()">empty</DisplayString>
<Expand>
<ExpandedItem
Condition="cbor()">cbor(),view(map)</ExpandedItem>
</Expand>
</Type>
<Type Name="QCborMap">
<Intrinsic Name="cbor" Expression="(Qt6Cored.dll!QCborContainerPrivate*)d.d"></Intrinsic>
<DisplayString Condition="!cbor()">empty</DisplayString>
<Expand>
<ExpandedItem
Condition="cbor()">cbor(),view(map)</ExpandedItem>
</Expand>
</Type>
<Type Name="QJsonValue">
<DisplayString>{value}</DisplayString>
<Expand>
<ExpandedItem>value</ExpandedItem>
</Expand>
</Type>
<Type Name="QCborValue">
<DisplayString Condition="t == QCborValue::Null">null</DisplayString>
<DisplayString Condition="t == QCborValue::Invalid">invalid</DisplayString>
<DisplayString Condition="t == QCborValue::Undefined">undefined</DisplayString>
<DisplayString Condition="t == QCborValue::False">false</DisplayString>
<DisplayString Condition="t == QCborValue::True">true</DisplayString>
<DisplayString Condition="t == QCborValue::Integer">{n}</DisplayString>
<DisplayString Condition="t == QCborValue::Double">{*(double*)&n}</DisplayString>
<DisplayString Condition="t == QCborValue::String && container->el(n).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
{container->byteDataAt(n)->u16(),[container->byteDataAt(n)->len/2]su}
</DisplayString>
<DisplayString Condition="t == QCborValue::String">
{container->byteDataAt(n)->str(),[container->byteDataAt(n)->len]s8}
</DisplayString>
<DisplayString Condition="(t == QCborValue::DateTime || t == QCborValue::Url || t == QCborValue::RegularExpression) && container->el(1).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
{container->byteDataAt(1)->u16(),[container->byteDataAt(1)->len/2]su}
</DisplayString>
<DisplayString Condition="(t == QCborValue::DateTime || t == QCborValue::Url || t == QCborValue::RegularExpression)">
{container->byteDataAt(1)->str(),[container->byteDataAt(1)->len]s8}
</DisplayString>
<DisplayString Condition="t == QCborValue::Array && container == nullptr">[]</DisplayString>
<DisplayString Condition="t == QCborValue::Map && container == nullptr">{{}}</DisplayString>
<Expand>
<ExpandedItem Condition="t == QCborValue::Array">container,view(arr)na</ExpandedItem>
<ExpandedItem Condition="t == QCborValue::Map">container,view(map)na</ExpandedItem>
<ExpandedItem Condition="t == QCborValue::Uuid">container,view(bytesAtOne)na</ExpandedItem>
<ExpandedItem Condition="t == QCborValue::ByteArray">
container->byteDataAt(n)->bytes(),[container->byteDataAt(n)->len]hv
</ExpandedItem>
<ExpandedItem Condition="t == QCborValue::String && container->el(n).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
container->byteDataAt(n)->u16(),[container->byteDataAt(n)->len/2]su
</ExpandedItem>
<ExpandedItem Condition="t == QCborValue::String && !(container->el(n).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16)">
container->byteDataAt(n)->str(),[container->byteDataAt(n)->len]s8
</ExpandedItem>
</Expand>
</Type>
<Type Name="QCborContainerPrivate">
<Intrinsic
Name="self" Expression="(Qt6Cored.dll!QCborContainerPrivate*)this" />
<Intrinsic
Name="el" Expression="self()->elements.d.ptr[n]">
<Parameter Name="n" Type="long long" />
</Intrinsic>
<Intrinsic
Name="byteDataAt"
Expression="((Qt6Cored.dll!QtCbor::ByteData*)(self()->data.d.ptr + el(n).value))">
<Parameter Name="n" Type="long long" />
</Intrinsic>
<Expand>
<!-- Arrays -->
<CustomListItems Condition="self()->elements.d.size > 0" IncludeView="arr">
<Variable Name="i" InitialValue="0" />
<Loop Condition="i < self()->elements.d.size">
<If Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::HasByteData">
<If Condition="el(i).type == QCborValue::Type::String">
<If Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
<Item Name="[{i}]">byteDataAt(i)->u16(),[byteDataAt(i)->len/2]su</Item>
</If>
<Else>
<Item Name="[{i}]">byteDataAt(i)->str(),[byteDataAt(i)->len]s8</Item>
</Else>
</If>
<Else>
<Item Name="[{i}]">byteDataAt(i)->bytes(),[byteDataAt(i)->len]hv</Item>
</Else>
</If>
<Elseif Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::IsContainer">
<If Condition="el(i).type == QCborValue::Type::Array">
<Item Name="[{i}]">el(i).container,view(arr)na</Item>
</If>
<Else>
<Item Name="[{i}]">el(i).container,view(map)na</Item>
</Else>
</Elseif>
<Else>
<Item Name="[{i}]">el(i)</Item>
</Else>
<Exec>++i</Exec>
</Loop>
</CustomListItems>
<!-- Maps/Objects -->
<CustomListItems Condition="self()->elements.d.size > 0" IncludeView="map">
<!-- keys can be anything in CBOR. Only strings and simple types are supported as keys (others would bloat the file) -->
<Variable Name="key8" InitialValue="(const char *)0" />
<Variable Name="key16" InitialValue="(const char16_t *)0" />
<!-- key8 and key16 might be nullptr even though the key is a string (we can't use "key8 || key16" to check if the key is a string) -->
<Variable Name="strKey" InitialValue="true"/>
<Variable Name="len" InitialValue="0" />
<Variable Name="i" InitialValue="0" />
<Loop Condition="i < self()->elements.d.size">
<If Condition="(i&1) == 0">
<!-- even elements are keys -->
<If Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
<!-- utf16 key -->
<Exec>key8 = nullptr</Exec>
<Exec>key16 = byteDataAt(i)->u16()</Exec>
<Exec>len = byteDataAt(i)->len/2</Exec>
<Exec>strKey = true</Exec>
</If>
<Elseif Condition="el(i).type == QCborValue::Type::String">
<!-- utf8/ascii key -->
<Exec>key8 = byteDataAt(i)->str()</Exec>
<Exec>key16 = nullptr</Exec>
<Exec>len = byteDataAt(i)->len</Exec>
<Exec>strKey = true</Exec>
</Elseif>
<Else>
<!-- non-string key -->
<Exec>key8 = nullptr</Exec>
<Exec>key16 = nullptr</Exec>
<Exec>len = 0</Exec>
<Exec>strKey = false</Exec>
</Else>
</If>
<Else>
<!-- odd elements are values -->
<If Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::HasByteData">
<If Condition="el(i).type == QCborValue::Type::String">
<If Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
<!-- utf16 strings -->
<If Condition="key16">
<Item Name="[{key16,[len]su}]">byteDataAt(i)->u16(),[byteDataAt(i)->len/2]su</Item>
</If>
<Elseif Condition="strKey">
<Item Name="[{key8,[len]s8}]">byteDataAt(i)->u16(),[byteDataAt(i)->len/2]su</Item>
</Elseif>
<Else>
<Item Name="[{el(i-1)}]">byteDataAt(i)->u16(),[byteDataAt(i)->len/2]su</Item>
</Else>
</If>
<Else>
<!-- utf8 or ascii strings (assume it's utf8) -->
<If Condition="key16">
<Item Name="[{key16,[len]su}]">byteDataAt(i)->str(),[byteDataAt(i)->len]s8</Item>
</If>
<Elseif Condition="strKey">
<Item Name="[{key8,[len]s8}]">byteDataAt(i)->str(),[byteDataAt(i)->len]s8</Item>
</Elseif>
<Else>
<Item Name="[{el(i-1)}]">byteDataAt(i)->str(),[byteDataAt(i)->len]s8</Item>
</Else>
</Else>
</If>
<Else>
<!-- elements with byte-data that aren't strings (e.g. byte arrays/uuids) -->
<If Condition="key16">
<Item Name="[{key16,[len]su}]">byteDataAt(i)->bytes(),[byteDataAt(i)->len]hv</Item>
</If>
<Elseif Condition="strKey">
<Item Name="[{key8,[len]s8}]">byteDataAt(i)->bytes(),[byteDataAt(i)->len]hv</Item>
</Elseif>
<Else>
<Item Name="[{el(i-1)}]">byteDataAt(i)->bytes(),[byteDataAt(i)->len]hv</Item>
</Else>
</Else>
</If>
<Elseif Condition="el(i).flags.i & Qt6Cored.dll!QtCbor::Element::IsContainer">
<If Condition="el(i).type == QCborValue::Type::Array">
<!-- arrays -->
<If Condition="key16">
<Item Name="[{key16,[len]su}]">el(i).container,view(arr)na</Item>
</If>
<Elseif Condition="strKey">
<Item Name="[{key8,[len]s8}]">el(i).container,view(arr)na</Item>
</Elseif>
<Else>
<Item Name="[{el(i-1)}]">el(i).container,view(arr)na</Item>
</Else>
</If>
<Else>
<!-- maps/objects -->
<If Condition="key16">
<Item Name="[{key16,[len]su}]">el(i).container,view(map)na</Item>
</If>
<Elseif Condition="strKey">
<Item Name="[{key8,[len]s8}]">el(i).container,view(map)na</Item>
</Elseif>
<Else>
<Item Name="[{el(i-1)}]">el(i).container,view(map)na</Item>
</Else>
</Else>
</Elseif>
<Else>
<!-- simple types (bool/null/undefined/number) -->
<If Condition="key16">
<Item Name="[{key16,[len]su}]">el(i)</Item>
</If>
<Elseif Condition="strKey">
<Item Name="[{key8,[len]s8}]">el(i)</Item>
</Elseif>
<Else>
<Item Name="[{el(i-1)}]">el(i)</Item>
</Else>
</Else>
</Else>
<Exec>++i</Exec>
</Loop>
</CustomListItems>
<ExpandedItem IncludeView="stringAtOne" Condition="el(1).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
byteDataAt(1)->u16(),[byteDataAt(1)->len/2]su
</ExpandedItem>
<ExpandedItem IncludeView="stringAtOne" Condition="!(el(1).flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16)">
byteDataAt(1)->str(),[byteDataAt(1)->len]s8
</ExpandedItem>
<ExpandedItem IncludeView="bytesAtOne">
byteDataAt(1)->bytes(),[byteDataAt(1)->len]hv
</ExpandedItem>
</Expand>
</Type>
<Type Name="QtCbor::ByteData">
<Intrinsic Name="str" Expression="(const char *)(this + 1)" ModuleName="Qt6Cored.dll"></Intrinsic>
<Intrinsic Name="bytes" Expression="(const uint8_t *)(this + 1)" ModuleName="Qt6Cored.dll"></Intrinsic>
<Intrinsic Name="u16" Expression="(const char16_t *)(this + 1)" ModuleName="Qt6Cored.dll"></Intrinsic>
</Type>
<Type Name="QtCbor::Element">
<DisplayString Condition="type == QCborValue::Null">null</DisplayString>
<DisplayString Condition="type == QCborValue::Undefined">undefined</DisplayString>
<DisplayString Condition="type == QCborValue::False">false</DisplayString>
<DisplayString Condition="type == QCborValue::True">true</DisplayString>
<DisplayString Condition="type == QCborValue::Integer">{value}</DisplayString>
<DisplayString Condition="type == QCborValue::Double">{*(double*)&value}</DisplayString>
<DisplayString Condition="type == QCborValue::Type::Array && container == nullptr">[]</DisplayString>
<DisplayString Condition="type == QCborValue::Type::Map && container == nullptr">{{}}</DisplayString>
</Type>
<Type Name="QJsonDocumentPrivate">
<Intrinsic
Name="self" Expression="(Qt6Cored.dll!QJsonDocumentPrivate*)this" />
<Expand>
<ExpandedItem>self()->value</ExpandedItem>
</Expand>
</Type>
<Type Name="QJsonValueRef">
<Intrinsic Name="container" Expression="(Qt6Cored.dll!QCborContainerPrivate*)(is_object ? o->o.d : a->a.d)" />
<Intrinsic Name="idx" Expression="is_object ? index * 2 + 1 : index" />
<Intrinsic Name="el" Expression="container()->el(idx())"/>
<Intrinsic Name="data" Expression="container()->byteDataAt(idx())" />
<Intrinsic Name="ty" Expression="el().type" />
<DisplayString Condition="ty() == QCborValue::Type::String && el().flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
{data()->u16(),[data()->len/2]su}
</DisplayString>
<DisplayString Condition="ty() == QCborValue::Type::String">
{data()->str(),[data()->len]s8}
</DisplayString>
<DisplayString Condition="ty() != QCborValue::Type::Array && ty() != QCborValue::Type::Map || !el().container">
{el()}
</DisplayString>
<Expand>
<ExpandedItem Condition="ty() == QCborValue::Type::Array">el().container,view(arr)na</ExpandedItem>
<ExpandedItem Condition="ty() == QCborValue::Type::Map">el().container,view(map)na</ExpandedItem>
<ExpandedItem Condition="ty() == QCborValue::Type::String && el().flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
data()->u16(),[data()->len/2]su
</ExpandedItem>
<ExpandedItem Condition="ty() == QCborValue::Type::String && !(el().flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16)">
data()->str(),[data()->len]s8
</ExpandedItem>
</Expand>
</Type>
<!-- Same as QJsonValueRef -->
<Type Name="QJsonValueConstRef">
<Intrinsic Name="container" Expression="(Qt6Cored.dll!QCborContainerPrivate*)(is_object ? o->o.d : a->a.d)" />
<Intrinsic Name="idx" Expression="is_object ? index * 2 + 1 : index" />
<Intrinsic Name="el" Expression="container()->el(idx())"/>
<Intrinsic Name="data" Expression="container()->byteDataAt(idx())" />
<Intrinsic Name="ty" Expression="el().type" />
<DisplayString Condition="ty() == QCborValue::Type::String && el().flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
{data()->u16(),[data()->len/2]su}
</DisplayString>
<DisplayString Condition="ty() == QCborValue::Type::String">
{data()->str(),[data()->len]s8}
</DisplayString>
<DisplayString Condition="ty() != QCborValue::Type::Array && ty() != QCborValue::Type::Map || !el().container">
{el()}
</DisplayString>
<Expand>
<ExpandedItem Condition="ty() == QCborValue::Type::Array">el().container,view(arr)na</ExpandedItem>
<ExpandedItem Condition="ty() == QCborValue::Type::Map">el().container,view(map)na</ExpandedItem>
<ExpandedItem Condition="ty() == QCborValue::Type::String && el().flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16">
data()->u16(),[data()->len/2]su
</ExpandedItem>
<ExpandedItem Condition="ty() == QCborValue::Type::String && !(el().flags.i & Qt6Cored.dll!QtCbor::Element::StringIsUtf16)">
data()->str(),[data()->len]s8
</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>