align implementation of smartname to r class name
This commit is contained in:
parent
deb8664165
commit
0fec14ba34
1 changed files with 11 additions and 16 deletions
|
|
@ -2091,21 +2091,16 @@ int R::functionWrapper(Node *n) {
|
||||||
if (constructor) {
|
if (constructor) {
|
||||||
Node * parent = Getattr(n, "parentNode");
|
Node * parent = Getattr(n, "parentNode");
|
||||||
String * smartname = Getattr(parent, "feature:smartptr");
|
String * smartname = Getattr(parent, "feature:smartptr");
|
||||||
if (smartname) {
|
if (smartname) { // SmartName handling - has to be aligned to the other implementation in this file
|
||||||
String * classtypeobj = Getattr(parent, "classtypeobj"); // this is the correct name, e.g. ClassName(int)
|
SwigType *spt = Swig_cparse_type(smartname);
|
||||||
String * classtype = NewString(Getattr(parent, "classtype")); // this is the "wrong" name e.g. ClassName<int>
|
String *smart = SwigType_typedef_resolve_all(spt);
|
||||||
|
String *smart_rname = SwigType_manglestr(smart);
|
||||||
// we replace inside smartname ClassName<int> with ClassName(int)
|
String *smart_rname_p = NewStringf("_p%s", smart_rname);
|
||||||
String * smartname_fixed = NewString(smartname);
|
Replaceall(tm, "$R_class", smart_rname_p);
|
||||||
Replaceall(classtype, " ", ""); // classtype actually has spaces inside so we remove them
|
Delete(spt);
|
||||||
Replaceall(smartname_fixed, classtype, classtypeobj);
|
Delete(smart);
|
||||||
|
Delete(smart_rname);
|
||||||
String * smartname_fixed_rclass = getRClassName(smartname_fixed, 1, 1);
|
Delete(smart_rname_p);
|
||||||
Replaceall(tm, "$R_class", smartname_fixed_rclass);
|
|
||||||
|
|
||||||
Delete(classtype);
|
|
||||||
Delete(smartname_fixed);
|
|
||||||
Delete(smartname_fixed_rclass);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (debugMode) {
|
if (debugMode) {
|
||||||
|
|
@ -2334,7 +2329,7 @@ void R::registerClass(Node *n) {
|
||||||
Printf(s_classes, "setClass('%s', contains = %s)\n", sname, base);
|
Printf(s_classes, "setClass('%s', contains = %s)\n", sname, base);
|
||||||
Delete(base);
|
Delete(base);
|
||||||
String *smartptr = Getattr(n, "feature:smartptr");
|
String *smartptr = Getattr(n, "feature:smartptr");
|
||||||
if (smartptr) {
|
if (smartptr) {// SmartName handling - has to be aligned to the other implementation in this file
|
||||||
List *l = Getattr(n, "bases");
|
List *l = Getattr(n, "bases");
|
||||||
SwigType *spt = Swig_cparse_type(smartptr);
|
SwigType *spt = Swig_cparse_type(smartptr);
|
||||||
String *smart = SwigType_typedef_resolve_all(spt);
|
String *smart = SwigType_typedef_resolve_all(spt);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue