Rapid Json 可视化 rapidjson.natvis In VS2013

将下面代码复制为utf8  rapidjson.natvis 到 \Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\Debugger\Visualizers\

和其他natvis文件放在一起

就可以在VS2013的c++环境调试中可视化查看rapidjson数据结构

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
 <Type Name="rapidjson::GenericValue<*,*>">
  <DisplayString Condition="flags_ == 0">NULL</DisplayString>

  <!-- edit By superzmy  QQ25360199 -->
  
  <DisplayString Condition="flags_ == 0x101">False</DisplayString>
  <DisplayString Condition="flags_ == 0x102">True</DisplayString>

  <DisplayString Condition="(flags_ & 0x30FF) == 0x3006">{data_.n.i64}</DisplayString>
  <DisplayString Condition="(flags_ & 0x30FF) ==0x1006">{data_.n.u64}</DisplayString>
  <DisplayString Condition="(flags_ & 0x40FF) ==0x4006">{data_.n.d}</DisplayString>

  
  <DisplayString Condition="flags_ == 3 && data_.o.size == 0">表(0){}</DisplayString>
  <DisplayString Condition="flags_ == 4 && data_.a.size == 0">组[0]{}</DisplayString>

  <DisplayString Condition="flags_ == 3 && data_.o.size == 1">表(1){{data_.o.members[0]}}</DisplayString>
  <DisplayString Condition="flags_ == 4 && data_.a.size == 1">组[1]{{data_.a.elements[0]}}</DisplayString>

  <DisplayString Condition="flags_ == 3 && data_.o.size == 2">表(2){{data_.o.members[0]}, {data_.o.members[1]}}</DisplayString>
  <DisplayString Condition="flags_ == 4 && data_.a.size == 2">组[2]{{data_.a.elements[0]}, {data_.a.elements[1]}}</DisplayString>
  
  <DisplayString Condition="flags_ == 3">表({data_.o.size,i}){{data_.o.members[0]}, {data_.o.members[1]}, ...}</DisplayString>
  <DisplayString Condition="flags_ == 4">组[{data_.a.size,i}]{{data_.a.elements[0]}, {data_.a.elements[1]}, ...}</DisplayString>


  <DisplayString Condition="flags_ == 0x700005">{data_.ss.str,s8}</DisplayString>
  <DisplayString Condition="(flags_ & 0xFF) == 5 && flags_ != 0x700005">{data_.s.str,s8}</DisplayString>
  <Expand>
   <Item Condition="flags_ == 3" Name="个数">data_.o.size,i</Item>
   <ArrayItems Condition="flags_ == 3">
    <Size>data_.o.size</Size>
    <ValuePointer>data_.o.members</ValuePointer>
   </ArrayItems>
   
   <Item Condition="flags_ == 4" Name="个数">data_.a.size,i</Item>
   <ArrayItems Condition="flags_ == 4">
    <Size>data_.a.size</Size>
    <ValuePointer>data_.a.elements</ValuePointer>
   </ArrayItems>
  </Expand>
 </Type>

 <Type Name="rapidjson::GenericMember<*,*>">
  <DisplayString>{name} 〓 {value}</DisplayString>
  <Expand>
   <ExpandedItem>value</ExpandedItem>
  </Expand>
 </Type>

</AutoVisualizer>

你可能感兴趣的:(json,visualizer,VS2013,rapidjson)