in lib/src/header_parser/sub_parsers/compounddecl_parser.dart [247:301]
int _compoundMembersVisitor(clang_types.CXCursor cursor,
clang_types.CXCursor parent, Pointer<Void> clientData) {
try {
if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) {
_logger.finer('===== member: ${cursor.completeStringRepr()}');
// Set maxChildAlignValue.
final align = cursor.type().alignment();
if (align > _stack.top.maxChildAlignment) {
_stack.top.maxChildAlignment = align;
}
final mt = cursor.type().toCodeGenType();
if (mt.broadType == BroadType.IncompleteArray) {
// TODO(68): Structs with flexible Array Members are not supported.
_stack.top.flexibleArrayMember = true;
}
if (clang.clang_getFieldDeclBitWidth(cursor) != -1) {
// TODO(84): Struct with bitfields are not suppoorted.
_stack.top.bitFieldMember = true;
}
if (mt.broadType == BroadType.Handle) {
_stack.top.dartHandleMember = true;
}
if (mt.isIncompleteCompound) {
_stack.top.incompleteCompoundMember = true;
}
if (mt.getBaseType().broadType == BroadType.Unimplemented) {
_stack.top.unimplementedMemberType = true;
}
_stack.top.compound!.members.add(
Member(
dartDoc: getCursorDocComment(
cursor,
nesting.length + commentPrefix.length,
),
originalName: cursor.spelling(),
name: config.structDecl.renameMemberUsingConfig(
_stack.top.compound!.originalName,
cursor.spelling(),
),
type: mt,
),
);
} else if (cursor.kind == clang_types.CXCursorKind.CXCursor_PackedAttr) {
_stack.top.hasPackedAttr = true;
}
} catch (e, s) {
_logger.severe(e);
_logger.severe(s);
rethrow;
}
return clang_types.CXChildVisitResult.CXChildVisit_Continue;
}