CastXML / pygccxml

pygccxml is a specialized XML reader that reads the output from CastXML or GCCXML. It provides a simple framework to navigate C++ declarations, using Python classes.
Boost Software License 1.0
130 stars 44 forks source link

Type name inconsistencies #76

Open ombre5733 opened 7 years ago

ombre5733 commented 7 years ago

I'm right now playing around with templates and noticed a few inconsistencies in the naming. For example:

>>> type(x)
<class 'pygccxml.declarations.class_declaration.class_declaration_t'>
>>> x.decl_string
'::A::T<A::B::D, bool>'
>>> x.partial_decl_string
'::A::T< A::B::D, bool >'

So the partial_decl_string has spaces after < and before > where the decl_string does not.

Even more severe for me is that the decl string for all types returns a fully qualified name starting with :: but the template arguments do not. In the example above, I wished that the first template argument would be rendered as ::A::B::D and not only A::B::D.

Is it possible to harmonize the output?

iMichka commented 7 years ago

Hi. Thanks for reporting.

Cleaning this up would surely be great. Not sure when I will be able to afford some time for this, probably next week. Changing this may not be too difficult. A pull request would also be welcome.