mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Initial C++.Net MBS support.
This commit is contained in:
parent
af47333e04
commit
b458382d75
1 changed files with 30 additions and 0 deletions
|
@ -265,4 +265,34 @@ public class PDOMFile {
|
|||
return (PDOMFile[])values.toArray(new PDOMFile[values.size()]);
|
||||
}
|
||||
|
||||
public PDOMFile[] getAllIncludes() throws CoreException {
|
||||
Map files = new HashMap();
|
||||
LinkedList todo = new LinkedList();
|
||||
|
||||
// Add me in to make sure we don't get caught in a circular include
|
||||
IString myFileName = getFileName();
|
||||
files.put(myFileName, this);
|
||||
|
||||
todo.addLast(this);
|
||||
while (todo.size() > 0) {
|
||||
PDOMFile file = (PDOMFile)todo.removeFirst();
|
||||
PDOMInclude include = file.getFirstInclude();
|
||||
while (include != null) {
|
||||
PDOMFile incFile = include.getIncludes();
|
||||
IString incFileName = incFile.getFileName();
|
||||
if (files.get(incFileName) == null) {
|
||||
files.put(incFileName, incFile);
|
||||
todo.addLast(incFile);
|
||||
}
|
||||
include = include.getNextInIncludes();
|
||||
}
|
||||
}
|
||||
|
||||
// Now remove me
|
||||
files.remove(myFileName);
|
||||
|
||||
Collection values = files.values();
|
||||
return (PDOMFile[])values.toArray(new PDOMFile[values.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue