mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Add extracting and using of class template info
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -496,6 +496,7 @@ class ClassDef(BaseDef):
|
||||
super(ClassDef, self).__init__()
|
||||
self.kind = kind
|
||||
self.protection = ''
|
||||
self.templateParams = [] # class is a template
|
||||
self.bases = [] # base class names
|
||||
self.includes = [] # .h file for this class
|
||||
self.abstract = False # is it an abstract base class?
|
||||
@@ -531,7 +532,9 @@ class ClassDef(BaseDef):
|
||||
self.bases.append(node.text)
|
||||
for node in element.findall('includes'):
|
||||
self.includes.append(node.text)
|
||||
|
||||
for node in element.findall('templateparamlist/param'):
|
||||
self.templateParams.append(node.find('type').text)
|
||||
|
||||
for node in element.findall('innerclass'):
|
||||
if node.get('prot') == 'private':
|
||||
continue
|
||||
@@ -609,7 +612,8 @@ class ClassDef(BaseDef):
|
||||
# look at all overloads
|
||||
ok = False
|
||||
for m in item.all():
|
||||
if m.ignored:
|
||||
# don't use ignored or static methods for propertiess
|
||||
if m.ignored or m.isStatic:
|
||||
continue
|
||||
if prefix == 'Get':
|
||||
prop.getter = m.name
|
||||
@@ -617,9 +621,6 @@ class ClassDef(BaseDef):
|
||||
# that item has exactly zero args without a default value
|
||||
if countNonDefaultArgs(m) != 0:
|
||||
continue
|
||||
# Getters must not be static methods
|
||||
if item.isStatic:
|
||||
continue
|
||||
ok = True
|
||||
break
|
||||
elif prefix == 'Set':
|
||||
|
||||
@@ -299,6 +299,8 @@ from %s import *
|
||||
return
|
||||
|
||||
# write the class header
|
||||
if klass.templateParams:
|
||||
stream.write('%stemplate<%s>\n' % (indent, ', '.join(klass.templateParams)))
|
||||
stream.write('%s%s %s' % (indent, klass.kind, klass.name))
|
||||
if klass.bases:
|
||||
stream.write(' : ')
|
||||
|
||||
Reference in New Issue
Block a user