Skip to main content
Module

x/libclang/include/Index.h.ts

Deno FFI bindings for libclang
Go to Latest
import * as libclang from "https://deno.land/x/libclang@1.0.0-beta.8/include/Index.h.ts";

Variables

Annotate the given set of tokens by providing cursors for each token that can be mapped to a specific entity within the abstract syntax tree.

Perform code completion at a given location in a translation unit.

Returns the cursor kind for the container for the current code completion context. The container is only guaranteed to be set for contexts where a container exists (i.e. member accesses or Objective-C message sends); if there is not a container, this function will return CXCursor_InvalidCode.

Returns the USR for the container for the current code completion context. If there is not a container for the current context, this function will return the empty string.

Determines what completions are appropriate for the context the given code completion.

Retrieve a diagnostic associated with the given code completion.

Determine the number of diagnostics produced prior to the location where code completion was performed.

Returns the currently-entered selector for an Objective-C message send, formatted like "initWithFoo:bar:". Only guaranteed to return a non-empty string for CXCompletionContext_ObjCInstanceMessage and CXCompletionContext_ObjCClassMessage.

Construct a USR for a specified Objective-C category.

Construct a USR for a specified Objective-C class.

Construct a USR for a specified Objective-C instance variable and the USR for its containing class.

Construct a USR for a specified Objective-C method and the USR for its containing class.

Construct a USR for a specified Objective-C property and the USR for its containing class.

Construct a USR for a specified Objective-C protocol.

Creates an empty CXCursorSet.

Provides a shared context for creating translation units.

Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes.

Create a translation unit from an AST file (-emit-ast).

Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler.

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

Retrieve the argument cursor of a function or method.

Given a cursor that represents a documentable entity (e.g., declaration), return the associated \paragraph ; otherwise return the first paragraph.

Given a cursor that represents a declaration, return the associated comment's source range. The range may include multiple consecutive comments with whitespace in between.

Retrieve the CXStrings representing the mangled symbols of the C++ constructor or destructor at the cursor.

Retrieve the CXString representing the mangled name of the cursor.

Given a CXCursor_ModuleImportDecl cursor, return the associated module.

Retrieve the number of non-variadic arguments associated with a given cursor.

Returns the number of template args of a function, struct, or class decl representing a template specialization.

Given a cursor that represents an Objective-C method or parameter declaration, return the associated Objective-C qualifiers for the return type or the parameter respectively. The bits are formed from CXObjCDeclQualifierKind.

Retrieve the CXStrings representing the mangled symbols of the ObjC class interface or implementation at the cursor.

Given a cursor that represents a property declaration, return the associated property attributes. The bits are formed from CXObjCPropertyAttrKind.

Given a cursor that represents a property declaration, return the name of the method that implements the getter.

Given a cursor that represents a property declaration, return the name of the method that implements the setter, if any.

If the cursor points to a selector identifier in an Objective-C method or message expression, this returns the selector index.

Return the offset of the field represented by the Cursor.

Given a cursor that represents a declaration, return the associated comment text, including comment markers.

Given a cursor pointing to an Objective-C message or property reference, or C++ method call, returns the CXType of the receiver.

Retrieve a range for a piece that forms the cursors spelling name. Most of the times there is only one range for the complete spelling but for Objective-C methods and Objective-C message expressions, there are multiple pieces for each selector identifier.

Returns the storage class for a function or variable declaration.

Retrieve the kind of the I'th template argument of the CXCursor C.

Retrieve a CXType representing the type of a TemplateArgument of a function decl representing a template specialization.

Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as an unsigned long long.

Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as a signed long long.

Returns the translation unit that a cursor originated from.

If cursor refers to a variable declaration and it has initializer returns cursor referring to the initializer otherwise return null cursor.

Determine whether the given cursor has any attributes.

If cursor refers to a variable declaration that has external storage returns 1. If cursor refers to a variable declaration that doesn't have external storage returns 0. Otherwise returns -1.

If cursor refers to a variable declaration that has global storage returns 1. If cursor refers to a variable declaration that doesn't have global storage returns 0. Otherwise returns -1.

Determine whether the given cursor represents an anonymous tag or namespace

Determine whether the given cursor represents an anonymous record declaration.

Returns non-zero if the cursor specifies a Record member that is a bitfield.

Given a cursor pointing to a C++ method call or an Objective-C message, returns non-zero if the method/message is "dynamic", meaning:

Returns non-zero if the given cursor points to a symbol marked with external_source_symbol attribute.

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

Determine whether the given cursor represents an inline namespace declaration.

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

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

Returns non-zero if cursor is null.

Given a cursor that represents an Objective-C method or property declaration, return non-zero if the declaration was affected by "@optional". Returns zero if the cursor is not such a declaration or it is "@required".

Returns non-zero if the given cursor is a variadic function or method.

Queries a CXCursorSet to see if it contains a specific CXCursor.

Inserts a CXCursor into a CXCursorSet.

Gets the general options associated with a CXIndex.

Sets general options associated with a CXIndex.

Sets the invocation emission path option in a CXIndex.

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

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

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

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

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

Determine if a C++ member function or member function template is declared 'const'.

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

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.

Determine if a C++ record is abstract, i.e. whether a class or struct has a pure virtual member function.

Returns a default set of code-completion options that can be passed toclang_codeCompleteAt().

Returns the set of flags that is suitable for parsing a translation unit that is being edited.

Returns the set of flags that is suitable for reparsing a translation unit.

Returns the set of flags that is suitable for saving a translation unit.

Free the given set of code-completion results.

Disposes a CXCursorSet and releases its associated memory.

Free the memory associated with a CXPlatformAvailability structure.

Destroy the given index.

Free the set of overridden cursors returned by clang_getOverriddenCursors().

Free the given set of tokens.

Destroy the specified CXTranslationUnit object.

Determine if an enum declaration refers to a scoped enum.

Determine whether two cursors are equivalent.

Determine whether two CXTypes represent the same type.

Disposes the created Eval memory.

Returns the evaluation result as double if the kind is double.

Returns the evaluation result as integer if the kind is Int.

Returns the evaluation result as a long long integer if the kind is Int. This prevents overflows that may happen if the result is returned with clang_EvalResult_getAsInt.

Returns the evaluation result as a constant string if the kind is other than Int or float. User must not free this pointer, instead call clang_EvalResult_dispose on the CXEvalResult returned by clang_Cursor_Evaluate.

Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero.

Returns the kind of the evaluated result.

Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer.

Find #import/#include directives in a specific file.

Find references of a declaration in a specific file.

Returns the address space of the given type.

Retrieve all ranges from all files that were skipped by the preprocessor.

Retrieve the type of a parameter of a function type.

Return the element type of an array type.

Return the array size of a constant array.

Retrieve the canonical cursor corresponding to the given cursor.

Return the canonical type for a CXType.

Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable).

Retrieve the annotation associated with the given completion string.

Determine the availability of the entity that this code-completion string refers to.

Retrieve the brief documentation comment attached to the declaration that corresponds to the given completion string.

Retrieve the completion string associated with a particular chunk within a completion string.

Determine the kind of a particular chunk within a completion string.

Retrieve the text associated with a particular chunk within a completion string.

Fix-its that must be applied before inserting the text for the corresponding completion.

Retrieve the number of annotations associated with the given completion string.

Retrieve the number of fix-its for the given completion index.

Retrieve the parent context of the given completion string.

Determine the priority of this code completion.

Map a source location to the cursor that describes the entity at that location in the source code.

Determine the availability of the entity that this cursor refers to, taking the current target platform into account.

Retrieve a completion string for an arbitrary declaration or macro definition cursor.

For a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that describes the definition of that entity.

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

Retrieve the exception specification type associated with a given cursor. This is a value of type CXCursor_ExceptionSpecificationKind.

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

Retrieve the kind of the given cursor.

These routines are used for testing and debugging, only, and should not be relied upon.

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

Determine the lexical parent of the given cursor.

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

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

Determine the availability of the entity that this cursor refers to on any platforms for which availability information is known.

Pretty print declarations.

Retrieve the default policy for the cursor.

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

Given a cursor that references something else, return the source range covering that reference.

Retrieve the return type associated with a given cursor.

Determine the semantic parent of the given cursor.

Retrieve a name for the entity referenced by this cursor.

Determine the "thread-local storage (TLS) kind" of the declaration referred to by a cursor.

Retrieve the type of a CXCursor (if any).

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

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

Return the memory usage of a translation unit. This object should be released with clang_disposeCXTUResourceUsage().

Returns the access control level for the referenced object.

Returns the Objective-C type encoding for the specified declaration.

Retrieve a diagnostic associated with the given translation unit.

Retrieve the complete set of diagnostics associated with a translation unit.

Return the element type of an array, complex, or vector type.

Retrieve the integer value of an enum constant declaration as an unsigned long long.

Retrieve the integer value of an enum constant declaration as a signed long long.

Retrieve the integer type of an enum declaration.

Retrieve the exception specification type associated with a function type. This is a value of type CXCursor_ExceptionSpecificationKind.

Retrieve the bit width of a bit field declaration as an integer.

Retrieve a file handle within the given translation unit.

Retrieve the buffer associated with the given file.

Retrieve the calling convention associated with a function type.

For cursors representing an iboutletcollection attribute, this function returns the collection element type.

Retrieve the file that is included by the given inclusion directive cursor.

Visit the set of preprocessor inclusions in a translation unit. The visitor function is called with the provided data for every included file. This does not include headers included by the PCH file (unless one is inspecting the inclusions in the PCH file itself).

Retrieves the source location associated with a given file/line/column in a particular translation unit.

Retrieves the source location associated with a given character offset in a particular translation unit.

Given a CXFile header file, return the module that contains it, if one exists.

Retrieve the NULL cursor, which represents no entity.

Retrieve the number of non-variadic parameters associated with a function type.

Retrieve the number of chunks in the given code-completion string.

Determine the number of diagnostics produced for the given translation unit.

Return the number of elements of an array or vector type.

Determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.

Retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.

Determine the set of methods that are overridden by the given method.

For pointer types, returns the type of the pointee.

Retrieve a remapping.

Retrieve a remapping.

Retrieve the return type associated with a function type.

Retrieve all ranges that were skipped by the preprocessor.

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.

Given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template.

Get the raw lexical token starting with the given location.

Retrieve a source range that covers the given token.

Determine the kind of the given token.

Retrieve the source location of the given token.

Determine the spelling of the given token.

Retrieve the cursor that represents the given translation unit.

Get the original translation unit source file name.

Get target information for this translation unit.

Returns the human-readable null-terminated C string that represents the name of the memory category. This string should never be freed.

Return the cursor for the declaration of the given type.

Retrieve the underlying type of a typedef declaration.

Returns the typedef name of the given type.

Retrieve the spelling of a given CXTypeKind.

Pretty-print the underlying type using the rules of the language of the translation unit from which it came.

Compute a hash value for the given cursor.

For retrieving a custom CXIdxClientContainer attached to a container.

For retrieving a custom CXIdxClientEntity attached to an entity.

For setting a custom CXIdxClientContainer attached to a container.

For setting a custom CXIdxClientEntity attached to an entity.

An indexing action/session, to be applied to one or multiple translation units.

Destroy the given index action.

Retrieve the CXSourceLocation represented by the given CXIdxLoc.

Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.

Index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks.

Same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary.

Index the given translation unit via callbacks implemented through #IndexerCallbacks.

Determine whether the given cursor kind represents an attribute.

Determine whether a CXType has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.

Determine whether the declaration pointed to by this cursor is also a definition of that entity.

Determine whether the given cursor kind represents a declaration.

Determine whether the given cursor kind represents an expression.

Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once.

Return 1 if the CXType is a variadic function type, and 0 otherwise.

Determine whether the given cursor kind represents an invalid cursor.

Determine whether the given declaration is invalid.

Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise.

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

Determine whether the given cursor kind represents a simple reference.

Determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.

Determine whether the given cursor kind represents a statement.

Determine whether the given cursor kind represents a translation unit.

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

Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual.

Determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.

Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes.

Parse the given source file and the translation unit corresponding to that file.

Same as clang_parseTranslationUnit2 but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary.

Release a printing policy.

Get a property value for the given printing policy.

Set a property value for the given printing policy.

Dispose the remapping.

Get the original and the associated filename from the remapping.

Determine the number of remappings.

Reparse the source files that produced this translation unit.

Saves a translation unit into a serialized representation of that translation unit on disk.

Sort the code-completion results in case-insensitive alphabetical order.

Suspend a translation unit in order to free memory associated with it.

Destroy the CXTargetInfo object.

Get the pointer width of the target in bits.

Get the normalized target triple as a string.

Enable/disable crash recovery.

Tokenize the source code described by the given range into raw lexical tokens.

Return the alignment of a type in bytes as per C++[expr.alignof] standard.

Return the class type of an member pointer type.

Retrieve the ref-qualifier kind of a function or method.

Return the type that was modified by this attributed type.

Retrieve the type named by the qualified-id.

Retrieve the nullability kind of a pointer type.

Retrieve the number of protocol references associated with an ObjC object/id.

Retrieve the number of type arguments associated with an ObjC object.

Returns the number of template arguments for given template specialization, or -1 if type T is not a template specialization.

Returns the Objective-C type encoding for the specified CXType.

Retrieves the base type of the ObjCObjectType.

Retrieve the decl for a protocol reference for an ObjC object/id.

Retrieve a type argument associated with an ObjC object.

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]

Return the size of a type in bytes as per C++[expr.sizeof] standard.

Returns the type template argument of a template class specialization at given index.

Gets the type contained by this atomic type.

Determine if a typedef is 'transparent' tag.

Visit the fields of a particular type.

Visit the children of a particular cursor.