Update of /cvsroot/pygccxml/source/pygccxml/declarations
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26712/pygccxml/declarations
Modified Files:
class_declaration.py decl_printer.py
Log Message:
Adding new feature:
instance of class_t has now references to all it's typedes. This will allow pyplusplus to suggest/set better alais
without user invocation.
Index: class_declaration.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/class_declaration.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** class_declaration.py 22 Mar 2006 10:39:12 -0000 1.20
--- class_declaration.py 20 Apr 2006 04:32:16 -0000 1.21
***************
*** 97,101 ****
self._private_members = []
self._protected_members = []
!
def __str__(self):
name = algorithm.full_name(self)
--- 97,102 ----
self._private_members = []
self._protected_members = []
! self._typedefs = []
!
def __str__(self):
name = algorithm.full_name(self)
***************
*** 204,207 ****
--- 205,215 ----
, doc="list of all protected L{members<declaration_t>}" )
+ def _get_typedefs(self):
+ return self._typedefs
+ def _set_typedefs( self, new_typedefs ):
+ self._typedefs = new_typedefs
+ typedefs = property( _get_typedefs, _set_typedefs
+ , doc="List of aliases/typedefs to this instance")
+
def _get_declarations_impl(self):
return self.get_members()
Index: decl_printer.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/decl_printer.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** decl_printer.py 22 Mar 2006 10:43:12 -0000 1.3
--- decl_printer.py 20 Apr 2006 04:32:16 -0000 1.4
***************
*** 130,133 ****
--- 130,138 ----
self.writer( ' ' * curr_level * self.INDENT_SIZE + class_type.ljust( self.JUSTIFY ) + os.linesep )
+ if self.__inst.typedefs:
+ aliases = map( lambda typedef: typedef.name, self.__inst.typedefs )
+ msg = 'aliases: ' + `aliases`
+ self.writer( ' ' * curr_level * self.INDENT_SIZE + msg.ljust( self.JUSTIFY ) + os.linesep )
+
def print_hierarchy(hierarchy_type, classes, curr_level):
self.writer( ' ' * curr_level * self.INDENT_SIZE + hierarchy_type.ljust( self.JUSTIFY ) + os.linesep )
|