return self._referenced
+ @property
+ def brief_comment(self):
+ """Returns the brief comment text associated with that Cursor"""
+ return conf.lib.clang_Cursor_getBriefCommentText(self)
+
+ @property
+ def raw_comment(self):
+ """Returns the raw comment text associated with that Cursor"""
+ return conf.lib.clang_Cursor_getRawCommentText(self)
+
def get_arguments(self):
"""Return an iterator for accessing the arguments of this cursor."""
num_args = conf.lib.clang_Cursor_getNumArguments(self)
"""
return conf.lib.clang_Type_getOffsetOf(self, c_char_p(fieldname))
+ @property
+ def spelling(self):
+ """Retrieve the spelling of this Type."""
+ return conf.lib.clang_getTypeSpelling(self)
+
def __eq__(self, other):
if type(other) != type(self):
return False
_CXString,
_CXString.from_result),
+ ("clang_getTypeSpelling",
+ [Type],
+ _CXString,
+ _CXString.from_result),
+
("clang_hashCursor",
[Cursor],
c_uint),
[Cursor],
bool),
+ ("clang_Cursor_getBriefCommentText",
+ [Cursor],
+ _CXString,
+ _CXString.from_result),
+
+ ("clang_Cursor_getRawCommentText",
+ [Cursor],
+ _CXString,
+ _CXString.from_result),
+
("clang_Type_getAlignOf",
[Type],
c_longlong),
assert a.type != None
assert a.type != 'foo'
+def test_type_spelling():
+ """Ensure Type.spelling works."""
+ tu = get_tu('int c[5]; int i[]; int x; int v[x];')
+ c = get_cursor(tu, 'c')
+ i = get_cursor(tu, 'i')
+ x = get_cursor(tu, 'x')
+ v = get_cursor(tu, 'v')
+ assert c is not None
+ assert i is not None
+ assert x is not None
+ assert v is not None
+ assert c.type.spelling == "int [5]"
+ assert i.type.spelling == "int []"
+ assert x.type.spelling == "int"
+ assert v.type.spelling == "int [x]"
+
def test_typekind_spelling():
"""Ensure TypeKind.spelling works."""
tu = get_tu('int a;')