@@ -2710,6 +2710,21 @@ def visitor(base, children):
27102710 conf .lib .clang_visitCXXBaseClasses (self , fields_visit_callback (visitor ), bases )
27112711 return iter (bases )
27122712
2713+ def get_methods (self ):
2714+ """Return an iterator for accessing the methods of this type."""
2715+
2716+ def visitor (method , children ):
2717+ assert method != conf .lib .clang_getNullCursor ()
2718+
2719+ # Create reference to TU so it isn't GC'd before Cursor.
2720+ method ._tu = self ._tu
2721+ methods .append (method )
2722+ return 1 # continue
2723+
2724+ methods : list [Cursor ] = []
2725+ conf .lib .clang_visitCXXMethods (self , fields_visit_callback (visitor ), methods )
2726+ return iter (methods )
2727+
27132728 def get_exception_specification_kind (self ):
27142729 """
27152730 Return the kind of the exception specification; a value from
@@ -4017,6 +4032,7 @@ def set_property(self, property, value):
40174032 ),
40184033 ("clang_visitChildren" , [Cursor , cursor_visit_callback , py_object ], c_uint ),
40194034 ("clang_visitCXXBaseClasses" , [Type , fields_visit_callback , py_object ], c_uint ),
4035+ ("clang_visitCXXMethods" , [Type , fields_visit_callback , py_object ], c_uint ),
40204036 ("clang_Cursor_getNumArguments" , [Cursor ], c_int ),
40214037 ("clang_Cursor_getArgument" , [Cursor , c_uint ], Cursor ),
40224038 ("clang_Cursor_getNumTemplateArguments" , [Cursor ], c_int ),
0 commit comments