Interface ICProject

    • Method Detail

      • 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
      • 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
      • findSourceRoot

        ISourceRoot findSourceRoot​(org.eclipse.core.resources.IResource resource)
      • findSourceRoot

        ISourceRoot findSourceRoot​(org.eclipse.core.runtime.IPath path)
      • 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 -
      • 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:
        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 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:
        CCorePlugin.getDefaultOptions()
      • 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:
        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), or null 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 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