我正在使用一些奇怪的类型的库。在Visual Studio中进行调试时,我希望以可读的形式显示它们。我找到了一些非常有用的文章,介绍如何编辑autoexp.dat文件。
http://www.idigitalhouse.com/Blog/?p=83
或者
http://mariusbancila.ro/blog/2007/04/06/tweaking-autoexpdat-for-custom-types-in-vs2005/
假设我有一个字符串类:
然后我可以轻松添加可视化器,因为_cbuf是一个成员变量。我只需编写
在autoexp.dat中不起作用。
class String {
//...
private:
char *_cbuf;
}
然后我可以轻松添加可视化器,因为_cbuf是一个成员变量。我只需编写
String{
preview (
[$c._cbuf]
)
}
在autoexp.dat文件的[Visualizer]
部分开头就可以使用,并且它能正常工作。
但是假设我想显示一个更复杂的类型,它没有有用的成员变量,但是它有非常有用的方法。例如:
class Date {
//...
String asString() const;
private:
long _someReallyStrangeAndUnusefulDateRepresentation;
}
我想显示字符串而不是无用的长串。如何实现?写成:
Date{
preview (
[$c.asString()]
)
}
在autoexp.dat中不起作用。