Cursor

The Cursor class represents a reference to an element within the AST. It acts as a kind of iterator.

@safe
struct Cursor {}

Members

Functions

bitFieldWidth
int bitFieldWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
children
Cursor[] children(bool ignorePredefined)

Array of all children of the cursor.

childrenInOrder
Cursor[] childrenInOrder(bool ignorePredefined)
Undocumented in source. Be warned that the author may not have intended to support it.
eval
Eval eval()

If cursor is a statement declaration tries to evaluate the statement and if its variable, tries to evaluate its initializer, into its corresponding type.

isBitField
bool isBitField()
Undocumented in source. Be warned that the author may not have intended to support it.
isConvertingConstructor
bool isConvertingConstructor()

Determine if a C++ constructor is a converting constructor.

isCopyConstructor
bool isCopyConstructor()

Determine if a C++ constructor is a copy constructor.

isDefaultConstructor
bool isDefaultConstructor()

Determine if a C++ constructor is the default constructor.

isDefaulted
bool isDefaulted()

Determine if a C++ method is declared '= default'.

isDefinition
bool isDefinition()

Returns true if the declaration pointed at by the cursor is also a definition of that entity.

isFunctionInlined
bool isFunctionInlined()

Determine whether a CXCursor that is a function declaration, is an inline declaration.

isMacroBuiltin
bool isMacroBuiltin()

Determine whether a CXCursor that is a macro, is a builtin one.

isMacroFunctionLike
bool isMacroFunctionLike()

Determine whether a CXCursor that is a macro, is function like.

isMoveConstructor
bool isMoveConstructor()

Determine if a C++ constructor is a move constructor.

isMutable
bool isMutable()

Determine if a C++ field is declared 'mutable'.

isPredefined
bool isPredefined()
Undocumented in source. Be warned that the author may not have intended to support it.
isPureVirtual
bool isPureVirtual()

Determine if a C++ member function or member function template is pure virtual.

opEquals
equals_t opEquals(Cursor cursor)

Determine whether two cursors are equivalent.

toHash
size_t toHash()

Compute a hash value for the given cursor.

visibility
CXVisibilityKind visibility()

Describe the visibility of the entity referred to by a cursor.

Mixins

__anonymous
mixin CX
Undocumented in source.

Properties

access
AccessCursor access [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
all
Visitor all [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
canonical
Cursor canonical [@property getter]

Retrieve the canonical cursor corresponding to the given cursor.

declarations
DeclarationVisitor declarations [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
definition
Cursor definition [@property getter]

If the cursor is a reference to a declaration or a declaration of some entity, return a cursor that points to the definition of that entity.

displayName
string displayName [@property getter]

Return the display name for the entity referenced by this cursor.

empty
Cursor empty [@property getter]

Retrieve the NULL cursor, which represents no entity.

enum_
EnumCursor enum_ [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
extent
SourceRange extent [@property getter]

Retrieve the physical extent of the source construct referenced by the given cursor.

func
FunctionCursor func [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
hasAttributes
bool hasAttributes [@property getter]

Determine whether the given cursor has any attributes.

include
IncludeCursor include [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
isAnonymous
bool isAnonymous [@property getter]

Determine whether the given cursor represents an anonymous record declaration.

isAttribute
bool isAttribute [@property getter]

Determine whether the given cursor kind represents an attribute.

isDeclaration
bool isDeclaration [@property getter]

Determine whether the given cursor kind represents a declaration.

isEmpty
bool isEmpty [@property getter]

Return: if cursor is null/empty.

isExpression
bool isExpression [@property getter]

Determine whether the given cursor kind represents an expression.

isPreprocessing
bool isPreprocessing [@property getter]

Determine whether the given cursor represents a preprocessing element, such as a preprocessor directive or macro instantiation.

isReference
bool isReference [@property getter]

Determine whether the given cursor kind represents a simple reference.

isStatement
bool isStatement [@property getter]

Determine whether the given cursor kind represents a statement.

isTranslationUnit
bool isTranslationUnit [@property getter]

Determine whether the given cursor kind represents a translation unit.

isUnderlyingTypeEnum
bool isUnderlyingTypeEnum [@property getter]

Return: if the underlying type is an enum.

isUnexposed
bool isUnexposed [@property getter]

Determine whether the given cursor represents a currently unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).

isValid
bool isValid [@property getter]

Determine whether the given cursor kind represents an invalid cursor.

isVirtualBase
bool isVirtualBase [@property getter]
kind
CXCursorKind kind [@property getter]

\brief Retrieve the CXStrings representing the mangled symbols of the C++ constructor or destructor at the cursor. Return: the kind of this cursor.

language
CXLanguageKind language [@property getter]

Determine the "language" of the entity referred to by a given cursor.

lexicalParent
Cursor lexicalParent [@property getter]

Determine the lexical parent of the given cursor.

linkage
CXLinkageKind linkage [@property getter]

Determine the linkage of the entity referred to by a given cursor.

location
SourceLocation location [@property getter]

Retrieve the physical location of the source constructor referenced by the given cursor.

mangling
string mangling [@property getter]

Retrieve the string representing the mangled name of the cursor.

objc
ObjcCursor objc [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
referenced
Cursor referenced [@property getter]

For a cursor that is a reference, retrieve a cursor representing the entity that it references.

semanticParent
Cursor semanticParent [@property getter]

Determine the semantic parent of the given cursor.

spelling
string spelling [@property getter]

Return: Retrieve a name for the entity referenced by this cursor.

storageClass
CX_StorageClass storageClass [@property getter]

Returns the storage class for a function or variable declaration.

templateCursor
CXCursor templateCursor [@property getter]

Return the cursor that represents the template that given cursor specializes (or is instantiated) from.

templateKind
CXCursorKind templateKind [@property getter]

Return the cursor kind of the template specialization that would be generated when instantiating the template with this cursor.

tokens
auto tokens [@property getter]

Obtain Token instances formulating that compose this Cursor.

translationUnit
TranslationUnit translationUnit [@property getter]
type
Type type [@property getter]

Type (if any) of the entity pointed at by the cursor.

typedefUnderlyingType
Type typedefUnderlyingType [@property getter]

Return the underlying type of a typedef declaration.

usr
string usr [@property getter]

Retrieve a Unified Symbol Resolution (USR) for the entity referenced by the given cursor.

Mixed In Members

From mixin CX

cx
CType cx;
Undocumented in source.
dispose
void dispose()

Trusted: on the assumption that dispose as implemented by the LLVM community is good _enough_. Any bugs should by now have been found.

isValid
bool isValid [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta