Package org.eclipse.cdt.core.model
Interface ICProject
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
,IBufferChangedListener
,ICElement
,IOpenable
,IParent
A C project represents a view of a project resource in terms of C
elements such as , ICContainer, ITranslationUnit ....
CoreModel.create(project)
.
- See Also:
- 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 inherited from interface org.eclipse.cdt.core.model.ICElement
ASM_LABEL, C_ARCHIVE, C_BINARY, C_CCONTAINER, C_CLASS, C_CLASS_CTOR, C_CLASS_DECLARATION, C_CLASS_DTOR, C_ENUMERATION, C_ENUMERATOR, C_FIELD, C_FUNCTION, C_FUNCTION_DECLARATION, C_INCLUDE, C_MACRO, C_METHOD, C_METHOD_DECLARATION, C_MODEL, C_NAMESPACE, C_PRAGMA, C_PROJECT, C_STORAGE_EXTERN, C_STORAGE_STATIC, C_STRUCT, C_STRUCT_DECLARATION, C_TEMPLATE_CLASS, C_TEMPLATE_CLASS_DECLARATION, C_TEMPLATE_FUNCTION, C_TEMPLATE_FUNCTION_DECLARATION, C_TEMPLATE_METHOD, C_TEMPLATE_METHOD_DECLARATION, C_TEMPLATE_STRUCT, C_TEMPLATE_STRUCT_DECLARATION, C_TEMPLATE_UNION, C_TEMPLATE_UNION_DECLARATION, C_TEMPLATE_VARIABLE, C_TYPEDEF, C_UNION, C_UNION_DECLARATION, C_UNIT, C_UNKNOWN_DECLARATION, C_USING, C_VARIABLE, C_VARIABLE_DECLARATION, C_VARIABLE_LOCAL, C_VCONTAINER, CPP_FRIEND, CPP_PRIVATE, CPP_PROTECTED, CPP_PUBLIC, EMPTY_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionfindElement
(org.eclipse.core.runtime.IPath path) Returns theICElement
corresponding to the given path, ornull
if no suchICElement
is found.findSourceRoot
(org.eclipse.core.resources.IResource resource) findSourceRoot
(org.eclipse.core.runtime.IPath path) Returns all of the existing source roots that exist on the project, in the order they are defined by the ".cdtproject".Return the ArchiveContainer of this Project.Return the BinaryContainer of this Project.Return the include paths set on the project.Return the library references for this project.Object[]
Returns an array of non-C resources directly contained in this project.Helper method for returning one option value only.getOptions
(boolean inheritCCoreOptions) Returns the table of the current custom options for this project.Return the output entries.org.eclipse.core.resources.IProject
Returns the list of entries for the project.String[]
Returns the names of the projects that are directly required by this project.Returns the list of entries for the project.getSourceRoot
(ISourceEntry entry) Returns the source root folders of the project.boolean
isOnOutputEntry
(org.eclipse.core.resources.IResource resource) boolean
isOnSourceRoot
(ICElement element) boolean
isOnSourceRoot
(org.eclipse.core.resources.IResource resource) void
Helper method for setting one option value only.void
setOptions
(Map<String, String> newOptions) Sets the project custom options.void
setRawPathEntries
(IPathEntry[] entries, org.eclipse.core.runtime.IProgressMonitor monitor) Sets the entries for this project.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.cdt.core.model.IBufferChangedListener
bufferChanged
Methods inherited from interface org.eclipse.cdt.core.model.ICElement
accept, exists, getAncestor, getCModel, getCProject, getElementName, getElementType, getHandleIdentifier, getLocationURI, getParent, getPath, getResource, getUnderlyingResource, isReadOnly, isStructureKnown
Methods inherited from interface org.eclipse.cdt.core.model.IOpenable
close, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, makeConsistent, open, save
Methods inherited from interface org.eclipse.cdt.core.model.IParent
getChildren, getChildrenOfType, hasChildren
-
Method Details
-
findElement
Returns theICElement
corresponding to the given path, ornull
if no suchICElement
is found.- Throws:
CModelException
- if the given path isnull
or absolute
-
getArchiveContainer
Return the ArchiveContainer of this Project.- Throws:
CModelException
-
getBinaryContainer
Return the BinaryContainer of this Project.- Throws:
CModelException
-
getSourceRoots
Returns the source root folders of the project.NOTE: This is equivalent to
getChildren()
.- Returns:
- ISourceRoot - root folders
- Throws:
CModelException
-
getAllSourceRoots
Returns all of the existing source roots that exist on the project, in the order they are defined by the ".cdtproject".- Returns:
- all of the existing source roots
- Throws:
CModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-
getSourceRoot
- Parameters:
entry
-- Returns:
- ISourceRoot
- Throws:
CModelException
-
findSourceRoot
-
findSourceRoot
-
getOutputEntries
Return the output entries.- Throws:
CModelException
-
isOnOutputEntry
boolean isOnOutputEntry(org.eclipse.core.resources.IResource resource) - Parameters:
resource
-
-
isOnSourceRoot
boolean isOnSourceRoot(org.eclipse.core.resources.IResource resource) - Parameters:
resource
-
-
isOnSourceRoot
- Parameters:
element
-
-
getLibraryReferences
Return the library references for this project.- Returns:
- [] ILibraryReference
- Throws:
CModelException
-
getIncludeReferences
Return the include paths set on the project.- Throws:
CModelException
-
getRequiredProjectNames
Returns the names of the projects that are directly required by this project. A project is required if it is in its cpath entries.The project names are returned in the order they appear on the cpathentries.
- Returns:
- the names of the projects that are directly required by this project
- Throws:
CModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-
getProject
org.eclipse.core.resources.IProject getProject()- Returns:
- IProject
-
getOption
Helper method for returning one option value only. Equivalent to(String)this.getOptions(inheritCCoreOptions).get(optionName)
Note that it may answernull
if this option does not exist, or if there is no custom value for it.For a complete description of the configurable options, see
CCorePlugin#getDefaultOptions
.- Parameters:
optionName
- the name of an optioninheritCCoreOptions
- - boolean indicating whether CCorePlugin options should be inherited as well- Returns:
- the String value of a given option
- See Also:
-
getOptions
Returns the table of the current custom options for this project. Projects remember their custom options, in other words, only the options different from the the CCorePlugin global options for the workspace. A boolean argument allows to directly merge the project options with global ones fromCCorePlugin
.For a complete description of the configurable options, see
CCorePlugin#getDefaultOptions
.- Parameters:
inheritCCoreOptions
- - boolean indicating whether CCorePlugin options should be inherited as well- Returns:
- table of current settings of all options
(key type:
String
; value type:String
) - See Also:
-
setOption
Helper method for setting one option value only. Equivalent toMap options = this.getOptions(false); map.put(optionName, optionValue); this.setOptions(map)
For a complete description of the configurable options, see
CCorePlugin#getDefaultOptions
.- Parameters:
optionName
- the name of an optionoptionValue
- the value of the option to set- See Also:
-
setOptions
Sets the project custom options. All and only the options explicitly included in the given table are remembered; all previous option settings are forgotten, including ones not explicitly mentioned.For a complete description of the configurable options, see
CCorePlugin#getDefaultOptions
.- Parameters:
newOptions
- the new options (key type:String
; value type:String
), ornull
to flush all custom options (clients will automatically get the global CCorePlugin options).- See Also:
-
getResolvedPathEntries
Returns the list of entries for the project. This corresponds to the exact set of entries which were assigned usingsetCPathEntries
.- Returns:
- the list of entries for the project.
- Throws:
CModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-
getRawPathEntries
Returns the list of entries for the project. This corresponds to the exact set of entries which were assigned usingsetCPathEntries
.- Returns:
- the list of entries for the project.
- Throws:
CModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-
setRawPathEntries
void setRawPathEntries(IPathEntry[] entries, org.eclipse.core.runtime.IProgressMonitor monitor) throws CModelException Sets the entries for this project.- Parameters:
entries
- a list of IPathEntry[] entriesmonitor
- the given progress monitor- Throws:
CModelException
- if the entries could not be set. Reasons include:- This C/C++ element does not exist (ELEMENT_DOES_NOT_EXIST)
- The entries are being modified during resource change event notification (CORE_EXCEPTION)
-
getNonCResources
Returns an array of non-C resources directly contained in this project. It does not transitively answer non-C resources contained in folders; these would have to be explicitly iterated over.Non-C resources includes files, folders, projects not accounted for.
- Returns:
- an array of non-C resources directly contained in this project
- Throws:
CModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-