clang 20.0.0git
|
Classes | |
struct | CXType |
The type of an element in the abstract syntax tree. More... | |
Functions | |
CINDEX_LINKAGE CXType | clang_getCursorType (CXCursor C) |
Retrieve the type of a CXCursor (if any). | |
CINDEX_LINKAGE CXString | clang_getTypeSpelling (CXType CT) |
Pretty-print the underlying type using the rules of the language of the translation unit from which it came. | |
CINDEX_LINKAGE CXType | clang_getTypedefDeclUnderlyingType (CXCursor C) |
Retrieve the underlying type of a typedef declaration. | |
CINDEX_LINKAGE CXType | clang_getEnumDeclIntegerType (CXCursor C) |
Retrieve the integer type of an enum declaration. | |
CINDEX_LINKAGE long long | clang_getEnumConstantDeclValue (CXCursor C) |
Retrieve the integer value of an enum constant declaration as a signed long long. | |
CINDEX_LINKAGE unsigned long long | clang_getEnumConstantDeclUnsignedValue (CXCursor C) |
Retrieve the integer value of an enum constant declaration as an unsigned long long. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isBitField (CXCursor C) |
Returns non-zero if the cursor specifies a Record member that is a bit-field. | |
CINDEX_LINKAGE int | clang_getFieldDeclBitWidth (CXCursor C) |
Retrieve the bit width of a bit-field declaration as an integer. | |
CINDEX_LINKAGE int | clang_Cursor_getNumArguments (CXCursor C) |
Retrieve the number of non-variadic arguments associated with a given cursor. | |
CINDEX_LINKAGE CXCursor | clang_Cursor_getArgument (CXCursor C, unsigned i) |
Retrieve the argument cursor of a function or method. | |
CINDEX_LINKAGE int | clang_Cursor_getNumTemplateArguments (CXCursor C) |
Returns the number of template args of a function, struct, or class decl representing a template specialization. | |
CINDEX_LINKAGE enum CXTemplateArgumentKind | clang_Cursor_getTemplateArgumentKind (CXCursor C, unsigned I) |
Retrieve the kind of the I'th template argument of the CXCursor C. | |
CINDEX_LINKAGE CXType | clang_Cursor_getTemplateArgumentType (CXCursor C, unsigned I) |
Retrieve a CXType representing the type of a TemplateArgument of a function decl representing a template specialization. | |
CINDEX_LINKAGE long long | clang_Cursor_getTemplateArgumentValue (CXCursor C, unsigned I) |
Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as a signed long long. | |
CINDEX_LINKAGE unsigned long long | clang_Cursor_getTemplateArgumentUnsignedValue (CXCursor C, unsigned I) |
Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as an unsigned long long. | |
CINDEX_LINKAGE unsigned | clang_equalTypes (CXType A, CXType B) |
Determine whether two CXTypes represent the same type. | |
CINDEX_LINKAGE CXType | clang_getCanonicalType (CXType T) |
Return the canonical type for a CXType. | |
CINDEX_LINKAGE unsigned | clang_isConstQualifiedType (CXType T) |
Determine whether a CXType has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isMacroFunctionLike (CXCursor C) |
Determine whether a CXCursor that is a macro, is function like. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isMacroBuiltin (CXCursor C) |
Determine whether a CXCursor that is a macro, is a builtin one. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isFunctionInlined (CXCursor C) |
Determine whether a CXCursor that is a function declaration, is an inline declaration. | |
CINDEX_LINKAGE unsigned | clang_isVolatileQualifiedType (CXType T) |
Determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level. | |
CINDEX_LINKAGE unsigned | clang_isRestrictQualifiedType (CXType T) |
Determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level. | |
CINDEX_LINKAGE unsigned | clang_getAddressSpace (CXType T) |
Returns the address space of the given type. | |
CINDEX_LINKAGE CXString | clang_getTypedefName (CXType CT) |
Returns the typedef name of the given type. | |
CINDEX_LINKAGE CXType | clang_getPointeeType (CXType T) |
For pointer types, returns the type of the pointee. | |
CINDEX_LINKAGE CXType | clang_getUnqualifiedType (CXType CT) |
Retrieve the unqualified variant of the given type, removing as little sugar as possible. | |
CINDEX_LINKAGE CXType | clang_getNonReferenceType (CXType CT) |
For reference types (e.g., "const int&"), returns the type that the reference refers to (e.g "const int"). | |
CINDEX_LINKAGE CXCursor | clang_getTypeDeclaration (CXType T) |
Return the cursor for the declaration of the given type. | |
CINDEX_LINKAGE CXString | clang_getDeclObjCTypeEncoding (CXCursor C) |
Returns the Objective-C type encoding for the specified declaration. | |
CINDEX_LINKAGE CXString | clang_Type_getObjCEncoding (CXType type) |
Returns the Objective-C type encoding for the specified CXType. | |
CINDEX_LINKAGE CXString | clang_getTypeKindSpelling (enum CXTypeKind K) |
Retrieve the spelling of a given CXTypeKind. | |
CINDEX_LINKAGE enum CXCallingConv | clang_getFunctionTypeCallingConv (CXType T) |
Retrieve the calling convention associated with a function type. | |
CINDEX_LINKAGE CXType | clang_getResultType (CXType T) |
Retrieve the return type associated with a function type. | |
CINDEX_LINKAGE int | clang_getExceptionSpecificationType (CXType T) |
Retrieve the exception specification type associated with a function type. | |
CINDEX_LINKAGE int | clang_getNumArgTypes (CXType T) |
Retrieve the number of non-variadic parameters associated with a function type. | |
CINDEX_LINKAGE CXType | clang_getArgType (CXType T, unsigned i) |
Retrieve the type of a parameter of a function type. | |
CINDEX_LINKAGE CXType | clang_Type_getObjCObjectBaseType (CXType T) |
Retrieves the base type of the ObjCObjectType. | |
CINDEX_LINKAGE unsigned | clang_Type_getNumObjCProtocolRefs (CXType T) |
Retrieve the number of protocol references associated with an ObjC object/id. | |
CINDEX_LINKAGE CXCursor | clang_Type_getObjCProtocolDecl (CXType T, unsigned i) |
Retrieve the decl for a protocol reference for an ObjC object/id. | |
CINDEX_LINKAGE unsigned | clang_Type_getNumObjCTypeArgs (CXType T) |
Retrieve the number of type arguments associated with an ObjC object. | |
CINDEX_LINKAGE CXType | clang_Type_getObjCTypeArg (CXType T, unsigned i) |
Retrieve a type argument associated with an ObjC object. | |
CINDEX_LINKAGE unsigned | clang_isFunctionTypeVariadic (CXType T) |
Return 1 if the CXType is a variadic function type, and 0 otherwise. | |
CINDEX_LINKAGE CXType | clang_getCursorResultType (CXCursor C) |
Retrieve the return type associated with a given cursor. | |
CINDEX_LINKAGE int | clang_getCursorExceptionSpecificationType (CXCursor C) |
Retrieve the exception specification type associated with a given cursor. | |
CINDEX_LINKAGE unsigned | clang_isPODType (CXType T) |
Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. | |
CINDEX_LINKAGE CXType | clang_getElementType (CXType T) |
Return the element type of an array, complex, or vector type. | |
CINDEX_LINKAGE long long | clang_getNumElements (CXType T) |
Return the number of elements of an array or vector type. | |
CINDEX_LINKAGE CXType | clang_getArrayElementType (CXType T) |
Return the element type of an array type. | |
CINDEX_LINKAGE long long | clang_getArraySize (CXType T) |
Return the array size of a constant array. | |
CINDEX_LINKAGE CXType | clang_Type_getNamedType (CXType T) |
Retrieve the type named by the qualified-id. | |
CINDEX_LINKAGE unsigned | clang_Type_isTransparentTagTypedef (CXType T) |
Determine if a typedef is 'transparent' tag. | |
CINDEX_LINKAGE enum CXTypeNullabilityKind | clang_Type_getNullability (CXType T) |
Retrieve the nullability kind of a pointer type. | |
CINDEX_LINKAGE long long | clang_Type_getAlignOf (CXType T) |
Return the alignment of a type in bytes as per C++[expr.alignof] standard. | |
CINDEX_LINKAGE CXType | clang_Type_getClassType (CXType T) |
Return the class type of an member pointer type. | |
CINDEX_LINKAGE long long | clang_Type_getSizeOf (CXType T) |
Return the size of a type in bytes as per C++[expr.sizeof] standard. | |
CINDEX_LINKAGE long long | clang_Type_getOffsetOf (CXType T, const char *S) |
Return the offset of a field named S in a record of type T in bits as it would be returned by offsetof as per C++11[18.2p4]. | |
CINDEX_LINKAGE CXType | clang_Type_getModifiedType (CXType T) |
Return the type that was modified by this attributed type. | |
CINDEX_LINKAGE CXType | clang_Type_getValueType (CXType CT) |
Gets the type contained by this atomic type. | |
CINDEX_LINKAGE long long | clang_Cursor_getOffsetOfField (CXCursor C) |
Return the offset of the field represented by the Cursor. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isAnonymous (CXCursor C) |
Determine whether the given cursor represents an anonymous tag or namespace. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isAnonymousRecordDecl (CXCursor C) |
Determine whether the given cursor represents an anonymous record declaration. | |
CINDEX_LINKAGE unsigned | clang_Cursor_isInlineNamespace (CXCursor C) |
Determine whether the given cursor represents an inline namespace declaration. | |
CINDEX_LINKAGE int | clang_Type_getNumTemplateArguments (CXType T) |
Returns the number of template arguments for given template specialization, or -1 if type T is not a template specialization. | |
CINDEX_LINKAGE CXType | clang_Type_getTemplateArgumentAsType (CXType T, unsigned i) |
Returns the type template argument of a template class specialization at given index. | |
CINDEX_LINKAGE enum CXRefQualifierKind | clang_Type_getCXXRefQualifier (CXType T) |
Retrieve the ref-qualifier kind of a function or method. | |
CINDEX_LINKAGE unsigned | clang_isVirtualBase (CXCursor) |
Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual. | |
CINDEX_LINKAGE enum CX_CXXAccessSpecifier | clang_getCXXAccessSpecifier (CXCursor) |
Returns the access control level for the referenced object. | |
CINDEX_LINKAGE enum CX_BinaryOperatorKind | clang_Cursor_getBinaryOpcode (CXCursor C) |
Returns the operator code for the binary operator. | |
CINDEX_LINKAGE CXString | clang_Cursor_getBinaryOpcodeStr (enum CX_BinaryOperatorKind Op) |
Returns a string containing the spelling of the binary operator. | |
CINDEX_LINKAGE enum CX_StorageClass | clang_Cursor_getStorageClass (CXCursor) |
Returns the storage class for a function or variable declaration. | |
CINDEX_LINKAGE unsigned | clang_getNumOverloadedDecls (CXCursor cursor) |
Determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor. | |
CINDEX_LINKAGE CXCursor | clang_getOverloadedDecl (CXCursor cursor, unsigned index) |
Retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor. | |
Represents a specific kind of binary operator which can appear at a cursor.
enum CX_StorageClass |
enum CXCallingConv |
Describes the calling convention of a function type.
enum CXRefQualifierKind |
Describes the kind of a template argument.
See the definition of llvm::clang::TemplateArgument::ArgKind for full element descriptions.
enum CXTypeKind |
Describes the kind of type.
enum CXTypeLayoutError |
List the possible error codes for clang_Type_getSizeOf
, clang_Type_getAlignOf
, clang_Type_getOffsetOf
and clang_Cursor_getOffsetOf
.
A value of this enumeration type can be returned if the target type is not a valid argument to sizeof, alignof or offsetof.
CINDEX_LINKAGE CXCursor clang_Cursor_getArgument | ( | CXCursor | C, |
unsigned | i | ||
) |
Retrieve the argument cursor of a function or method.
The argument cursor can be determined for calls as well as for declarations of functions or methods. For other cursors and for invalid indices, an invalid cursor is returned.
CINDEX_LINKAGE enum CX_BinaryOperatorKind clang_Cursor_getBinaryOpcode | ( | CXCursor | C | ) |
Returns the operator code for the binary operator.
CINDEX_LINKAGE CXString clang_Cursor_getBinaryOpcodeStr | ( | enum CX_BinaryOperatorKind | Op | ) |
Returns a string containing the spelling of the binary operator.
CINDEX_LINKAGE int clang_Cursor_getNumArguments | ( | CXCursor | C | ) |
Retrieve the number of non-variadic arguments associated with a given cursor.
The number of arguments can be determined for calls as well as for declarations of functions or methods. For other cursors -1 is returned.
CINDEX_LINKAGE int clang_Cursor_getNumTemplateArguments | ( | CXCursor | C | ) |
Returns the number of template args of a function, struct, or class decl representing a template specialization.
If the argument cursor cannot be converted into a template function declaration, -1 is returned.
For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }
template <> void foo<float, -7, true>();
The value 3 would be returned from this call.
CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField | ( | CXCursor | C | ) |
Return the offset of the field represented by the Cursor.
If the cursor is not a field declaration, -1 is returned. If the cursor semantic parent is not a record field declaration, CXTypeLayoutError_Invalid is returned. If the field's type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the field's type declaration is a dependent type, CXTypeLayoutError_Dependent is returned. If the field's name S is not found, CXTypeLayoutError_InvalidFieldName is returned.
CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass | ( | CXCursor | ) |
Returns the storage class for a function or variable declaration.
If the passed in Cursor is not a function or variable declaration, CX_SC_Invalid is returned else the storage class.
CINDEX_LINKAGE enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind | ( | CXCursor | C, |
unsigned | I | ||
) |
Retrieve the kind of the I'th template argument of the CXCursor C.
If the argument CXCursor does not represent a FunctionDecl, StructDecl, or ClassTemplatePartialSpecialization, an invalid template argument kind is returned.
For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }
template <> void foo<float, -7, true>();
For I = 0, 1, and 2, Type, Integral, and Integral will be returned, respectively.
CINDEX_LINKAGE CXType clang_Cursor_getTemplateArgumentType | ( | CXCursor | C, |
unsigned | I | ||
) |
Retrieve a CXType representing the type of a TemplateArgument of a function decl representing a template specialization.
If the argument CXCursor does not represent a FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization whose I'th template argument has a kind of CXTemplateArgKind_Integral, an invalid type is returned.
For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }
template <> void foo<float, -7, true>();
If called with I = 0, "float", will be returned. Invalid types will be returned for I == 1 or 2.
CINDEX_LINKAGE unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue | ( | CXCursor | C, |
unsigned | I | ||
) |
Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as an unsigned long long.
It is undefined to call this function on a CXCursor that does not represent a FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization or whose I'th template argument is not an integral value.
For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }
template <> void foo<float, 2147483649, true>();
If called with I = 1 or 2, 2147483649 or true will be returned, respectively. For I == 0, this function's behavior is undefined.
CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue | ( | CXCursor | C, |
unsigned | I | ||
) |
Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as a signed long long.
It is undefined to call this function on a CXCursor that does not represent a FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization whose I'th template argument is not an integral value.
For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }
template <> void foo<float, -7, true>();
If called with I = 1 or 2, -7 or true will be returned, respectively. For I == 0, this function's behavior is undefined.
CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous | ( | CXCursor | C | ) |
Determine whether the given cursor represents an anonymous tag or namespace.
CINDEX_LINKAGE unsigned clang_Cursor_isAnonymousRecordDecl | ( | CXCursor | C | ) |
Determine whether the given cursor represents an anonymous record declaration.
CINDEX_LINKAGE unsigned clang_Cursor_isBitField | ( | CXCursor | C | ) |
Returns non-zero if the cursor specifies a Record member that is a bit-field.
CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined | ( | CXCursor | C | ) |
Determine whether a CXCursor that is a function declaration, is an inline declaration.
CINDEX_LINKAGE unsigned clang_Cursor_isInlineNamespace | ( | CXCursor | C | ) |
Determine whether the given cursor represents an inline namespace declaration.
CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin | ( | CXCursor | C | ) |
Determine whether a CXCursor that is a macro, is a builtin one.
CINDEX_LINKAGE unsigned clang_Cursor_isMacroFunctionLike | ( | CXCursor | C | ) |
Determine whether a CXCursor that is a macro, is function like.
CINDEX_LINKAGE unsigned clang_equalTypes | ( | CXType | A, |
CXType | B | ||
) |
Determine whether two CXTypes represent the same type.
CINDEX_LINKAGE unsigned clang_getAddressSpace | ( | CXType | T | ) |
Returns the address space of the given type.
CINDEX_LINKAGE CXType clang_getArgType | ( | CXType | T, |
unsigned | i | ||
) |
Retrieve the type of a parameter of a function type.
If a non-function type is passed in or the function does not have enough parameters, an invalid type is returned.
CINDEX_LINKAGE CXType clang_getArrayElementType | ( | CXType | T | ) |
Return the element type of an array type.
If a non-array type is passed in, an invalid type is returned.
CINDEX_LINKAGE long long clang_getArraySize | ( | CXType | T | ) |
Return the array size of a constant array.
If a non-array type is passed in, -1 is returned.
CINDEX_LINKAGE CXType clang_getCanonicalType | ( | CXType | T | ) |
Return the canonical type for a CXType.
Clang's type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the "sugar" removed. For example, if 'T' is a typedef for 'int', the canonical type for 'T' would be 'int'.
CINDEX_LINKAGE int clang_getCursorExceptionSpecificationType | ( | CXCursor | C | ) |
Retrieve the exception specification type associated with a given cursor.
This is a value of type CXCursor_ExceptionSpecificationKind.
This only returns a valid result if the cursor refers to a function or method.
CINDEX_LINKAGE CXType clang_getCursorResultType | ( | CXCursor | C | ) |
Retrieve the return type associated with a given cursor.
This only returns a valid type if the cursor refers to a function or method.
CINDEX_LINKAGE CXType clang_getCursorType | ( | CXCursor | C | ) |
Retrieve the type of a CXCursor (if any).
CINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier | ( | CXCursor | ) |
Returns the access control level for the referenced object.
If the cursor refers to a C++ declaration, its access control level within its parent scope is returned. Otherwise, if the cursor refers to a base specifier or access specifier, the specifier itself is returned.
CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding | ( | CXCursor | C | ) |
Returns the Objective-C type encoding for the specified declaration.
CINDEX_LINKAGE CXType clang_getElementType | ( | CXType | T | ) |
Return the element type of an array, complex, or vector type.
If a type is passed in that is not an array, complex, or vector type, an invalid type is returned.
CINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue | ( | CXCursor | C | ) |
Retrieve the integer value of an enum constant declaration as an unsigned long long.
If the cursor does not reference an enum constant declaration, ULLONG_MAX is returned. Since this is also potentially a valid constant value, the kind of the cursor must be verified before calling this function.
CINDEX_LINKAGE long long clang_getEnumConstantDeclValue | ( | CXCursor | C | ) |
Retrieve the integer value of an enum constant declaration as a signed long long.
If the cursor does not reference an enum constant declaration, LLONG_MIN is returned. Since this is also potentially a valid constant value, the kind of the cursor must be verified before calling this function.
CINDEX_LINKAGE CXType clang_getEnumDeclIntegerType | ( | CXCursor | C | ) |
Retrieve the integer type of an enum declaration.
If the cursor does not reference an enum declaration, an invalid type is returned.
CINDEX_LINKAGE int clang_getExceptionSpecificationType | ( | CXType | T | ) |
Retrieve the exception specification type associated with a function type.
This is a value of type CXCursor_ExceptionSpecificationKind.
If a non-function type is passed in, an error code of -1 is returned.
CINDEX_LINKAGE int clang_getFieldDeclBitWidth | ( | CXCursor | C | ) |
Retrieve the bit width of a bit-field declaration as an integer.
If the cursor does not reference a bit-field, or if the bit-field's width expression cannot be evaluated, -1 is returned.
For example:
CINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv | ( | CXType | T | ) |
Retrieve the calling convention associated with a function type.
If a non-function type is passed in, CXCallingConv_Invalid is returned.
CINDEX_LINKAGE CXType clang_getNonReferenceType | ( | CXType | CT | ) |
For reference types (e.g., "const int&"), returns the type that the reference refers to (e.g "const int").
Otherwise, returns the type itself.
A type that has kind CXType_LValueReference
or CXType_RValueReference
is a reference type.
CINDEX_LINKAGE int clang_getNumArgTypes | ( | CXType | T | ) |
Retrieve the number of non-variadic parameters associated with a function type.
If a non-function type is passed in, -1 is returned.
CINDEX_LINKAGE long long clang_getNumElements | ( | CXType | T | ) |
Return the number of elements of an array or vector type.
If a type is passed in that is not an array or vector type, -1 is returned.
CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls | ( | CXCursor | cursor | ) |
Determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef
cursor.
cursor | The cursor whose overloaded declarations are being queried. |
cursor
. If it is not a CXCursor_OverloadedDeclRef
cursor, returns 0. CINDEX_LINKAGE CXCursor clang_getOverloadedDecl | ( | CXCursor | cursor, |
unsigned | index | ||
) |
Retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef
cursor.
cursor | The cursor whose overloaded declarations are being queried. |
index | The zero-based index into the set of overloaded declarations in the cursor. |
cursor
at the specified index
. If the cursor does not have an associated set of overloaded declarations, or if the index is out of bounds, returns clang_getNullCursor()
; CINDEX_LINKAGE CXType clang_getPointeeType | ( | CXType | T | ) |
For pointer types, returns the type of the pointee.
CINDEX_LINKAGE CXType clang_getResultType | ( | CXType | T | ) |
Retrieve the return type associated with a function type.
If a non-function type is passed in, an invalid type is returned.
CINDEX_LINKAGE CXCursor clang_getTypeDeclaration | ( | CXType | T | ) |
Return the cursor for the declaration of the given type.
CINDEX_LINKAGE CXType clang_getTypedefDeclUnderlyingType | ( | CXCursor | C | ) |
Retrieve the underlying type of a typedef declaration.
If the cursor does not reference a typedef declaration, an invalid type is returned.
CINDEX_LINKAGE CXString clang_getTypedefName | ( | CXType | CT | ) |
Returns the typedef name of the given type.
CINDEX_LINKAGE CXString clang_getTypeKindSpelling | ( | enum CXTypeKind | K | ) |
Retrieve the spelling of a given CXTypeKind.
CINDEX_LINKAGE CXString clang_getTypeSpelling | ( | CXType | CT | ) |
Pretty-print the underlying type using the rules of the language of the translation unit from which it came.
If the type is invalid, an empty string is returned.
CINDEX_LINKAGE CXType clang_getUnqualifiedType | ( | CXType | CT | ) |
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
For example, given the following series of typedefs:
Executing clang_getUnqualifiedType()
on a CXType
that represents DifferenceType
, will desugar to a type representing Integer
, that has no qualifiers.
And, executing clang_getUnqualifiedType()
on the type of the first argument of the following function declaration:
Will return a type representing int
, removing the const
qualifier.
Sugar over array types is not desugared.
A type can be checked for qualifiers with clang_isConstQualifiedType()
, clang_isVolatileQualifiedType()
and clang_isRestrictQualifiedType()
.
A type that resulted from a call to clang_getUnqualifiedType
will return false
for all of the above calls.
CINDEX_LINKAGE unsigned clang_isConstQualifiedType | ( | CXType | T | ) |
Determine whether a CXType has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.
CINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic | ( | CXType | T | ) |
Return 1 if the CXType is a variadic function type, and 0 otherwise.
CINDEX_LINKAGE unsigned clang_isPODType | ( | CXType | T | ) |
Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise.
CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType | ( | CXType | T | ) |
Determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.
CINDEX_LINKAGE unsigned clang_isVirtualBase | ( | CXCursor | ) |
Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual.
CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType | ( | CXType | T | ) |
Determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.
CINDEX_LINKAGE long long clang_Type_getAlignOf | ( | CXType | T | ) |
Return the alignment of a type in bytes as per C++[expr.alignof] standard.
If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the type declaration is a dependent type, CXTypeLayoutError_Dependent is returned. If the type declaration is not a constant size type, CXTypeLayoutError_NotConstantSize is returned.
CINDEX_LINKAGE CXType clang_Type_getClassType | ( | CXType | T | ) |
Return the class type of an member pointer type.
If a non-member-pointer type is passed in, an invalid type is returned.
CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier | ( | CXType | T | ) |
Retrieve the ref-qualifier kind of a function or method.
The ref-qualifier is returned for C++ functions or methods. For other types or non-C++ declarations, CXRefQualifier_None is returned.
CINDEX_LINKAGE CXType clang_Type_getModifiedType | ( | CXType | T | ) |
Return the type that was modified by this attributed type.
If the type is not an attributed type, an invalid type is returned.
CINDEX_LINKAGE CXType clang_Type_getNamedType | ( | CXType | T | ) |
Retrieve the type named by the qualified-id.
If a non-elaborated type is passed in, an invalid type is returned.
CINDEX_LINKAGE enum CXTypeNullabilityKind clang_Type_getNullability | ( | CXType | T | ) |
Retrieve the nullability kind of a pointer type.
CINDEX_LINKAGE unsigned clang_Type_getNumObjCProtocolRefs | ( | CXType | T | ) |
Retrieve the number of protocol references associated with an ObjC object/id.
If the type is not an ObjC object, 0 is returned.
CINDEX_LINKAGE unsigned clang_Type_getNumObjCTypeArgs | ( | CXType | T | ) |
Retrieve the number of type arguments associated with an ObjC object.
If the type is not an ObjC object, 0 is returned.
CINDEX_LINKAGE int clang_Type_getNumTemplateArguments | ( | CXType | T | ) |
Returns the number of template arguments for given template specialization, or -1 if type T
is not a template specialization.
CINDEX_LINKAGE CXString clang_Type_getObjCEncoding | ( | CXType | type | ) |
Returns the Objective-C type encoding for the specified CXType.
CINDEX_LINKAGE CXType clang_Type_getObjCObjectBaseType | ( | CXType | T | ) |
Retrieves the base type of the ObjCObjectType.
If the type is not an ObjC object, an invalid type is returned.
CINDEX_LINKAGE CXCursor clang_Type_getObjCProtocolDecl | ( | CXType | T, |
unsigned | i | ||
) |
Retrieve the decl for a protocol reference for an ObjC object/id.
If the type is not an ObjC object or there are not enough protocol references, an invalid cursor is returned.
CINDEX_LINKAGE CXType clang_Type_getObjCTypeArg | ( | CXType | T, |
unsigned | i | ||
) |
Retrieve a type argument associated with an ObjC object.
If the type is not an ObjC or the index is not valid, an invalid type is returned.
CINDEX_LINKAGE long long clang_Type_getOffsetOf | ( | CXType | T, |
const char * | S | ||
) |
Return the offset of a field named S in a record of type T in bits as it would be returned by offsetof as per C++11[18.2p4].
If the cursor is not a record field declaration, CXTypeLayoutError_Invalid is returned. If the field's type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the field's type declaration is a dependent type, CXTypeLayoutError_Dependent is returned. If the field's name S is not found, CXTypeLayoutError_InvalidFieldName is returned.
CINDEX_LINKAGE long long clang_Type_getSizeOf | ( | CXType | T | ) |
Return the size of a type in bytes as per C++[expr.sizeof] standard.
If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the type declaration is a dependent type, CXTypeLayoutError_Dependent is returned.
CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType | ( | CXType | T, |
unsigned | i | ||
) |
Returns the type template argument of a template class specialization at given index.
This function only returns template type arguments and does not handle template template arguments or variadic packs.
CINDEX_LINKAGE CXType clang_Type_getValueType | ( | CXType | CT | ) |
Gets the type contained by this atomic type.
If a non-atomic type is passed in, an invalid type is returned.
CINDEX_LINKAGE unsigned clang_Type_isTransparentTagTypedef | ( | CXType | T | ) |
Determine if a typedef is 'transparent' tag.
A typedef is considered 'transparent' if it shares a name and spelling location with its underlying tag type, as is the case with the NS_ENUM macro.