aboutsummaryrefslogtreecommitdiff
path: root/find-modules/sip_generator.py
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2017-01-14 21:42:50 +0000
committerStephen Kelly <steveire@gmail.com>2017-01-15 11:18:34 +0000
commit8c347c61abafa68e247ff4664ae658cfa15af932 (patch)
tree972eca5ade46d3a0c213d854f6f8acfe1881a3d2 /find-modules/sip_generator.py
parent3c31028dad2f9c53bea6630fd0da127a6da0d610 (diff)
downloadextra-cmake-modules-8c347c61abafa68e247ff4664ae658cfa15af932.tar.gz
extra-cmake-modules-8c347c61abafa68e247ff4664ae658cfa15af932.tar.bz2
Bindings: Use lists in function API instead of strings
Custom rules should be able to deal with lists in these cases. This is already the case for function parameters.
Diffstat (limited to 'find-modules/sip_generator.py')
-rw-r--r--find-modules/sip_generator.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/find-modules/sip_generator.py b/find-modules/sip_generator.py
index a8c164b5..41dd6369 100644
--- a/find-modules/sip_generator.py
+++ b/find-modules/sip_generator.py
@@ -345,9 +345,9 @@ class SipGenerator(object):
#
# Flesh out the SIP context for the rules engine.
#
- sip["template_parameters"] = ", ".join(template_type_parameters)
+ sip["template_parameters"] = template_type_parameters
sip["decl"] = container_type
- sip["base_specifiers"] = ", ".join(base_specifiers)
+ sip["base_specifiers"] = base_specifiers
sip["body"] = body
modifying_rule = self.rules.container_rules().apply(container, sip)
pad = " " * (level * 4)
@@ -364,11 +364,11 @@ class SipGenerator(object):
body = pad + "// Discarded {} (by {})\n".format(SipGenerator.describe(container), "/External/ handling")
else:
if sip["base_specifiers"]:
- decl += ": " + sip["base_specifiers"]
+ decl += ": " + ", ".join(sip["base_specifiers"])
if sip["annotations"]:
decl += " /" + ",".join(sip["annotations"]) + "/"
if sip["template_parameters"]:
- decl = pad + "template <" + sip["template_parameters"] + ">\n" + decl
+ decl = pad + "template <" + ", ".join(sip["template_parameters"]) + ">\n" + decl
decl += "\n" + pad + "{\n"
decl += "%TypeHeaderCode\n#include <{}>\n%End\n".format(include_filename)
body = decl + sip["body"] + pad + "};\n"
@@ -511,13 +511,12 @@ class SipGenerator(object):
if parameter_modifying_rules:
decl += pad
- sip["template_parameters"] = ", ".join(sip["template_parameters"])
decl += sip["name"] + "(" + ", ".join(sip["parameters"]) + ")"
if sip["fn_result"]:
decl = sip["fn_result"] + " " + decl
decl = pad + sip["prefix"] + decl + sip["suffix"]
if sip["template_parameters"]:
- decl = pad + "template <" + sip["template_parameters"] + ">\n" + decl
+ decl = pad + "template <" + ", ".join(sip["template_parameters"]) + ">\n" + decl
decl += ";\n"
decl += sip["code"]
else: