Additions to %types so that a user can specify the code to go into the casting / conversion function
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10222 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
560b18eb3f
commit
629aae375c
5 changed files with 76 additions and 13 deletions
|
|
@ -776,6 +776,7 @@ int Language::typemapcopyDirective(Node *n) {
|
|||
|
||||
int Language::typesDirective(Node *n) {
|
||||
Parm *parms = Getattr(n, "parms");
|
||||
String *convcode = Getattr(n, "convcode"); /* optional user supplied conversion code for custom casting */
|
||||
while (parms) {
|
||||
SwigType *t = Getattr(parms, "type");
|
||||
String *v = Getattr(parms, "value");
|
||||
|
|
@ -783,7 +784,7 @@ int Language::typesDirective(Node *n) {
|
|||
SwigType_remember(t);
|
||||
} else {
|
||||
if (SwigType_issimple(t)) {
|
||||
SwigType_inherit(t, v, 0);
|
||||
SwigType_inherit(t, v, 0, convcode);
|
||||
}
|
||||
}
|
||||
parms = nextSibling(parms);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class TypePass:private Dispatcher {
|
|||
Setmeta(bname, "already_warned", "1");
|
||||
}
|
||||
}
|
||||
SwigType_inherit(clsname, bname, cast);
|
||||
SwigType_inherit(clsname, bname, cast, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ class TypePass:private Dispatcher {
|
|||
String *bname = Getattr(n, "name");
|
||||
Node *bclass = n; /* Getattr(n,"class"); */
|
||||
Hash *scopes = Getattr(bclass, "typescope");
|
||||
SwigType_inherit(clsname, bname, cast);
|
||||
SwigType_inherit(clsname, bname, cast, 0);
|
||||
if (!importmode) {
|
||||
String *btype = Copy(bname);
|
||||
SwigType_add_pointer(btype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue