better fix for typedef + inheritance
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8786 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cb18392a7a
commit
ff0c451c08
2 changed files with 53 additions and 17 deletions
|
|
@ -250,7 +250,14 @@ namespace TagLib
|
||||||
public:
|
public:
|
||||||
File() {}
|
File() {}
|
||||||
};
|
};
|
||||||
class AudioProperties { };
|
|
||||||
|
class AudioProperties {
|
||||||
|
};
|
||||||
|
|
||||||
|
class AudioPropertiesFile {
|
||||||
|
public:
|
||||||
|
typedef TagLib::File File;
|
||||||
|
};
|
||||||
|
|
||||||
namespace FLAC
|
namespace FLAC
|
||||||
{
|
{
|
||||||
|
|
@ -260,6 +267,27 @@ namespace TagLib
|
||||||
Properties(File *) {}
|
Properties(File *) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PropertiesFile : public AudioPropertiesFile {
|
||||||
|
public:
|
||||||
|
PropertiesFile(File * = 0) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class PropertiesFree {
|
||||||
|
public:
|
||||||
|
PropertiesFree(File *) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class FooFilePrivate : private PropertiesFile {
|
||||||
|
public:
|
||||||
|
FooFilePrivate(File *) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class FooFile : PropertiesFile {
|
||||||
|
public:
|
||||||
|
FooFile(File *) {}
|
||||||
|
};
|
||||||
|
|
||||||
class File {
|
class File {
|
||||||
public:
|
public:
|
||||||
File() {}
|
File() {}
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ static Typetab *resolved_scope = 0;
|
||||||
/* Internal function */
|
/* Internal function */
|
||||||
|
|
||||||
static SwigType *
|
static SwigType *
|
||||||
typedef_resolve(Typetab *s, String *base) {
|
_typedef_resolve(Typetab *s, String *base, int look_parent) {
|
||||||
Hash *ttab;
|
Hash *ttab;
|
||||||
SwigType *type = 0;
|
SwigType *type = 0;
|
||||||
List *inherit;
|
List *inherit;
|
||||||
|
|
@ -507,30 +507,38 @@ typedef_resolve(Typetab *s, String *base) {
|
||||||
resolved_scope = s;
|
resolved_scope = s;
|
||||||
Setmark(s,0);
|
Setmark(s,0);
|
||||||
} else {
|
} else {
|
||||||
/* Hmmm. Not found in my scope. check parent */
|
/* Hmmm. Not found in my scope. It could be in an inherited scope */
|
||||||
parent = Getattr(s,k_parent);
|
inherit = Getattr(s,k_inherit);
|
||||||
type = parent ? typedef_resolve(parent, base) : 0;
|
if (inherit) {
|
||||||
if (!type) {
|
int i,len;
|
||||||
/* Hmmm. Not found in my scope. It could be in an inherited scope */
|
len = Len(inherit);
|
||||||
inherit = Getattr(s,k_inherit);
|
for (i = 0; i < len; i++) {
|
||||||
if (inherit) {
|
type = _typedef_resolve(Getitem(inherit,i), base, 0);
|
||||||
int i,len;
|
if (type) {
|
||||||
len = Len(inherit);
|
Setmark(s,0);
|
||||||
for (i = 0; i < len; i++) {
|
break;
|
||||||
type = typedef_resolve(Getitem(inherit,i), base);
|
|
||||||
if (type) {
|
|
||||||
Setmark(s,0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!type) {
|
||||||
|
/* Hmmm. Not found in my scope. check parent */
|
||||||
|
if (look_parent) {
|
||||||
|
parent = Getattr(s,k_parent);
|
||||||
|
type = parent ? _typedef_resolve(parent, base, 1) : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Setmark(s,0);
|
Setmark(s,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SwigType *
|
||||||
|
typedef_resolve(Typetab *s, String *base) {
|
||||||
|
return _typedef_resolve(s, base, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* SwigType_typedef_resolve()
|
* SwigType_typedef_resolve()
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue