Permalink
Browse files

Merge: [clang.py] Add Cursor.get_arguments()

Patch provided by Matthias Kleine <matthias_kleine@gmx.de>

https://llvm.org/svn/llvm-project/cfe/trunk@167216
  • Loading branch information...
1 parent 57f7a13 commit 5cdcc085103e613ce09324ab71bea5af7fd066a3 @tobig tobig committed Nov 18, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 plugin/clang/cindex.py
View
@@ -1271,6 +1271,12 @@ def translation_unit(self):
# 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 @@ def cursor(self):
("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):

0 comments on commit 5cdcc08

Please sign in to comment.