org.eclipse.cdt.core.model

## Class CoreModel

- java.lang.Object
- - org.eclipse.cdt.core.model.CoreModel

    public class CoreModel
    extends Object

### Field Summary

Fields
`static String` `CORE_MODEL_ID`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener, int eventTypes)`
`void` `addElementChangedListener(IElementChangedListener listener)`
`ICElement` `create(IFile file)` Creates an ICElement for an IFile.
`ICContainer` `create(IFolder folder)` Creates an ICElement for an IFolder.
`ICElement` `create(IPath path)` Creates an ICElement for an IPath.
`ICProject` `create(IProject project)` Creates an ICElement for an IProject.
`ICElement` `create(IResource resource)` Creates an ICElement for an IResource.
`static ICModel` `create(IWorkspaceRoot root)` Returns the C model.
`org.eclipse.cdt.core.settings.model.ICProjectDescription` `createProjectDescription(IProject project, boolean loadIfExists)` This method is a full equivalent to `createProjectDescription(project, loadIfExists, false)`.
`org.eclipse.cdt.core.settings.model.ICProjectDescription` `createProjectDescription(IProject project, boolean loadIfExists, boolean creating)` Creates and returns a writable project description
`ITranslationUnit` `createTranslationUnitFrom(ICProject cproject, IPath path)` Creates a translation from an IPath.
`ICModel` `getCModel()` Returns the default ICModel.
`static CoreModel` `getDefault()` Returns the singleton.
`static IIncludeEntry[]` `getIncludeEntries(IPath path)` This method returns the include entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.
`static IIncludeFileEntry[]` `getIncludeFileEntries(IPath path)` This method returns the include file entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.
`static IMacroEntry[]` `getMacroEntries(IPath path)` This method returns the macro entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.
`static IMacroFileEntry[]` `getMacroFileEntries(IPath path)` This method returns the macro file entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.
`static IPathEntryContainer` `getPathEntryContainer(IPath containerPath, ICProject project)` Answers the project specific value for a given container.
`static PathEntryContainerInitializer` `getPathEntryContainerInitializer(String containerID)` Helper method finding the pathentry container initializer registered for a given container ID or `null` if none was found while iterating over the contributions to extension point to the extension point "org.eclipse.cdt.core.PathEntryContainerInitializer".
`static IPathEntryStore` `getPathEntryStore(IProject project)` Returns the IPathEntryStore of the project.
`org.eclipse.cdt.core.settings.model.ICProjectDescription` `getProjectDescription(IProject project)` Returns the project description associated with this project or null if the project does not contain the CDT data associated with it.
`org.eclipse.cdt.core.settings.model.ICProjectDescription` `getProjectDescription(IProject project, boolean write)` returns the project description associated with this project or null if the project does not contain the CDT data associated with it.
`org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager` `getProjectDescriptionManager()`
`static IPathEntry[]` `getRawPathEntries(ICProject cproject)` Returns the raw pathentries for the project.
`static String` `getRegistedContentTypeId(IProject project, String name)` Return the registered content type id, for example: CONTENT_TYPE_CHEADER CONTENT_TYPE_CXXHEADER CONTENT_TYPE_CSOURCE CONTENT_TYPE_CXXSOURCE CONTENT_TYPE_ASMSOURCE or null is return if no id match the list
`static String[]` `getRegistedContentTypeIds()` Returns an array of the register contentTypes.
`static IPathEntry[]` `getResolvedPathEntries(ICProject cproject)` This method returns the resolved pathentries for the project All pathEntry.CDT_CONTAINER entries in the project's will be replaced by the entries they resolve to.
`static boolean` `hasCCNature(IProject project)` Returns true if project has C++ nature.
`static boolean` `hasCNature(IProject project)` Returns true if project has C nature.
`boolean` `isArchive(IFile file)` Returns true if IFile is an Achive, *.a
`boolean` `isBinary(IFile file)` Returns true if IFile is an ELF.
`boolean` `isExecutable(IFile file)` Returns true if IFile is an ELF executable
`boolean` `isNewStyleProject(IProject project)` Answers whether the given project is a new-style project, i.e.
`boolean` `isObject(IFile file)` Returns true if IFile is a an object(ELF), i.e. *.o
`static boolean` `isScannerInformationEmpty(IResource resource)` The method returns whether scanner information for a resource is empty or not.
`boolean` `isSharedLib(IFile file)` Returns true if IFile is a shared library, i.e. libxx.so
`static boolean` `isTranslationUnit(IFile file)` Returns true if IFile is a possible TranslationUnit.
`static boolean` `isValidASMSourceUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidCHeaderUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidCSourceUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidCXXHeaderUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidCXXSourceUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidHeaderUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidSourceUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static boolean` `isValidTranslationUnitName(IProject project, String name)` Returns true if name is a valid name for a translation unit.
`static IContainerEntry` `newContainerEntry(IPath id)` Creates and returns a new entry of kind `CDT_CONTAINER` for the given path.
`static IContainerEntry` `newContainerEntry(IPath id, boolean isExported)` Creates and returns a new entry of kind `CDT_CONTAINER` for the given path.
`static IIncludeEntry` `newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath)` Creates and returns a new entry of kind `CDT_INCLUDE`
`static IIncludeEntry` `newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude)` * Creates and returns a new entry of kind `CDT_INCLUDE`
`static IIncludeEntry` `newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude, IPath[] exclusionPatterns)` Creates and returns a new entry of kind `CDT_INCLUDE`
`static IIncludeEntry` `newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude, IPath[] exclusionPatterns, boolean isExported)` Creates and returns a new entry of kind `CDT_INCLUDE`
`static IIncludeFileEntry` `newIncludeFileEntry(IPath resourcePath, IPath includeFile)` Creates a new entry of kind `CDT_INCLUDE_FILE`
`static IIncludeFileEntry` `newIncludeFileEntry(IPath resourcePath, IPath baseRef, IPath basePath, IPath includeFilePath, IPath[] exclusionPatterns, boolean isExported)` Creates and returns a new entry of kind `CDT_INCLUDE_FILE`
`static IIncludeEntry` `newIncludeRefEntry(IPath resourcePath, IPath baseRef, IPath includePath)` Creates and returns a new entry of kind `CDT_INCLUDE`
`static ILibraryEntry` `newLibraryEntry(IPath resourcePath, IPath basePath, IPath libraryPath, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IPath sourceAttachmentPrefixMapping, boolean isExported)` Creates and returns a new entry of kind `CDT_LIBRARY` for the archive or folder identified by the given absolute path.
`static ILibraryEntry` `newLibraryRefEntry(IPath resourcePath, IPath baseRef, IPath libraryPath)` Creates and returns a new entry of kind `CDT_LIBRARY` for the archive or folder identified by the given absolute path.
`static IMacroEntry` `newMacroEntry(IPath resourcePath, String macroName, String macroValue)` Creates and returns an entry kind `CDT_MACRO`
`static IMacroEntry` `newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns)` Creates and returns an entry kind `CDT_MACRO`
`static IMacroEntry` `newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported)` Creates and returns an entry kind `CDT_MACRO`
`static IMacroFileEntry` `newMacroFileEntry(IPath resourcePath, IPath macroFile)` Creates an entry kind `CDT_MACRO_FILE`
`static IMacroFileEntry` `newMacroFileEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath macroFilePath, IPath[] exclusionPatterns, boolean isExported)` Creates and returns an entry kind `CDT_MACRO_FILE`
`static IMacroEntry` `newMacroRefEntry(IPath resourcePath, IPath baseRef, String macroName)` Creates and returns an entry kind `CDT_MACRO`
`static IOutputEntry` `newOutputEntry(IPath outputPath)` Creates and returns a new entry of kind `CDT_OUTPUT` for the project's output folder
`static IOutputEntry` `newOutputEntry(IPath outputPath, IPath[] exclusionPatterns)` Creates and returns a new entry of kind `CDT_OUPUT` for the project
`static IProjectEntry` `newProjectEntry(IPath projectPath)` Creates and returns a new non-exported entry of kind `CDT_PROJECT` for the project identified by the given absolute path.
`static IProjectEntry` `newProjectEntry(IPath projectPath, boolean isExported)` Creates and returns a new entry of kind `CDT_PROJECT` for the project identified by the given workspace-relative path.
`static ISourceEntry` `newSourceEntry(IPath sourcePath)` Creates and returns a new entry of kind `CDT_SOURCE` for the project's source folder identified by the given absolute workspace-relative path.
`static ISourceEntry` `newSourceEntry(IPath sourcePath, IPath[] exclusionPatterns)` Creates and returns a new entry of kind `CDT_SOURCE` for the project's source folder identified by the given absolute workspace-relative path but excluding all source files with paths matching any of the given patterns.
`static void` `pathEntryContainerUpdates(IPathEntryContainerExtension container, PathEntryContainerChanged[] changes, IProgressMonitor monitor)` Helper method use by a path entry container implementing `IPathEntryContainerExtension` It notify the model of changes.
`void` `removeCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener)`
`void` `removeElementChangedListener(IElementChangedListener listener)` Removes the given element changed listener.
`static void` `run(IWorkspaceRunnable action, IProgressMonitor monitor)` Runs the given action as an atomic C model operation.
`static void` `run(IWorkspaceRunnable action, ISchedulingRule rule, IProgressMonitor monitor)` Runs the given action as an atomic C model operation.
`static void` `setPathEntryContainer(ICProject[] affectedProjects, IPathEntryContainer container, IProgressMonitor monitor)` Bind a container reference path to some actual containers (`IPathEntryContainer`).
`static void` `setPathEntryStore(IProject project, IPathEntryStore store)` Set in the map the store, but not persisted.
`void` `setProjectDescription(IProject project, org.eclipse.cdt.core.settings.model.ICProjectDescription des)` This method is called to save/apply the project description the method should be called to apply changes made to the project description returned by the `getProjectDescription(IProject, boolean)` or `createProjectDescription(IProject, boolean)`
`void` `setProjectDescription(IProject project, org.eclipse.cdt.core.settings.model.ICProjectDescription des, boolean force, IProgressMonitor monitor)`
`static void` `setRawPathEntries(ICProject cproject, IPathEntry[] newEntries, IProgressMonitor monitor)` Sets the pathentries of this project using a list of entries.
`void` `shutdown()`
`void` `startup()`
`void` `updateProjectDescriptions(IProject[] projects, IProgressMonitor monitor)` Forces the cached data of the specified projects to be re-calculated.
`static ICModelStatus` `validatePathEntries(ICProject cProject, IPathEntry[] entries)` Validate a given path entries for a project, using the following rules: Entries cannot collide with each other; that is, all entry paths must be unique.
`static ICModelStatus` `validatePathEntry(ICProject cProject, IPathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers)` Returns a C model status describing the problem related to this entry if any, a status object with code `IStatus.OK` if the entry is fine (that is, if the given entry denotes a valid element).

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CORE_MODEL_ID

    public static final String CORE_MODEL_ID

### Method Detail

#### create

    public ICElement create(IPath path)

Creates an ICElement for an IPath. Returns null if not found.

#### createTranslationUnitFrom

    public ITranslationUnit createTranslationUnitFrom(ICProject cproject,
                                                      IPath path)

Creates a translation from an IPath. Returns null if not found.

#### create

    public ICElement create(IFile file)

Creates an ICElement for an IFile. Returns null if not found.

#### create

    public ICContainer create(IFolder folder)

Creates an ICElement for an IFolder. Returns null if not found.

#### create

    public ICProject create(IProject project)

Creates an ICElement for an IProject. Returns null if not found.

#### create

    public ICElement create(IResource resource)

Creates an ICElement for an IResource. Returns null if not found.

#### create

    public static ICModel create(IWorkspaceRoot root)

Returns the C model.

Parameters:
  `root` - the given root
Returns:
  the C model, or `null` if the root is null

#### getCModel

    public ICModel getCModel()

Returns the default ICModel.

#### isSharedLib

    public boolean isSharedLib(IFile file)

Returns true if IFile is a shared library, i.e. libxx.so

#### isObject

    public boolean isObject(IFile file)

Returns true if IFile is a an object(ELF), i.e. *.o

#### isExecutable

    public boolean isExecutable(IFile file)

Returns true if IFile is an ELF executable

#### isBinary

    public boolean isBinary(IFile file)

Returns true if IFile is an ELF.

#### isArchive

    public boolean isArchive(IFile file)

Returns true if IFile is an Achive, *.a

#### isTranslationUnit

    public static boolean isTranslationUnit(IFile file)

Returns true if IFile is a possible TranslationUnit.

#### getRegistedContentTypeIds

    public static String[] getRegistedContentTypeIds()

Returns an array of the register contentTypes.

Returns:
  String[] ids

#### isValidTranslationUnitName

    public static boolean isValidTranslationUnitName(IProject project,
                                                     String name)

Returns true if name is a valid name for a translation unit.

#### isValidHeaderUnitName

    public static boolean isValidHeaderUnitName(IProject project,
                                                String name)

Returns true if name is a valid name for a translation unit.

#### isValidSourceUnitName

    public static boolean isValidSourceUnitName(IProject project,
                                                String name)

Returns true if name is a valid name for a translation unit.

#### isValidCSourceUnitName

    public static boolean isValidCSourceUnitName(IProject project,
                                                 String name)

Returns true if name is a valid name for a translation unit.

#### isValidCXXSourceUnitName

    public static boolean isValidCXXSourceUnitName(IProject project,
                                                   String name)

Returns true if name is a valid name for a translation unit.

#### isValidASMSourceUnitName

    public static boolean isValidASMSourceUnitName(IProject project,
                                                   String name)

Returns true if name is a valid name for a translation unit.

#### isValidCXXHeaderUnitName

    public static boolean isValidCXXHeaderUnitName(IProject project,
                                                   String name)

Returns true if name is a valid name for a translation unit.

#### isValidCHeaderUnitName

    public static boolean isValidCHeaderUnitName(IProject project,
                                                 String name)

Returns true if name is a valid name for a translation unit.

#### getRegistedContentTypeId

    public static String getRegistedContentTypeId(IProject project,
                                                  String name)

Return the registered content type id, for example:

- CONTENT_TYPE_CHEADER
- CONTENT_TYPE_CXXHEADER
- CONTENT_TYPE_CSOURCE
- CONTENT_TYPE_CXXSOURCE
- CONTENT_TYPE_ASMSOURCE

or null is return if no id match the list

Returns:
  the know id or null

#### hasCNature

    public static boolean hasCNature(IProject project)

Returns true if project has C nature.

#### hasCCNature

    public static boolean hasCCNature(IProject project)

Returns true if project has C++ nature.

#### newProjectEntry

    public static IProjectEntry newProjectEntry(IPath projectPath)

Creates and returns a new non-exported entry of kind `CDT_PROJECT` for the project identified by the given absolute path.

A project entry is used to denote a prerequisite project. The exported IPathEntry[] entries of the project will be contributed.

The prerequisite project is referred to using an absolute path relative to the workspace root.

The resulting entry is not exported to dependent projects. This method is equivalent to `newProjectEntry(path, false)`.

Parameters:
  `projectPath` - the workspace-relative path of the project
Returns:
  a new project entry
See Also:
  `newProjectEntry(IPath, boolean)`

#### newProjectEntry

    public static IProjectEntry newProjectEntry(IPath projectPath,
                                                boolean isExported)

Creates and returns a new entry of kind `CDT_PROJECT` for the project identified by the given workspace-relative path.

A project entry is used to denote a prerequisite project. All the IPathEntries of the project will be contributed as a whole. The prerequisite project is referred to using an absolute path relative to the workspace root.

Parameters:
  `projectPath` - the absolute workspace-relative path of the prerequisite project
  `isExported` - indicates whether this entry is contributed to dependent projects
Returns:
  a new project entry

#### newContainerEntry

    public static IContainerEntry newContainerEntry(IPath id)

Creates and returns a new entry of kind `CDT_CONTAINER` for the given path. The path of the container will be used during resolution so as to map this container entry to a set of other entries the container is acting for.

The resulting entry is not exported to dependent projects. This method is equivalent to `newContainerEntry(path, false)`.

Parameters:
  `id` - the id of the container
Returns:
  a new container entry

#### newContainerEntry

    public static IContainerEntry newContainerEntry(IPath id,
                                                    boolean isExported)

Creates and returns a new entry of kind `CDT_CONTAINER` for the given path. The path of the container will be used during resolution so as to map this container entry to a set of other entries the container is acting for.

The resulting entry is not exported to dependent projects. This method is equivalent to `newContainerEntry(path,false)`.

#### newLibraryRefEntry

    public static ILibraryEntry newLibraryRefEntry(IPath resourcePath,
                                                   IPath baseRef,
                                                   IPath libraryPath)

Creates and returns a new entry of kind `CDT_LIBRARY` for the archive or folder identified by the given absolute path.

Parameters:
  `resourcePath` - the affected project-relative resource path
  `baseRef` - the base reference path to find the library
  `libraryPath` - the library name.
Returns:
  a new library entry

#### newLibraryEntry

    public static ILibraryEntry newLibraryEntry(IPath resourcePath,
                                                IPath basePath,
                                                IPath libraryPath,
                                                IPath sourceAttachmentPath,
                                                IPath sourceAttachmentRootPath,
                                                IPath sourceAttachmentPrefixMapping,
                                                boolean isExported)

Creates and returns a new entry of kind `CDT_LIBRARY` for the archive or folder identified by the given absolute path. Note that this operation does not attempt to validate or access the resources at the given paths.

Parameters:
  `resourcePath` - the affected project-relative resource path
  `basePath` - the base path of the library
  `libraryPath` - the path of the library
  `sourceAttachmentPath` - the project-relative path of the corresponding source archive or folder, or `null` if none.
  `sourceAttachmentRootPath` - the location of the root within the source archive or folder or `null`.
  `sourceAttachmentPrefixMapping` - prefix mapping or `null`.
  `isExported` - whether the entry is exported
Returns:
  a new library entry

#### newOutputEntry

    public static IOutputEntry newOutputEntry(IPath outputPath)

Creates and returns a new entry of kind `CDT_OUTPUT` for the project's output folder

Parameters:
  `outputPath` - the project-relative path of a folder
Returns:
  a new source entry with not exclusion patterns

#### newOutputEntry

    public static IOutputEntry newOutputEntry(IPath outputPath,
                                              IPath[] exclusionPatterns)

Creates and returns a new entry of kind `CDT_OUPUT` for the project

Parameters:
  `outputPath` - the project-relative path of a folder
  `exclusionPatterns` - the possibly empty list of exclusion patterns represented as relative paths
Returns:
  a new source entry with the given exclusion patterns

#### newSourceEntry

    public static ISourceEntry newSourceEntry(IPath sourcePath)

Creates and returns a new entry of kind `CDT_SOURCE` for the project's source folder identified by the given absolute workspace-relative path.

The source folder is referred to using an absolute path relative to the workspace root, e.g. `/Project/src`. A project's source folders are located with that project. That is, a source entry specifying the path `/P1/src` is only usable for project `P1`.

Note that all sources/binaries inside a project are contributed as a whole through a project entry (see `newProjectEntry`). Particular source entries cannot be selectively exported.

Parameters:
  `sourcePath` - the project-relative path of a source folder
Returns:
  a new source entry with not exclusion patterns

#### newSourceEntry

    public static ISourceEntry newSourceEntry(IPath sourcePath,
                                              IPath[] exclusionPatterns)

Creates and returns a new entry of kind `CDT_SOURCE` for the project's source folder identified by the given absolute workspace-relative path but excluding all source files with paths matching any of the given patterns. This specifies that all package fragments within the root will have children of type `ICompilationUnit`.

The source folder is referred to using an absolute path relative to the workspace root, e.g. `/Project/src`. A project's source folders are located with that project. That is, a source entry specifying the path `/P1/src` is only usable for project `P1`.

Parameters:
  `sourcePath` - the absolute project-relative path of a source folder
  `exclusionPatterns` - the possibly empty list of exclusion patterns represented as relative paths
Returns:
  a new source entry with the given exclusion patterns

#### newIncludeEntry

    public static IIncludeEntry newIncludeEntry(IPath resourcePath,
                                                IPath basePath,
                                                IPath includePath)

Creates and returns a new entry of kind `CDT_INCLUDE`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `basePath` - the base path of the includePath
  `includePath` - the absolute path of the include
Returns:
  IIncludeEntry

#### newIncludeEntry

    public static IIncludeEntry newIncludeEntry(IPath resourcePath,
                                                IPath basePath,
                                                IPath includePath,
                                                boolean isSystemInclude)

* Creates and returns a new entry of kind `CDT_INCLUDE`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `basePath` - the base path of the includePath
  `includePath` - the absolute path of the include
  `isSystemInclude` - whether this include path should be consider a system include path
Returns:
  IIncludeEntry

#### newIncludeEntry

    public static IIncludeEntry newIncludeEntry(IPath resourcePath,
                                                IPath basePath,
                                                IPath includePath,
                                                boolean isSystemInclude,
                                                IPath[] exclusionPatterns)

Creates and returns a new entry of kind `CDT_INCLUDE`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `basePath` - the base path of the includePath
  `includePath` - the absolute path of the include
  `isSystemInclude` - whether this include path should be consider the system include path
  `exclusionPatterns` - exclusion patterns in the resource if a container
Returns:
  IIincludeEntry

#### newIncludeEntry

    public static IIncludeEntry newIncludeEntry(IPath resourcePath,
                                                IPath basePath,
                                                IPath includePath,
                                                boolean isSystemInclude,
                                                IPath[] exclusionPatterns,
                                                boolean isExported)

Creates and returns a new entry of kind `CDT_INCLUDE`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `basePath` - the base path of the include
  `includePath` - the path of the include
  `isSystemInclude` - whether this include path should be consider the system include path
  `exclusionPatterns` - exclusion patterns in the resource if a container
  `isExported` - if the entry ix exported to reference projects
Returns:
  IIincludeEntry

#### newIncludeRefEntry

    public static IIncludeEntry newIncludeRefEntry(IPath resourcePath,
                                                   IPath baseRef,
                                                   IPath includePath)

Creates and returns a new entry of kind `CDT_INCLUDE`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `baseRef` - the base reference path of the include
  `includePath` - the path of the include
Returns:
  IIincludeEntry

#### newIncludeFileEntry

    public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath,
                                                        IPath includeFile)

Creates a new entry of kind `CDT_INCLUDE_FILE`

#### newIncludeFileEntry

    public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath,
                                                        IPath baseRef,
                                                        IPath basePath,
                                                        IPath includeFilePath,
                                                        IPath[] exclusionPatterns,
                                                        boolean isExported)

Creates and returns a new entry of kind `CDT_INCLUDE_FILE`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `basePath` - the base path of the include
  `includeFilePath` - the path of the include
  `exclusionPatterns` - exclusion patterns in the resource if a container
  `isExported` - if the entry ix exported to reference projects
Returns:
  IIincludeEntry

#### newMacroEntry

    public static IMacroEntry newMacroEntry(IPath resourcePath,
                                            String macroName,
                                            String macroValue)

Creates and returns an entry kind `CDT_MACRO`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `macroName` - the name of the macro
  `macroValue` - the value of the macro
Returns:
  IMacroEntry

#### newMacroEntry

    public static IMacroEntry newMacroEntry(IPath resourcePath,
                                            String macroName,
                                            String macroValue,
                                            IPath[] exclusionPatterns)

Creates and returns an entry kind `CDT_MACRO`

Parameters:
  `resourcePath` - the affected project-relative resource path
  `macroName` - the name of the macro
  `macroValue` - the value of the macro
  `exclusionPatterns` - exclusion patterns in the resource if a container

#### newMacroEntry

    public static IMacroEntry newMacroEntry(IPath resourcePath,
                                            String macroName,
                                            String macroValue,
                                            IPath[] exclusionPatterns,
                                            boolean isExported)

Creates and returns an entry kind `CDT_MACRO`

Parameters:
  `resourcePath` - the affected workspace-relative resource path
  `macroName` - the name of the macro
  `macroValue` - the value of the macro
  `exclusionPatterns` - exclusion patterns in the resource if a container

#### newMacroRefEntry

    public static IMacroEntry newMacroRefEntry(IPath resourcePath,
                                               IPath baseRef,
                                               String macroName)

Creates and returns an entry kind `CDT_MACRO`

Parameters:
  `resourcePath` - the affected workspace-relative resource path
  `baseRef` - the base reference path
  `macroName` - the name of the macro

#### newMacroFileEntry

    public static IMacroFileEntry newMacroFileEntry(IPath resourcePath,
                                                    IPath macroFile)

Creates an entry kind `CDT_MACRO_FILE`

#### newMacroFileEntry

    public static IMacroFileEntry newMacroFileEntry(IPath resourcePath,
                                                    IPath basePath,
                                                    IPath baseRef,
                                                    IPath macroFilePath,
                                                    IPath[] exclusionPatterns,
                                                    boolean isExported)

Creates and returns an entry kind `CDT_MACRO_FILE`

Parameters:
  `resourcePath` - the affected workspace-relative resource path
  `basePath` - the base path
  `macroFilePath` - the file path where the macros are define
  `exclusionPatterns` - exclusion patterns in the resource if a container

#### getPathEntryContainer

    public static IPathEntryContainer getPathEntryContainer(IPath containerPath,
                                                            ICProject project)
                                                     throws CModelException

Answers the project specific value for a given container. In case this container path could not be resolved, then will answer `null`. Both the container path and the project context are supposed to be non-null.

The containerPath is a formed by a first ID segment followed with extra segments, which can be used as additional hints for resolution. If no container was ever recorded for this container path onto this project (using `setPathEntryContainer`, then a `PathEntryContainerInitializer` will be activated if any was registered for this container ID onto the extension point "org.eclipse.cdt.core.PathEntryContainerInitializer".

PathEntry container values are persisted locally to the workspace, but are not preserved from a session to another. It is thus highly recommended to register a `PathEntryContainerInitializer` for each referenced container (through the extension point "org.eclipse.cdt.core.PathEntryContainerInitializer").

Parameters:
  `containerPath` - the name of the container, which needs to be resolved
  `project` - a specific project in which the container is being resolved
Returns:
  the corresponding container or `null` if unable to find one.
Throws:
  `CModelException` - if an exception occurred while resolving the container, or if the resolved container contains illegal entries (contains CDT_CONTAINER entries or null entries).
See Also:
  `PathEntryContainerInitializer`, `IPathEntryContainer`, `setPathEntryContainer(ICProject[], IPathEntryContainer, IProgressMonitor)`

#### setPathEntryContainer

    public static void setPathEntryContainer(ICProject[] affectedProjects,
                                             IPathEntryContainer container,
                                             IProgressMonitor monitor)
                                      throws CModelException

Bind a container reference path to some actual containers (`IPathEntryContainer`). This API must be invoked whenever changes in container need to be reflected onto the CModel.

In reaction to changing container values, the CModel will be updated to reflect the new state of the updated container.

This functionality cannot be used while the resource tree is locked.

PathEntry container values are persisted locally to the workspace, but are not preserved from a session to another. It is thus highly recommended to register a `PathEntryContainerInitializer` for each referenced container (through the extension point "org.eclipse.cdt.core.PathEntryContainerInitializer").

Note: setting a container to `null` will cause it to be lazily resolved again whenever its value is required. In particular, this will cause a registered initializer to be invoked again.

Parameters:
  `affectedProjects` - - the set of projects for which this container is being bound
  `container` - - the container for the affected projects
  `monitor` - a monitor to report progress
Throws:
  `CModelException`
See Also:
  `PathEntryContainerInitializer`, `getPathEntryContainer(IPath, ICProject)`, `IPathEntryContainer`

#### pathEntryContainerUpdates

    public static void pathEntryContainerUpdates(IPathEntryContainerExtension container,
                                                 PathEntryContainerChanged[] changes,
                                                 IProgressMonitor monitor)

Helper method use by a path entry container implementing `IPathEntryContainerExtension` It notify the model of changes. Note: the paths in the `PathEntryContainerChanged[]` array must be on source that the container was set too. If not the changes will be silently ignore.

Parameters:
  `container` -
  `changes` - array of changes.
  `monitor` - progress monitor

#### setRawPathEntries

    public static void setRawPathEntries(ICProject cproject,
                                         IPathEntry[] newEntries,
                                         IProgressMonitor monitor)
                                  throws CModelException

Sets the pathentries of this project using a list of entries.

Setting the pathentries to `null` specifies a default classpath (the project root). Setting the pathentry to an empty array specifies an empty pathentry.

Parameters:
  `newEntries` - a list of entries
  `monitor` - the given progress monitor
Throws:
  `CModelException` - if the entries could not be set. Reasons include:

#### getRawPathEntries

    public static IPathEntry[] getRawPathEntries(ICProject cproject)
                                          throws CModelException

Returns the raw pathentries for the project. This corresponds to the exact set of entries which were assigned using `setRawPathEntries`

Returns:
  the raw entires for the project
Throws:
  `CModelException` - if this element does not exist or if an exception occurs while accessing its corresponding resource
See Also:
  `IPathEntry`

#### getResolvedPathEntries

    public static IPathEntry[] getResolvedPathEntries(ICProject cproject)
                                               throws CModelException

This method returns the resolved pathentries for the project All pathEntry.CDT_CONTAINER entries in the project's will be replaced by the entries they resolve to.

The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.

Returns:
  the resolved entries for the project
Throws:
  `CModelException`
See Also:
  `IPathEntry`

#### getIncludeEntries

    public static IIncludeEntry[] getIncludeEntries(IPath path)
                                             throws CModelException

This method returns the include entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.

The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.

Returns:
  the include entries for the translation unit
Throws:
  `CModelException`
See Also:
  `IPathEntry`

#### getIncludeFileEntries

    public static IIncludeFileEntry[] getIncludeFileEntries(IPath path)
                                                     throws CModelException

This method returns the include file entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.

The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.

Returns:
  the include file entries for the translation unit
Throws:
  `CModelException`
See Also:
  `IPathEntry`

#### getMacroEntries

    public static IMacroEntry[] getMacroEntries(IPath path)
                                         throws CModelException

This method returns the macro entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.

The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.

Returns:
  the resolved entries for the project
Throws:
  `CModelException`
See Also:
  `IPathEntry`

#### getMacroFileEntries

    public static IMacroFileEntry[] getMacroFileEntries(IPath path)
                                                 throws CModelException

This method returns the macro file entries associated with a translation unit if the path does not refer to a valid translation unit an empty array is return.

The resulting resolved entries are accurate for the given point in time. If the project's raw entries are later modified they can become out of date. Because of this, hanging on resolved pathentries is not recommended.

Returns:
  the macro file entries for the translation unit
Throws:
  `CModelException`
See Also:
  `IPathEntry`

#### getPathEntryContainerInitializer

    public static PathEntryContainerInitializer getPathEntryContainerInitializer(String containerID)

Helper method finding the pathentry container initializer registered for a given container ID or `null` if none was found while iterating over the contributions to extension point to the extension point "org.eclipse.cdt.core.PathEntryContainerInitializer".

A containerID is the first segment of any container path, used to identify the registered container initializer.

Parameters:
  `containerID` - - a containerID identifying a registered initializer
Returns:
  ClasspathContainerInitializer - the registered classpath container initializer or `null` if none was found.

#### getPathEntryStore

    public static IPathEntryStore getPathEntryStore(IProject project)
                                             throws CoreException

Returns the IPathEntryStore of the project.

Throws:
  `CoreException`

#### setPathEntryStore

    public static void setPathEntryStore(IProject project,
                                         IPathEntryStore store)

Set in the map the store, but not persisted.

Parameters:
  `project` -
  `store` -

#### validatePathEntries

    public static ICModelStatus validatePathEntries(ICProject cProject,
                                                    IPathEntry[] entries)

Validate a given path entries for a project, using the following rules:

- Entries cannot collide with each other; that is, all entry paths must be unique.
- The output entry location path can be empty, if not they must be located inside the project.
- Source entry location can be null, if not they must be located inside the project,
- A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself).
- Source entries or output locations cannot coincide or be nested in each other, except for the following scenarios listed below:
  - A source folder can coincide with its own output location, in which case this output can then contain library archives. However, a specific output location cannot coincide with any library or a distinct source folder than the one referring to it.
  - A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one.
  - An output location can be nested in a source folder, if the source folder coincides with the project itself, or if the output location is excluded from the source folder.

Note that the entries are not validated automatically. Only bound variables or containers are considered in the checking process (this allows to perform a consistency check on an entry which has references to yet non existing projects, folders, ...).

This validation is intended to anticipate issues prior to assigning it to a project. In particular, it will automatically be performed during the setting operation (if validation fails, the classpath setting will not complete) and during `getResolvedPathEntries(org.eclipse.cdt.core.model.ICProject)`.

Parameters:
  `cProject` - the given C project
Returns:
  a status object with code `IStatus.OK` if the entries location are compatible, otherwise a status object indicating what is wrong with them

#### validatePathEntry

    public static ICModelStatus validatePathEntry(ICProject cProject,
                                                  IPathEntry entry,
                                                  boolean checkSourceAttachment,
                                                  boolean recurseInContainers)

Returns a C model status describing the problem related to this entry if any, a status object with code `IStatus.OK` if the entry is fine (that is, if the given entry denotes a valid element).

Parameters:
  `cProject` - the given C project
  `entry` - the given entry
  `checkSourceAttachment` - a flag to determine if source attachment should be checked
  `recurseInContainers` - flag indicating whether validation should be applied to container entries recursively
Returns:
  a c model status describing the problem related to this entry if any, a status object with code `IStatus.OK` if the entry is fine

#### getDefault

    public static CoreModel getDefault()

Returns the singleton.

#### addElementChangedListener

    public void addElementChangedListener(IElementChangedListener listener)

#### removeElementChangedListener

    public void removeElementChangedListener(IElementChangedListener listener)

Removes the given element changed listener. Has no affect if an identical listener is not registered.

Parameters:
  `listener` - the listener

#### startup

    public void startup()

See Also:
  `Plugin#startup`

#### shutdown

    public void shutdown()

#### run

    public static void run(IWorkspaceRunnable action,
                           IProgressMonitor monitor)
                    throws CoreException

Runs the given action as an atomic C model operation.

After running a method that modifies C elements, registered listeners receive after-the-fact notification of what just transpired, in the form of a element changed event. This method allows clients to call a number of methods that modify C elements and only have element changed event notifications reported at the end of the entire batch.

If this method is called outside the dynamic scope of another such call, this method runs the action and then reports a single element changed event describing the net effect of all changes done to C elements by the action.

If this method is called in the dynamic scope of another such call, this method simply runs the action.

Parameters:
  `action` - the action to perform
  `monitor` - a progress monitor, or `null` if progress reporting and cancellation are not desired
Throws:
  `CoreException` - if the operation failed.
Since:
  2.1

#### run

    public static void run(IWorkspaceRunnable action,
                           ISchedulingRule rule,
                           IProgressMonitor monitor)
                    throws CoreException

Runs the given action as an atomic C model operation.

After running a method that modifies C elements, registered listeners receive after-the-fact notification of what just transpired, in the form of a element changed event. This method allows clients to call a number of methods that modify C elements and only have element changed event notifications reported at the end of the entire batch.

If this method is called outside the dynamic scope of another such call, this method runs the action and then reports a single element changed event describing the net effect of all changes done to C elements by the action.

If this method is called in the dynamic scope of another such call, this method simply runs the action.

The supplied scheduling rule is used to determine whether this operation can be run simultaneously with workspace changes in other threads. See `IWorkspace#run` for more details.

Parameters:
  `action` - the action to perform
  `rule` - the scheduling rule to use when running this operation, or `null` if there are no scheduling restrictions for this operation.
  `monitor` - a progress monitor, or `null` if progress reporting and cancellation are not desired
Throws:
  `CoreException` - if the operation failed.
Since:
  3.0

#### isScannerInformationEmpty

    public static boolean isScannerInformationEmpty(IResource resource)

The method returns whether scanner information for a resource is empty or not. If `null` is supplied the method returns `true`.

Parameters:
  `resource` -
Since:
  3.0

#### createProjectDescription

    public org.eclipse.cdt.core.settings.model.ICProjectDescription createProjectDescription(IProject project,
                                                                                             boolean loadIfExists)
                                                                                      throws CoreException

This method is a full equivalent to `createProjectDescription(project, loadIfExists, false)`.

Throws:
  `CoreException`
See Also:
  `createProjectDescription(IProject, boolean, boolean)`

#### createProjectDescription

    public org.eclipse.cdt.core.settings.model.ICProjectDescription createProjectDescription(IProject project,
                                                                                             boolean loadIfExists,
                                                                                             boolean creating)
                                                                                      throws CoreException

Creates and returns a writable project description

Parameters:
  `project` - project for which the project description is requested
  `loadIfExists` - if true the method first tries to load and return the project description from the settings file (.cproject) if false, the stored settings are ignored and the new (empty) project description is created
  `creating` - if true the created project description will be contain the true "isCdtProjectCreating" state. NOTE: in case the project already contains the project description AND its "isCdtProjectCreating" is false the resulting description will be created with the false "isCdtProjectCreating" state NOTE: changes made to the returned project description will not be applied until the `setProjectDescription(IProject, ICProjectDescription)` is called
Returns:
  `ICProjectDescription`
Throws:
  `CoreException`

#### getProjectDescription

    public org.eclipse.cdt.core.settings.model.ICProjectDescription getProjectDescription(IProject project)

Returns the project description associated with this project or null if the project does not contain the CDT data associated with it. this is a convenience method fully equivalent to getProjectDescription(project, true) see `getProjectDescription(IProject, boolean)` for more detail

Parameters:
  `project` -
Returns:
  a writable copy of the ICProjectDescription or null if the project does not contain the CDT data associated with it. Note: changes to the project description will not be reflected/used by the core until the `setProjectDescription(IProject, ICProjectDescription)` is called
See Also:
  `getProjectDescription(IProject, boolean)`

#### setProjectDescription

    public void setProjectDescription(IProject project,
                                      org.eclipse.cdt.core.settings.model.ICProjectDescription des)
                               throws CoreException

This method is called to save/apply the project description the method should be called to apply changes made to the project description returned by the `getProjectDescription(IProject, boolean)` or `createProjectDescription(IProject, boolean)`

Parameters:
  `project` -
  `des` -
Throws:
  `CoreException`
See Also:
  `getProjectDescription(IProject, boolean)`, `createProjectDescription(IProject, boolean)`

#### setProjectDescription

    public void setProjectDescription(IProject project,
                                      org.eclipse.cdt.core.settings.model.ICProjectDescription des,
                                      boolean force,
                                      IProgressMonitor monitor)
                               throws CoreException

Throws:
  `CoreException`

#### getProjectDescription

    public org.eclipse.cdt.core.settings.model.ICProjectDescription getProjectDescription(IProject project,
                                                                                          boolean write)

returns the project description associated with this project or null if the project does not contain the CDT data associated with it.

Parameters:
  `project` - project for which the description is requested
  `write` - if true, the writable description copy is returned. If false the cached read-only description is returned. CDT core maintains the cached project description settings. If only read access is needed to description, then the read-only project description should be obtained. This description always operates with cached data and thus it is better to use it for performance reasons All set* calls to the read-only description result in the `WriteAccessException` When the writable description is requested, the description copy is created. Changes to this description will not be reflected/used by the core and Build System until the `setProjectDescription(IProject, ICProjectDescription)` is called Each getProjectDescription(project, true) returns a new copy of the project description The writable description uses the cached data untill the first set call after that the description communicates directly to the Build System i.e. the implementer of the org.eclipse.cdt.core.CConfigurationDataProvider extension This ensures the Core<->Build System settings integrity
Returns:
  `ICProjectDescription` or null if the project does not contain the CDT data associated with it.

#### updateProjectDescriptions

    public void updateProjectDescriptions(IProject[] projects,
                                          IProgressMonitor monitor)
                                   throws CoreException

Forces the cached data of the specified projects to be re-calculated. If the `projects` argument is `null`, all projects within the workspace are updated.

Parameters:
  `projects` -
  `monitor` -
Throws:
  `CoreException`

#### isNewStyleProject

    public boolean isNewStyleProject(IProject project)

Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven.

#### addCProjectDescriptionListener

    public void addCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener,
                                               int eventTypes)

#### removeCProjectDescriptionListener

    public void removeCProjectDescriptionListener(org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener listener)

#### getProjectDescriptionManager

    public org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager getProjectDescriptionManager()