Package org.eclipse.cdt.core.index

## Interface IIndexInclude

    public interface IIndexInclude

Interface for an include directive stored in the index.

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
`static IIndexInclude[]` `EMPTY_INCLUDES_ARRAY`

### Method Summary

All Methods Instance Methods Abstract Methods
`String` `getFullName()` Returns the name of the include.
`IIndexFile` `getIncludedBy()` Returns the file that contains this directive.
`IIndexFileLocation` `getIncludedByLocation()` Returns the IIndexFileLocation of the file that contains this directive.
`IIndexFileLocation` `getIncludesLocation()` Returns the IIndexFileLocation of the file that is included by this directive.
`String` `getName()` Returns the simple name of the directive.
`int` `getNameLength()` Returns the length of the name of the include.
`int` `getNameOffset()` Returns the character offset of the name of the include in its source file.
`boolean` `isActive()` Test whether this include is in active code (not skipped by conditional preprocessing).
`boolean` `isIncludedFileExported()` Returns `true` if the included file is exported by the including header.
`boolean` `isResolved()` Test whether this include has been resolved (found in the file system).
`boolean` `isResolvedByHeuristics()` Tests whether this include has been resolved using a heuristics rather than relying on the include search path.
`boolean` `isSystemInclude()` Returns whether this is a system include (an include specified within angle brackets).

### Field Detail

#### EMPTY_INCLUDES_ARRAY

    static final IIndexInclude[] EMPTY_INCLUDES_ARRAY

### Method Detail

#### getIncludedBy

    IIndexFile getIncludedBy()
                      throws org.eclipse.core.runtime.CoreException

Returns the file that contains this directive.

Returns:
  the file performing the include
Throws:
  `org.eclipse.core.runtime.CoreException`

#### getIncludedByLocation

    IIndexFileLocation getIncludedByLocation()
                                      throws org.eclipse.core.runtime.CoreException

Returns the IIndexFileLocation of the file that contains this directive.

Returns:
  the IIndexFileLocation of the file performing the include
Throws:
  `org.eclipse.core.runtime.CoreException`

#### getIncludesLocation

    IIndexFileLocation getIncludesLocation()
                                    throws org.eclipse.core.runtime.CoreException

Returns the IIndexFileLocation of the file that is included by this directive. In case of an unresolved include `null` will be returned.

Returns:
  the IIndexFileLocation of the file that is included by this directive or `null` if the include is unresolved or inactive
Throws:
  `org.eclipse.core.runtime.CoreException`

#### getName

    String getName()
            throws org.eclipse.core.runtime.CoreException

Returns the simple name of the directive. This skips any leading directories. E.g. for `<sys/types.h>` `"types.h"` will be returned.

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

#### getFullName

    String getFullName()
                throws org.eclipse.core.runtime.CoreException

Returns the name of the include. The name does not include the enclosing quotes or angle brackets. E.g. for `<sys/types.h>` `"sys/types.h"` will be returned.

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

#### getNameOffset

    int getNameOffset()
               throws org.eclipse.core.runtime.CoreException

Returns the character offset of the name of the include in its source file. The name does not include the enclosing quotes or angle brackets.

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

#### getNameLength

    int getNameLength()
               throws org.eclipse.core.runtime.CoreException

Returns the length of the name of the include. The name does not include the enclosing quotes or angle brackets.

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

#### isSystemInclude

    boolean isSystemInclude()
                     throws org.eclipse.core.runtime.CoreException

Returns whether this is a system include (an include specified within angle brackets).

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

#### isActive

    boolean isActive()
              throws org.eclipse.core.runtime.CoreException

Test whether this include is in active code (not skipped by conditional preprocessing).

Returns:
  whether this include is in active code
Throws:
  `org.eclipse.core.runtime.CoreException`

#### isResolved

    boolean isResolved()
                throws org.eclipse.core.runtime.CoreException

Test whether this include has been resolved (found in the file system). Inactive includes are not resolved, unless they constitute a hidden dependency. This is the case when an include is inactive because it has been included before:

       #ifndef _header_h
       #include "header.h"
       #endif

Returns:
  whether this is a resolved include
Throws:
  `org.eclipse.core.runtime.CoreException`

#### isResolvedByHeuristics

    boolean isResolvedByHeuristics()
                            throws org.eclipse.core.runtime.CoreException

Tests whether this include has been resolved using a heuristics rather than relying on the include search path.

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

#### isIncludedFileExported

    boolean isIncludedFileExported()
                            throws org.eclipse.core.runtime.CoreException

Returns `true` if the included file is exported by the including header.

Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  5.5
See Also:
  "https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md"