mirror of
https://github.com/mappu/miqt.git
synced 2025-01-21 22:20: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":
|
||||
// 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":
|
||||
// A C++ class method implementation directly in the header
|
||||
// Skip over these
|
||||
|
@ -84,6 +84,12 @@ type CppClass struct {
|
||||
Props []CppProperty
|
||||
}
|
||||
|
||||
type CppTypedef struct {
|
||||
Name string
|
||||
Typedef string
|
||||
}
|
||||
|
||||
type CppParsedHeader struct {
|
||||
Typedefs []CppTypedef
|
||||
Classes []CppClass
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user