def _process_method(self, c: Cursor, class_, store_global: bool): func = Method( parent=class_, name=c.spelling, location=location_from_cursor(c), ret_type=c.result_type.spelling, access=c.access_specifier.name.lower(), is_virtual=c.is_virtual_method(), is_pure_virtual=c.is_pure_virtual_method(), is_static=c.is_static_method(), brief_comment=c.brief_comment, ) for ac in c.get_arguments(): arg = self._process_variable(ac, class_, warn_failed=False, store_global=store_global) func.args.append(arg) for ac in c.get_children(): if ac.kind == CursorKind.CXX_FINAL_ATTR: func.is_final = True elif ac.kind in METHOD_UNSUPPORTED_CURSORS: pass else: logger.warning( "unknown kind in cxx_method child: %s %s", ac.kind, ac.extent, ) if store_global: self.objects[func.full_name] = func return func
def _process_function(self, c: Cursor, parent: Namespace, store_global: bool): func = Function( name=c.spelling, parent=parent, location=location_from_cursor(c), ret_type=c.result_type.spelling, args=[ Variable(name=ac.spelling, type=ac.type.spelling) for ac in c.get_arguments() ], brief_comment=c.brief_comment, ) if store_global: self.objects[func.full_name] = func return func