diff options
author | Gregory Szorc <gregory.szorc@gmail.com> | 2012-11-01 05:46:30 +0000 |
---|---|---|
committer | Gregory Szorc <gregory.szorc@gmail.com> | 2012-11-01 05:46:30 +0000 |
commit | b03b57d14983f90adb85f662812ba5742cfe45f2 (patch) | |
tree | 9454f1c31b4cfaf12f99b093fb9a6d4fca100376 /bindings/python/clang/cindex.py | |
parent | 1d489cf4a04ad0ad8ac2696e4eed0995f3a67288 (diff) |
[clang.py] Add Cursor.get_arguments()
Patch provided by Matthias Kleine <matthias_kleine@gmx.de>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/clang/cindex.py')
-rw-r--r-- | bindings/python/clang/cindex.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index 8f03dd6b1b..5e162c0e83 100644 --- a/bindings/python/clang/cindex.py +++ b/bindings/python/clang/cindex.py @@ -1271,6 +1271,12 @@ class Cursor(Structure): # created. return self._tu + def get_arguments(self): + """Return an iterator for accessing the arguments of this cursor.""" + num_args = conf.lib.clang_Cursor_getNumArguments(self) + for i in range(0, num_args): + yield conf.lib.clang_Cursor_getArgument(self, i) + def get_children(self): """Return an iterator for accessing the children of this cursor.""" @@ -2973,6 +2979,15 @@ functionList = [ ("clang_visitChildren", [Cursor, callbacks['cursor_visit'], py_object], c_uint), + + ("clang_Cursor_getNumArguments", + [Cursor], + c_int), + + ("clang_Cursor_getArgument", + [Cursor, c_uint], + Cursor, + Cursor.from_result), ] class LibclangError(Exception): |