"""Test if this is an invalid kind."""
return CursorKind_is_inv(self)
+ def is_translation_unit(self):
+ """Test if this is a translation unit kind."""
+ return CursorKind_is_translation_unit(self)
+
+ def is_preprocessing(self):
+ """Test if this is a preprocessing kind."""
+ return CursorKind_is_preprocessing(self)
+
+ def is_unexposed(self):
+ """Test if this is an unexposed kind."""
+ return CursorKind_is_unexposed(self)
+
def __repr__(self):
return 'CursorKind.%s' % (self.name,)
CursorKind_is_inv.argtypes = [CursorKind]
CursorKind_is_inv.restype = bool
+CursorKind_is_translation_unit = lib.clang_isTranslationUnit
+CursorKind_is_translation_unit.argtypes = [CursorKind]
+CursorKind_is_translation_unit.restype = bool
+
+CursorKind_is_preprocessing = lib.clang_isPreprocessing
+CursorKind_is_preprocessing.argtypes = [CursorKind]
+CursorKind_is_preprocessing.restype = bool
+
+CursorKind_is_unexposed = lib.clang_isUnexposed
+CursorKind_is_unexposed.argtypes = [CursorKind]
+CursorKind_is_unexposed.restype = bool
+
# Cursor Functions
# TODO: Implement this function
Cursor_get = lib.clang_getCursor
assert CursorKind.UNEXPOSED_STMT.is_statement()
assert CursorKind.INVALID_FILE.is_invalid()
+ assert CursorKind.TRANSLATION_UNIT.is_translation_unit()
+ assert not CursorKind.TYPE_REF.is_translation_unit()
+
+ assert CursorKind.PREPROCESSING_DIRECTIVE.is_preprocessing()
+ assert not CursorKind.TYPE_REF.is_preprocessing()
+
+ assert CursorKind.UNEXPOSED_DECL.is_unexposed()
+ assert not CursorKind.TYPE_REF.is_unexposed()
+
for k in CursorKind.get_all_kinds():
group = [n for n in ('is_declaration', 'is_reference', 'is_expression',
'is_statement', 'is_invalid', 'is_attribute')