2015-02-11 113 views

回答

1

编辑:我已将此文件添加到visualstudio-debugger repository on GitHub

编辑2:此问题的其他两个答案已链接到其他github存储库(我没有签出)。


由于没有人来通过与:出于某种原因,他们被管理员(我不知道为什么),所以他们在这里删除答案(有些人认为这是由于某种原因在关于计算器的话题)我写了我自己的,在这里。使用风险自负。

<?xml version="1.0" encoding="utf-8"?> 
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> 
    <!-- Json::Value - basic support --> 
    <Type Name="Json::Value"> 
    <DisplayString Condition="type_ == 0">null</DisplayString> 
    <DisplayString Condition="type_ == 1">{value_.int_}</DisplayString> 
    <DisplayString Condition="type_ == 2">{value_.uint_}</DisplayString> 
    <DisplayString Condition="type_ == 3">{value_.real_}</DisplayString> 
    <DisplayString Condition="type_ == 4">{value_.string_,s8}</DisplayString> 
    <DisplayString Condition="type_ == 5">{value_.bool_}</DisplayString> 
    <DisplayString Condition="type_ == 6">array ({value_.map_-&gt;_Mysize})</DisplayString> 
    <DisplayString Condition="type_ == 7">object ({value_.map_-&gt;_Mysize})</DisplayString> 
    <DisplayString >Unknown Value type!</DisplayString> 
    <StringView Condition="type_ == 4">value_.string_,s8</StringView> 
    <Expand> 
     <ExpandedItem Condition="type_ == 6">*(value_.map_)</ExpandedItem> 
     <ExpandedItem Condition="type_ == 7">*(value_.map_)</ExpandedItem> 
    </Expand> 
    </Type> 

    <!-- Key/value pairs - used as values for objects and arrays (in arrays the key is null so don't display it) --> 
    <Type Name="std::pair&lt;Json::Value::CZString const ,Json::Value&gt;"> 
    <DisplayString Condition="first.cstr_ != nullptr">{first.cstr_,s8}: {second}</DisplayString> 
    <DisplayString>{second}</DisplayString> 
    <Expand> 
     <Item Name="key" Condition="first.cstr_ != nullptr">first.cstr_</Item> 
     <Item Name="value" Condition="first.cstr_ != nullptr">second</Item> 
     <ExpandedItem>second</ExpandedItem> 
    </Expand> 
    </Type> 
</AutoVisualizer>