Generate optional stubs for the wxFileSystemWatcher* classes

This commit is contained in:
Robin Dunn
2019-01-03 21:57:06 -08:00
parent 1702cb6db8
commit 02c06475f5
4 changed files with 22 additions and 3 deletions

View File

@@ -1270,7 +1270,8 @@ def guessTypeStr(v):
# generating stubs then we can still provide the wrapper classes but simply
# have them raise NotImplemented errors or whatnot.
def generateStubs(cppFlag, module, excludes=[], typeValMap={}):
def generateStubs(cppFlag, module, excludes=[], typeValMap={},
extraHdrCode=None, extraCppCode=None):
"""
Generate C++ stubs for all items in the module, except those that are
in the optional excludes list.
@@ -1306,6 +1307,12 @@ def generateStubs(cppFlag, module, excludes=[], typeValMap={}):
if isinstance(item, extractors.ClassDef):
code.hdr.append('class {};'.format(item.name))
if extraHdrCode:
code.hdr.append(extraHdrCode)
if extraCppCode:
code.cpp.append(extraCppCode)
# Now write code for all the items in the module.
for item in module:
if item.name in excludes: