合并Visual Studio本地C++XML注释文档和PDB的符号内容 (二)

2014-11-24 12:15:09 · 作者: · 浏览: 6
面,大家去查一下就知道了。我们首先回忆一下msdn的.net framework的文档,文档里面的每一个类的基类也好,每一个函数的参数类型和返回类型也好,都是超链接。为了生成这样子的文档,我们首先就要知道一个函数的参数类型和返回类型究竟是什么。但是在这里我们发现这份XML并不包含这个内容。这也是为什么找不到一个生成本地C++XML注释的可读文档工具的原因。而C++/CLI也好,.net的其他语言也好,都有这样的工具,因为.net的可执行文件可以反射出每一个符号的所有细节内容。

这也就是为什么有上一篇博客http://www.2cto.com/kf/201203/122574.html 的原因。既然可执行文件不包含元数据,那么pdb总包含的吧。良心的Visual Studio提供了我们msdia100.dll这个COM库,使得我们可以做到从pdb读取符号内容的事情。当然上一篇博客是针对VisualStudio本地C++编译出来的pdb开发的,不能适合所有种类的pdb。

有了这个pdb之后,我们把pdb用C++调用msdia100.dll先生成一份xml,然后就可以用伟大的.net linq to xml来完成接下来的事情了。现在我们手上有了两份xml,一份是xml注释,另一份是pdb符号表。利用Vczh Library++ 3.0的[Tools\Release\SideProjects\GacUISrc\Xml2Doc\Xml2Doc.csproj]项目里面的代码,就可以将这两份xml合并成第三份xml了: < xml version="1.0" encoding="utf-8" >










This is the interface for graphics renderers.





vl::presentation::Size



Calculate the minimum size using the binded graphics element and its state.

The minimum size.






void



Notify that the state in the binded graphics element is changed. This function is usually called by the element itself.







void
vl::presentation::Rect



Render the graphics element using a specified bounds.

Bounds to decide the size and position of the binded graphics element.






void
vl::presentation::elements::IGuiGraphicsRenderTarget*



Set a to this element.

The graphics render target. It can be NULL.






void



Release all resources that used by this renderer.







void
vl::presentation::elements::IGuiGraphicsElement*



Initialize the grpahics renderer by binding a to it.

The graphics element to bind.






vl::presentation::elements::IGuiGraphicsRendererFactory*



Access the graphics that is used to create this graphics renderer.

Returns the related factory.











现在一个类型和函数的xml注释也好,他的基类啊函数的参数类型返回类型也好,全部都出现了。下面可以做的事情就很多了。譬如说自己写一个xml到html文档的转换程序啦,或者用伟大的.net linq to xml把这个xml一转成为其他xml格式,然后使用现有的工具生成文档啦,所有的事情都可以做了。

我接下来会根据GacUI的情况不断增加这个小工具的功能,最终让他可以产生一份好的GacUI的文档,不仅包含XML注释的内容,还可以包含外部插入的tutorial啊,带高亮的code sample等等。


摘自