aboutsummaryrefslogtreecommitdiff
path: root/tools/codegenerator
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2012-11-26 23:29:35 -0500
committerJim Carroll <thecarrolls@jiminger.com>2013-03-10 12:02:46 -0400
commit92c7bf0e682a63baee3cd81a36468a346b16d5a8 (patch)
tree6be9f64923fb0b6dfcb8fa633167346e4592f57d /tools/codegenerator
parent87047e93e02375851505e9d6c420dd1225996bdb (diff)
Introduce a Buffer class and use it to replace custom API definitions for RenderCapture and xbmcvfs.File.
Diffstat (limited to 'tools/codegenerator')
-rw-r--r--tools/codegenerator/SwigTypeParser.groovy19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/codegenerator/SwigTypeParser.groovy b/tools/codegenerator/SwigTypeParser.groovy
index 282a971140..94872e21a8 100644
--- a/tools/codegenerator/SwigTypeParser.groovy
+++ b/tools/codegenerator/SwigTypeParser.groovy
@@ -42,9 +42,9 @@ public class SwigTypeParser
public static String convertTypeToLTypeForParam(String ty)
{
// in the case where we're converting from a type to an ltype for a parameter,
- // and the type is a r.q(const).*, we are going to assume the ltype is
+ // and the type is a r.*, we are going to assume the ltype is
// a "pass-by-value" on the stack.
- return (ty.trim().startsWith('r.q(const).') ? SwigTypeParser.SwigType_ltype(ty.trim().substring(11)) : SwigTypeParser.SwigType_ltype(ty.trim()))
+ return (ty.trim().startsWith('r.') ? SwigTypeParser.SwigType_ltype(ty.trim().substring(2)) : SwigTypeParser.SwigType_ltype(ty.trim()))
}
/**
@@ -248,10 +248,18 @@ public class SwigTypeParser
public static boolean SwigType_ispointer(String t)
{
- if (t.startsWith('q(')) t = t.substring(t.indexOf('.') + 1,)
+ if (t.startsWith('q(')) t = t.substring(t.indexOf('.') + 1)
return t.startsWith('p.')
}
+ public static String SwigType_makepointer(String t)
+ {
+ String prefix = (t.startsWith('q(')) ? t.substring(0,t.indexOf('.') + 1) : ""
+ String remainder = (t.startsWith('q(')) ? t.substring(t.indexOf('.') + 1) : t
+
+ return prefix + "p." + remainder
+ }
+
public static boolean SwigType_isarray(String t) { return t.startsWith('a(') }
public static boolean SwigType_ismemberpointer(String t) { return t?.startsWith('m(') }
@@ -542,11 +550,12 @@ public class SwigTypeParser
//System.out.println "${convertTypeToLType('bool')}"
//testPrint('p.q(const).XBMCAddon::xbmcgui::ListItemList')
//testPrint('p.q(const).XBMCAddon::xbmcgui::ListItemList')
- testPrint('r.q(const).std::map<(String,String)>', 'foo')
+ //testPrint(SwigTypeParser.SwigType_makepointer('r.q(const).std::map<(String,String)>'), 'foo')
+ testPrint(SwigTypeParser.SwigType_makepointer('q(const).p.q(const).char'),'bfoo')
}
private static void testPrint(String ty, String id = 'foo')
{
- println SwigTypeParser.SwigType_ltype(ty) + "|" + SwigTypeParser.SwigType_str(SwigTypeParser.SwigType_ltype(ty),id) + ' ' + " = " + SwigTypeParser.SwigType_str(ty,id)
+ println SwigTypeParser.SwigType_ltype(ty) + "|" + SwigTypeParser.SwigType_str(SwigTypeParser.SwigType_ltype(ty),id) + ' ' + " = " + ty + '|' + SwigTypeParser.SwigType_str(ty,id)
}
}