Package org.eclipse.cdt.core.index

# Interface IIndexFile

All Superinterfaces:
  `IFileNomination`

public interface IIndexFile extends IFileNomination
Represents a file that has been indexed.

Since:
  4.0
Restriction:
  This interface is not intended to be implemented by clients.
Restriction:
  This interface is not intended to be extended by clients.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final IIndexFile[]`
`EMPTY_FILE_ARRAY`

## Method Summary

Modifier and Type
Method
Description
`IIndexName[]`
`findNames(int offset, int length)`
Find all names within the given range.
`long`
`getContentsHash()`
Hash of the file contents when the file was indexed.
`int`
`getEncodingHashcode()`
Deprecated.
Returns 0.
`IIndexInclude[]`
`getIncludes()`
Returns all includes found in this file.
`int`
`getLinkageID()`
Returns the id of the linkage this file was parsed in.
`IIndexFileLocation`
`getLocation()`
Returns an IIndexFileLocation representing the location of this file
`IIndexMacro[]`
`getMacros()`
Returns all macros defined in this file.
`IIndexInclude`
`getParsedInContext()`
Returns the include that was used to parse this file, may be `null`.
`String`
`getReplacementHeader()`
Returns the name of the replacement header obtained from `@headername{header}` or from `IWYU pragma: private, include "header"`.
`int`
`getScannerConfigurationHashcode()`
Deprecated.
Returns 0.
`long`
`getSourceReadTime()`
Time when the file was read during indexing.
`long`
`getTimestamp()`
Last modification of file before it was indexed.
`ICPPUsingDirective[]`
`getUsingDirectives()`
Returns all using directives for namespaces and global scope, found in this file.
`String`
`toDebugString()`
Returns detailed information about the file.

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IFileNomination

`getSignificantMacros, hasPragmaOnceSemantics`

## Field Details

### EMPTY_FILE_ARRAY

static final IIndexFile[] EMPTY_FILE_ARRAY

## Method Details

### getLocation

IIndexFileLocation getLocation() throws org.eclipse.core.runtime.CoreException
Returns an IIndexFileLocation representing the location of this file

Throws:
  `org.eclipse.core.runtime.CoreException`

### getIncludes

IIndexInclude[] getIncludes() throws org.eclipse.core.runtime.CoreException
Returns all includes found in this file.

Returns:
  an array of all includes found in this file
Throws:
  `org.eclipse.core.runtime.CoreException`

### getMacros

IIndexMacro[] getMacros() throws org.eclipse.core.runtime.CoreException
Returns all macros defined in this file.

Returns:
  an array of macros found in this file
Throws:
  `org.eclipse.core.runtime.CoreException`

### getUsingDirectives

ICPPUsingDirective[] getUsingDirectives() throws org.eclipse.core.runtime.CoreException
Returns all using directives for namespaces and global scope, found in this file.

Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.0

### getTimestamp

long getTimestamp() throws org.eclipse.core.runtime.CoreException
Last modification of file before it was indexed.

Returns:
  the last modification date of the file at the time it was parsed.
Throws:
  `org.eclipse.core.runtime.CoreException`

### getSourceReadTime

long getSourceReadTime() throws org.eclipse.core.runtime.CoreException
Time when the file was read during indexing. Corresponds to the start of reading.

Returns:
  time of indexing in milliseconds since epoch
Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.4

### getContentsHash

long getContentsHash() throws org.eclipse.core.runtime.CoreException
Hash of the file contents when the file was indexed.

Returns:
  64-bit hash of the file content.
Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.2

### getScannerConfigurationHashcode

@Deprecated int getScannerConfigurationHashcode() throws org.eclipse.core.runtime.CoreException
Deprecated.
Returns 0.

Throws:
  `org.eclipse.core.runtime.CoreException`
Restriction:
  This method is not intended to be referenced by clients.

### getEncodingHashcode

@Deprecated int getEncodingHashcode() throws org.eclipse.core.runtime.CoreException
Deprecated.
Returns 0.

Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.3
Restriction:
  This method is not intended to be referenced by clients.

### findNames

IIndexName[] findNames(int offset, int length) throws org.eclipse.core.runtime.CoreException
Find all names within the given range.

Throws:
  `org.eclipse.core.runtime.CoreException`

### getParsedInContext

IIndexInclude getParsedInContext() throws org.eclipse.core.runtime.CoreException
Returns the include that was used to parse this file, may be `null`.

Throws:
  `org.eclipse.core.runtime.CoreException`

### getLinkageID

int getLinkageID() throws org.eclipse.core.runtime.CoreException
Returns the id of the linkage this file was parsed in.

Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.0

### getReplacementHeader

String getReplacementHeader() throws org.eclipse.core.runtime.CoreException
Returns the name of the replacement header obtained from `@headername{header}` or from `IWYU pragma: private, include "header"`. Returns an empty string if the file contained `IWYU pragma: private` without a replacement header. Returns `null` if the file does not contain `@headername{header}` or `IWYU pragma: private`.

Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.7

### toDebugString

String toDebugString()
Returns detailed information about the file. For debugging only.

Since:
  5.4