Interface IIndex

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type IIndex = interface(IInterface)

Description

An "index" that consists of a set of translation units that would typically be linked together into an executable or library. Use TIndex to create an instance.

Attributes
GUID['{F432C0B8-2E5F-459E-8514-BE601317F6F3}']

Hierarchy

  • IInterface
  • IIndex

Overview

Methods

Public function GetGlobalOptions: TGlobalOptions;
Public procedure SetGlobalOptions(const AValue: TGlobalOptions);
Public procedure SetInvocationEmissionPath(const AValue: String);
Public function GetHandle: TCXIndex;
Public function CreateTranslationUnitFromSource(const ASourceFilename: String; const AClangCommandLineArgs: array of String; const AUnsavedFiles: TArray<TUnsavedFile> = nil): ITranslationUnit; overload;
Public function CreateTranslationUnitFromSource(const ASourceFilename: String; const AUnsavedFiles: TArray<TUnsavedFile> = nil): ITranslationUnit; overload;
Public function CreateTranslationUnit(const AAstFilename: String): ITranslationUnit;
Public function ParseTranslationUnit(const ASourceFilename: String; const AClangCommandLineArgs: array of String; const AUnsavedFiles: TArray<TUnsavedFile> = nil; const AOptions: TTranslationUnitFlags = []): ITranslationUnit;
Public function CreateIndexAction: IIndexAction;

Properties

Public property GlobalOptions: TGlobalOptions read GetGlobalOptions write SetGlobalOptions;
Public property InvocationEmissionPath: String write SetInvocationEmissionPath;
Public property Handle: TCXIndex read GetHandle;

Description

Methods

Public function GetGlobalOptions: TGlobalOptions;
 
Public procedure SetGlobalOptions(const AValue: TGlobalOptions);
 
Public procedure SetInvocationEmissionPath(const AValue: String);
 
Public function GetHandle: TCXIndex;
 
Public function CreateTranslationUnitFromSource(const ASourceFilename: String; const AClangCommandLineArgs: array of String; const AUnsavedFiles: TArray<TUnsavedFile> = nil): ITranslationUnit; overload;
Public function CreateTranslationUnitFromSource(const ASourceFilename: String; const AUnsavedFiles: TArray<TUnsavedFile> = nil): ITranslationUnit; overload;

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

Note: The ASourceFilename argument is optional. If the caller provides an empty string, the name of the source file is expected to reside in the specified command line arguments.

Note: When encountered in AClangCommandLineArgs, the following options are ignored:

  • '-c'

  • '-emit-ast'

  • '-fsyntax-only'

  • '-o <output file>' (both '-o' and '<output file>' are ignored)

Parameters
ASourceFilename
The name of the source file to load, or an empty string if the source file is included in AClangCommandLineArgs.
AClangCommandLineArgs
(optional) command-line arguments that would be passed to the clang executable if it were being invoked out-of-process. These command-line options will be parsed and will affect how the translation unit is parsed. Note that the following options are
ignored
'-c', '-emit-ast', '-fsyntax-only' (which is the default), and '-o <output file>'.
AUnsavedFiles
(optional) array of files that have not yet been saved to disk but may be required for code completion, including the contents of those files.
Returns

The translation unit or nil in case of an error (eg. file does not exist or parse error)

Public function CreateTranslationUnit(const AAstFilename: String): ITranslationUnit;

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

Parameters
AAstFilename
name of the AST file to load.
Returns

The translation unit or nil in case of an error (eg. file does not exist or in invalid format)

Public function ParseTranslationUnit(const ASourceFilename: String; const AClangCommandLineArgs: array of String; const AUnsavedFiles: TArray<TUnsavedFile> = nil; const AOptions: TTranslationUnitFlags = []): ITranslationUnit;

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

This routine is the main entry point for the Clang C API, providing the ability to parse a source file into a translation unit that can then be queried by other functions in the API. This routine accepts a set of command-line arguments so that the compilation can be configured in the same way that the compiler is configured on the command line.

Parameters
ASourceFilename
The name of the source file to load, or an empty string if the source file is included in AClangCommandLineArgs.
AClangCommandLineArgs
(optional) command-line arguments that would be passed to the clang executable if it were being invoked out-of-process. These command-line options will be parsed and will affect how the translation unit is parsed. Note that the following options are
ignored
'-c', '-emit-ast', '-fsyntax-only' (which is the default), and '-o <output file>'.
AUnsavedFiles
(optional) array of files that have not yet been saved to disk but may be required for code completion, including the contents of those files.
AOptions
(optional) options that affects how the translation unit is managed but not its compilation.
Returns

The translation unit or nil in case of an error (eg. file does not exist or parse error)

Public function CreateIndexAction: IIndexAction;

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

Returns

The index action or nil in case of an error.

Properties

Public property GlobalOptions: TGlobalOptions read GetGlobalOptions write SetGlobalOptions;

General options associated with an Index

Public property InvocationEmissionPath: String write SetInvocationEmissionPath;

The invocation emission path. Specifies a path which will contain log files for certain libclang invocations. An empty string (default) implies that libclang invocations are not logged.

Public property Handle: TCXIndex read GetHandle;

Internal handle to C API


Generated by PasDocEx, based on PasDoc 0.14.0.