mirror of
https://github.com/mappu/miqt.git
synced 2025-01-22 06:30:38 +00:00
genbindings: parse typedefs (don't do anything with them yet)
This commit is contained in:
parent
944e04bf5d
commit
d7a7ae9bcf
@ -61,6 +61,22 @@ func parseHeader(inner []interface{}) (*CppParsedHeader, error) {
|
|||||||
case "FunctionDecl":
|
case "FunctionDecl":
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
case "TypedefDecl":
|
||||||
|
// Must have a name
|
||||||
|
nodename, ok := node["name"].(string)
|
||||||
|
if !ok {
|
||||||
|
return nil, errors.New("node has no name")
|
||||||
|
}
|
||||||
|
|
||||||
|
if typ, ok := node["type"].(map[string]interface{}); ok {
|
||||||
|
if qualType, ok := typ["qualType"].(string); ok {
|
||||||
|
ret.Typedefs = append(ret.Typedefs, CppTypedef{
|
||||||
|
Name: nodename,
|
||||||
|
Typedef: qualType,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case "CXXMethodDecl":
|
case "CXXMethodDecl":
|
||||||
// A C++ class method implementation directly in the header
|
// A C++ class method implementation directly in the header
|
||||||
// Skip over these
|
// Skip over these
|
||||||
|
@ -84,6 +84,12 @@ type CppClass struct {
|
|||||||
Props []CppProperty
|
Props []CppProperty
|
||||||
}
|
}
|
||||||
|
|
||||||
type CppParsedHeader struct {
|
type CppTypedef struct {
|
||||||
Classes []CppClass
|
Name string
|
||||||
|
Typedef string
|
||||||
|
}
|
||||||
|
|
||||||
|
type CppParsedHeader struct {
|
||||||
|
Typedefs []CppTypedef
|
||||||
|
Classes []CppClass
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user