json.natvis 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
  3. <Type Name="boost::json::storage_ptr">
  4. <DisplayString Condition="i_==0">default</DisplayString>
  5. <DisplayString Condition="(i_&amp;3)==1"> shared</DisplayString>
  6. <DisplayString Condition="(i_&amp;3)==2"> trivial</DisplayString>
  7. <DisplayString Condition="(i_&amp;3)==3"> shared, trivial</DisplayString>
  8. <DisplayString>non-owning</DisplayString>
  9. <Expand>
  10. <Item Name="[ refs ]" Condition="(i_&amp;1)==1">((shared_resource*)(i_&amp;~3))->refs</Item>
  11. <Item Name="[ resource ]" Condition="(i_&amp;2)==1">(shared_resource*)(i_&amp;~3)</Item>
  12. <Item Name="[ resource ]" Condition="(i_&amp;2)!=1">(memory_resource*)(i_&amp;~3)</Item>
  13. </Expand>
  14. </Type>
  15. <Type Name="boost::json::detail::shared_resource_impl&lt;*&gt;">
  16. <DisplayString>$T1*</DisplayString>
  17. <Expand>
  18. <Item Name="[ refs ]">refs</Item>
  19. </Expand>
  20. </Type>
  21. <Type Name="boost::json::monotonic_resource">
  22. <DisplayString>monotonic_resource</DisplayString>
  23. <Expand>
  24. <Item Name="[ free ]">head_->n</Item>
  25. </Expand>
  26. </Type>
  27. <Type Name="boost::json::static_resource">
  28. <DisplayString>static_resource</DisplayString>
  29. <Expand>
  30. <Item Name="[ free ]">n_</Item>
  31. </Expand>
  32. </Type>
  33. <Type Name="boost::json::value">
  34. <DisplayString Condition="sca_.k==kind::null">null</DisplayString>
  35. <DisplayString Condition="sca_.k==kind::bool_">{sca_.b}</DisplayString>
  36. <DisplayString Condition="sca_.k==kind::int64">{sca_.i}</DisplayString>
  37. <DisplayString Condition="sca_.k==kind::uint64">{sca_.u}u</DisplayString>
  38. <DisplayString Condition="sca_.k==kind::double_">{sca_.d}</DisplayString>
  39. <DisplayString Condition="sca_.k==kind::string">{((char*)(str_.impl_.p_.t+1)),[str_.impl_.p_.t->size]s}</DisplayString>
  40. <DisplayString Condition="sca_.k==kind::string+64">{((char*)(str_.impl_.k_.s)),[str_.impl_.k_.n]s}:</DisplayString>
  41. <DisplayString Condition="sca_.k==kind::string+128">{str_.impl_.s_.buf,[detail::string_impl::sbo_chars_-str_.impl_.s_.buf[detail::string_impl::sbo_chars_]]s}</DisplayString>
  42. <DisplayString Condition="sca_.k==kind::array">array [{arr_.t_->size}]</DisplayString>
  43. <DisplayString Condition="sca_.k==kind::object">object [{obj_.t_->size}]</DisplayString>
  44. <Expand>
  45. <ExpandedItem Condition="sca_.k==kind::string">str_</ExpandedItem>
  46. <ExpandedItem Condition="sca_.k==kind::string+64">str_</ExpandedItem>
  47. <ExpandedItem Condition="sca_.k==kind::string+128">str_</ExpandedItem>
  48. <ExpandedItem Condition="sca_.k==kind::array">arr_</ExpandedItem>
  49. <ExpandedItem Condition="sca_.k==kind::object">obj_</ExpandedItem>
  50. </Expand>
  51. </Type>
  52. <Type Name="boost::json::string">
  53. <DisplayString Condition="impl_.s_.k==kind::string">{((char*)(impl_.p_.t+1)),[impl_.p_.t->size]s}</DisplayString>
  54. <DisplayString Condition="impl_.s_.k==kind::string+64">{((char*)(impl_.k_.s)),[impl_.k_.n]s}:</DisplayString>
  55. <DisplayString Condition="impl_.s_.k==kind::string+128">{impl_.s_.buf,[detail::string_impl::sbo_chars_-impl_.s_.buf[detail::string_impl::sbo_chars_]]s}</DisplayString>
  56. <Expand>
  57. <!-- VFALCO Need to handle key string here -->
  58. <Item Name="[size]">impl_.s_.k==kind::string?impl_.p_.t->size:detail::string_impl::sbo_chars_-impl_.s_.buf[detail::string_impl::sbo_chars_]</Item>
  59. <Item Name="[capacity]">impl_.s_.k==kind::string?impl_.p_.t->capacity:detail::string_impl::sbo_chars_</Item>
  60. <Item Name="[storage]">sp_</Item>
  61. </Expand>
  62. </Type>
  63. <Type Name="boost::json::array">
  64. <DisplayString>array [{t_->size}]</DisplayString>
  65. <Expand>
  66. <ArrayItems>
  67. <Size>t_->size</Size>
  68. <ValuePointer>((value*)(t_+1))</ValuePointer>
  69. </ArrayItems>
  70. <Item Name="[capacity]">t_->capacity</Item>
  71. <Item Name="[storage]">sp_</Item>
  72. </Expand>
  73. </Type>
  74. <Type Name="boost::json::object">
  75. <DisplayString>object [{t_->size}]</DisplayString>
  76. <Expand>
  77. <ArrayItems>
  78. <Size>t_->size</Size>
  79. <ValuePointer>(boost::json::key_value_pair*)(t_+1)</ValuePointer>
  80. </ArrayItems>
  81. <Item Name="[capacity]">t_->capacity</Item>
  82. <Item Name="[storage]">sp_</Item>
  83. </Expand>
  84. </Type>
  85. <Type Name="boost::json::key_value_pair">
  86. <DisplayString Condition="value_.sca_.k==kind::null">{{ {key_,[len_]s}, null }}</DisplayString>
  87. <DisplayString Condition="value_.sca_.k==kind::bool_">{{ {key_,[len_]s}, {value_.sca_.b} }}</DisplayString>
  88. <DisplayString Condition="value_.sca_.k==kind::int64">{{ {key_,[len_]s}, {value_.sca_.i} }}</DisplayString>
  89. <DisplayString Condition="value_.sca_.k==kind::uint64">{{ {key_,[len_]s}, {value_.sca_.u} }}</DisplayString>
  90. <DisplayString Condition="value_.sca_.k==kind::double_">{{ {key_,[len_]s}, {value_.sca_.d} }}</DisplayString>
  91. <DisplayString Condition="value_.sca_.k==kind::string">{{ {key_,[len_]s}, {((char*)(value_.str_.impl_.p_.t+1)),[value_.str_.impl_.p_.t->size]s} }}</DisplayString>
  92. <DisplayString Condition="value_.sca_.k==kind::string+128">{{ {key_,[len_]s}, {value_.str_.impl_.s_.buf,[detail::string_impl::sbo_chars_-value_.str_.impl_.s_.buf[detail::string_impl::sbo_chars_]]s} }}</DisplayString>
  93. <DisplayString Condition="value_.sca_.k==kind::array">{{ {key_,[len_]s}, array [{value_.arr_.t_->size}] }}</DisplayString>
  94. <DisplayString Condition="value_.sca_.k==kind::object">{{ {key_,[len_]s}, object [{value_.obj_.t_->size}] }}</DisplayString>
  95. <Expand>
  96. <ExpandedItem>&amp;this->value_</ExpandedItem>
  97. </Expand>
  98. </Type>
  99. </AutoVisualizer>