Getting the class name described by a CXCursor


I’m using libclang and I get various CXCursor objects while parsing (with the visitor API, see

When I get CXCursors whose kind is CXCursor_ClassDecl, clang_getCursorSpelling() gives me the raw name (eg: if class is A, I get « A » ).
However when I get CXCursors whose kind is CXCursor_CXXBaseSpecifier, clang_getCursorSpelling() gives me a long name: « class A » instead of what I would like: « A ».

If there a way to access the raw class name for C++ parent classes? Or is the only possible way cutting the string to drop the « class » prefix?

Thank you very much for your help!