/** Computes the dependencies between directories */ void DirDef::computeDependencies() { FileList *fl = m_fileList; if (fl) { QListIterator<FileDef> fli(*fl); FileDef *fd; for (fli.toFirst();(fd=fli.current());++fli) // foreach file in dir dd { //printf(" File %s\n",fd->name().data()); //printf("** dir=%s file=%s\n",shortName().data(),fd->name().data()); QList<IncludeInfo> *ifl = fd->includeFileList(); if (ifl) { QListIterator<IncludeInfo> ifli(*ifl); IncludeInfo *ii; for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file { //printf(" > %s\n",ii->includeName.data()); //printf(" #include %s\n",ii->includeName.data()); if (ii->fileDef && ii->fileDef->isLinkable()) // linkable file { DirDef *usedDir = ii->fileDef->getDirDef(); if (usedDir) { // add dependency: thisDir->usedDir //static int count=0; //printf(" %d: add dependency %s->%s\n",count++,name().data(),usedDir->name().data()); addUsesDependency(usedDir,fd,ii->fileDef,FALSE); } } } } } } if (m_usedDirs) { QDictIterator<UsedDir> udi(*m_usedDirs); UsedDir *udir; for (udi.toFirst();(udir=udi.current());++udi) { udir->sort(); } } }
/*! Writes the sorted list of index items into a html like list. * * An list of calls with <code>name = level1,level2</code> as follows: * <pre> * a1,b1 * a1,b2 * a2,b1 * a2,b2 * a3 * a4,b1 * </pre> * * Will result in the following list: * * <pre> * a1 -> link to url if hasLink==TRUE * b1 -> link to url#anchor * b2 -> link to url#anchor * a2 -> link to url if hasLink==TRUE * b1 -> link to url#anchor * b2 -> link to url#anchor * a3 -> link to url if hasLink==TRUE * a4 -> link to url if hasLink==TRUE * b1 -> link to url#anchor * </pre> */ void HtmlHelpIndex::writeFields(FTextStream &t) { dict->sort(); IndexFieldSDict::Iterator ifli(*dict); IndexField *f; QCString lastLevel1; bool level2Started=FALSE; for (;(f=ifli.current());++ifli) { QCString level1,level2; int i; if ((i=f->name.find('?'))!=-1) { level1 = f->name.left(i); level2 = f->name.right(f->name.length()-i-1); } else { level1 = f->name.copy(); } if (level1!=lastLevel1) { // finish old list at level 2 if (level2Started) t << " </UL>" << endl; level2Started=FALSE; // <Antony> // Added this code so that an item with only one subitem is written // without any subitem. // For example: // a1, b1 -> will create only a1, not separate subitem for b1 // a2, b2 // a2, b3 QCString nextLevel1; IndexField* fnext = ++ifli; if (fnext) { nextLevel1 = fnext->name.left(fnext->name.find('?')); --ifli; } if (level1 != nextLevel1) { level2 = ""; } // </Antony> if (level2.isEmpty()) { t << " <LI><OBJECT type=\"text/sitemap\">"; t << "<param name=\"Local\" value=\"" << f->url << Doxygen::htmlFileExtension; if (!f->anchor.isEmpty() && f->reversed) t << "#" << f->anchor; t << "\">"; t << "<param name=\"Name\" value=\"" << level1 << "\">" "</OBJECT>\n"; } else { if (f->link) { t << " <LI><OBJECT type=\"text/sitemap\">"; t << "<param name=\"Local\" value=\"" << f->url << Doxygen::htmlFileExtension; if (!f->anchor.isEmpty() && f->reversed) t << "#" << f->anchor; t << "\">"; t << "<param name=\"Name\" value=\"" << level1 << "\">" "</OBJECT>\n"; } else { t << " <LI><OBJECT type=\"text/sitemap\">"; t << "<param name=\"See Also\" value=\"" << level1 << "\">"; t << "<param name=\"Name\" value=\"" << level1 << "\">" "</OBJECT>\n"; } } } if (!level2Started && !level2.isEmpty()) { // start new list at level 2 t << " <UL>" << endl; level2Started=TRUE; } else if (level2Started && level2.isEmpty()) { // end list at level 2 t << " </UL>" << endl; level2Started=FALSE; } if (level2Started) { t << " <LI><OBJECT type=\"text/sitemap\">"; t << "<param name=\"Local\" value=\"" << f->url << Doxygen::htmlFileExtension; if (!f->anchor.isEmpty()) t << "#" << f->anchor; t << "\">"; t << "<param name=\"Name\" value=\"" << level2 << "\">" "</OBJECT>\n"; } lastLevel1 = level1.copy(); } if (level2Started) t << " </UL>" << endl; }