update function and enum generation

This commit is contained in:
Erik Frojdh
2020-05-26 11:26:24 +02:00
parent 37cb0bb1c0
commit f4ba46c19b
5 changed files with 295 additions and 232 deletions

View File

@ -47,6 +47,8 @@ lines = []
ag2 = []
cn = []
def get_arguments(node):
args = [a.type.spelling for a in node.get_arguments()]
args = [
@ -66,8 +68,12 @@ def get_fdec(node):
else:
return_type = 'void'
if node.is_const_method():
const = 'const'
else:
const = ''
args = ", ".join(args)
args = f'({return_type}(Detector::*)({args}))'
args = f'({return_type}(Detector::*)({args}){const})'
return args
@ -85,6 +91,7 @@ def visit(node):
lines.append(
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
)
cn.append(child)
for child in node.get_children():
visit(child)