Menu

#63 Missing Mapping info in typedefs of the class

v1.0 (example)
open
nobody
5
2017-03-13
2016-02-23
No

the typedefs is a simple collection instead of a dictionary

there is no usable information that can be pulled from that list but the name of the typedef,
in other words, no actual type this typedef comes to define can be concluded from such list of typedefs.
the only information can be pulled from it is whether it is public, protected or private.

suggested change:

1) in file CppHeaderParser, in class CppClass, in method _init_
after the line change the line 560
from:
typedefAccessSpecificList[accessSpecifier] = []
to:

if accessSpecifier == 'public':
    typedefAccessSpecificList[accessSpecifier] = self._public_typedefs
else:
    typedefAccessSpecificList[accessSpecifier] = {}

2) in file CppHeaderParser, in class _CppHeader, in method evaluate_property_stack
replace line 1910 with:
klass[ 'typedefs' ][ self.curAccessSpecifier ][ name ] = typedef['type']
remove line 1911 as it is redundent now

Discussion

  • Jashua Cloutier

    Jashua Cloutier - 2016-09-06

    I'm not following you on this one. If in my headerfile I have the following

    typedef char TenCharArray[10];

    I can look up cppHeader.typedefs["TenCharArray[10]"] to get the value "char". Please provide an example of what exactly you see as an issue.

     
  • Matt Oyer

    Matt Oyer - 2017-03-13

    Had the same issue, (typedefs in a class only showing as their names) the above change resolved this issue for me (using 2.7.4)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.