genbindings: change AllInherits() to return lookupResultClass

This commit is contained in:
mappu 2025-01-19 16:38:27 +13:00
parent 28fd54f6a3
commit 883ba8c131
2 changed files with 8 additions and 8 deletions

View File

@ -608,9 +608,9 @@ func getReferencedTypes(src *CppParsedHeader) []string {
}
maybeAddType(vm.ReturnType)
}
for _, cn := range c.AllInherits() {
for _, cn := range c.AllInheritsClassInfo() {
maybeAddType(CppParameter{
ParameterType: cn,
ParameterType: cn.Class.ClassName,
})
}
}

View File

@ -505,17 +505,17 @@ func (c *CppClass) VirtualMethods() []CppMethod {
return ret
}
// AllInherits recursively finds and lists all the parent classes of this class.
func (c *CppClass) AllInherits() []string {
var ret []string
// AllInheritsClassInfo recursively finds and lists all the parent classes of this class.
func (c *CppClass) AllInheritsClassInfo() []lookupResultClass {
var ret []lookupResultClass
// FIXME prevent duplicates arising from diamond inheritance
for _, baseClassInfo := range c.DirectInheritClassInfo() {
ret = append(ret, baseClassInfo.Class.ClassName)
ret = append(ret, baseClassInfo)
recurseInfo := baseClassInfo.Class.AllInherits()
recurseInfo := baseClassInfo.Class.AllInheritsClassInfo()
for _, childClass := range recurseInfo {
ret = append(ret, childClass)
}
@ -528,7 +528,7 @@ func (c *CppClass) AllInherits() []string {
func (c *CppClass) DirectInheritClassInfo() []lookupResultClass {
var ret []lookupResultClass
for _, inh := range c.DirectInherits { // AllInherits() {
for _, inh := range c.DirectInherits {
cinfo, ok := KnownClassnames[inh]
if !ok {
if strings.HasPrefix(inh, `QList<`) {