Package org.eclipse.cdt.core.model
Interface ICProject
-
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
,IBufferChangedListener
,ICElement
,IOpenable
,IParent
public interface ICProject extends IParent, IOpenable, ICElement
A C project represents a view of a project resource in terms of C elements such as , ICContainer, ITranslationUnit ....CoreModel.create(project)
.- See Also:
CoreModel.create(org.eclipse.core.resources.IProject)
- 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ICElement
findElement(org.eclipse.core.runtime.IPath path)
Returns theICElement
corresponding to the given path, ornull
if no suchICElement
is found.ISourceRoot
findSourceRoot(org.eclipse.core.resources.IResource resource)
ISourceRoot
findSourceRoot(org.eclipse.core.runtime.IPath path)
ISourceRoot[]
getAllSourceRoots()
Returns all of the existing source roots that exist on the project, in the order they are defined by the ".cdtproject".IArchiveContainer
getArchiveContainer()
Return the ArchiveContainer of this Project.IBinaryContainer
getBinaryContainer()
Return the BinaryContainer of this Project.IIncludeReference[]
getIncludeReferences()
Return the include paths set on the project.ILibraryReference[]
getLibraryReferences()
Return the library references for this project.Object[]
getNonCResources()
Returns an array of non-C resources directly contained in this project.String
getOption(String optionName, boolean inheritCCoreOptions)
Helper method for returning one option value only.Map<String,String>
getOptions(boolean inheritCCoreOptions)
Returns the table of the current custom options for this project.IOutputEntry[]
getOutputEntries()
Return the output entries.org.eclipse.core.resources.IProject
getProject()
IPathEntry[]
getRawPathEntries()
Returns the list of entries for the project.String[]
getRequiredProjectNames()
Returns the names of the projects that are directly required by this project.IPathEntry[]
getResolvedPathEntries()
Returns the list of entries for the project.ISourceRoot
getSourceRoot(ISourceEntry entry)
ISourceRoot[]
getSourceRoots()
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
setOption(String optionName, String optionValue)
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.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 Detail
-
findElement
ICElement findElement(org.eclipse.core.runtime.IPath path) throws CModelException
Returns theICElement
corresponding to the given path, ornull
if no suchICElement
is found.- Throws:
CModelException
- if the given path isnull
or absolute
-
getArchiveContainer
IArchiveContainer getArchiveContainer() throws CModelException
Return the ArchiveContainer of this Project.- Throws:
CModelException
-
getBinaryContainer
IBinaryContainer getBinaryContainer() throws CModelException
Return the BinaryContainer of this Project.- Throws:
CModelException
-
getSourceRoots
ISourceRoot[] getSourceRoots() throws CModelException
Returns the source root folders of the project.NOTE: This is equivalent to
getChildren()
.- Returns:
- ISourceRoot - root folders
- Throws:
CModelException
-
getAllSourceRoots
ISourceRoot[] getAllSourceRoots() throws CModelException
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
ISourceRoot getSourceRoot(ISourceEntry entry) throws CModelException
- Parameters:
entry
-- Returns:
- ISourceRoot
- Throws:
CModelException
-
findSourceRoot
ISourceRoot findSourceRoot(org.eclipse.core.resources.IResource resource)
-
findSourceRoot
ISourceRoot findSourceRoot(org.eclipse.core.runtime.IPath path)
-
getOutputEntries
IOutputEntry[] getOutputEntries() throws CModelException
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
boolean isOnSourceRoot(ICElement element)
- Parameters:
element
-
-
getLibraryReferences
ILibraryReference[] getLibraryReferences() throws CModelException
Return the library references for this project.- Returns:
- [] ILibraryReference
- Throws:
CModelException
-
getIncludeReferences
IIncludeReference[] getIncludeReferences() throws CModelException
Return the include paths set on the project.- Throws:
CModelException
-
getRequiredProjectNames
String[] getRequiredProjectNames() throws CModelException
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
String getOption(String optionName, boolean inheritCCoreOptions)
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:
CCorePlugin.getDefaultOptions()
-
getOptions
Map<String,String> getOptions(boolean inheritCCoreOptions)
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:
CCorePlugin.getDefaultOptions()
-
setOption
void setOption(String optionName, String optionValue)
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:
CCorePlugin.getDefaultOptions()
-
setOptions
void setOptions(Map<String,String> newOptions)
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:
CCorePlugin.getDefaultOptions()
-
getResolvedPathEntries
IPathEntry[] getResolvedPathEntries() throws CModelException
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
IPathEntry[] getRawPathEntries() throws CModelException
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
Object[] getNonCResources() throws CModelException
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
-
-