diff options
author | Gregory Szorc <gregory.szorc@gmail.com> | 2012-04-15 18:51:10 +0000 |
---|---|---|
committer | Gregory Szorc <gregory.szorc@gmail.com> | 2012-04-15 18:51:10 +0000 |
commit | 6e67eed3276f16edac4ab4ef5a36d2b896e18288 (patch) | |
tree | 8da7b1cd1d10376d2af7db819b5f593103e4f7c7 /bindings/python/clang/cindex.py | |
parent | 2d7cb069fe101da3971a07900ff583380bcac184 (diff) |
[clang.py] Implement TypeKind.spelling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/clang/cindex.py')
-rw-r--r-- | bindings/python/clang/cindex.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index b4563eb0c6..6f0d25f1a8 100644 --- a/bindings/python/clang/cindex.py +++ b/bindings/python/clang/cindex.py @@ -1079,6 +1079,11 @@ class TypeKind(object): self._name_map[value] = key return self._name_map[self] + @property + def spelling(self): + """Retrieve the spelling of this TypeKind.""" + return TypeKind_spelling(self.value) + @staticmethod def from_id(id): if id >= len(TypeKind._kinds) or TypeKind._kinds[id] is None: @@ -1088,6 +1093,10 @@ class TypeKind(object): def __repr__(self): return 'TypeKind.%s' % (self.name,) +TypeKind_spelling = lib.clang_getTypeKindSpelling +TypeKind_spelling.argtypes = [c_uint] +TypeKind_spelling.restype = _CXString +TypeKind_spelling.errcheck = _CXString.from_result TypeKind.INVALID = TypeKind(0) |