Skip to main content

The DirDefImpl Class Reference

Declaration

class DirDefImpl { ... }

Base class

classDefinitionMixin<Base>

Public Constructors Index

DirDefImpl (const QCString &path)

Public Destructor Index

~DirDefImpl () override

Public Member Functions Index

DefTypedefinitionType () const override
CodeSymbolTypecodeSymbolType () const override
QCStringgetOutputFileBase () const override
QCStringanchor () const override
boolisLinkableInProject () const override
boolisLinkable () const override
QCStringdisplayName (bool=TRUE) const override
const QCStringshortName () const override
voidaddSubDir (DirDef *subdir) override
const FileList &getFiles () const override
voidaddFile (FileDef *fd) override
const DirList &subDirs () const override
boolhasSubdirs () const override
intlevel () const override
DirDef *parent () const override
intdirIndex () const override
const UsedDirLinkedMap &usedDirs () const override
boolisParentOf (const DirDef *dir) const override
booldepGraphIsTrivial () const override
QCStringshortTitle () const override
boolhasDetailedDescription () const override
voidwriteDocumentation (OutputList &ol) override
voidwritePageNavigation (OutputList &ol) const override
voidwriteTagFile (TextStream &t) override
voidsetDiskName (const QCString &name) override
voidsort () override
voidsetParent (DirDef *parent) override
voidsetDirIndex (int index) override
voidsetLevel () override
voidaddUsesDependency (const DirDef *usedDir, const FileDef *srcFd, const FileDef *dstFd, bool srcDirect, bool dstDirect) override

Add as "uses" dependency between this dir and dir, that was caused by a dependency on file fd. More...

voidcomputeDependencies () override

Computes the dependencies between directories. More...

boolhasDirectoryGraph () const override
voidoverrideDirectoryGraph (bool e) override

Private Member Functions Index

voidwriteDetailedDescription (OutputList &ol, const QCString &title)
voidwriteBriefDescription (OutputList &ol)
voidwriteDirectoryGraph (OutputList &ol)
voidwriteSubDirList (OutputList &ol)
voidwriteFileList (OutputList &ol)
voidstartMemberDeclarations (OutputList &ol)
voidendMemberDeclarations (OutputList &ol)

Private Member Attributes Index

DirListm_subdirs
QCStringm_dispName
QCStringm_shortName
QCStringm_diskName
FileListm_fileList
intm_dirIndex = -1
intm_level
DirDef *m_parent
UsedDirLinkedMapm_usedDirs
boolm_hasDirectoryGraph = false

Public Static Functions Index

static DirDef *mergeDirectoryInTree (const QCString &path)

Private Static Functions Index

static DirDef *createNewDir (const QCString &path)
static boolmatchPath (const QCString &path, const StringVector &l)

Definition at line 37 of file dirdef.cpp.

Public Constructors

DirDefImpl()

DirDefImpl::DirDefImpl (const QCString & path)

Definition at line 40 of file dirdef.cpp.

117DirDefImpl::DirDefImpl(const QCString &path) : DefinitionMixin(path,1,1,path)
118{
119 bool fullPathNames = Config_getBool(FULL_PATH_NAMES);
120 // get display name (stripping the paths mentioned in STRIP_FROM_PATH)
121 // get short name (last part of path)
122 m_shortName = path;
123 m_diskName = path;
124 if (m_shortName.at(m_shortName.length()-1)=='/')
125 { // strip trailing /
126 m_shortName = m_shortName.left(m_shortName.length()-1);
127 }
128 int pi=m_shortName.findRev('/');
129 if (pi!=-1)
130 { // remove everything till the last /
131 m_shortName = m_shortName.mid(pi+1);
132 }
134 m_dispName = fullPathNames ? stripFromPath(path) : m_shortName;
135 if (m_dispName.length()>0 && m_dispName.at(m_dispName.length()-1)=='/')
136 { // strip trailing /
137 m_dispName = m_dispName.left(m_dispName.length()-1);
138 }
139
140 m_level=-1;
141 m_parent=nullptr;
142 m_hasDirectoryGraph=Config_getBool(DIRECTORY_GRAPH);
143
144}

References Config_getBool, DefinitionMixin< DirDef >::DefinitionMixin, m_diskName, m_dispName, m_hasDirectoryGraph, m_level, m_parent, m_shortName, DefinitionMixin< DirDef >::setLocalName and stripFromPath.

Public Destructor

~DirDefImpl()

DirDefImpl::~DirDefImpl ()

Definition at line 41 of file dirdef.cpp.

Public Member Functions

addFile()

void DirDefImpl::addFile (FileDef * fd)
virtual

Definition at line 54 of file dirdef.cpp.

178{
179 m_fileList.push_back(fd);
180 fd->setDirDef(this);
181}

References m_fileList and FileDef::setDirDef.

addSubDir()

void DirDefImpl::addSubDir (DirDef * subdir)
virtual

Definition at line 52 of file dirdef.cpp.

161{
162 m_subdirs.push_back(subdir);
163 subdir->setOuterScope(this);
164 subdir->setParent(this);
165}

References m_subdirs, DefinitionMutable::setOuterScope and DirDef::setParent.

addUsesDependency()

void DirDefImpl::addUsesDependency (const DirDef * dir, const FileDef * srcFd, const FileDef * dstFd, bool srcDirect, bool dstDirect)
virtual

Add as "uses" dependency between this dir and dir, that was caused by a dependency on file fd.

srcDirect and dstDirect indicate if it is a direct dependencies (true) or if the dependencies was indirect (e.g. a parent dir that has a child dir that has the dependencies)

Definition at line 73 of file dirdef.cpp.

706void DirDefImpl::addUsesDependency(const DirDef *dir,const FileDef *srcFd,
707 const FileDef *dstFd,bool srcDirect, bool dstDirect)
708{
709 if (this==dir) return; // do not add self-dependencies
710 AUTO_TRACE("add dependency {}->{} due to {}->{}",
712 qPrint(dir->shortName()),
713 qPrint(srcFd->name()),
714 qPrint(dstFd->name()));
715
716 // levels match => add direct dependency
717 bool added=FALSE;
718 UsedDir *usedDir = m_usedDirs.find(dir->getOutputFileBase());
719 if (usedDir) // dir dependency already present
720 {
721 const FilePair *usedPair = usedDir->findFilePair(FilePair::key(srcFd,dstFd));
722 if (usedPair==nullptr) // new file dependency
723 {
724 AUTO_TRACE_ADD("{} => {} new file dependency",srcFd->name(),dstFd->name());
725 usedDir->addFileDep(srcFd,dstFd, srcDirect, dstDirect);
726 added=TRUE;
727 }
728 else
729 {
730 // dir & file dependency already added
731 }
732 }
733 else // new directory dependency
734 {
735 AUTO_TRACE_ADD("{} => {} new file dependency",srcFd->name(),dstFd->name());
736 auto newUsedDir = std::make_unique<UsedDir>(dir);
737 newUsedDir->addFileDep(srcFd,dstFd, srcDirect, dstDirect);
738 m_usedDirs.add(dir->getOutputFileBase(),std::move(newUsedDir));
739 added=TRUE;
740 }
741 if (added)
742 {
743 if (dir->parent())
744 {
745 // add relation to parent of used dir
747 srcFd,
748 dstFd,
749 srcDirect,
750 false); // indirect dependency on dest dir
751 }
752 if (parent())
753 {
754 // add relation for the parent of this dir as well
756 srcFd,
757 dstFd,
758 false, // indirect dependency from source dir
759 dstDirect);
760 }
761 }
762}

References UsedDir::addFileDep, DirDef::addUsesDependency, addUsesDependency, AUTO_TRACE, AUTO_TRACE_ADD, FALSE, UsedDir::findFilePair, Definition::getOutputFileBase, FilePair::key, m_usedDirs, Definition::name, DirDef::parent, parent, qPrint, DirDef::shortName, shortName and TRUE.

Referenced by addUsesDependency and computeDependencies.

anchor()

QCString DirDefImpl::anchor ()
inline virtual

Returns the anchor within a page where this item can be found

Definition at line 47 of file dirdef.cpp.

47 QCString anchor() const override { return QCString(); }

codeSymbolType()

CodeSymbolType DirDefImpl::codeSymbolType ()
inline virtual

Used for syntax highlighting symbol class

Definition at line 45 of file dirdef.cpp.

Reference Default.

computeDependencies()

void DirDefImpl::computeDependencies ()
virtual

Computes the dependencies between directories.

Definition at line 75 of file dirdef.cpp.

767{
768 AUTO_TRACE();
769 for (const auto &fd : m_fileList)
770 {
771 AUTO_TRACE_ADD("dir={} file={}",shortName(),fd->name());
772 for (const auto &ii : fd->includeFileList())
773 {
774 AUTO_TRACE_ADD("#include {}",ii.includeName);
775 if (ii.fileDef && ii.fileDef->isLinkable()) // linkable file
776 {
777 DirDef *usedDir = ii.fileDef->getDirDef();
778 if (usedDir)
779 {
780 // add dependency: thisDir->usedDir
781 AUTO_TRACE_ADD("add dependency {}->{}",name(),usedDir->name());
782 addUsesDependency(usedDir,fd,ii.fileDef,true,true);
783 }
784 }
785 }
786 }
787
788 std::stable_sort(m_usedDirs.begin(),m_usedDirs.end(),
789 [](const auto &u1,const auto &u2)
790 { return qstricmp_sort(u1->dir()->getOutputFileBase(),u2->dir()->getOutputFileBase())<0; });
791
792 for (const auto& usedDirectory : m_usedDirs)
793 {
794 usedDirectory->sort();
795 }
796}

References addUsesDependency, AUTO_TRACE, AUTO_TRACE_ADD, m_fileList, m_usedDirs, Definition::name, DefinitionMixin< DirDef >::name and shortName.

definitionType()

DefType DirDefImpl::definitionType ()
inline virtual

Use this for dynamic inspection of the type of the derived class

Definition at line 44 of file dirdef.cpp.

44 DefType definitionType() const override { return TypeDir; }

References definitionType and Definition::TypeDir.

Referenced by definitionType.

depGraphIsTrivial()

bool DirDefImpl::depGraphIsTrivial ()
virtual

Definition at line 62 of file dirdef.cpp.

809{
810 return m_usedDirs.empty() && m_parent==nullptr;
811}

References m_parent and m_usedDirs.

dirIndex()

int DirDefImpl::dirIndex ()
inline virtual

Definition at line 59 of file dirdef.cpp.

59 int dirIndex() const override { return m_dirIndex; }

Reference m_dirIndex.

displayName()

QCString DirDefImpl::displayName (bool includeScope=TRUE)
inline virtual

Returns the name of the definition as it appears in the output

Definition at line 50 of file dirdef.cpp.

50 QCString displayName(bool=TRUE) const override { return m_dispName; }

References m_dispName and TRUE.

Referenced by writeDirectoryGraph and writeTagFile.

getFiles()

const FileList & DirDefImpl::getFiles ()
inline virtual

Definition at line 53 of file dirdef.cpp.

53 const FileList &getFiles() const override { return m_fileList; }

Reference m_fileList.

getOutputFileBase()

QCString DirDefImpl::getOutputFileBase ()
virtual

Returns the base file name (without extension) of this definition. as it is referenced to/written to disk.

Definition at line 46 of file dirdef.cpp.

224{
225 QCString dir = "dir_"+encodeDirName(m_diskName);
226 AUTO_TRACE("diskName={} result={}",m_diskName,dir);
227 return dir;
228}

References AUTO_TRACE, encodeDirName and m_diskName.

Referenced by writeDocumentation and writeTagFile.

hasDetailedDescription()

bool DirDefImpl::hasDetailedDescription ()
virtual

Definition at line 64 of file dirdef.cpp.

508{
509 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
510 return (!briefDescription().isEmpty() && repeatBrief) || !documentation().isEmpty();
511}

References DefinitionMixin< DirDef >::briefDescription, Config_getBool, DefinitionMixin< DirDef >::documentation and QCString::isEmpty.

hasDirectoryGraph()

bool DirDefImpl::hasDirectoryGraph ()
virtual

Definition at line 77 of file dirdef.cpp.

900{
902}

Reference m_hasDirectoryGraph.

hasSubdirs()

bool DirDefImpl::hasSubdirs ()
inline virtual

Definition at line 56 of file dirdef.cpp.

56 bool hasSubdirs() const override { return !m_subdirs.empty(); }

Reference m_subdirs.

isLinkable()

bool DirDefImpl::isLinkable ()
virtual

Returns TRUE iff it is possible to link to this item. This can be a link to another project imported via a tag file.

Definition at line 49 of file dirdef.cpp.

156{
157 return isReference() || isLinkableInProject();
158}

References isLinkableInProject and DefinitionMixin< DirDef >::isReference.

isLinkableInProject()

bool DirDefImpl::isLinkableInProject ()
virtual

Returns TRUE iff it is possible to link to this item within this project.

Definition at line 48 of file dirdef.cpp.

151{
152 return !isReference();
153}

Reference DefinitionMixin< DirDef >::isReference.

Referenced by isLinkable.

isParentOf()

bool DirDefImpl::isParentOf (const DirDef * dir)
virtual

Definition at line 61 of file dirdef.cpp.

798bool DirDefImpl::isParentOf(const DirDef *dir) const
799{
800 if (dir->parent()==this) // this is a parent of dir
801 return TRUE;
802 else if (dir->parent()) // repeat for the parent of dir
803 return isParentOf(dir->parent());
804 else
805 return FALSE;
806}

References FALSE, isParentOf, DirDef::parent and TRUE.

Referenced by isParentOf.

level()

int DirDefImpl::level ()
inline virtual

Definition at line 57 of file dirdef.cpp.

57 int level() const override { return m_level; }

Reference m_level.

overrideDirectoryGraph()

void DirDefImpl::overrideDirectoryGraph (bool e)
virtual

Definition at line 78 of file dirdef.cpp.

Reference m_hasDirectoryGraph.

parent()

DirDef * DirDefImpl::parent ()
inline virtual

Definition at line 58 of file dirdef.cpp.

58 DirDef *parent() const override { return m_parent; }

Reference m_parent.

Referenced by addUsesDependency and setLevel.

setDirIndex()

void DirDefImpl::setDirIndex (int index)
virtual

Definition at line 71 of file dirdef.cpp.

173{
174 m_dirIndex=index;
175}

Reference m_dirIndex.

setDiskName()

void DirDefImpl::setDiskName (const QCString & name)
inline virtual

Definition at line 68 of file dirdef.cpp.

68 void setDiskName(const QCString &name) override { m_diskName = name; }

References m_diskName and DefinitionMixin< DirDef >::name.

setLevel()

void DirDefImpl::setLevel ()
virtual

Definition at line 72 of file dirdef.cpp.

685{
686 if (m_level==-1) // level not set before
687 {
688 DirDef *p = parent();
689 if (p)
690 {
691 p->setLevel();
692 m_level = p->level()+1;
693 }
694 else
695 {
696 m_level = 0;
697 }
698 }
699}

References DirDef::level, m_level, parent and DirDef::setLevel.

setParent()

void DirDefImpl::setParent (DirDef * parent)
virtual

Definition at line 70 of file dirdef.cpp.

168{
169 m_parent=p;
170}

Reference m_parent.

shortName()

const QCString DirDefImpl::shortName ()
inline virtual

Definition at line 51 of file dirdef.cpp.

51 const QCString shortName() const override { return m_shortName; }

Reference m_shortName.

Referenced by addUsesDependency, computeDependencies and writeDirectoryGraph.

shortTitle()

QCString DirDefImpl::shortTitle ()
virtual

Definition at line 63 of file dirdef.cpp.

496{
497 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
498 {
499 return m_shortName;
500 }
501 else
502 {
503 return theTranslator->trDirReference(m_shortName);
504 }
505}

References Config_getBool, m_shortName and theTranslator.

Referenced by writeDocumentation.

sort()

void DirDefImpl::sort ()
virtual

Definition at line 69 of file dirdef.cpp.

184{
185 std::stable_sort(m_subdirs.begin(), m_subdirs.end(), compareDirDefs);
186 std::stable_sort(m_fileList.begin(), m_fileList.end(), compareFileDefs);
187}

References compareDirDefs, compareFileDefs, m_fileList and m_subdirs.

subDirs()

const DirList & DirDefImpl::subDirs ()
inline virtual

Definition at line 55 of file dirdef.cpp.

55 const DirList &subDirs() const override { return m_subdirs; }

Reference m_subdirs.

usedDirs()

const UsedDirLinkedMap & DirDefImpl::usedDirs ()
inline virtual

Definition at line 60 of file dirdef.cpp.

60 const UsedDirLinkedMap &usedDirs() const override { return m_usedDirs; }

Reference m_usedDirs.

writeDocumentation()

void DirDefImpl::writeDocumentation (OutputList & ol)
virtual

Definition at line 65 of file dirdef.cpp.

553{
554 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
556
557 QCString title;
558 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
559 {
560 title=m_dispName;
561 }
562 else
563 {
564 title=theTranslator->trDirReference(m_dispName);
565 }
566 AUTO_TRACE("title={}",title);
567 startFile(ol,getOutputFileBase(),name(),title,HighlightedItem::Files,!generateTreeView);
568
569 if (!generateTreeView)
570 {
571 // write navigation path
573 ol.endQuickIndices();
574 }
575
580 ol.enableAll();
582 ol.parseText(title);
584 endTitle(ol,getOutputFileBase(),title);
585 ol.startContents();
586
587 //---------------------------------------- start flexible part -------------------------------
588
589 SrcLangExt lang = getLanguage();
590 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory))
591 {
592 switch (lde->kind())
593 {
594 case LayoutDocEntry::BriefDesc:
596 break;
597 case LayoutDocEntry::DirGraph:
599 break;
600 case LayoutDocEntry::MemberDeclStart:
602 break;
603 case LayoutDocEntry::DirSubDirs:
605 break;
606 case LayoutDocEntry::DirFiles:
607 writeFileList(ol);
608 break;
609 case LayoutDocEntry::MemberDeclEnd:
611 break;
612 case LayoutDocEntry::DetailedDesc:
613 {
614 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
615 if (ls)
616 {
617 writeDetailedDescription(ol,ls->title(lang));
618 }
619 }
620 break;
621 case LayoutDocEntry::ClassIncludes:
622 case LayoutDocEntry::ClassInlineClasses:
623 case LayoutDocEntry::ClassInheritanceGraph:
624 case LayoutDocEntry::ClassNestedClasses:
625 case LayoutDocEntry::ClassCollaborationGraph:
626 case LayoutDocEntry::ClassAllMembersLink:
627 case LayoutDocEntry::ClassUsedFiles:
628 case LayoutDocEntry::NamespaceNestedNamespaces:
629 case LayoutDocEntry::NamespaceNestedConstantGroups:
630 case LayoutDocEntry::NamespaceClasses:
631 case LayoutDocEntry::NamespaceConcepts:
632 case LayoutDocEntry::NamespaceInterfaces:
633 case LayoutDocEntry::NamespaceStructs:
634 case LayoutDocEntry::NamespaceExceptions:
635 case LayoutDocEntry::NamespaceInlineClasses:
636 case LayoutDocEntry::ConceptDefinition:
637 case LayoutDocEntry::FileClasses:
638 case LayoutDocEntry::FileConcepts:
639 case LayoutDocEntry::FileInterfaces:
640 case LayoutDocEntry::FileStructs:
641 case LayoutDocEntry::FileExceptions:
642 case LayoutDocEntry::FileNamespaces:
643 case LayoutDocEntry::FileConstantGroups:
644 case LayoutDocEntry::FileIncludes:
645 case LayoutDocEntry::FileIncludeGraph:
646 case LayoutDocEntry::FileIncludedByGraph:
647 case LayoutDocEntry::FileSourceLink:
648 case LayoutDocEntry::FileInlineClasses:
649 case LayoutDocEntry::GroupClasses:
650 case LayoutDocEntry::GroupConcepts:
651 case LayoutDocEntry::GroupModules:
652 case LayoutDocEntry::GroupInlineClasses:
653 case LayoutDocEntry::GroupNamespaces:
654 case LayoutDocEntry::GroupDirs:
655 case LayoutDocEntry::GroupNestedGroups:
656 case LayoutDocEntry::GroupFiles:
657 case LayoutDocEntry::GroupGraph:
658 case LayoutDocEntry::GroupPageDocs:
659 case LayoutDocEntry::ModuleExports:
660 case LayoutDocEntry::ModuleClasses:
661 case LayoutDocEntry::ModuleConcepts:
662 case LayoutDocEntry::ModuleUsedFiles:
663 case LayoutDocEntry::AuthorSection:
664 case LayoutDocEntry::MemberGroups:
665 case LayoutDocEntry::MemberDecl:
666 case LayoutDocEntry::MemberDef:
667 case LayoutDocEntry::MemberDefStart:
668 case LayoutDocEntry::MemberDefEnd:
669 err("Internal inconsistency: member '{}' should not be part of "
670 "LayoutDocManager::Directory entry list\n",qPrint(lde->entryToString()));
671 break;
672 }
673 }
674
675 //---------------------------------------- end flexible part -------------------------------
676
677 ol.endContents();
678
679 endFileWithNavPath(ol,this);
680
682}

References AUTO_TRACE, Config_getBool, OutputList::disable, OutputList::disableAllBut, OutputList::enableAll, OutputList::endContents, endFileWithNavPath, endMemberDeclarations, OutputList::endQuickIndices, endTitle, err, Files, DefinitionMixin< DirDef >::getLanguage, getOutputFileBase, Html, LayoutDocManager::instance, m_dispName, DefinitionMixin< DirDef >::name, OutputList::parseText, OutputList::popGeneratorState, OutputList::pushGeneratorState, qPrint, shortTitle, OutputList::startContents, startFile, startMemberDeclarations, startTitle, theTranslator, LayoutDocEntrySection::title, writeBriefDescription, writeDetailedDescription, writeDirectoryGraph, writeFileList, DefinitionMixin< DirDef >::writeNavigationPath and writeSubDirList.

writePageNavigation()

void DirDefImpl::writePageNavigation (OutputList & ol)
virtual

Definition at line 66 of file dirdef.cpp.

317{
319}

Reference OutputList::writePageOutline.

writeTagFile()

void DirDefImpl::writeTagFile (TextStream & t)
virtual

Definition at line 67 of file dirdef.cpp.

514{
515 tagFile << " <compound kind=\"dir\">\n";
516 tagFile << " <name>" << convertToXML(displayName()) << "</name>\n";
517 tagFile << " <path>" << convertToXML(stripFromPath(name())) << "</path>\n";
520 tagFile << " <filename>" << fn << "</filename>\n";
521 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory))
522 {
523 switch (lde->kind())
524 {
525 case LayoutDocEntry::DirSubDirs:
526 {
527 if (m_subdirs.size()>0)
528 {
529 for(const auto dd : m_subdirs)
530 {
531 tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>\n";
532 }
533 }
534 }
535 break;
536 case LayoutDocEntry::DirFiles:
537 {
538 for (const auto &fd : m_fileList)
539 {
540 tagFile << " <file>" << convertToXML(fd->name()) << "</file>\n";
541 }
542 }
543 break;
544 default:
545 break;
546 }
547 }
549 tagFile << " </compound>\n";
550}

References addHtmlExtensionIfMissing, convertToXML, displayName, getOutputFileBase, LayoutDocManager::instance, m_fileList, m_subdirs, DefinitionMixin< DirDef >::name, stripFromPath and DefinitionMixin< DirDef >::writeDocAnchorsToTagFile.

Private Member Functions

endMemberDeclarations()

void DirDefImpl::endMemberDeclarations (OutputList & ol)

Definition at line 91 of file dirdef.cpp.

Reference OutputList::endMemberSections.

Referenced by writeDocumentation.

startMemberDeclarations()

void DirDefImpl::startMemberDeclarations (OutputList & ol)

Definition at line 90 of file dirdef.cpp.

Reference OutputList::startMemberSections.

Referenced by writeDocumentation.

writeBriefDescription()

void DirDefImpl::writeBriefDescription (OutputList & ol)

Definition at line 86 of file dirdef.cpp.

278{
279 AUTO_TRACE();
281 {
282 auto parser { createDocParser() };
283 auto ast { validatingParseDoc(
284 *parser.get(), briefFile(),briefLine(),this,nullptr,briefDescription(),TRUE,FALSE,
285 QCString(),FALSE,FALSE) };
286 if (!ast->isEmpty())
287 {
288 ol.startParagraph();
291 ol.writeString(" - ");
293 ol.writeDoc(ast.get(),this,nullptr);
296 ol.writeString(" \n");
298
299 if (Config_getBool(REPEAT_BRIEF) ||
300 !documentation().isEmpty()
301 )
302 {
304 ol.startTextLink(QCString(),"details");
305 ol.parseText(theTranslator->trMore());
306 ol.endTextLink();
307 }
309
310 ol.endParagraph();
311 }
312 }
313 ol.writeSynopsis();
314}

References AUTO_TRACE, DefinitionMixin< DirDef >::briefDescription, DefinitionMixin< DirDef >::briefFile, DefinitionMixin< DirDef >::briefLine, Config_getBool, createDocParser, OutputList::disable, OutputList::disableAllBut, DefinitionMixin< DirDef >::documentation, OutputList::enable, OutputList::endParagraph, OutputList::endTextLink, FALSE, DefinitionMixin< DirDef >::hasBriefDescription, Html, Man, OutputList::parseText, OutputList::popGeneratorState, OutputList::pushGeneratorState, RTF, OutputList::startParagraph, OutputList::startTextLink, theTranslator, TRUE, validatingParseDoc, OutputList::writeDoc, OutputList::writeString and OutputList::writeSynopsis.

Referenced by writeDocumentation.

writeDetailedDescription()

void DirDefImpl::writeDetailedDescription (OutputList & ol, const QCString & title)

Definition at line 85 of file dirdef.cpp.

231{
232 AUTO_TRACE();
233 if ((!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF)) ||
234 !documentation().isEmpty())
235 {
238 ol.writeRuler();
242 ol.writeAnchor(QCString(),"details");
244 ol.startGroupHeader("details");
245 ol.parseText(title);
246 ol.endGroupHeader();
247
248 // repeat brief description
249 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
250 {
253 }
254 // separator between brief and details
255 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
256 !documentation().isEmpty())
257 {
261 ol.enableAll();
264 ol.writeString("\n\n");
266 }
267
268 // write documentation
269 if (!documentation().isEmpty())
270 {
271 ol.generateDoc(docFile(),docLine(),this,nullptr,documentation()+"\n",TRUE,FALSE,
273 }
274 }
275}

References AUTO_TRACE, DefinitionMixin< DirDef >::briefDescription, DefinitionMixin< DirDef >::briefFile, DefinitionMixin< DirDef >::briefLine, Config_getBool, OutputList::disable, OutputList::disableAllBut, DefinitionMixin< DirDef >::docFile, DefinitionMixin< DirDef >::docLine, DefinitionMixin< DirDef >::documentation, OutputList::enable, OutputList::enableAll, OutputList::endGroupHeader, FALSE, OutputList::generateDoc, Html, Latex, Man, OutputList::parseText, OutputList::popGeneratorState, OutputList::pushGeneratorState, RTF, OutputList::startGroupHeader, TRUE, OutputList::writeAnchor, OutputList::writeRuler and OutputList::writeString.

Referenced by writeDocumentation.

writeDirectoryGraph()

void DirDefImpl::writeDirectoryGraph (OutputList & ol)

Definition at line 87 of file dirdef.cpp.

322{
323 // write graph dependency graph
324 if (Config_getBool(HAVE_DOT) && m_hasDirectoryGraph /*&& Config_getBool(DIRECTORY_GRAPH)*/)
325 {
326 DotDirDeps dirDep(this);
327 if (!dirDep.isTrivial())
328 {
329 msg("Generating dependency graph for directory {}\n",displayName());
331 //ol.startParagraph();
333 ol.parseText(theTranslator->trDirDepGraph(shortName()));
334 ol.endDirDepGraph(dirDep);
335 //ol.endParagraph();
336 ol.enableAll();
337 }
338 }
339}

References Config_getBool, OutputList::disable, displayName, OutputList::enableAll, OutputList::endDirDepGraph, DotDirDeps::isTrivial, m_hasDirectoryGraph, Man, msg, OutputList::parseText, shortName, OutputList::startDirDepGraph and theTranslator.

Referenced by writeDocumentation.

writeFileList()

void DirDefImpl::writeFileList (OutputList & ol)

Definition at line 89 of file dirdef.cpp.

402{
403 AUTO_TRACE();
404 int numFiles = 0;
405 for (const auto &fd : m_fileList)
406 {
407 bool genSourceFile=false;
408 if (fileVisibleInIndex(fd,genSourceFile))
409 {
410 numFiles++;
411 }
412 else if (genSourceFile)
413 {
414 numFiles++;
415 }
416 }
417
418 AUTO_TRACE_ADD("numFiles={}",numFiles);
419 // write file list
420 if (numFiles>0)
421 {
422 ol.startMemberHeader("files");
423 ol.parseText(theTranslator->trFile(TRUE,FALSE));
424 ol.endMemberHeader();
425 ol.startMemberList();
426 for (const auto &fd : m_fileList)
427 {
428 bool src = false;
429 bool doc = fileVisibleInIndex(fd,src);
430 if (doc || src)
431 {
433 QCString anc = fd->anchor();
434 if (anc.isEmpty()) anc=fd->displayName(); else anc.prepend(fd->displayName()+"_");
436 {
439 bool genSrc = fd->generateSourceFile();
440 if (genSrc)
441 {
442 ol.startTextLink(fd->includeName(),QCString());
443 }
444 ol.writeString("<span class=\"icondoc\"><div class=\"doc-icon\"></div></span>");
445 if (genSrc)
446 {
447 ol.endTextLink();
448 }
449 ol.enableAll();
451 ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
453 }
455 if (fd->isLinkable())
456 {
457 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->displayName());
458 }
459 else
460 {
461 ol.startBold();
462 ol.docify(fd->displayName());
463 ol.endBold();
464 }
466 if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
467 {
468 ol.startMemberDescription(fd->getOutputFileBase());
469 ol.generateDoc(briefFile(),briefLine(),fd,nullptr,fd->briefDescription(),
470 FALSE, // indexWords
471 FALSE, // isExample
472 QCString(), // exampleName
473 TRUE, // single line
474 TRUE // link from index
475 );
477 }
478 ol.endMemberDeclaration(fd->anchor(),QCString());
479 }
480 }
481 ol.endMemberList();
482 }
483}

References AUTO_TRACE, AUTO_TRACE_ADD, DefinitionMixin< DirDef >::briefFile, DefinitionMixin< DirDef >::briefLine, Config_getBool, OutputList::disable, OutputList::disableAllBut, OutputList::docify, OutputList::enableAll, OutputList::endBold, OutputList::endMemberDeclaration, OutputList::endMemberDescription, OutputList::endMemberHeader, OutputList::endMemberItem, OutputList::endMemberList, OutputList::endTextLink, FALSE, fileVisibleInIndex, OutputList::generateDoc, Html, OutputList::insertMemberAlign, QCString::isEmpty, m_fileList, OutputGenerator::Normal, OutputList::parseText, OutputList::popGeneratorState, QCString::prepend, OutputList::pushGeneratorState, OutputList::startBold, OutputList::startMemberDeclaration, OutputList::startMemberDescription, OutputList::startMemberHeader, OutputList::startMemberItem, OutputList::startMemberList, OutputList::startTextLink, theTranslator, TRUE, OutputList::writeObjectLink and OutputList::writeString.

Referenced by writeDocumentation.

writeSubDirList()

void DirDefImpl::writeSubDirList (OutputList & ol)

Definition at line 88 of file dirdef.cpp.

342{
343 AUTO_TRACE();
344 int numSubdirs = 0;
345 for(const auto dd : m_subdirs)
346 {
347 if (dd->hasDocumentation() || !dd->getFiles().empty())
348 {
349 numSubdirs++;
350 }
351 }
352
353 AUTO_TRACE_ADD("numSubdirs={}",numSubdirs);
354 // write subdir list
355 if (numSubdirs>0)
356 {
357 ol.startMemberHeader("subdirs");
359 ol.endMemberHeader();
360 ol.startMemberList();
361 for(const auto dd : m_subdirs)
362 {
363 if (dd->hasDocumentation() || !dd->getFiles().empty())
364 {
366 QCString anc=dd->anchor();
367 if (anc.isEmpty()) anc=dd->shortName(); else anc.prepend(dd->shortName()+"_");
369 {
372 ol.writeString("<span class=\"iconfolder\"><div class=\"folder-icon\"></div></span>");
373 ol.enableAll();
375 ol.parseText(theTranslator->trDir(FALSE,TRUE)+" ");
377 }
379 ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),QCString(),dd->shortName());
381 if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
382 {
383 ol.startMemberDescription(dd->getOutputFileBase());
384 ol.generateDoc(briefFile(),briefLine(),dd,nullptr,dd->briefDescription(),
385 FALSE, // indexWords
386 FALSE, // isExample
387 QCString(), // exampleName
388 TRUE, // single line
389 TRUE // link from index
390 );
392 }
393 ol.endMemberDeclaration(dd->anchor(),QCString());
394 }
395 }
396
397 ol.endMemberList();
398 }
399}

References AUTO_TRACE, AUTO_TRACE_ADD, DefinitionMixin< DirDef >::briefFile, DefinitionMixin< DirDef >::briefLine, Config_getBool, OutputList::disable, OutputList::disableAllBut, OutputList::enableAll, OutputList::endMemberDeclaration, OutputList::endMemberDescription, OutputList::endMemberHeader, OutputList::endMemberItem, OutputList::endMemberList, FALSE, OutputList::generateDoc, Html, OutputList::insertMemberAlign, QCString::isEmpty, m_subdirs, OutputGenerator::Normal, OutputList::parseText, OutputList::popGeneratorState, QCString::prepend, OutputList::pushGeneratorState, OutputList::startMemberDeclaration, OutputList::startMemberDescription, OutputList::startMemberHeader, OutputList::startMemberItem, OutputList::startMemberList, theTranslator, TRUE, OutputList::writeObjectLink and OutputList::writeString.

Referenced by writeDocumentation.

Private Member Attributes

m_dirIndex

int DirDefImpl::m_dirIndex = -1

Definition at line 101 of file dirdef.cpp.

101 int m_dirIndex = -1;

Referenced by dirIndex and setDirIndex.

m_diskName

QCString DirDefImpl::m_diskName

Definition at line 99 of file dirdef.cpp.

Referenced by DirDefImpl, getOutputFileBase and setDiskName.

m_dispName

QCString DirDefImpl::m_dispName

Definition at line 97 of file dirdef.cpp.

Referenced by DirDefImpl, displayName and writeDocumentation.

m_fileList

FileList DirDefImpl::m_fileList

Definition at line 100 of file dirdef.cpp.

100 FileList m_fileList; // list of files in the group

Referenced by addFile, computeDependencies, getFiles, sort, writeFileList and writeTagFile.

m_hasDirectoryGraph

bool DirDefImpl::m_hasDirectoryGraph = false

Definition at line 105 of file dirdef.cpp.

105 bool m_hasDirectoryGraph = false;

Referenced by DirDefImpl, hasDirectoryGraph, overrideDirectoryGraph and writeDirectoryGraph.

m_level

int DirDefImpl::m_level

Definition at line 102 of file dirdef.cpp.

Referenced by DirDefImpl, level and setLevel.

m_parent

DirDef* DirDefImpl::m_parent

Definition at line 103 of file dirdef.cpp.

Referenced by depGraphIsTrivial, DirDefImpl, parent and setParent.

m_shortName

QCString DirDefImpl::m_shortName

Definition at line 98 of file dirdef.cpp.

Referenced by DirDefImpl, shortName and shortTitle.

m_subdirs

DirList DirDefImpl::m_subdirs

Definition at line 96 of file dirdef.cpp.

Referenced by addSubDir, hasSubdirs, sort, subDirs, writeSubDirList and writeTagFile.

m_usedDirs

UsedDirLinkedMap DirDefImpl::m_usedDirs

Public Static Functions

mergeDirectoryInTree()

DirDef * DirDefImpl::mergeDirectoryInTree (const QCString & path)
static

strip part of path if it matches one of the paths in the Config_getList(STRIP_FROM_PATH) list

Definition at line 81 of file dirdef.cpp.

878{
879 AUTO_TRACE("path={}",path);
880 int p=0,i=0;
881 DirDef *dir=nullptr;
882 while ((i=path.find('/',p))!=-1)
883 {
884 QCString part=path.left(i+1);
885 if (!matchPath(part,Config_getList(STRIP_FROM_PATH)) && (part!="/" && part!="//" && part!="//?/"))
886 {
888 }
889 p=i+1;
890 }
891 return dir;
892}

References AUTO_TRACE, Config_getList, createNewDir, QCString::find, QCString::left, matchPath and removeLongPathMarker.

Referenced by buildDirectories.

Private Static Functions

createNewDir()

DirDef * DirDefImpl::createNewDir (const QCString & path)
static

Definition at line 93 of file dirdef.cpp.

847{
848 AUTO_TRACE();
849 ASSERT(path!=nullptr);
850 DirDef *dir = Doxygen::dirLinkedMap->find(path);
851 if (dir==nullptr) // new dir
852 {
853 dir = Doxygen::dirLinkedMap->add(path,
854 std::unique_ptr<DirDef>(
855 createDirDef(path)));
856 AUTO_TRACE_ADD("Adding new dir {} shortName {}",path,dir->shortName());
857 }
858 return dir;
859}

References ASSERT, AUTO_TRACE, AUTO_TRACE_ADD, createDirDef, Doxygen::dirLinkedMap and DirDef::shortName.

Referenced by mergeDirectoryInTree.

matchPath()

bool DirDefImpl::matchPath (const QCString & path, const StringVector & l)
static

Definition at line 94 of file dirdef.cpp.

862{
863 for (const auto &s : l)
864 {
865 std::string prefix = s.substr(0,path.length());
866 if (qstricmp_sort(prefix.c_str(),path)==0) // case insensitive compare
867 {
868 return TRUE;
869 }
870 }
871 return FALSE;
872}

References FALSE, QCString::length, prefix, qstricmp_sort and TRUE.

Referenced by mergeDirectoryInTree.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus by Doxygen 1.14.0.