[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

customized display of e.g. std::string?

From: Geert Kloosterman
Subject: customized display of e.g. std::string?
Date: Fri, 15 May 2009 12:41:13 +0200

Hi all,

When I display a std::string in DDD, the display looks somewhat like

1. s
npos = 429457295
_M_dataplus = {...}

The content of the string isn't immediately visible, I have to dive into
the structure to see what's in there.

Is there a way to customize the display of std::string items?

I can print/display the string itself, either using s._M_dataplus._M_p
or using s.c_str().  It would be nice to have its display look more like
that of a char *:

3. pointervar
0xbfd9ea54 "this is my char* string"

Another, more fancy display would be something like this:
42. s
c_str()    = "my std::string value"
length()   = 20
capacity() = 20

Would it be possible to instruct DDD to display all std::string types
like this?  Could this be done by writing a DDD theme?

Such a custom display could be useful for other structures as well.

Best regards,
Geert Kloosterman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]