diff options
Diffstat (limited to 'src/dirdef.cpp')
-rw-r--r-- | src/dirdef.cpp | 95 |
1 files changed, 46 insertions, 49 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 81245e3..70ca3c0 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -14,6 +14,7 @@ #include "config.h" #include "docparser.h" #include "definitionimpl.h" +#include "filedef.h" //---------------------------------------------------------------------- @@ -103,7 +104,7 @@ DirDefImpl::DirDefImpl(const char *path) : DefinitionImpl(path,1,1,path) m_shortName = m_shortName.left(m_shortName.length()-1); } int pi=m_shortName.findRev('/'); - if (pi!=-1) + if (pi!=-1) { // remove everything till the last / m_shortName = m_shortName.mid(pi+1); } @@ -113,7 +114,7 @@ DirDefImpl::DirDefImpl(const char *path) : DefinitionImpl(path,1,1,path) { // strip trailing / m_dispName = m_dispName.left(m_dispName.length()-1); } - + m_fileList = new FileList; m_usedDirs = new QDict<UsedDir>(257); m_usedDirs->setAutoDelete(TRUE); @@ -128,14 +129,14 @@ DirDefImpl::~DirDefImpl() delete m_usedDirs; } -bool DirDefImpl::isLinkableInProject() const -{ - return !isReference(); +bool DirDefImpl::isLinkableInProject() const +{ + return !isReference(); } -bool DirDefImpl::isLinkable() const -{ - return isReference() || isLinkableInProject(); +bool DirDefImpl::isLinkable() const +{ + return isReference() || isLinkableInProject(); } void DirDefImpl::addSubDir(DirDef *subdir) @@ -203,7 +204,7 @@ QCString DirDefImpl::getOutputFileBase() const void DirDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title) { - if ((!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF)) || + if ((!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF)) || !documentation().isEmpty()) { ol.pushGeneratorState(); @@ -224,7 +225,7 @@ void DirDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title) ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE); } // separator between brief and details - if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) && + if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) && !documentation().isEmpty()) { ol.pushGeneratorState(); @@ -495,7 +496,7 @@ void DirDefImpl::writeDocumentation(OutputList &ol) { static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); ol.pushGeneratorState(); - + QCString title=theTranslator->trDirReference(m_dispName); startFile(ol,getOutputFileBase(),name(),title,HLI_Files,!generateTreeView); @@ -527,25 +528,25 @@ void DirDefImpl::writeDocumentation(OutputList &ol) { switch (lde->kind()) { - case LayoutDocEntry::BriefDesc: + case LayoutDocEntry::BriefDesc: writeBriefDescription(ol); - break; - case LayoutDocEntry::DirGraph: + break; + case LayoutDocEntry::DirGraph: writeDirectoryGraph(ol); - break; - case LayoutDocEntry::MemberDeclStart: + break; + case LayoutDocEntry::MemberDeclStart: startMemberDeclarations(ol); - break; - case LayoutDocEntry::DirSubDirs: + break; + case LayoutDocEntry::DirSubDirs: writeSubDirList(ol); - break; - case LayoutDocEntry::DirFiles: + break; + case LayoutDocEntry::DirFiles: writeFileList(ol); - break; - case LayoutDocEntry::MemberDeclEnd: + break; + case LayoutDocEntry::MemberDeclEnd: endMemberDeclarations(ol); break; - case LayoutDocEntry::DetailedDesc: + case LayoutDocEntry::DetailedDesc: { LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; writeDetailedDescription(ol,ls->title(lang)); @@ -573,16 +574,16 @@ void DirDefImpl::writeDocumentation(OutputList &ol) case LayoutDocEntry::FileConstantGroups: case LayoutDocEntry::FileIncludes: case LayoutDocEntry::FileIncludeGraph: - case LayoutDocEntry::FileIncludedByGraph: + case LayoutDocEntry::FileIncludedByGraph: case LayoutDocEntry::FileSourceLink: case LayoutDocEntry::FileInlineClasses: - case LayoutDocEntry::GroupClasses: - case LayoutDocEntry::GroupInlineClasses: + case LayoutDocEntry::GroupClasses: + case LayoutDocEntry::GroupInlineClasses: case LayoutDocEntry::GroupNamespaces: - case LayoutDocEntry::GroupDirs: - case LayoutDocEntry::GroupNestedGroups: + case LayoutDocEntry::GroupDirs: + case LayoutDocEntry::GroupNestedGroups: case LayoutDocEntry::GroupFiles: - case LayoutDocEntry::GroupGraph: + case LayoutDocEntry::GroupGraph: case LayoutDocEntry::GroupPageDocs: case LayoutDocEntry::AuthorSection: case LayoutDocEntry::MemberGroups: @@ -624,7 +625,7 @@ void DirDefImpl::setLevel() /** Add as "uses" dependency between \a this dir and \a dir, * that was caused by a dependency on file \a fd. - */ + */ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd, FileDef *dstFd,bool inherited) { @@ -646,7 +647,7 @@ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd, if (usedPair==0) // new file dependency { //printf(" => new file\n"); - usedDir->addFileDep(srcFd,dstFd); + usedDir->addFileDep(srcFd,dstFd); added=TRUE; } else @@ -658,7 +659,7 @@ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd, { //printf(" => new file\n"); usedDir = new UsedDir(dir,inherited); - usedDir->addFileDep(srcFd,dstFd); + usedDir->addFileDep(srcFd,dstFd); m_usedDirs->insert(dir->getOutputFileBase(),usedDir); added=TRUE; } @@ -682,7 +683,7 @@ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd, void DirDefImpl::computeDependencies() { FileList *fl = m_fileList; - if (fl) + if (fl) { QListIterator<FileDef> fli(*fl); FileDef *fd; @@ -693,7 +694,7 @@ void DirDefImpl::computeDependencies() QList<IncludeInfo> *ifl = fd->includeFileList(); if (ifl) { - QListIterator<IncludeInfo> ifli(*ifl); + QListIterator<IncludeInfo> ifli(*ifl); IncludeInfo *ii; for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file { @@ -727,10 +728,10 @@ void DirDefImpl::computeDependencies() bool DirDefImpl::isParentOf(const DirDef *dir) const { - if (dir->parent()==this) // this is a parent of dir + if (dir->parent()==this) // this is a parent of dir return TRUE; else if (dir->parent()) // repeat for the parent of dir - return isParentOf(dir->parent()); + return isParentOf(dir->parent()); else return FALSE; } @@ -822,7 +823,7 @@ DirDef *DirDefImpl::mergeDirectoryInTree(const QCString &path) QCString part=path.left(i+1); if (!matchPath(part,Config_getList(STRIP_FROM_PATH)) && (part!="/" && part!="//")) { - dir=createNewDir(part); + dir=createNewDir(part); } p=i+1; } @@ -833,7 +834,7 @@ DirDef *DirDefImpl::mergeDirectoryInTree(const QCString &path) static void writePartialDirPath(OutputList &ol,const DirDef *root,const DirDef *target) { - if (target->parent()!=root) + if (target->parent()!=root) { writePartialDirPath(ol,root,target->parent()); ol.writeString(" / "); @@ -910,7 +911,7 @@ void DirRelation::writeDocumentation(OutputList &ol) ol.writeString("</table>"); ol.endContents(); - + endFileWithNavPath(m_src,ol); ol.popGeneratorState(); @@ -936,7 +937,7 @@ static void computeCommonDirPrefix() int i=path.findRev('/',(int)path.length()-2); path=path.left(i+1); bool done=FALSE; - if (i==-1) + if (i==-1) { path=""; } @@ -1003,13 +1004,9 @@ static void computeCommonDirPrefix() void buildDirectories() { // for each input file - FileNameListIterator fnli(*Doxygen::inputNameList); - FileName *fn; - for (fnli.toFirst();(fn=fnli.current());++fnli) + for (const auto &fn : *Doxygen::inputNameLinkedMap) { - FileNameIterator fni(*fn); - FileDef *fd; - for (;(fd=fni.current());++fni) + for (const auto &fd : *fn) { //printf("buildDirectories %s\n",fd->name().data()); if (fd->getReference().isEmpty()) @@ -1019,7 +1016,7 @@ void buildDirectories() { dir = DirDefImpl::mergeDirectoryInTree(fd->getPath()); } - if (dir && !fd->isDocumentationFile()) dir->addFile(fd); + if (dir && !fd->isDocumentationFile()) dir->addFile(fd.get()); } else { @@ -1040,9 +1037,9 @@ void buildDirectories() { DirDef *parent = Doxygen::directories->find(name.left(i+1)); //if (parent==0) parent=root; - if (parent) + if (parent) { - parent->addSubDir(dir); + parent->addSubDir(dir); //printf("DirDefImpl::addSubdir(): Adding subdir\n%s to\n%s\n", // dir->displayName().data(), parent->displayName().data()); } |