Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Creating a CDT_INCLUDE IPathEntry for a filesystem path

All,

Any clues on how to programmatically create a CDT_INCLUDE type IPathEntry
for a standard make project that references a filesystem location?

Currently, I have code that works with paths within the project:

for (int i = 0; i < includePaths.length; i++) {
      currentElement = new CPElement(cProj, IPathEntry.CDT_INCLUDE,
proj.getFullPath(), proj.getFolder(includePaths[i]));
      currentElement.setAttribute(CPElement.INCLUDE,
proj.getFolder(includePaths[i]).getLocation());
      checkedPaths.add(currentElement.getPathEntry());
}
cProj.setRawPathEntries((IPathEntry[]) checkedPaths.toArray(new
IPathEntry[] {}), new SubProgressMonitor(monitor, 7));

But, what if includePaths[i] == C:\Local_Includes?  How do I add this as a
valid IPathEntry?  I tried creating a simple PathEntry() object, but got a
ClassCastException down the road.  I then looked at the constructor
parameters for IncludeEntry:

IPath resourcePath,
IPath basePath,
IPath baseRef,
IPath includePath,
boolean isSystemInclude,
IPath[] exclusionPatterns,
boolean isExported

...but, I don't know what these parameters expect from a filesystem path.

Thanks,

Chad Barnes
Rockwell Collins, Inc.



Back to the top