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:
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.
  • Method Details

    • findElement

      ICElement findElement(org.eclipse.core.runtime.IPath path) throws CModelException
      Returns the ICElement corresponding to the given path, or null if no such ICElement is found.
      Throws:
      CModelException - if the given path is null 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 answer null 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 option
      inheritCCoreOptions - - boolean indicating whether CCorePlugin options should be inherited as well
      Returns:
      the String value of a given option
      See Also:
    • 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 from CCorePlugin.

      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

      void setOption(String optionName, String optionValue)
      Helper method for setting one option value only. Equivalent to Map 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 option
      optionValue - the value of the option to set
      See Also:
    • 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), or null to flush all custom options (clients will automatically get the global CCorePlugin options).
      See Also:
    • getResolvedPathEntries

      IPathEntry[] getResolvedPathEntries() throws CModelException
      Returns the list of entries for the project. This corresponds to the exact set of entries which were assigned using setCPathEntries.

      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 using setCPathEntries.

      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[] entries
      monitor - 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