aboutsummaryrefslogtreecommitdiff
path: root/tools/codegenerator
diff options
context:
space:
mode:
authormontellese <montellese@xbmc.org>2015-01-15 20:36:55 +0100
committermontellese <montellese@xbmc.org>2015-03-01 14:52:01 +0100
commit55ba0c476f0044e370a4ecd3af77958fb15c4601 (patch)
tree5a826b57b6bf6972273a6862b10080a6aff0c24b /tools/codegenerator
parent436a59d23e074384892ac6a252622068ac6b0a1e (diff)
python: fix property getters/setters for custom API types
Diffstat (limited to 'tools/codegenerator')
-rw-r--r--tools/codegenerator/Helper.groovy13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy
index 8b471067f7..920c7d1b95 100644
--- a/tools/codegenerator/Helper.groovy
+++ b/tools/codegenerator/Helper.groovy
@@ -665,6 +665,19 @@ public class Helper
}
/**
+ * Because the return type of a property is a combination of the function
+ * 'decl' and the function 'type,' this method will construct a valid Swig
+ * typestring from the two.
+ */
+ public static String getPropertyReturnSwigType(Node method)
+ {
+ // we're going to take a shortcut here because it appears only the pointer indicator
+ // ends up attached to the decl.
+ String prefix = (method.@decl != null && method.@decl == 'p.') ? 'p.' : ''
+ return method.@type != null ? prefix + method.@type : 'void'
+ }
+
+ /**
* Because the return type is a combination of the function 'decl' and the
* function 'type,' this method will construct a valid Swig typestring from
* the two.