clang API Documentation
Enumerations | |
enum | CXNameRefFlags { CXNameRange_WantQualifier = 0x1, CXNameRange_WantTemplateArgs = 0x2, CXNameRange_WantSinglePiece = 0x4 } |
Functions | |
CINDEX_LINKAGE unsigned | clang_CXXMethod_isPureVirtual (CXCursor C) |
Determine if a C++ member function or member function template is pure virtual. | |
CINDEX_LINKAGE unsigned | clang_CXXMethod_isStatic (CXCursor C) |
Determine if a C++ member function or member function template is declared 'static'. | |
CINDEX_LINKAGE unsigned | clang_CXXMethod_isVirtual (CXCursor C) |
Determine if a C++ member function or member function template is explicitly declared 'virtual' or if it overrides a virtual method from one of the base classes. | |
CINDEX_LINKAGE unsigned | clang_CXXMethod_isConst (CXCursor C) |
Determine if a C++ member function or member function template is declared 'const'. | |
CINDEX_LINKAGE enum CXCursorKind | clang_getTemplateCursorKind (CXCursor C) |
Given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template. | |
CINDEX_LINKAGE CXCursor | clang_getSpecializedCursorTemplate (CXCursor C) |
Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated. | |
CINDEX_LINKAGE CXSourceRange | clang_getCursorReferenceNameRange (CXCursor C, unsigned NameFlags, unsigned PieceIndex) |
Given a cursor that references something else, return the source range covering that reference. |
The routines in this group provide access information in the ASTs specific to C++ language features.
enum CXNameRefFlags |
Determine if a C++ member function or member function template is declared 'const'.
Determine if a C++ member function or member function template is pure virtual.
Determine if a C++ member function or member function template is declared 'static'.
Determine if a C++ member function or member function template is explicitly declared 'virtual' or if it overrides a virtual method from one of the base classes.
CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange | ( | CXCursor | C, |
unsigned | NameFlags, | ||
unsigned | PieceIndex | ||
) |
Given a cursor that references something else, return the source range covering that reference.
C | A cursor pointing to a member reference, a declaration reference, or an operator call. |
NameFlags | A bitset with three independent flags: CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and CXNameRange_WantSinglePiece. |
PieceIndex | For contiguous names or when passing the flag CXNameRange_WantSinglePiece, only one piece with index 0 is available. When the CXNameRange_WantSinglePiece flag is not passed for a non-contiguous names, this index can be used to retrieve the individual pieces of the name. See also CXNameRange_WantSinglePiece. |
Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated.
This routine determines the template involved both for explicit specializations of templates and for implicit instantiations of the template, both of which are referred to as "specializations". For a class template specialization (e.g., std::vector<bool>
), this routine will return either the primary template (std::vector
) or, if the specialization was instantiated from a class template partial specialization, the class template partial specialization. For a class template partial specialization and a function template specialization (including instantiations), this this routine will return the specialized template.
For members of a class template (e.g., member functions, member classes, or static data members), returns the specialized or instantiated member. Although not strictly "templates" in the C++ language, members of class templates have the same notions of specializations and instantiations that templates do, so this routine treats them similarly.
C | A cursor that may be a specialization of a template or a member of a template. |
Given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template.
This routine can be used to determine what flavor of function template, class template, or class template partial specialization is stored in the cursor. For example, it can describe whether a class template cursor is declared with "struct", "class" or "union".
C | The cursor to query. This cursor should represent a template declaration. |
C
. If C
is not a template, returns CXCursor_NoDeclFound
.