Methods Summary |
---|
public void | addIfAbsent(makedep.FileList s)
for (Iterator iter = iterator(); iter.hasNext(); ) {
if (iter.next() == s) {
return;
}
}
add(s);
|
public boolean | compareLists(makedep.FileList s)
Iterator myIter = iterator();
Iterator hisIter = s.iterator();
while (myIter.hasNext() &&
hisIter.hasNext()) {
// crude: order dependent
FileList myElement = (FileList) myIter.next();
FileList hisElement = (FileList) hisIter.next();
if (!plat.fileNameStringEquality(myElement.name,
hisElement.name)) {
return false;
}
}
if (myIter.hasNext() != hisIter.hasNext()) {
// One ended earlier
return false;
}
return true;
|
public makedep.FileList | doCFile()
FileList s = new FileList(name, plat);
s.useGrandInclude = useGrandInclude; // propagate this
doFiles(s);
for (Iterator iter = s.iterator(); iter.hasNext(); ) {
FileList l = (FileList) iter.next();
l.beenHere = false;
}
return s;
|
public boolean | doFiles(makedep.FileList s)
boolean result = true;
for (Iterator iter = iterator(); iter.hasNext(); ) {
FileList h = (FileList) iter.next();
if (h.platformDependentInclude != null) {
System.err.println("Error: the source for " +
h.platformDependentInclude +
" is " + h.name + ".");
System.err.println("\tIt shouldn't be included directly by " +
name + ".");
h.platformDependentInclude = null; // report once per file
result = false;
}
h.doHFile(s);
}
return result;
|
public void | doHFile(makedep.FileList s)
if (beenHere) {
if (mayBeCycle) {
traceCycle(this);
}
return;
}
beenHere = true;
mayBeCycle = true;
doFiles(s);
mayBeCycle = false;
s.add(this);
|
public boolean | equals(java.lang.Object o)
return ((Object) this) == o;
|
public int | getCount()
return count;
|
public java.lang.String | getName()
return name;
|
public java.lang.String | getPlatformDependentInclude()
return platformDependentInclude;
|
public boolean | getUseGrandInclude()
return useGrandInclude;
|
public boolean | hasListForFile(java.lang.String fileName)
for (Iterator iter = iterator(); iter.hasNext(); ) {
FileList fl = (FileList) iter.next();
if (plat.fileNameStringEquality(fl.name, fileName)) {
plat.fileNamePortabilityCheck(fl.name, fileName);
return true;
}
}
return false;
|
public void | incrementCount()
count++;
|
public makedep.FileList | listForFile(java.lang.String fileName)
for (Iterator iter = iterator(); iter.hasNext(); ) {
FileList fl = (FileList) iter.next();
if (plat.fileNameStringEquality(fl.name, fileName)) {
plat.fileNamePortabilityCheck(fl.name, fileName);
return fl;
}
}
plat.fileNamePortabilityCheck(fileName);
FileList newList = new FileList(fileName, plat);
add(newList);
return newList;
|
public void | putInclFile(Database db)if .h file is included thresh times, put it in the grand
include file
boolean needline = true;
FileName inclName = plat.getInclFileTemplate().copyStem(name);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter writer = new OutputStreamWriter(baos);
PrintWriter inclFile = new PrintWriter(writer);
if (plat.haveGrandInclude() && plat.includeGIInEachIncl()) {
inclFile.println("# include \"" +
plat.getGIFileTemplate().dirPreStemAltSuff() +
"\"");
needline = false;
}
for (Iterator iter = iterator(); iter.hasNext(); ) {
FileList hfile = (FileList) iter.next();
if (!db.hfileIsInGrandInclude(hfile, this)) {
String incname = plat.getInclFileTemplate().getInvDir() +
db.tryGetFullPath(hfile.name);
incname = plat.translateFileName(incname);
inclFile.println("#include \"" + incname + "\"");
needline = false;
}
}
// Solaris C++ in strict mode warns about empty files
if (needline) {
inclFile.println();
}
inclFile.flush();
Database.updateFile(inclName.dirPreStemSuff(), baos);
inclFile.close();
|
public void | setFirstFile(makedep.FileList s)
// Remove the file list if it's already here
remove(s);
add(0, s);
|
public void | setLastFile(makedep.FileList s)
// Remove the file list if it's already here
remove(s);
add(s);
|
public void | setPlatformDependentInclude(java.lang.String arg)
platformDependentInclude = arg;
|
public void | setUseGrandInclude(boolean arg)
useGrandInclude = arg;
|
public void | sortByName()
Collections.sort(this, new Comparator() {
public int compare(Object o1, Object o2) {
FileList fl1 = (FileList) o1;
FileList fl2 = (FileList) o2;
return fl1.getName().compareTo(fl2.getName());
}
});
|
public void | traceCycle(makedep.FileList s)
if (isCycle) // already traced
return;
isCycle = true;
System.err.println("\ttracing cycle for " + name);
// IMPL_NOTE: must return status in caller routine
// exitCode = 1;
for (Iterator iter = iterator(); iter.hasNext(); ) {
FileList q = (FileList) iter.next();
if (q.mayBeCycle) {
if (s == q) {
plat.fatalError("\tend of cycle for " + s.getName());
} else {
q.traceCycle(s);
}
}
}
|