Doxygen
dirdef.h 文件参考
#include <vector>
#include <map>
#include "qcstring.h"
#include "linkedmap.h"
#include "definition.h"
+ dirdef.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

class  FilePair
 Class representing a pair of FileDef objects 更多...
 
class  FilePairLinkedMap
 A linked map of file pairs 更多...
 
class  UsedDir
 Usage information of a directory. 更多...
 
class  DirDef
 A model of a directory symbol. 更多...
 
class  DirDef::UsedDirLinkedMap
 
class  DirRelation
 A usage relation between two directories. 更多...
 
class  DirLinkedMap
 A linked map of directories 更多...
 
class  DirList
 A list of directories. 更多...
 
class  DirRelationLinkedMap
 

函数

bool compareDirDefs (const DirDef *item1, const DirDef *item2)
 
DirDeftoDirDef (Definition *d)
 
const DirDeftoDirDef (const Definition *d)
 
void buildDirectories ()
 
void generateDirDocs (OutputList &ol)
 
void computeDirDependencies ()
 

函数说明

◆ buildDirectories()

void buildDirectories ( )

在文件 dirdef.cpp1005 行定义.

1006 {
1007  // for each input file
1008  for (const auto &fn : *Doxygen::inputNameLinkedMap)
1009  {
1010  for (const auto &fd : *fn)
1011  {
1012  if (fd->getReference().isEmpty())
1013  {
1014  DirDef *dir;
1015  if ((dir=Doxygen::dirLinkedMap->find(fd->getPath()))==0) // new directory
1016  {
1017  dir = DirDefImpl::mergeDirectoryInTree(fd->getPath());
1018  }
1019  if (dir && !fd->isDocumentationFile()) dir->addFile(fd.get());
1020  }
1021  else
1022  {
1023  // do something for file imported via tag files.
1024  }
1025  }
1026  }
1027 
1028  // compute relations between directories => introduce container dirs.
1029  for (const auto &dir : *Doxygen::dirLinkedMap)
1030  {
1031  QCString name = dir->name();
1032  int i=name.findRev('/',(int)name.length()-2);
1033  if (i>0)
1034  {
1035  DirDef *parent = Doxygen::dirLinkedMap->find(name.left(i+1));
1036  //if (parent==0) parent=root;
1037  if (parent)
1038  {
1039  parent->addSubDir(dir.get());
1040  //printf("DirDefImpl::addSubdir(): Adding subdir\n%s to\n%s\n",
1041  // qPrint(dir->displayName()), qPrint(parent->displayName()));
1042  }
1043  }
1044  }
1045 
1046  // sort the directory contents
1047  for (const auto &dir : *Doxygen::dirLinkedMap)
1048  {
1049  dir->sort();
1050  }
1051 
1052  // short the directories themselves
1053  std::sort(Doxygen::dirLinkedMap->begin(),
1055  [](const auto &d1,const auto &d2)
1056  {
1057  QCString s1 = d1->shortName(), s2 = d2->shortName();
1058  int i = qstricmp(s1,s2);
1059  if (i==0) // if sort name are equal, sort on full path
1060  {
1061  QCString n1 = d1->name(), n2 = d2->name();
1062  int n = qstricmp(n1,n2);
1063  return n < 0;
1064  }
1065  return i < 0;
1066  });
1067 
1068  // set the directory count identifier
1069  int dirCount=0;
1070  for (const auto &dir : *Doxygen::dirLinkedMap)
1071  {
1072  dir->setDirCount(dirCount++);
1073  }
1074 
1076 }

引用了 DirDef::addFile(), DirDef::addSubDir(), begin(), computeCommonDirPrefix(), Doxygen::dirLinkedMap, end(), LinkedMap< T, Hash, KeyEqual, Map >::find(), QCString::findRev(), Doxygen::inputNameLinkedMap, QCString::left(), QCString::length(), DirDefImpl::mergeDirectoryInTree() , 以及 qstricmp().

被这些函数引用 parseInput().

◆ compareDirDefs()

bool compareDirDefs ( const DirDef item1,
const DirDef item2 
)

在文件 dirdef.cpp1115 行定义.

1116 {
1117  return qstricmp(item1->shortName(),item2->shortName()) < 0;
1118 }

引用了 qstricmp() , 以及 DirDef::shortName().

被这些函数引用 DirDefImpl::sort() , 以及 GroupDefImpl::sortMemberLists().

◆ computeDirDependencies()

void computeDirDependencies ( )

在文件 dirdef.cpp1078 行定义.

1079 {
1080  // compute nesting level for each directory
1081  for (const auto &dir : *Doxygen::dirLinkedMap)
1082  {
1083  dir->setLevel();
1084  }
1085 
1086  // compute uses dependencies between directories
1087  for (const auto &dir : *Doxygen::dirLinkedMap)
1088  {
1089  //printf("computeDependencies for %s: #dirs=%d\n",qPrint(dir->name()),Doxygen::directories.count());
1090  dir->computeDependencies();
1091  }
1092 }

引用了 Doxygen::dirLinkedMap.

被这些函数引用 parseInput().

◆ generateDirDocs()

void generateDirDocs ( OutputList ol)

在文件 dirdef.cpp1094 行定义.

1095 {
1096  for (const auto &dir : *Doxygen::dirLinkedMap)
1097  {
1098  ol.pushGeneratorState();
1099  if (!dir->hasDocumentation())
1100  {
1102  }
1103  dir->writeDocumentation(ol);
1104  ol.popGeneratorState();
1105  }
1106  if (Config_getBool(DIRECTORY_GRAPH))
1107  {
1108  for (const auto &dr : Doxygen::dirRelations)
1109  {
1110  dr->writeDocumentation(ol);
1111  }
1112  }
1113 }

引用了 Config_getBool, Doxygen::dirLinkedMap, Doxygen::dirRelations, OutputList::disableAllBut(), OutputGenerator::Html, OutputList::popGeneratorState() , 以及 OutputList::pushGeneratorState().

被这些函数引用 generateOutput().

◆ toDirDef() [1/2]

const DirDef* toDirDef ( const Definition d)

在文件 dirdef.cpp1135 行定义.

1136 {
1137  if (d==0) return 0;
1138  if (d && typeid(*d)==typeid(DirDefImpl))
1139  {
1140  return static_cast<const DirDef*>(d);
1141  }
1142  else
1143  {
1144  return 0;
1145  }
1146 }

◆ toDirDef() [2/2]

DirDef* toDirDef ( Definition d)

在文件 dirdef.cpp1122 行定义.

1123 {
1124  if (d==0) return 0;
1125  if (d && typeid(*d)==typeid(DirDefImpl))
1126  {
1127  return static_cast<DirDef*>(d);
1128  }
1129  else
1130  {
1131  return 0;
1132  }
1133 }

被这些函数引用 NestingNodeContext::Private::addDirFiles() , 以及 NestingNodeContext::Private::createDir().

OutputList::disableAllBut
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:76
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
DirDef::addFile
virtual void addFile(const FileDef *fd)=0
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
DirDef
A model of a directory symbol.
Definition: dirdef.h:110
DirDef::sort
virtual void sort()=0
Doxygen::dirLinkedMap
static DirLinkedMap * dirLinkedMap
Definition: doxygen.h:109
begin
DirIterator begin(DirIterator it) noexcept
Definition: dir.cpp:123
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
Doxygen::inputNameLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
Definition: doxygen.h:88
DirDef::shortName
virtual const QCString shortName() const =0
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
qstricmp
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:433
DirDefImpl
Definition: dirdef.cpp:37
Definition::name
virtual QCString name() const =0
OutputGenerator::Html
@ Html
Definition: outputgen.h:333
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
Doxygen::dirRelations
static DirRelationLinkedMap dirRelations
Definition: doxygen.h:110
DirDef::addSubDir
virtual void addSubDir(DirDef *subdir)=0
DirDefImpl::mergeDirectoryInTree
static DirDef * mergeDirectoryInTree(const QCString &path)
Definition: dirdef.cpp:817
OutputList::popGeneratorState
void popGeneratorState()
Definition: outputlist.cpp:134
DirDef::setDirCount
virtual void setDirCount(int count)=0
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
OutputList::pushGeneratorState
void pushGeneratorState()
Definition: outputlist.cpp:126
computeCommonDirPrefix
static void computeCommonDirPrefix()
In order to create stable, but unique directory names, we compute the common part of the path shared ...
Definition: dirdef.cpp:930
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108