Scarab  v2.9.0
Project 8 C++ Utility Library
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
Cursor Class Reference
Inheritance diagram for Cursor:
Inheritance graph

Public Member Functions

def __eq__ (self, other)
 
def __ne__ (self, other)
 
def is_definition (self)
 
def is_const_method (self)
 
def is_converting_constructor (self)
 
def is_copy_constructor (self)
 
def is_default_constructor (self)
 
def is_move_constructor (self)
 
def is_default_method (self)
 
def is_mutable_field (self)
 
def is_pure_virtual_method (self)
 
def is_static_method (self)
 
def is_virtual_method (self)
 
def get_definition (self)
 
def get_usr (self)
 
def kind (self)
 
def spelling (self)
 
def displayname (self)
 
def mangled_name (self)
 
def location (self)
 
def extent (self)
 
def storage_class (self)
 
def access_specifier (self)
 
def type (self)
 
def canonical (self)
 
def result_type (self)
 
def underlying_typedef_type (self)
 
def enum_type (self)
 
def enum_value (self)
 
def objc_type_encoding (self)
 
def hash (self)
 
def semantic_parent (self)
 
def lexical_parent (self)
 
def translation_unit (self)
 
def referenced (self)
 
def brief_comment (self)
 
def raw_comment (self)
 
def get_arguments (self)
 
def get_num_template_arguments (self)
 
def get_template_argument_kind (self, num)
 
def get_template_argument_type (self, num)
 
def get_template_argument_value (self, num)
 
def get_template_argument_unsigned_value (self, num)
 
def get_children (self)
 
def walk_preorder (self)
 
def get_tokens (self)
 
def get_field_offsetof (self)
 
def is_anonymous (self)
 
def is_bitfield (self)
 
def get_bitfield_width (self)
 

Static Public Member Functions

def from_location (tu, location)
 
def from_result (res, fn, args)
 
def from_cursor_result (res, fn, args)
 

Public Attributes

 kind
 

Private Attributes

 _spelling
 
 _displayname
 
 _mangled_name
 
 _loc
 
 _extent
 
 _storage_class
 
 _access_specifier
 
 _type
 
 _canonical
 
 _result_type
 
 _underlying_type
 
 _enum_type
 
 _enum_value
 
 _objc_type_encoding
 
 _hash
 
 _semantic_parent
 
 _lexical_parent
 
 _referenced
 

Static Private Attributes

list _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)]
 

Detailed Description

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

Definition at line 1286 of file cindex.py.

Member Function Documentation

◆ __eq__()

def __eq__ (   self,
  other 
)

Definition at line 1302 of file cindex.py.

◆ __ne__()

def __ne__ (   self,
  other 
)

Definition at line 1305 of file cindex.py.

◆ access_specifier()

def access_specifier (   self)
Retrieves the access specifier (if any) of the entity pointed at by the
cursor.

Definition at line 1461 of file cindex.py.

◆ brief_comment()

def brief_comment (   self)
Returns the brief comment text associated with that Cursor

Definition at line 1607 of file cindex.py.

◆ canonical()

def canonical (   self)
Return the canonical Cursor corresponding to this Cursor.

The canonical cursor is the cursor which is representative for the
underlying entity. For example, if you have multiple forward
declarations for the same class, the canonical cursor for the forward
declarations will be identical.

Definition at line 1482 of file cindex.py.

◆ displayname()

def displayname (   self)
Return the display name for the entity referenced by this cursor.

The display name contains extra information that helps identify the
cursor, such as the parameters of a function or template or the
arguments of a class template specialization.

Definition at line 1406 of file cindex.py.

◆ enum_type()

def enum_type (   self)
Return the integer type of an enum declaration.

Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises.

Definition at line 1518 of file cindex.py.

◆ enum_value()

def enum_value (   self)
Return the value of an enum constant.

Definition at line 1531 of file cindex.py.

◆ extent()

def extent (   self)
Return the source range (the range of text) occupied by the entity
pointed at by the cursor.

Definition at line 1439 of file cindex.py.

◆ from_cursor_result()

def from_cursor_result (   res,
  fn,
  args 
)
static

Definition at line 1728 of file cindex.py.

◆ from_location()

def from_location (   tu,
  location 
)
static

Definition at line 1294 of file cindex.py.

◆ from_result()

def from_result (   res,
  fn,
  args 
)
static

Definition at line 1704 of file cindex.py.

◆ get_arguments()

def get_arguments (   self)
Return an iterator for accessing the arguments of this cursor.

Definition at line 1616 of file cindex.py.

◆ get_bitfield_width()

def get_bitfield_width (   self)
Retrieve the width of a bitfield.

Definition at line 1697 of file cindex.py.

◆ get_children()

def get_children (   self)
Return an iterator for accessing the children of this cursor.

Definition at line 1643 of file cindex.py.

◆ get_definition()

def get_definition (   self)
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.

Definition at line 1371 of file cindex.py.

◆ get_field_offsetof()

def get_field_offsetof (   self)
Returns the offsetof the FIELD_DECL pointed by this Cursor.

Definition at line 1679 of file cindex.py.

◆ get_num_template_arguments()

def get_num_template_arguments (   self)
Returns the number of template args associated with this cursor.

Definition at line 1622 of file cindex.py.

◆ get_template_argument_kind()

def get_template_argument_kind (   self,
  num 
)
Returns the TemplateArgumentKind for the indicated template
argument.

Definition at line 1626 of file cindex.py.

◆ get_template_argument_type()

def get_template_argument_type (   self,
  num 
)
Returns the CXType for the indicated template argument.

Definition at line 1631 of file cindex.py.

◆ get_template_argument_unsigned_value()

def get_template_argument_unsigned_value (   self,
  num 
)
Returns the value of the indicated arg as an unsigned 64b integer.

Definition at line 1639 of file cindex.py.

◆ get_template_argument_value()

def get_template_argument_value (   self,
  num 
)
Returns the value of the indicated arg as a signed 64b integer.

Definition at line 1635 of file cindex.py.

◆ get_tokens()

def get_tokens (   self)
Obtain Token instances formulating that compose this Cursor.

This is a generator for Token instances. It returns all tokens which
occupy the extent this cursor occupies.

Definition at line 1671 of file cindex.py.

◆ get_usr()

def get_usr (   self)
Return the Unified Symbol Resultion (USR) for the entity referenced
by the given cursor (or None).

A Unified Symbol Resolution (USR) is a string that identifies a
particular entity (function, class, variable, etc.) within a
program. USRs can be compared across translation units to determine,
e.g., when references in one translation refer to an entity defined in
another translation unit.

Definition at line 1381 of file cindex.py.

◆ hash()

def hash (   self)
Returns a hash of the cursor as an int.

Definition at line 1565 of file cindex.py.

◆ is_anonymous()

def is_anonymous (   self)
Check if the record is anonymous.

Definition at line 1683 of file cindex.py.

◆ is_bitfield()

def is_bitfield (   self)
Check if the field is a bitfield.

Definition at line 1691 of file cindex.py.

◆ is_const_method()

def is_const_method (   self)
Returns True if the cursor refers to a C++ member function or member
function template that is declared 'const'.

Definition at line 1315 of file cindex.py.

◆ is_converting_constructor()

def is_converting_constructor (   self)
Returns True if the cursor refers to a C++ converting constructor.

Definition at line 1321 of file cindex.py.

◆ is_copy_constructor()

def is_copy_constructor (   self)
Returns True if the cursor refers to a C++ copy constructor.

Definition at line 1326 of file cindex.py.

◆ is_default_constructor()

def is_default_constructor (   self)
Returns True if the cursor refers to a C++ default constructor.

Definition at line 1331 of file cindex.py.

◆ is_default_method()

def is_default_method (   self)
Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'.

Definition at line 1341 of file cindex.py.

◆ is_definition()

def is_definition (   self)
Returns true if the declaration pointed at by the cursor is also a
definition of that entity.

Definition at line 1308 of file cindex.py.

◆ is_move_constructor()

def is_move_constructor (   self)
Returns True if the cursor refers to a C++ move constructor.

Definition at line 1336 of file cindex.py.

◆ is_mutable_field()

def is_mutable_field (   self)
Returns True if the cursor refers to a C++ field that is declared
'mutable'.

Definition at line 1347 of file cindex.py.

◆ is_pure_virtual_method()

def is_pure_virtual_method (   self)
Returns True if the cursor refers to a C++ member function or member
function template that is declared pure virtual.

Definition at line 1353 of file cindex.py.

◆ is_static_method()

def is_static_method (   self)
Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'.

Definition at line 1359 of file cindex.py.

◆ is_virtual_method()

def is_virtual_method (   self)
Returns True if the cursor refers to a C++ member function or member
function template that is declared 'virtual'.

Definition at line 1365 of file cindex.py.

◆ kind()

def kind (   self)
Return the kind of this cursor.

Definition at line 1393 of file cindex.py.

◆ lexical_parent()

def lexical_parent (   self)
Return the lexical parent for this cursor.

Definition at line 1581 of file cindex.py.

◆ location()

def location (   self)
Return the source location (the starting character) of the entity
pointed at by the cursor.

Definition at line 1428 of file cindex.py.

◆ mangled_name()

def mangled_name (   self)
Return the mangled name for the entity referenced by this cursor.

Definition at line 1420 of file cindex.py.

◆ objc_type_encoding()

def objc_type_encoding (   self)
Return the Objective-C type encoding as a str.

Definition at line 1556 of file cindex.py.

◆ raw_comment()

def raw_comment (   self)
Returns the raw comment text associated with that Cursor

Definition at line 1612 of file cindex.py.

◆ referenced()

def referenced (   self)
For a cursor that is a reference, returns a cursor
representing the entity that it references.

Definition at line 1596 of file cindex.py.

◆ result_type()

def result_type (   self)
Retrieve the Type of the result for this Cursor.

Definition at line 1496 of file cindex.py.

◆ semantic_parent()

def semantic_parent (   self)
Return the semantic parent for this cursor.

Definition at line 1573 of file cindex.py.

◆ spelling()

def spelling (   self)
Return the spelling of the entity pointed at by the cursor.

Definition at line 1398 of file cindex.py.

◆ storage_class()

def storage_class (   self)
Retrieves the storage class (if any) of the entity pointed at by the
cursor.

Definition at line 1450 of file cindex.py.

◆ translation_unit()

def translation_unit (   self)
Returns the TranslationUnit to which this Cursor belongs.

Definition at line 1589 of file cindex.py.

◆ type()

def type (   self)
Retrieve the Type (if any) of the entity pointed at by the cursor.

Definition at line 1472 of file cindex.py.

◆ underlying_typedef_type()

def underlying_typedef_type (   self)
Return the underlying type of a typedef declaration.

Returns a Type for the typedef this cursor is a declaration for. If
the current cursor is not a typedef, this raises.

Definition at line 1504 of file cindex.py.

◆ walk_preorder()

def walk_preorder (   self)
Depth-first preorder walk over the cursor and its descendants.

Yields cursors.

Definition at line 1661 of file cindex.py.

Member Data Documentation

◆ _access_specifier

_access_specifier
private

Definition at line 1467 of file cindex.py.

◆ _canonical

_canonical
private

Definition at line 1491 of file cindex.py.

◆ _displayname

_displayname
private

Definition at line 1415 of file cindex.py.

◆ _enum_type

_enum_type
private

Definition at line 1526 of file cindex.py.

◆ _enum_value

_enum_value
private

Definition at line 1549 of file cindex.py.

◆ _extent

_extent
private

Definition at line 1445 of file cindex.py.

◆ _fields_

list _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)]
staticprivate

Definition at line 1291 of file cindex.py.

◆ _hash

_hash
private

Definition at line 1568 of file cindex.py.

◆ _lexical_parent

_lexical_parent
private

Definition at line 1584 of file cindex.py.

◆ _loc

_loc
private

Definition at line 1434 of file cindex.py.

◆ _mangled_name

_mangled_name
private

Definition at line 1423 of file cindex.py.

◆ _objc_type_encoding

_objc_type_encoding
private

Definition at line 1559 of file cindex.py.

◆ _referenced

_referenced
private

Definition at line 1602 of file cindex.py.

◆ _result_type

_result_type
private

Definition at line 1499 of file cindex.py.

◆ _semantic_parent

_semantic_parent
private

Definition at line 1576 of file cindex.py.

◆ _spelling

_spelling
private

Definition at line 1401 of file cindex.py.

◆ _storage_class

_storage_class
private

Definition at line 1456 of file cindex.py.

◆ _type

_type
private

Definition at line 1477 of file cindex.py.

◆ _underlying_type

_underlying_type
private

Definition at line 1512 of file cindex.py.

◆ kind

kind

Definition at line 1525 of file cindex.py.


The documentation for this class was generated from the following file: