aboutsummaryrefslogtreecommitdiff
path: root/tools/codegenerator
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2013-12-15 13:58:18 -0500
committerJim Carroll <thecarrolls@jiminger.com>2013-12-24 11:27:42 -0500
commit6a935ddc2be899366b2b110c84a67d66302cb501 (patch)
treedc6dac9462389750014cd563c2fa46c22d7b8aaf /tools/codegenerator
parente4ce605532d2865735b0d150132a7c7ae3a8e371 (diff)
codegenerator handles typdefs - needed for Strnig and Dictionary changes.
Diffstat (limited to 'tools/codegenerator')
-rw-r--r--tools/codegenerator/Helper.groovy13
-rw-r--r--tools/codegenerator/SwigTypeParser.groovy6
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy
index 1e98df05e0..8b471067f7 100644
--- a/tools/codegenerator/Helper.groovy
+++ b/tools/codegenerator/Helper.groovy
@@ -221,6 +221,11 @@ public class Helper
if (!convertTemplate)
{
+ // check the typedef resolution
+ String apiTypeResolved = SwigTypeParser.SwigType_resolve_all_typedefs(apiType)
+ if (!apiTypeResolved.equals(apiType))
+ return getOutConversion(apiTypeResolved, apiName, method, overrideBindings, recurse)
+
if (recurse)
return getOutConversion(SwigTypeParser.SwigType_ltype(apiType),apiName,method,overrideBindings,false)
else if (!isKnownApiType(apiType,method))
@@ -339,7 +344,13 @@ public class Helper
if (convertTemplate == null)
convertTemplate = inTypemap.find({ key, value -> (key instanceof Pattern && key.matcher(apiLType).matches()) })?.value
- if (!convertTemplate){
+ if (!convertTemplate)
+ {
+ // check the typedef resolution
+ String apiTypeResolved = SwigTypeParser.SwigType_resolve_all_typedefs(apiType)
+ if (!apiTypeResolved.equals(apiType))
+ return getInConversion(apiTypeResolved, apiName, paramName, slName, method, overrideBindings)
+
// it's ok if this is a known type
if (!isKnownApiType(apiType,method) && !isKnownApiType(apiLType,method))
System.out.println("WARNING: Unknown parameter type: ${apiType} (or ${apiLType}) for the call ${Helper.findFullClassName(method) + '::' + Helper.callingName(method)}")
diff --git a/tools/codegenerator/SwigTypeParser.groovy b/tools/codegenerator/SwigTypeParser.groovy
index c7efb3f7d2..d079c485ed 100644
--- a/tools/codegenerator/SwigTypeParser.groovy
+++ b/tools/codegenerator/SwigTypeParser.groovy
@@ -348,6 +348,12 @@ public class SwigTypeParser
return t.substring(start,c)
}
+ public static List SwigType_templateparmlist(String t)
+ {
+ int i = t.indexOf('<');
+ return SwigType_parmlist(t.substring(i))
+ }
+
/* -----------------------------------------------------------------------------
* SwigType_parmlist()
*