Doxygen
Loading...
Searching...
No Matches
FileDefImpl Class Reference
+ Inheritance diagram for FileDefImpl:
+ Collaboration diagram for FileDefImpl:

Public Member Functions

 FileDefImpl (const QCString &p, const QCString &n, const QCString &ref=QCString(), const QCString &dn=QCString())
 
 ~FileDefImpl () override
 
DefType definitionType () const override
 
CodeSymbolType codeSymbolType () const override
 
const QCStringname () const override
 
QCString displayName (bool=TRUE) const override
 
QCString fileName () const override
 
QCString getOutputFileBase () const override
 
QCString anchor () const override
 
QCString getSourceFileBase () const override
 
QCString includeName () const override
 
QCString includeDependencyGraphFileName () const override
 
QCString includedByDependencyGraphFileName () const override
 
QCString absFilePath () const override
 
const QCStringdocName () const override
 
bool isSource () const override
 
bool isDocumentationFile () const override
 
const DefinitiongetSourceDefinition (int lineNr) const override
 
const MemberDefgetSourceMember (int lineNr) const override
 
QCString getPath () const override
 
QCString getVersion () const override
 
bool isLinkableInProject () const override
 
bool isLinkable () const override
 
bool isIncluded (const QCString &name) const override
 
DirDefgetDirDef () const override
 
ModuleDefgetModuleDef () const override
 
const LinkedRefMap< NamespaceDef > & getUsedNamespaces () const override
 
const LinkedRefMap< const Definition > & getUsedDefinitions () const override
 
const IncludeInfoListincludeFileList () const override
 
const IncludeInfoListincludedByFileList () const override
 
void getAllIncludeFilesRecursively (StringVector &incFiles) const override
 
MemberListgetMemberList (MemberListType lt) const override
 
const MemberListsgetMemberLists () const override
 
const MemberGroupListgetMemberGroups () const override
 
const NamespaceLinkedRefMapgetNamespaces () const override
 
const ConceptLinkedRefMapgetConcepts () const override
 
const ClassLinkedRefMapgetClasses () const override
 
QCString title () const override
 
bool hasDetailedDescription () const override
 
QCString fileVersion () const override
 
bool subGrouping () const override
 
void countMembers () override
 
int numDocMembers () const override
 
int numDecMembers () const override
 
void addSourceRef (int line, const Definition *d, const MemberDef *md) override
 
void writeDocumentation (OutputList &ol) override
 
void writeMemberPages (OutputList &ol) override
 
void writeQuickMemberLinks (OutputList &ol, const MemberDef *currentMd) const override
 
void writeSummaryLinks (OutputList &ol) const override
 
void writeTagFile (TextStream &t) override
 
void writeSourceHeader (OutputList &ol) override
 
void writeSourceBody (OutputList &ol, ClangTUParser *clangParser) override
 
void writeSourceFooter (OutputList &ol) override
 
void parseSource (ClangTUParser *clangParser) override
 
void setDiskName (const QCString &name) override
 
void insertMember (MemberDef *md) override
 
void removeMember (MemberDef *md) override
 
void insertClass (ClassDef *cd) override
 
void insertConcept (ConceptDef *cd) override
 
void insertNamespace (NamespaceDef *nd) override
 
void computeAnchors () override
 
void setDirDef (DirDef *dd) override
 
void setModuleDef (ModuleDef *mod) override
 
void addUsingDirective (NamespaceDef *nd) override
 
void addUsingDeclaration (const Definition *d) override
 
void combineUsingRelations () override
 
bool generateSourceFile () const override
 
void sortMemberLists () override
 
void addIncludeDependency (const FileDef *fd, const QCString &incName, IncludeKind kind) override
 
void addIncludedByDependency (const FileDef *fd, const QCString &incName, IncludeKind kind) override
 
void addMembersToMemberGroup () override
 
void distributeMemberGroupDocumentation () override
 
void findSectionsInDocumentation () override
 
void addIncludedUsingDirectives (FileDefSet &visitedFiles) override
 
void addListReferences () override
 
bool hasIncludeGraph () const override
 
bool hasIncludedByGraph () const override
 
void overrideIncludeGraph (bool e) override
 
void overrideIncludedByGraph (bool e) override
 
- Public Member Functions inherited from DefinitionMixin< FileDef >
 DefinitionMixin (const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
 
 DefinitionMixin (const DefinitionMixin &other)
 
 DefinitionMixin (DefinitionMixin &&)=delete
 
DefinitionMixinoperator= (const DefinitionMixin &other)
 
DefinitionMixinoperator= (DefinitionMixin &&)=delete
 
 ~DefinitionMixin () override=default
 
bool isAlias () const override
 
bool isAnonymous () const override
 
const QCStringlocalName () const override
 
QCString qualifiedName () const override
 
QCString symbolName () const override
 
QCString getSourceAnchor () const override
 
QCString documentation () const override
 
int docLine () const override
 
QCString docFile () const override
 
QCString briefDescription (bool abbreviate=FALSE) const override
 
QCString briefDescriptionAsTooltip () const override
 
int briefLine () const override
 
QCString inbodyDocumentation () const override
 
QCString inbodyFile () const override
 
int inbodyLine () const override
 
QCString briefFile () const override
 
QCString getDefFileName () const override
 
QCString getDefFileExtension () const override
 
int getDefLine () const override
 
int getDefColumn () const override
 
bool hasDocumentation () const override
 
bool hasUserDocumentation () const override
 
bool isVisibleInProject () const override
 
bool isVisible () const override
 
bool isHidden () const override
 
bool isArtificial () const override
 
bool isExported () const override
 
QCString getReference () const override
 
bool isReference () const override
 
QCString externalReference (const QCString &relPath) const override
 
int getStartDefLine () const override
 
int getStartBodyLine () const override
 
int getEndBodyLine () const override
 
const FileDefgetBodyDef () const override
 
SrcLangExt getLanguage () const override
 
const GroupListpartOfGroups () const override
 
bool isLinkableViaGroup () const override
 
const RefItemVectorxrefListItems () const override
 
const DefinitionfindInnerCompound (const QCString &name) const override
 
DefinitiongetOuterScope () const override
 
const MemberVectorgetReferencesMembers () const override
 
const MemberVectorgetReferencedByMembers () const override
 
bool hasSections () const override
 
bool hasSources () const override
 
bool hasBriefDescription () const override
 
QCString id () const override
 
const SectionRefsgetSectionRefs () const override
 
void setName (const QCString &name) override
 
void setId (const QCString &name) override
 
void setDefFile (const QCString &df, int defLine, int defColumn) override
 
void setDocumentation (const QCString &doc, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE) override
 
void setBriefDescription (const QCString &brief, const QCString &briefFile, int briefLine) override
 
void setInbodyDocumentation (const QCString &doc, const QCString &docFile, int docLine) override
 
void setReference (const QCString &r) override
 
void addSectionsToDefinition (const std::vector< const SectionInfo * > &anchorList) override
 
void setBodySegment (int defLine, int bls, int ble) override
 
void setBodyDef (const FileDef *fd) override
 
void addSourceReferencedBy (MemberDef *md, const QCString &sourceRefName) override
 
void addSourceReferences (MemberDef *md, const QCString &sourceRefName) override
 
void setRefItems (const RefItemVector &sli) override
 
void mergeRefItems (Definition *def) override
 
void mergeReferences (const Definition *other) override
 
void mergeReferencedBy (const Definition *other) override
 
void addInnerCompound (Definition *def) override
 
void setOuterScope (Definition *def) override
 
void setHidden (bool b) override
 
void setArtificial (bool b) override
 
void setExported (bool b) override
 
void setLanguage (SrcLangExt lang) override
 
void writeSourceDef (OutputList &ol) const override
 
void writeInlineCode (OutputList &ol, const QCString &scopeName) const override
 
bool hasSourceRefs () const override
 
bool hasSourceReffedBy () const override
 
void writeSourceRefs (OutputList &ol, const QCString &scopeName) const override
 
void writeSourceReffedBy (OutputList &ol, const QCString &scopeName) const override
 
void makePartOfGroup (GroupDef *gd) override
 
void writeNavigationPath (OutputList &ol) const override
 
QCString navigationPathAsString () const override
 
QCString pathFragment () const override
 
void writeDocAnchorsToTagFile (TextStream &fs) const override
 
void setLocalName (const QCString &name) override
 
void writeToc (OutputList &ol, const LocalToc &lt) const override
 
void computeTooltip () override
 
void _setSymbolName (const QCString &name) override
 
QCString _symbolName () const override
 
- Public Member Functions inherited from FileDef
- Public Member Functions inherited from DefinitionMutable
- Public Member Functions inherited from Definition

Private Member Functions

void setDiskNameLocal (const QCString &name)
 
void acquireFileVersion ()
 
void addMemberToList (MemberListType lt, MemberDef *md)
 
void writeMemberDeclarations (OutputList &ol, MemberListType lt, const QCString &title)
 
void writeMemberDocumentation (OutputList &ol, MemberListType lt, const QCString &title)
 
void writeIncludeFiles (OutputList &ol)
 
void writeIncludeGraph (OutputList &ol)
 
void writeIncludedByGraph (OutputList &ol)
 
void writeMemberGroups (OutputList &ol)
 
void writeAuthorSection (OutputList &ol)
 
void writeSourceLink (OutputList &ol)
 
void writeNamespaceDeclarations (OutputList &ol, const QCString &title, bool isConstantGroup)
 
void writeClassDeclarations (OutputList &ol, const QCString &title, const ClassLinkedRefMap &list)
 
void writeConcepts (OutputList &ol, const QCString &title)
 
void writeInlineClasses (OutputList &ol)
 
void startMemberDeclarations (OutputList &ol)
 
void endMemberDeclarations (OutputList &ol)
 
void startMemberDocumentation (OutputList &ol)
 
void endMemberDocumentation (OutputList &ol)
 
void writeDetailedDescription (OutputList &ol, const QCString &title)
 
void writeBriefDescription (OutputList &ol)
 
void writeClassesToTagFile (TextStream &t, const ClassLinkedRefMap &list)
 
void removeMemberFromList (MemberListType lt, MemberDef *md)
 

Private Attributes

IncludeInfoMap m_includeMap
 
IncludeInfoList m_includeList
 
IncludeInfoMap m_includedByMap
 
IncludeInfoList m_includedByList
 
LinkedRefMap< NamespaceDefm_usingDirList
 
LinkedRefMap< const Definitionm_usingDeclList
 
QCString m_path
 
QCString m_filePath
 
QCString m_inclDepFileName
 
QCString m_inclByDepFileName
 
QCString m_outputDiskName
 
QCString m_fileName
 
QCString m_docname
 
DefinitionLineMap m_srcDefMap
 
MemberDefLineMap m_srcMemberMap
 
bool m_isSource
 
QCString m_fileVersion
 
DirDefm_dir = nullptr
 
ModuleDefm_moduleDef = nullptr
 
MemberLists m_memberLists
 
MemberGroupList m_memberGroups
 
NamespaceLinkedRefMap m_namespaces
 
ClassLinkedRefMap m_classes
 
ClassLinkedRefMap m_interfaces
 
ClassLinkedRefMap m_structs
 
ClassLinkedRefMap m_exceptions
 
ConceptLinkedRefMap m_concepts
 
bool m_subGrouping
 
bool m_hasIncludeGraph = Config_getBool(INCLUDE_GRAPH)
 
bool m_hasIncludedByGraph = Config_getBool(INCLUDED_BY_GRAPH)
 

Additional Inherited Members

- Public Types inherited from Definition
enum  DefType {
  TypeClass = 0 , TypeFile = 1 , TypeNamespace = 2 , TypeModule = 3 ,
  TypeMember = 4 , TypeGroup = 5 , TypePackage = 6 , TypePage = 7 ,
  TypeDir = 8 , TypeConcept = 9
}
 

Detailed Description

Definition at line 122 of file filedef.cpp.

Constructor & Destructor Documentation

◆ FileDefImpl()

FileDefImpl::FileDefImpl ( const QCString & p,
const QCString & nm,
const QCString & lref = QCString(),
const QCString & dn = QCString() )

create a new file definition, where p is the file path, nm the file name, and lref is an HTML anchor name if the file was read from a tag file or nullptr otherwise

Definition at line 279 of file filedef.cpp.

281 : DefinitionMixin(QCString(p)+nm,1,1,nm,nullptr,nullptr,!p.isEmpty())
282{
284 m_filePath=p+nm;
285 m_fileName=nm;
286
287 setReference(lref);
288 setDiskNameLocal(!dn.isEmpty() ? dn : nm);
289 m_isSource = guessSection(nm).isSource();
290 m_docname = nm;
291 m_dir = nullptr;
292 if (Config_getBool(FULL_PATH_NAMES))
293 {
295 }
297 Config_getBool(FULL_PATH_NAMES) ? m_fileName : DefinitionMixin::name()));
299 m_subGrouping=Config_getBool(SUBGROUPING);
300}
const QCString & name() const override
void setLanguage(SrcLangExt lang) override
void setReference(const QCString &r) override
DefinitionMixin(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
DirDef * m_dir
Definition filedef.cpp:252
QCString m_path
Definition filedef.cpp:241
void setDiskNameLocal(const QCString &name)
Definition filedef.cpp:307
void acquireFileVersion()
Definition filedef.cpp:1640
QCString m_fileName
Definition filedef.cpp:246
bool m_isSource
Definition filedef.cpp:250
bool m_subGrouping
Definition filedef.cpp:262
QCString m_docname
Definition filedef.cpp:247
QCString m_filePath
Definition filedef.cpp:242
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
#define Config_getBool(name)
Definition config.h:33
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309
EntryType guessSection(const QCString &name)
Definition util.cpp:349
QCString removeLongPathMarker(QCString path)
Definition util.cpp:298

References acquireFileVersion(), Config_getBool, DefinitionMixin< FileDef >::DefinitionMixin(), getLanguageFromFileName(), guessSection(), QCString::isEmpty(), m_dir, m_docname, m_fileName, m_filePath, m_isSource, m_path, m_subGrouping, DefinitionMixin< Base >::name(), removeLongPathMarker(), setDiskNameLocal(), DefinitionMixin< FileDef >::setLanguage(), DefinitionMixin< FileDef >::setReference(), and stripFromPath().

◆ ~FileDefImpl()

FileDefImpl::~FileDefImpl ( )
override

destroy the file definition

Definition at line 303 of file filedef.cpp.

304{
305}

Member Function Documentation

◆ absFilePath()

QCString FileDefImpl::absFilePath ( ) const
inlineoverridevirtual

Returns the absolute path including the file name.

Implements FileDef.

Definition at line 141 of file filedef.cpp.

141{ return m_filePath; }

References m_filePath.

Referenced by parseSource(), and writeSourceBody().

◆ acquireFileVersion()

void FileDefImpl::acquireFileVersion ( )
private

Definition at line 1640 of file filedef.cpp.

1641{
1642 QCString vercmd = Config_getString(FILE_VERSION_FILTER);
1643 if (!vercmd.isEmpty() && !m_filePath.isEmpty() && !isReference() &&
1644 m_filePath!="generated" && m_filePath!="graph_legend.dox")
1645 {
1646 msg("Version of %s : ",qPrint(m_filePath));
1647 QCString cmd = vercmd+" \""+m_filePath+"\"";
1648 Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
1649 FILE *f=Portable::popen(cmd,"r");
1650 if (!f)
1651 {
1652 err("could not execute %s\n",qPrint(vercmd));
1653 return;
1654 }
1655 const int bufSize=1024;
1656 char buf[bufSize];
1657 int numRead = static_cast<int>(fread(buf,1,bufSize-1,f));
1659 if (numRead>0 && numRead<bufSize)
1660 {
1661 buf[numRead]='\0';
1662 m_fileVersion=QCString(buf,numRead).stripWhiteSpace();
1663 if (!m_fileVersion.isEmpty())
1664 {
1665 msg("%s\n",qPrint(m_fileVersion));
1666 return;
1667 }
1668 }
1669 msg("no version available\n");
1670 }
1671}
@ ExtCmd
Definition debug.h:35
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition debug.cpp:81
virtual bool isReference() const =0
QCString m_fileVersion
Definition filedef.cpp:251
#define Config_getString(name)
Definition config.h:32
void msg(const char *fmt,...)
Definition message.cpp:98
#define err(fmt,...)
Definition message.h:84
FILE * popen(const QCString &name, const QCString &type)
Definition portable.cpp:496
int pclose(FILE *stream)
Definition portable.cpp:505
const char * qPrint(const char *s)
Definition qcstring.h:672

References Config_getString, err, Debug::ExtCmd, QCString::isEmpty(), DefinitionMixin< FileDef >::isReference(), m_filePath, m_fileVersion, msg(), Portable::pclose(), Portable::popen(), Debug::print(), qPrint(), and QCString::stripWhiteSpace().

Referenced by FileDefImpl().

◆ addIncludedByDependency()

void FileDefImpl::addIncludedByDependency ( const FileDef * fd,
const QCString & incName,
IncludeKind kind )
overridevirtual

Implements FileDef.

Definition at line 1546 of file filedef.cpp.

1547{
1548 //printf("FileDefImpl::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local);
1549 QCString iName = fd ? fd->absFilePath() : incName;
1550 if (!iName.isEmpty() && m_includedByMap.find(iName.str())==m_includedByMap.end())
1551 {
1552 m_includedByList.emplace_back(fd,incName,kind);
1553 m_includedByMap.emplace(iName.str(),&m_includedByList.back());
1554 }
1555}
virtual QCString absFilePath() const =0
IncludeInfoList m_includedByList
Definition filedef.cpp:238
IncludeInfoMap m_includedByMap
Definition filedef.cpp:237
const std::string & str() const
Definition qcstring.h:537

References FileDef::absFilePath(), QCString::isEmpty(), m_includedByList, m_includedByMap, and QCString::str().

◆ addIncludeDependency()

void FileDefImpl::addIncludeDependency ( const FileDef * fd,
const QCString & incName,
IncludeKind kind )
overridevirtual

Implements FileDef.

Definition at line 1487 of file filedef.cpp.

1488{
1489 //printf("FileDefImpl::addIncludeDependency(%p,%s,%d)\n",(void*)fd,qPrint(incName),kind);
1490 QCString iName = fd ? fd->absFilePath() : incName;
1491 if (!iName.isEmpty() && m_includeMap.find(iName.str())==m_includeMap.end())
1492 {
1493 m_includeList.emplace_back(fd,incName,kind);
1494 m_includeMap.emplace(iName.str(),&m_includeList.back());
1495 }
1496}
IncludeInfoMap m_includeMap
Definition filedef.cpp:235
IncludeInfoList m_includeList
Definition filedef.cpp:236

References FileDef::absFilePath(), QCString::isEmpty(), m_includeList, m_includeMap, and QCString::str().

◆ addIncludedUsingDirectives()

void FileDefImpl::addIncludedUsingDirectives ( FileDefSet & visitedFiles)
overridevirtual

Implements FileDef.

Definition at line 1498 of file filedef.cpp.

1499{
1500 if (visitedFiles.find(this)!=visitedFiles.end()) return; // file already processed
1501 visitedFiles.insert(this);
1502 //printf("( FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
1503
1504 if (!m_includeList.empty()) // file contains #includes
1505 {
1506 {
1507 for (const auto &ii : m_includeList) // foreach #include...
1508 {
1509 if (ii.fileDef) // ...that is a known file
1510 {
1511 // recurse into this file
1512 const_cast<FileDef*>(ii.fileDef)->addIncludedUsingDirectives(visitedFiles);
1513 }
1514 }
1515 }
1516 {
1517 // iterate through list from last to first
1518 for (auto ii_it = m_includeList.rbegin(); ii_it!=m_includeList.rend(); ++ii_it)
1519 {
1520 auto &ii = *ii_it;
1521 if (ii.fileDef && ii.fileDef!=this)
1522 {
1523 // add using directives
1524 auto unl = ii.fileDef->getUsedNamespaces();
1525 for (auto it = unl.rbegin(); it!=unl.rend(); ++it)
1526 {
1527 auto *nd = *it;
1528 //printf(" adding using directive for %s\n",qPrint(nd->qualifiedName()));
1529 m_usingDirList.prepend(nd->qualifiedName(),nd);
1530 }
1531 // add using declarations
1532 auto udl = ii.fileDef->getUsedDefinitions();
1533 for (auto it = udl.rbegin(); it!=udl.rend(); ++it)
1534 {
1535 auto *d = *it;
1536 m_usingDeclList.prepend(d->qualifiedName(),d);
1537 }
1538 }
1539 }
1540 }
1541 }
1542 //printf(") end FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
1543}
void addIncludedUsingDirectives(FileDefSet &visitedFiles) override
Definition filedef.cpp:1498
LinkedRefMap< const Definition > m_usingDeclList
Definition filedef.cpp:240
LinkedRefMap< NamespaceDef > m_usingDirList
Definition filedef.cpp:239

References addIncludedUsingDirectives(), QCString::insert(), m_includeList, m_usingDeclList, and m_usingDirList.

Referenced by addIncludedUsingDirectives().

◆ addListReferences()

void FileDefImpl::addListReferences ( )
overridevirtual

Implements FileDef.

Definition at line 1575 of file filedef.cpp.

1576{
1577 {
1578 const RefItemVector &xrefItems = xrefListItems();
1579 addRefItem(xrefItems,
1583 QCString(),
1584 nullptr
1585 );
1586 }
1587 for (const auto &mg : m_memberGroups)
1588 {
1589 mg->addListReferences(this);
1590 }
1591 for (auto &ml : m_memberLists)
1592 {
1593 if (ml->listType().isDocumentation())
1594 {
1595 ml->addListReferences(this);
1596 }
1597 }
1598}
const RefItemVector & xrefListItems() const override
QCString getOutputFileBase() const override
Definition filedef.cpp:1686
MemberGroupList m_memberGroups
Definition filedef.cpp:255
const QCString & name() const override
Definition filedef.cpp:1435
MemberLists m_memberLists
Definition filedef.cpp:254
virtual QCString trFile(bool first_capital, bool singular)=0
Translator * theTranslator
Definition language.cpp:71
#define TRUE
Definition qcstring.h:37
std::vector< RefItem * > RefItemVector
Definition reflist.h:133
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
Definition util.cpp:5146

References addRefItem(), getOutputFileBase(), m_memberGroups, m_memberLists, name(), theTranslator, TRUE, and DefinitionMixin< FileDef >::xrefListItems().

◆ addMembersToMemberGroup()

void FileDefImpl::addMembersToMemberGroup ( )
overridevirtual

Implements FileDef.

Definition at line 1253 of file filedef.cpp.

1254{
1255 for (auto &ml : m_memberLists)
1256 {
1257 if (ml->listType().isDeclaration())
1258 {
1260 }
1261 }
1262
1263 // add members inside sections to their groups
1264 for (const auto &mg : m_memberGroups)
1265 {
1266 if (mg->allMembersInSameSection() && m_subGrouping)
1267 {
1268 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
1269 mg->addToDeclarationSection();
1270 }
1271 }
1272}
void addMembersToMemberGroup() override
Definition filedef.cpp:1253

References addMembersToMemberGroup(), m_memberGroups, m_memberLists, and m_subGrouping.

Referenced by addMembersToMemberGroup().

◆ addMemberToList()

void FileDefImpl::addMemberToList ( MemberListType lt,
MemberDef * md )
private

Definition at line 1697 of file filedef.cpp.

1698{
1699 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1700 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1701 const auto &ml = m_memberLists.get(lt,MemberListContainer::File);
1702 ml->setNeedsSorting(
1703 (ml->listType().isDeclaration() && sortBriefDocs) ||
1704 (ml->listType().isDocumentation() && sortMemberDocs));
1705 ml->push_back(md);
1706 if (ml->listType().isDeclaration())
1707 {
1708 MemberDefMutable *mdm = toMemberDefMutable(md);
1709 if (mdm)
1710 {
1711 mdm->setSectionList(this,ml.get());
1712 }
1713 }
1714}
virtual void setSectionList(const Definition *container, const MemberList *sl)=0
MemberDefMutable * toMemberDefMutable(Definition *d)

References Config_getBool, File, m_memberLists, MemberDefMutable::setSectionList(), and toMemberDefMutable().

Referenced by insertMember().

◆ addSourceRef()

void FileDefImpl::addSourceRef ( int line,
const Definition * d,
const MemberDef * md )
overridevirtual

Implements FileDef.

Definition at line 1443 of file filedef.cpp.

1444{
1445 //printf("FileDefImpl::addSourceRef(%d,%s,%s)\n",line,qPrint(d?d->name():"nullptr"),qPrint(md?md->name():"nullptr"));
1446 if (d)
1447 {
1448 m_srcDefMap.emplace(line,d);
1449 if (md) m_srcMemberMap.emplace(line,md);
1450 //printf("Adding member %s with anchor %s at line %d to file %s\n",
1451 // md?qPrint(md->name()):"<none>",md?qPrint(md->anchor()):"<none>",line,qPrint(name()));
1452 }
1453}
MemberDefLineMap m_srcMemberMap
Definition filedef.cpp:249
DefinitionLineMap m_srcDefMap
Definition filedef.cpp:248

References m_srcDefMap, and m_srcMemberMap.

◆ addUsingDeclaration()

void FileDefImpl::addUsingDeclaration ( const Definition * d)
overridevirtual

Implements FileDef.

Definition at line 1482 of file filedef.cpp.

1483{
1484 m_usingDeclList.add(d->qualifiedName(),d);
1485}
virtual QCString qualifiedName() const =0

References m_usingDeclList, and Definition::qualifiedName().

Referenced by combineUsingRelations().

◆ addUsingDirective()

void FileDefImpl::addUsingDirective ( NamespaceDef * nd)
overridevirtual

Implements FileDef.

Definition at line 1470 of file filedef.cpp.

1471{
1472 m_usingDirList.add(nd->qualifiedName(),nd);
1473 //printf("%p: FileDefImpl::addUsingDirective: %s:%d\n",this,qPrint(name()),usingDirList->count());
1474}

References m_usingDirList, and Definition::qualifiedName().

Referenced by combineUsingRelations().

◆ anchor()

QCString FileDefImpl::anchor ( ) const
inlineoverridevirtual

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

Implements Definition.

Definition at line 136 of file filedef.cpp.

136{ return QCString(); }

◆ codeSymbolType()

CodeSymbolType FileDefImpl::codeSymbolType ( ) const
inlineoverridevirtual

Used for syntax highlighting symbol class

Implements Definition.

Definition at line 130 of file filedef.cpp.

130{ return CodeSymbolType::Default; }

References Default.

◆ combineUsingRelations()

void FileDefImpl::combineUsingRelations ( )
overridevirtual

Implements FileDef.

Definition at line 1602 of file filedef.cpp.

1603{
1604 LinkedRefMap<NamespaceDef> usingDirList = m_usingDirList;
1605 NamespaceDefSet visitedNamespaces;
1606 for (auto &nd : usingDirList)
1607 {
1608 NamespaceDefMutable *ndm = toNamespaceDefMutable(nd);
1609 if (ndm)
1610 {
1611 ndm->combineUsingRelations(visitedNamespaces);
1612 }
1613 }
1614
1615 for (auto &nd : usingDirList)
1616 {
1617 // add used namespaces of namespace nd to this namespace
1618 for (const auto &und : nd->getUsedNamespaces())
1619 {
1620 addUsingDirective(und);
1621 }
1622 // add used classes of namespace nd to this namespace
1623 for (const auto &ud : nd->getUsedDefinitions())
1624 {
1626 }
1627 }
1628}
void addUsingDirective(NamespaceDef *nd) override
Definition filedef.cpp:1470
void addUsingDeclaration(const Definition *d) override
Definition filedef.cpp:1482
virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace)=0
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
std::unordered_set< const NamespaceDef * > NamespaceDefSet

References addUsingDeclaration(), addUsingDirective(), NamespaceDefMutable::combineUsingRelations(), m_usingDirList, and toNamespaceDefMutable().

◆ computeAnchors()

void FileDefImpl::computeAnchors ( )
overridevirtual

Compute the HTML anchor names for all members in the class

Implements FileDef.

Definition at line 329 of file filedef.cpp.

330{
331 MemberList *ml = getMemberList(MemberListType::AllMembersList());
332 if (ml) ml->setAnchors();
333}
MemberList * getMemberList(MemberListType lt) const override
Definition filedef.cpp:1755
void setAnchors()

References getMemberList(), and MemberList::setAnchors().

◆ countMembers()

void FileDefImpl::countMembers ( )
overridevirtual

Implements FileDef.

Definition at line 1839 of file filedef.cpp.

1840{
1841 for (auto &ml : m_memberLists)
1842 {
1843 ml->countDecMembers();
1844 ml->countDocMembers();
1845 }
1846 for (const auto &mg : m_memberGroups)
1847 {
1848 mg->countDecMembers();
1849 mg->countDocMembers();
1850 }
1851}

References m_memberGroups, and m_memberLists.

◆ definitionType()

DefType FileDefImpl::definitionType ( ) const
inlineoverridevirtual

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

Implements Definition.

Definition at line 129 of file filedef.cpp.

129{ return TypeFile; }

References definitionType(), and Definition::TypeFile.

Referenced by definitionType().

◆ displayName()

QCString FileDefImpl::displayName ( bool includeScope = TRUE) const
inlineoverridevirtual

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

Implements Definition.

Definition at line 133 of file filedef.cpp.

133{ return localName(); }
const QCString & localName() const override

References DefinitionMixin< FileDef >::localName(), and TRUE.

Referenced by writeDocumentation().

◆ distributeMemberGroupDocumentation()

void FileDefImpl::distributeMemberGroupDocumentation ( )
overridevirtual

Implements FileDef.

Definition at line 335 of file filedef.cpp.

336{
337 //printf("FileDefImpl::distributeMemberGroupDocumentation()\n");
338 for (const auto &mg : m_memberGroups)
339 {
340 mg->distributeMemberGroupDocumentation();
341 }
342}

References m_memberGroups.

◆ docName()

const QCString & FileDefImpl::docName ( ) const
inlineoverridevirtual

Returns the name as it is used in the documentation

Implements FileDef.

Definition at line 142 of file filedef.cpp.

142{ return m_docname; }

References m_docname.

◆ endMemberDeclarations()

void FileDefImpl::endMemberDeclarations ( OutputList & ol)
private

Definition at line 735 of file filedef.cpp.

736{
738}
void endMemberSections()
Definition outputlist.h:464

References OutputList::endMemberSections().

Referenced by writeDocumentation().

◆ endMemberDocumentation()

void FileDefImpl::endMemberDocumentation ( OutputList & ol)
private

Definition at line 749 of file filedef.cpp.

750{
751 if (Config_getBool(SEPARATE_MEMBER_PAGES))
752 {
755 }
756}
static bool suppressDocWarnings
Definition doxygen.h:132
void enable(OutputType o)
#define FALSE
Definition qcstring.h:34

References Config_getBool, OutputList::enable(), FALSE, Html, and Doxygen::suppressDocWarnings.

Referenced by writeDocumentation().

◆ fileName()

QCString FileDefImpl::fileName ( ) const
inlineoverridevirtual

Returns the unique file name (this may include part of the path).

Implements FileDef.

Definition at line 134 of file filedef.cpp.

134{ return m_fileName; }

References m_fileName.

◆ fileVersion()

QCString FileDefImpl::fileVersion ( ) const
overridevirtual

Implements FileDef.

Definition at line 1824 of file filedef.cpp.

1825{
1826 return m_fileVersion;
1827}

References m_fileVersion.

◆ findSectionsInDocumentation()

void FileDefImpl::findSectionsInDocumentation ( )
overridevirtual

Implements FileDef.

Definition at line 344 of file filedef.cpp.

345{
349 for (const auto &mg : m_memberGroups)
350 {
351 mg->findSectionsInDocumentation(this);
352 }
353
354 for (auto &ml : m_memberLists)
355 {
356 if (ml->listType().isDeclaration())
357 {
358 ml->findSectionsInDocumentation(this);
359 }
360 }
361}
QCString docFile() const override
QCString briefDescription(bool abbreviate=FALSE) const override
QCString inbodyDocumentation() const override
QCString documentation() const override
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)

References DefinitionMixin< FileDef >::briefDescription(), DefinitionMixin< FileDef >::docFile(), docFindSections(), DefinitionMixin< FileDef >::documentation(), DefinitionMixin< FileDef >::inbodyDocumentation(), m_memberGroups, and m_memberLists.

◆ generateSourceFile()

bool FileDefImpl::generateSourceFile ( ) const
overridevirtual

Implements FileDef.

Definition at line 1563 of file filedef.cpp.

1564{
1565 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1566 bool verbatimHeaders = Config_getBool(VERBATIM_HEADERS);
1567 return !isReference() &&
1568 (sourceBrowser ||
1569 (verbatimHeaders && (guessSection(name()).isHeader() || !m_includedByMap.empty()))
1570 ) &&
1572}
bool isReference() const override
bool isDocumentationFile() const override
Definition filedef.cpp:1630

References Config_getBool, guessSection(), isDocumentationFile(), DefinitionMixin< FileDef >::isReference(), m_includedByMap, and name().

Referenced by writeSourceHeader(), and writeSourceLink().

◆ getAllIncludeFilesRecursively()

void FileDefImpl::getAllIncludeFilesRecursively ( StringVector & incFiles) const
overridevirtual

Implements FileDef.

Definition at line 1813 of file filedef.cpp.

1814{
1815 StringUnorderedSet includes;
1816 ::getAllIncludeFilesRecursively(includes,this,incFiles);
1817}
void getAllIncludeFilesRecursively(StringVector &incFiles) const override
Definition filedef.cpp:1813
std::unordered_set< std::string > StringUnorderedSet
Definition containers.h:29

References getAllIncludeFilesRecursively().

Referenced by getAllIncludeFilesRecursively().

◆ getClasses()

const ClassLinkedRefMap & FileDefImpl::getClasses ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 164 of file filedef.cpp.

164{ return m_classes; }
ClassLinkedRefMap m_classes
Definition filedef.cpp:257

References m_classes.

◆ getConcepts()

const ConceptLinkedRefMap & FileDefImpl::getConcepts ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 163 of file filedef.cpp.

163{ return m_concepts; }
ConceptLinkedRefMap m_concepts
Definition filedef.cpp:261

References m_concepts.

◆ getDirDef()

DirDef * FileDefImpl::getDirDef ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 152 of file filedef.cpp.

152{ return m_dir; }

References m_dir.

Referenced by writeDocumentation(), and writeSourceHeader().

◆ getMemberGroups()

const MemberGroupList & FileDefImpl::getMemberGroups ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 161 of file filedef.cpp.

161{ return m_memberGroups; }

References m_memberGroups.

◆ getMemberList()

MemberList * FileDefImpl::getMemberList ( MemberListType lt) const
overridevirtual

Implements FileDef.

Definition at line 1755 of file filedef.cpp.

1756{
1757 for (auto &ml : m_memberLists)
1758 {
1759 if (ml->listType()==lt)
1760 {
1761 return ml.get();
1762 }
1763 }
1764 return nullptr;
1765}

References m_memberLists.

Referenced by computeAnchors(), insertMember(), numDecMembers(), numDocMembers(), removeMemberFromList(), writeDocumentation(), writeMemberDeclarations(), writeMemberDocumentation(), writeQuickMemberLinks(), writeSummaryLinks(), and writeTagFile().

◆ getMemberLists()

const MemberLists & FileDefImpl::getMemberLists ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 160 of file filedef.cpp.

160{ return m_memberLists; }

References m_memberLists.

◆ getModuleDef()

ModuleDef * FileDefImpl::getModuleDef ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 153 of file filedef.cpp.

153{ return m_moduleDef; }
ModuleDef * m_moduleDef
Definition filedef.cpp:253

References m_moduleDef.

◆ getNamespaces()

const NamespaceLinkedRefMap & FileDefImpl::getNamespaces ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 162 of file filedef.cpp.

162{ return m_namespaces; }
NamespaceLinkedRefMap m_namespaces
Definition filedef.cpp:256

References m_namespaces.

◆ getOutputFileBase()

QCString FileDefImpl::getOutputFileBase ( ) const
overridevirtual

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

Implements Definition.

Definition at line 1686 of file filedef.cpp.

1687{
1688 return m_outputDiskName;
1689}
QCString m_outputDiskName
Definition filedef.cpp:245

References m_outputDiskName.

Referenced by addListReferences(), writeDocumentation(), writeSourceHeader(), and writeTagFile().

◆ getPath()

QCString FileDefImpl::getPath ( ) const
inlineoverridevirtual

Returns the absolute path of this file.

Implements FileDef.

Definition at line 147 of file filedef.cpp.

147{ return m_path; }

References m_path.

Referenced by writeTagFile().

◆ getSourceDefinition()

const Definition * FileDefImpl::getSourceDefinition ( int lineNr) const
overridevirtual

Implements FileDef.

Definition at line 1455 of file filedef.cpp.

1456{
1457 auto it = m_srcDefMap.find(lineNr);
1458 //printf("%s::getSourceDefinition(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcDefMap.end()?qPrint(it->second->name()):"none");
1459 return it!=m_srcDefMap.end() ? it->second : nullptr;
1460}

References m_srcDefMap.

◆ getSourceFileBase()

QCString FileDefImpl::getSourceFileBase ( ) const
overridevirtual

Returns the name of the source listing of this definition.

Reimplemented from DefinitionMixin< FileDef >.

Definition at line 1674 of file filedef.cpp.

1675{
1676 if (Htags::useHtags)
1677 {
1679 }
1680 else
1681 {
1682 return m_outputDiskName+"_source";
1683 }
1684}
static QCString path2URL(const QCString &path)
Definition htags.cpp:157
static bool useHtags
Definition htags.h:23

References m_filePath, m_outputDiskName, Htags::path2URL(), and Htags::useHtags.

Referenced by includeName(), writeDetailedDescription(), and writeSourceHeader().

◆ getSourceMember()

const MemberDef * FileDefImpl::getSourceMember ( int lineNr) const
overridevirtual

Implements FileDef.

Definition at line 1462 of file filedef.cpp.

1463{
1464 auto it = m_srcMemberMap.find(lineNr);
1465 //printf("%s::getSourceMember(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcMemberMap.end()?qPrint(it->second->name()):"none");
1466 return it!=m_srcMemberMap.end() ? it->second : nullptr;
1467}

References m_srcMemberMap.

◆ getUsedDefinitions()

const LinkedRefMap< const Definition > & FileDefImpl::getUsedDefinitions ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 155 of file filedef.cpp.

155{ return m_usingDeclList; }

References m_usingDeclList.

◆ getUsedNamespaces()

const LinkedRefMap< NamespaceDef > & FileDefImpl::getUsedNamespaces ( ) const
overridevirtual

Implements FileDef.

Definition at line 1476 of file filedef.cpp.

1477{
1478 //printf("%p: FileDefImpl::getUsedNamespace: %s:%d\n",this,qPrint(name()),usingDirList?usingDirList->count():0);
1479 return m_usingDirList;
1480}

References m_usingDirList.

◆ getVersion()

QCString FileDefImpl::getVersion ( ) const
inlineoverridevirtual

Returns version of this file.

Implements FileDef.

Definition at line 148 of file filedef.cpp.

148{ return m_fileVersion; }

References m_fileVersion.

◆ hasDetailedDescription()

bool FileDefImpl::hasDetailedDescription ( ) const
overridevirtual

Implements FileDef.

Definition at line 363 of file filedef.cpp.

364{
365 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
366 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
367 return ((!briefDescription().isEmpty() && repeatBrief) ||
368 !documentation().stripWhiteSpace().isEmpty() || // avail empty section
369 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef())
370 );
371}
const FileDef * getBodyDef() const override
int getStartBodyLine() const override
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
Definition stringutil.h:72

References DefinitionMixin< FileDef >::briefDescription(), Config_getBool, DefinitionMixin< FileDef >::documentation(), DefinitionMixin< FileDef >::getBodyDef(), DefinitionMixin< FileDef >::getStartBodyLine(), and stripWhiteSpace().

Referenced by writeDetailedDescription().

◆ hasIncludedByGraph()

bool FileDefImpl::hasIncludedByGraph ( ) const
overridevirtual

Implements FileDef.

Definition at line 1880 of file filedef.cpp.

1881{
1882 return m_hasIncludedByGraph;
1883}
bool m_hasIncludedByGraph
Definition filedef.cpp:264

References m_hasIncludedByGraph.

◆ hasIncludeGraph()

bool FileDefImpl::hasIncludeGraph ( ) const
overridevirtual

Implements FileDef.

Definition at line 1875 of file filedef.cpp.

1876{
1877 return m_hasIncludeGraph;
1878}
bool m_hasIncludeGraph
Definition filedef.cpp:263

References m_hasIncludeGraph.

◆ includedByDependencyGraphFileName()

QCString FileDefImpl::includedByDependencyGraphFileName ( ) const
overridevirtual

Implements FileDef.

Definition at line 1834 of file filedef.cpp.

1835{
1836 return m_inclByDepFileName;
1837}
QCString m_inclByDepFileName
Definition filedef.cpp:244

References m_inclByDepFileName.

◆ includedByFileList()

const IncludeInfoList & FileDefImpl::includedByFileList ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 157 of file filedef.cpp.

157{ return m_includedByList; }

References m_includedByList.

◆ includeDependencyGraphFileName()

QCString FileDefImpl::includeDependencyGraphFileName ( ) const
overridevirtual

Implements FileDef.

Definition at line 1829 of file filedef.cpp.

1830{
1831 return m_inclDepFileName;
1832}
QCString m_inclDepFileName
Definition filedef.cpp:243

References m_inclDepFileName.

◆ includeFileList()

const IncludeInfoList & FileDefImpl::includeFileList ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 156 of file filedef.cpp.

156{ return m_includeList; }

References m_includeList.

◆ includeName()

QCString FileDefImpl::includeName ( ) const
overridevirtual

Returns the name of the verbatim copy of this file (if any).

Implements FileDef.

Definition at line 1692 of file filedef.cpp.

1693{
1694 return getSourceFileBase();
1695}
QCString getSourceFileBase() const override
Definition filedef.cpp:1674

References getSourceFileBase().

Referenced by writeSourceLink().

◆ insertClass()

void FileDefImpl::insertClass ( ClassDef * cd)
overridevirtual

Adds compound definition cd to the list of all compounds of this file

Implements FileDef.

Definition at line 1397 of file filedef.cpp.

1398{
1399 if (cd->isHidden()) return;
1400
1401 ClassLinkedRefMap *list = &m_classes;
1402
1403 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
1404 {
1406 {
1407 list = &m_interfaces;
1408 }
1409 else if (cd->compoundType()==ClassDef::Struct)
1410 {
1411 list = &m_structs;
1412 }
1413 else if (cd->compoundType()==ClassDef::Exception)
1414 {
1415 list = &m_exceptions;
1416 }
1417 }
1418
1419 list->add(cd->name(),cd);
1420}
@ Interface
Definition classdef.h:112
@ Exception
Definition classdef.h:115
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
virtual bool isHidden() const =0
virtual const QCString & name() const =0
ClassLinkedRefMap m_interfaces
Definition filedef.cpp:258
ClassLinkedRefMap m_structs
Definition filedef.cpp:259
ClassLinkedRefMap m_exceptions
Definition filedef.cpp:260
bool add(const char *k, T *obj)
Adds an object reference to the ordered vector if it was not added already.
Definition linkedmap.h:284

References LinkedRefMap< T, Hash, KeyEqual, Map >::add(), ClassDef::compoundType(), Config_getBool, ClassDef::Exception, ClassDef::Interface, Definition::isHidden(), m_classes, m_exceptions, m_interfaces, m_structs, Definition::name(), and ClassDef::Struct.

◆ insertConcept()

void FileDefImpl::insertConcept ( ConceptDef * cd)
overridevirtual

Implements FileDef.

Definition at line 1422 of file filedef.cpp.

1423{
1424 if (cd->isHidden()) return;
1425 m_concepts.add(cd->name(),cd);
1426}

References Definition::isHidden(), m_concepts, and Definition::name().

◆ insertMember()

void FileDefImpl::insertMember ( MemberDef * md)
overridevirtual

Adds member definition md to the list of all members of this file

Implements FileDef.

Definition at line 1275 of file filedef.cpp.

1276{
1277 if (md->isHidden()) return;
1278 //printf("%s:FileDefImpl::insertMember(%s (=%p) list has %d elements)\n",
1279 // qPrint(name()),qPrint(md->name()),md,allMemberList.count());
1280 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1281 if (allMemberList && allMemberList->contains(md))
1282 {
1283 return;
1284 }
1285
1286 if (allMemberList==nullptr)
1287 {
1288 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::File));
1289 allMemberList = m_memberLists.back().get();
1290 }
1291 allMemberList->push_back(md);
1292 switch (md->memberType())
1293 {
1295 if (md->getLanguage() == SrcLangExt::Python)
1296 {
1297 addMemberToList(MemberListType::PropertyMembers(),md);
1298 addMemberToList(MemberListType::Properties(),md);
1299 break;
1300 }
1301 // fallthrough, explicitly no break here
1303 addMemberToList(MemberListType::DecVarMembers(),md);
1304 addMemberToList(MemberListType::DocVarMembers(),md);
1305 break;
1307 addMemberToList(MemberListType::DecFuncMembers(),md);
1308 addMemberToList(MemberListType::DocFuncMembers(),md);
1309 break;
1311 addMemberToList(MemberListType::DecTypedefMembers(),md);
1312 addMemberToList(MemberListType::DocTypedefMembers(),md);
1313 break;
1315 addMemberToList(MemberListType::DecSequenceMembers(),md);
1316 addMemberToList(MemberListType::DocSequenceMembers(),md);
1317 break;
1319 addMemberToList(MemberListType::DecDictionaryMembers(),md);
1320 addMemberToList(MemberListType::DocDictionaryMembers(),md);
1321 break;
1323 addMemberToList(MemberListType::DecEnumMembers(),md);
1324 addMemberToList(MemberListType::DocEnumMembers(),md);
1325 break;
1326 case MemberType::EnumValue: // enum values are shown inside their enums
1327 break;
1328 case MemberType::Define:
1329 addMemberToList(MemberListType::DecDefineMembers(),md);
1330 addMemberToList(MemberListType::DocDefineMembers(),md);
1331 break;
1332 default:
1333 err("FileDefImpl::insertMembers(): "
1334 "member '%s' with class scope '%s' inserted in file scope '%s'!\n",
1335 qPrint(md->name()),
1336 md->getClassDef() ? qPrint(md->getClassDef()->name()) : "<global>",
1337 qPrint(name()));
1338 }
1339 //addMemberToGroup(md,groupId);
1340}
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
void addMemberToList(MemberListType lt, MemberDef *md)
Definition filedef.cpp:1697
virtual const ClassDef * getClassDef() const =0
virtual MemberType memberType() const =0
bool contains(const MemberDef *md) const
Definition memberlist.h:88
void push_back(const T &value)
Definition memberlist.h:47
@ Enumeration
Definition types.h:395
@ EnumValue
Definition types.h:396
@ Dictionary
Definition types.h:406
@ Sequence
Definition types.h:405
@ Variable
Definition types.h:393
@ Property
Definition types.h:401
@ Typedef
Definition types.h:394
@ Function
Definition types.h:392
@ Python
Definition types.h:52

References addMemberToList(), MemberVector::contains(), Define, Dictionary, Enumeration, EnumValue, err, File, Function, MemberDef::getClassDef(), Definition::getLanguage(), getMemberList(), Definition::isHidden(), m_memberLists, MemberDef::memberType(), Definition::name(), name(), Property, MemberVector::push_back(), Python, qPrint(), Sequence, Typedef, and Variable.

◆ insertNamespace()

void FileDefImpl::insertNamespace ( NamespaceDef * nd)
overridevirtual

Adds namespace definition nd to the list of all compounds of this file

Implements FileDef.

Definition at line 1429 of file filedef.cpp.

1430{
1431 if (nd->isHidden()) return;
1432 m_namespaces.add(nd->name(),nd);
1433}

References Definition::isHidden(), m_namespaces, and Definition::name().

◆ isDocumentationFile()

bool FileDefImpl::isDocumentationFile ( ) const
overridevirtual

Implements FileDef.

Definition at line 1630 of file filedef.cpp.

1631{
1632 static const std::unordered_set<std::string> docExtensions =
1633 { "doc", "txt", "dox", "md", "markdown" };
1634
1635 int lastDot = name().findRev('.');
1636 return (lastDot!=-1 && docExtensions.find(name().mid(lastDot+1).str())!=docExtensions.end()) ||
1638}
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
@ Markdown
Definition types.h:57
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5591

References QCString::findRev(), getFileNameExtension(), getLanguageFromFileName(), Markdown, and name().

Referenced by generateSourceFile(), and writeSourceHeader().

◆ isIncluded()

bool FileDefImpl::isIncluded ( const QCString & name) const
overridevirtual

Implements FileDef.

Definition at line 1557 of file filedef.cpp.

1558{
1559 if (name.isEmpty()) return FALSE;
1560 return m_includeMap.find(name.str())!=m_includeMap.end();
1561}

References FALSE, m_includeMap, and name().

◆ isLinkable()

bool FileDefImpl::isLinkable ( ) const
inlineoverridevirtual

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

Implements Definition.

Definition at line 150 of file filedef.cpp.

150{ return isLinkableInProject() || isReference(); }
bool isLinkableInProject() const override
Definition filedef.cpp:1791

References isLinkableInProject(), and DefinitionMixin< FileDef >::isReference().

Referenced by writeSourceHeader().

◆ isLinkableInProject()

bool FileDefImpl::isLinkableInProject ( ) const
overridevirtual

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

Implements Definition.

Definition at line 1791 of file filedef.cpp.

1792{
1793 bool showFiles = Config_getBool(SHOW_FILES);
1794 return hasDocumentation() && !isReference() && (showFiles || isLinkableViaGroup());
1795}
bool isLinkableViaGroup() const override
bool hasDocumentation() const override

References Config_getBool, DefinitionMixin< FileDef >::hasDocumentation(), DefinitionMixin< FileDef >::isLinkableViaGroup(), and DefinitionMixin< FileDef >::isReference().

Referenced by isLinkable().

◆ isSource()

bool FileDefImpl::isSource ( ) const
inlineoverridevirtual

Returns TRUE if this file is a source file.

Implements FileDef.

Definition at line 143 of file filedef.cpp.

143{ return m_isSource; }

References m_isSource.

◆ name()

◆ numDecMembers()

int FileDefImpl::numDecMembers ( ) const
overridevirtual

Implements FileDef.

Definition at line 1859 of file filedef.cpp.

1860{
1861 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1862 return ml ? ml->numDecMembers() : 0;
1863}
int numDecMembers() const
Definition memberlist.h:116

References getMemberList(), and MemberList::numDecMembers().

◆ numDocMembers()

int FileDefImpl::numDocMembers ( ) const
overridevirtual

Implements FileDef.

Definition at line 1853 of file filedef.cpp.

1854{
1855 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1856 return ml ? ml->numDocMembers() : 0;
1857}
int numDocMembers() const
Definition memberlist.h:118

References getMemberList(), and MemberList::numDocMembers().

◆ overrideIncludedByGraph()

void FileDefImpl::overrideIncludedByGraph ( bool e)
overridevirtual

Implements FileDef.

Definition at line 1870 of file filedef.cpp.

1871{
1873}

References m_hasIncludedByGraph.

◆ overrideIncludeGraph()

void FileDefImpl::overrideIncludeGraph ( bool e)
overridevirtual

Implements FileDef.

Definition at line 1865 of file filedef.cpp.

1866{
1868}

References m_hasIncludeGraph.

◆ parseSource()

void FileDefImpl::parseSource ( ClangTUParser * clangParser)
overridevirtual

Implements FileDef.

Definition at line 1226 of file filedef.cpp.

1227{
1228 bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
1229 OutputCodeList devNullList;
1230 devNullList.add<DevNullCodeGenerator>();
1231#if USE_LIBCLANG
1232 if (Doxygen::clangAssistedParsing && clangParser &&
1234 {
1235 clangParser->switchToFile(this);
1236 clangParser->writeSources(devNullList,this);
1237 }
1238 else
1239#endif
1240 {
1242 intf->resetCodeParserState();
1243 intf->parseCode(
1244 devNullList,QCString(),
1245 fileToString(absFilePath(),filterSourceFiles,TRUE),
1246 getLanguage(),
1247 Config_getBool(STRIP_CODE_COMMENTS),
1248 FALSE,QCString(),this
1249 );
1250 }
1251}
void switchToFile(const FileDef *fd)
Switches to another file within the translation unit started with start().
void writeSources(OutputCodeList &ol, const FileDef *fd)
writes the syntax highlighted source code for a file
QCString getDefFileExtension() const override
SrcLangExt getLanguage() const override
static bool clangAssistedParsing
Definition doxygen.h:138
static ParserManager * parserManager
Definition doxygen.h:131
QCString absFilePath() const override
Definition filedef.cpp:141
void add(OutputCodeIntfPtr &&p)
Definition outputlist.h:194
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
Definition parserintf.h:218
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1414

References absFilePath(), OutputCodeList::add(), Doxygen::clangAssistedParsing, Config_getBool, Cpp, FALSE, fileToString(), DefinitionMixin< FileDef >::getDefFileExtension(), DefinitionMixin< FileDef >::getLanguage(), ObjC, Doxygen::parserManager, and TRUE.

◆ removeMember()

void FileDefImpl::removeMember ( MemberDef * md)
overridevirtual

Implements FileDef.

Definition at line 1348 of file filedef.cpp.

1349{
1350 removeMemberFromList(MemberListType::AllMembersList(),md);
1351 switch(md->memberType())
1352 {
1354 if (md->getLanguage() == SrcLangExt::Python)
1355 {
1356 removeMemberFromList(MemberListType::PropertyMembers(),md);
1357 removeMemberFromList(MemberListType::Properties(),md);
1358 break;
1359 }
1360 // fallthrough, explicitly no break here
1362 removeMemberFromList(MemberListType::DecVarMembers(),md);
1363 removeMemberFromList(MemberListType::DocVarMembers(),md);
1364 break;
1366 removeMemberFromList(MemberListType::DecFuncMembers(),md);
1367 removeMemberFromList(MemberListType::DocFuncMembers(),md);
1368 break;
1370 removeMemberFromList(MemberListType::DecTypedefMembers(),md);
1371 removeMemberFromList(MemberListType::DocTypedefMembers(),md);
1372 break;
1374 removeMemberFromList(MemberListType::DecSequenceMembers(),md);
1375 removeMemberFromList(MemberListType::DocSequenceMembers(),md);
1376 break;
1378 removeMemberFromList(MemberListType::DecDictionaryMembers(),md);
1379 removeMemberFromList(MemberListType::DocDictionaryMembers(),md);
1380 break;
1382 removeMemberFromList(MemberListType::DecEnumMembers(),md);
1383 removeMemberFromList(MemberListType::DocEnumMembers(),md);
1384 break;
1385 case MemberType::EnumValue: // enum values are shown inside their enums
1386 break;
1387 case MemberType::Define:
1388 removeMemberFromList(MemberListType::DecDefineMembers(),md);
1389 removeMemberFromList(MemberListType::DocDefineMembers(),md);
1390 break;
1391 default:
1392 err("FileDefImpl::removeMember(): unexpected member remove in file!\n");
1393 }
1394}
void removeMemberFromList(MemberListType lt, MemberDef *md)
Definition filedef.cpp:1342

References Define, Dictionary, Enumeration, EnumValue, err, Function, Definition::getLanguage(), MemberDef::memberType(), Property, Python, removeMemberFromList(), Sequence, Typedef, and Variable.

◆ removeMemberFromList()

void FileDefImpl::removeMemberFromList ( MemberListType lt,
MemberDef * md )
private

Definition at line 1342 of file filedef.cpp.

1343{
1344 MemberList *ml = getMemberList(lt);
1345 if (ml) ml->remove(md);
1346}
void remove(const MemberDef *md)
Definition memberlist.h:83

References getMemberList(), and MemberVector::remove().

Referenced by removeMember().

◆ setDirDef()

void FileDefImpl::setDirDef ( DirDef * dd)
inlineoverridevirtual

Implements FileDef.

Definition at line 189 of file filedef.cpp.

189{ m_dir=dd; }

References m_dir.

◆ setDiskName()

void FileDefImpl::setDiskName ( const QCString & name)
overridevirtual

Implements FileDef.

Definition at line 323 of file filedef.cpp.

324{
326}

References name(), and setDiskNameLocal().

◆ setDiskNameLocal()

void FileDefImpl::setDiskNameLocal ( const QCString & name)
private

Definition at line 307 of file filedef.cpp.

308{
309 if (isReference())
310 {
312 m_inclDepFileName = name+"_incl";
313 m_inclByDepFileName = name+"_dep_incl";
314 }
315 else
316 {
320 }
321}
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3858

References convertNameToFile(), DefinitionMixin< FileDef >::isReference(), m_inclByDepFileName, m_inclDepFileName, m_outputDiskName, and name().

Referenced by FileDefImpl(), and setDiskName().

◆ setModuleDef()

void FileDefImpl::setModuleDef ( ModuleDef * mod)
inlineoverridevirtual

Implements FileDef.

Definition at line 190 of file filedef.cpp.

190{ m_moduleDef=mod; }

References m_moduleDef.

◆ sortMemberLists()

void FileDefImpl::sortMemberLists ( )
overridevirtual

Implements FileDef.

Definition at line 1716 of file filedef.cpp.

1717{
1718 for (auto &ml : m_memberLists)
1719 {
1720 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
1721 }
1722
1723 for (const auto &mg : m_memberGroups)
1724 {
1725 MemberList &mlg = const_cast<MemberList&>(mg->members());
1726 if (mlg.needsSorting()) { mlg.sort(); mlg.setNeedsSorting(FALSE); }
1727 }
1728
1729 std::stable_sort(m_includedByList.begin(),m_includedByList.end(),
1730 [](const auto &fi1,const auto &fi2) { return fi1.includeName < fi2.includeName; });
1731
1732 if (Config_getBool(SORT_BRIEF_DOCS))
1733 {
1734 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1735 {
1736 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1737 qstricmp_sort(c1->name(), c2->name())<0 :
1738 qstricmp_sort(c1->className(), c2->className())<0;
1739 };
1740
1741 std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1742 std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1743 std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1744 std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1745
1746 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1747 {
1748 return qstricmp_sort(n1->name(),n2->name())<0;
1749 };
1750
1751 std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1752 }
1753}
virtual QCString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
bool needsSorting() const
Definition memberlist.h:120
void setNeedsSorting(bool b)
void sort()
Definition memberlist.h:75
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86

References ClassDef::className(), Config_getBool, FALSE, m_classes, m_exceptions, m_includedByList, m_interfaces, m_memberGroups, m_memberLists, m_namespaces, m_structs, Definition::name(), MemberList::needsSorting(), qstricmp_sort(), MemberList::setNeedsSorting(), and MemberVector::sort().

◆ startMemberDeclarations()

void FileDefImpl::startMemberDeclarations ( OutputList & ol)
private

Definition at line 730 of file filedef.cpp.

731{
733}
void startMemberSections()
Definition outputlist.h:462

References OutputList::startMemberSections().

Referenced by writeDocumentation().

◆ startMemberDocumentation()

void FileDefImpl::startMemberDocumentation ( OutputList & ol)
private

Definition at line 740 of file filedef.cpp.

741{
742 if (Config_getBool(SEPARATE_MEMBER_PAGES))
743 {
746 }
747}
void disable(OutputType o)

References Config_getBool, OutputList::disable(), Html, Doxygen::suppressDocWarnings, and TRUE.

Referenced by writeDocumentation().

◆ subGrouping()

bool FileDefImpl::subGrouping ( ) const
inlineoverridevirtual

Implements FileDef.

Definition at line 168 of file filedef.cpp.

168{ return m_subGrouping; }

References m_subGrouping.

◆ title()

QCString FileDefImpl::title ( ) const
overridevirtual

Implements FileDef.

Definition at line 1819 of file filedef.cpp.

1820{
1822}
virtual QCString trFileReference(const QCString &fileName)=0

References name(), and theTranslator.

Referenced by writeClassDeclarations(), writeConcepts(), writeDetailedDescription(), writeDocumentation(), writeMemberDeclarations(), writeMemberDocumentation(), writeNamespaceDeclarations(), and writeSourceHeader().

◆ writeAuthorSection()

void FileDefImpl::writeAuthorSection ( OutputList & ol)
private

Definition at line 770 of file filedef.cpp.

771{
772 // write Author section (Man only)
775 ol.startGroupHeader();
777 ol.endGroupHeader();
780}
void startGroupHeader(int extraLevels=0)
Definition outputlist.h:454
void pushGeneratorState()
void disableAllBut(OutputType o)
void popGeneratorState()
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:456
void parseText(const QCString &textStr)
virtual QCString trGeneratedAutomatically(const QCString &s)=0
virtual QCString trAuthor(bool first_capital, bool singular)=0

References Config_getString, OutputList::disableAllBut(), OutputList::endGroupHeader(), Man, OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startGroupHeader(), theTranslator, and TRUE.

Referenced by writeDocumentation().

◆ writeBriefDescription()

void FileDefImpl::writeBriefDescription ( OutputList & ol)
private

Definition at line 533 of file filedef.cpp.

534{
536 {
537 auto parser { createDocParser() };
538 auto ast { validatingParseDoc(*parser.get(),
539 briefFile(),briefLine(),this,nullptr,
541 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
542 if (!ast->isEmpty())
543 {
544 ol.startParagraph();
547 ol.writeString(" - ");
549 ol.writeDoc(ast.get(),this,nullptr);
552 ol.writeString(" \n");
554
555 if (Config_getBool(REPEAT_BRIEF) ||
556 !documentation().stripWhiteSpace().isEmpty()
557 )
558 {
560 ol.startTextLink(QCString(),"details");
562 ol.endTextLink();
563 }
565 ol.endParagraph();
566 }
567 }
568 ol.writeSynopsis();
569}
virtual QCString briefFile() const =0
bool hasBriefDescription() const override
int briefLine() const override
void writeString(const QCString &text)
Definition outputlist.h:412
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md)
Definition outputlist.h:384
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:408
void endParagraph()
Definition outputlist.h:410
void endTextLink()
Definition outputlist.h:445
void writeSynopsis()
Definition outputlist.h:593
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:443
virtual QCString trMore()=0
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)

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

Referenced by writeDocumentation().

◆ writeClassDeclarations()

void FileDefImpl::writeClassDeclarations ( OutputList & ol,
const QCString & title,
const ClassLinkedRefMap & list )
private

Definition at line 705 of file filedef.cpp.

706{
707 // write list of classes
708 list.writeDeclaration(ol,nullptr,title,FALSE);
709}
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const QCString &header, bool localNames) const
Definition classlist.cpp:53
QCString title() const override
Definition filedef.cpp:1819

References FALSE, title(), and ClassLinkedRefMap::writeDeclaration().

Referenced by writeDocumentation().

◆ writeClassesToTagFile()

void FileDefImpl::writeClassesToTagFile ( TextStream & t,
const ClassLinkedRefMap & list )
private

Definition at line 571 of file filedef.cpp.

572{
573 for (const auto &cd : list)
574 {
575 if (cd->isLinkableInProject())
576 {
577 tagFile << " <class kind=\"" << cd->compoundTypeString() <<
578 "\">" << convertToXML(cd->name()) << "</class>\n";
579 }
580 }
581}
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4266

References convertToXML().

Referenced by writeTagFile().

◆ writeConcepts()

void FileDefImpl::writeConcepts ( OutputList & ol,
const QCString & title )
private

Definition at line 711 of file filedef.cpp.

712{
713 // write list of classes
714 m_concepts.writeDeclaration(ol,title,FALSE);
715}

References FALSE, m_concepts, and title().

Referenced by writeDocumentation().

◆ writeDetailedDescription()

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

Definition at line 471 of file filedef.cpp.

472{
474 {
477 ol.writeRuler();
481 ol.writeAnchor(QCString(),"details");
483 ol.startGroupHeader();
484 ol.parseText(title);
485 ol.endGroupHeader();
486
487 ol.startTextBlock();
488 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
489 {
491 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
492 }
493 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
494 !documentation().isEmpty())
495 {
499 ol.enableAll();
502 ol.writeString("\n\n");
504 }
505 if (!documentation().isEmpty())
506 {
507 ol.generateDoc(docFile(),docLine(),this,nullptr,documentation()+"\n",TRUE,FALSE,
508 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
509 }
510 //printf("Writing source ref for file %s\n",qPrint(name()));
511 if (Config_getBool(SOURCE_BROWSER))
512 {
513 ol.startParagraph("definition");
514 QCString refText = theTranslator->trDefinedInSourceFile();
515 int fileMarkerPos = refText.find("@0");
516 if (fileMarkerPos!=-1) // should always pass this.
517 {
518 ol.parseText(refText.left(fileMarkerPos)); //text left from marker 1
519 ol.writeObjectLink(QCString(),getSourceFileBase(),QCString(),name());
520 ol.parseText(refText.right(
521 refText.length()-fileMarkerPos-2)); // text right from marker 2
522 }
523 else
524 {
525 err("translation error: invalid marker in trDefinedInSourceFile()\n");
526 }
527 ol.endParagraph();
528 }
529 ol.endTextBlock();
530 }
531}
QCString briefFile() const override
int docLine() const override
bool hasDetailedDescription() const override
Definition filedef.cpp:363
void endTextBlock(bool paraBreak=FALSE)
Definition outputlist.h:671
void writeRuler()
Definition outputlist.h:522
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:440
void startTextBlock(bool dense=FALSE)
Definition outputlist.h:669
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:524
void enableAll()
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString right(size_t len) const
Definition qcstring.h:219
QCString left(size_t len) const
Definition qcstring.h:214
virtual QCString trDefinedInSourceFile()=0

References DefinitionMixin< FileDef >::briefDescription(), DefinitionMixin< FileDef >::briefFile(), DefinitionMixin< FileDef >::briefLine(), Config_getBool, OutputList::disable(), OutputList::disableAllBut(), DefinitionMixin< FileDef >::docFile(), DefinitionMixin< FileDef >::docLine(), DefinitionMixin< FileDef >::documentation(), OutputList::enable(), OutputList::enableAll(), OutputList::endGroupHeader(), OutputList::endParagraph(), OutputList::endTextBlock(), err, FALSE, QCString::find(), OutputList::generateDoc(), getSourceFileBase(), hasDetailedDescription(), Html, Latex, QCString::left(), QCString::length(), Man, name(), OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), QCString::right(), RTF, OutputList::startGroupHeader(), OutputList::startParagraph(), OutputList::startTextBlock(), theTranslator, title(), TRUE, OutputList::writeAnchor(), OutputList::writeObjectLink(), OutputList::writeRuler(), and OutputList::writeString().

Referenced by writeDocumentation().

◆ writeDocumentation()

void FileDefImpl::writeDocumentation ( OutputList & ol)
overridevirtual

Write the documentation page for this file to the file of output generators ol.

Implements FileDef.

Definition at line 851 of file filedef.cpp.

852{
853 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
854 //funcList->countDecMembers();
855
856 //QCString fn = name();
857 //if (Config_getBool(FULL_PATH_NAMES))
858 //{
859 // fn.prepend(stripFromPath(getPath()));
860 //}
861
862 //printf("WriteDocumentation diskname=%s\n",qPrint(diskname));
863
864 QCString versionTitle;
865 if (!m_fileVersion.isEmpty())
866 {
867 versionTitle=("("+m_fileVersion+")");
868 }
869 QCString title = m_docname+versionTitle;
870 QCString pageTitle=theTranslator->trFileReference(m_docname);
871
872 if (getDirDef())
873 {
874 startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::FileVisible,!generateTreeView);
875 if (!generateTreeView)
876 {
878 ol.endQuickIndices();
879 }
880 startTitle(ol,getOutputFileBase(),this);
884 ol.enableAll();
886 ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
887 pageTitle :
890 addGroupListToTitle(ol,this);
892 }
893 else
894 {
895 startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::FileVisible,!generateTreeView);
896 if (!generateTreeView)
897 {
898 ol.endQuickIndices();
899 }
900 startTitle(ol,getOutputFileBase(),this);
901 ol.parseText(pageTitle);
902 addGroupListToTitle(ol,this);
904 }
905
906 ol.startContents();
907
908 if (!m_fileVersion.isEmpty())
909 {
912 ol.docify(versionTitle);
913 ol.endProjectNumber();
914 ol.enableAll();
915 }
916
917 //---------------------------------------- start flexible part -------------------------------
918
919 SrcLangExt lang = getLanguage();
920 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
921 {
922 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
923 switch (lde->kind())
924 {
925 case LayoutDocEntry::BriefDesc:
927 break;
928 case LayoutDocEntry::MemberDeclStart:
930 break;
931 case LayoutDocEntry::FileIncludes:
933 break;
934 case LayoutDocEntry::FileIncludeGraph:
936 break;
937 case LayoutDocEntry::FileIncludedByGraph:
939 break;
940 case LayoutDocEntry::FileSourceLink:
941 writeSourceLink(ol);
942 break;
943 case LayoutDocEntry::FileClasses:
944 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
945 break;
946 case LayoutDocEntry::FileInterfaces:
947 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
948 break;
949 case LayoutDocEntry::FileStructs:
950 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
951 break;
952 case LayoutDocEntry::FileExceptions:
953 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
954 break;
955 case LayoutDocEntry::FileConcepts:
956 if (ls) writeConcepts(ol,ls->title(lang));
957 break;
958 case LayoutDocEntry::FileNamespaces:
959 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
960 break;
961 case LayoutDocEntry::FileConstantGroups:
962 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
963 break;
964 case LayoutDocEntry::MemberGroups:
966 break;
967 case LayoutDocEntry::MemberDecl:
968 {
969 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
970 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
971 }
972 break;
973 case LayoutDocEntry::MemberDeclEnd:
975 break;
976 case LayoutDocEntry::DetailedDesc:
977 if (ls) writeDetailedDescription(ol,ls->title(lang));
978 break;
979 case LayoutDocEntry::MemberDefStart:
981 break;
982 case LayoutDocEntry::FileInlineClasses:
984 break;
985 case LayoutDocEntry::MemberDef:
986 {
987 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
988 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
989 }
990 break;
991 case LayoutDocEntry::MemberDefEnd:
993 break;
994 case LayoutDocEntry::AuthorSection:
996 break;
997 case LayoutDocEntry::ClassIncludes:
998 case LayoutDocEntry::ClassInheritanceGraph:
999 case LayoutDocEntry::ClassNestedClasses:
1000 case LayoutDocEntry::ClassCollaborationGraph:
1001 case LayoutDocEntry::ClassAllMembersLink:
1002 case LayoutDocEntry::ClassUsedFiles:
1003 case LayoutDocEntry::ClassInlineClasses:
1004 case LayoutDocEntry::NamespaceNestedNamespaces:
1005 case LayoutDocEntry::NamespaceNestedConstantGroups:
1006 case LayoutDocEntry::NamespaceClasses:
1007 case LayoutDocEntry::NamespaceConcepts:
1008 case LayoutDocEntry::NamespaceInterfaces:
1009 case LayoutDocEntry::NamespaceStructs:
1010 case LayoutDocEntry::NamespaceExceptions:
1011 case LayoutDocEntry::NamespaceInlineClasses:
1012 case LayoutDocEntry::ConceptDefinition:
1013 case LayoutDocEntry::GroupClasses:
1014 case LayoutDocEntry::GroupConcepts:
1015 case LayoutDocEntry::GroupModules:
1016 case LayoutDocEntry::GroupInlineClasses:
1017 case LayoutDocEntry::GroupNamespaces:
1018 case LayoutDocEntry::GroupDirs:
1019 case LayoutDocEntry::GroupNestedGroups:
1020 case LayoutDocEntry::GroupFiles:
1021 case LayoutDocEntry::GroupGraph:
1022 case LayoutDocEntry::GroupPageDocs:
1023 case LayoutDocEntry::ModuleExports:
1024 case LayoutDocEntry::ModuleClasses:
1025 case LayoutDocEntry::ModuleConcepts:
1026 case LayoutDocEntry::ModuleUsedFiles:
1027 case LayoutDocEntry::DirSubDirs:
1028 case LayoutDocEntry::DirFiles:
1029 case LayoutDocEntry::DirGraph:
1030 err("Internal inconsistency: member '%s' should not be part of "
1031 "LayoutDocManager::File entry list\n",qPrint(lde->entryToString()));
1032 break;
1033 }
1034 }
1035
1036 //---------------------------------------- end flexible part -------------------------------
1037
1038 ol.endContents();
1039
1040 endFileWithNavPath(ol,this);
1041
1042 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1043 {
1044 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1045 if (ml) ml->sort();
1046 writeMemberPages(ol);
1047 }
1048}
virtual void writeNavigationPath(OutputList &ol) const =0
void writeBriefDescription(OutputList &ol)
Definition filedef.cpp:533
void writeSourceLink(OutputList &ol)
Definition filedef.cpp:683
void writeNamespaceDeclarations(OutputList &ol, const QCString &title, bool isConstantGroup)
Definition filedef.cpp:698
void writeClassDeclarations(OutputList &ol, const QCString &title, const ClassLinkedRefMap &list)
Definition filedef.cpp:705
void endMemberDeclarations(OutputList &ol)
Definition filedef.cpp:735
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
Definition filedef.cpp:1767
void writeInlineClasses(OutputList &ol)
Definition filedef.cpp:717
void writeIncludeFiles(OutputList &ol)
Definition filedef.cpp:583
void writeDetailedDescription(OutputList &ol, const QCString &title)
Definition filedef.cpp:471
void writeMemberPages(OutputList &ol) override
Definition filedef.cpp:1050
void writeConcepts(OutputList &ol, const QCString &title)
Definition filedef.cpp:711
void writeIncludedByGraph(OutputList &ol)
Definition filedef.cpp:657
void writeAuthorSection(OutputList &ol)
Definition filedef.cpp:770
DirDef * getDirDef() const override
Definition filedef.cpp:152
QCString displayName(bool=TRUE) const override
Definition filedef.cpp:133
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
Definition filedef.cpp:1785
void writeIncludeGraph(OutputList &ol)
Definition filedef.cpp:632
void startMemberDocumentation(OutputList &ol)
Definition filedef.cpp:740
void startMemberDeclarations(OutputList &ol)
Definition filedef.cpp:730
void endMemberDocumentation(OutputList &ol)
Definition filedef.cpp:749
void writeMemberGroups(OutputList &ol)
Definition filedef.cpp:758
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1423
void endContents()
Definition outputlist.h:619
void docify(const QCString &s)
Definition outputlist.h:438
void startProjectNumber()
Definition outputlist.h:392
void endQuickIndices()
Definition outputlist.h:605
void startContents()
Definition outputlist.h:617
void endProjectNumber()
Definition outputlist.h:394
void startTitle(OutputList &ol, const QCString &fileName, const DefinitionMutable *def)
Definition index.cpp:386
void endTitle(OutputList &ol, const QCString &fileName, const QCString &name)
Definition index.cpp:395
void startFile(OutputList &ol, const QCString &name, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel)
Definition index.cpp:402
void endFileWithNavPath(OutputList &ol, const Definition *d)
Definition index.cpp:441
QCString title(SrcLangExt lang) const
Definition layout.cpp:1533
MemberListType type
Definition layout.h:115
MemberListType type
Definition layout.h:130
QCString title(SrcLangExt lang) const
Definition layout.cpp:1545
QCString title(SrcLangExt lang) const
Definition layout.cpp:1526
SrcLangExt
Language as given by extension.
Definition types.h:42
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:5233

References addGroupListToTitle(), Config_getBool, OutputList::disable(), OutputList::disableAllBut(), displayName(), OutputList::docify(), OutputList::enableAll(), OutputList::endContents(), endFileWithNavPath(), endMemberDeclarations(), endMemberDocumentation(), OutputList::endProjectNumber(), OutputList::endQuickIndices(), endTitle(), err, FileVisible, getDirDef(), DefinitionMixin< FileDef >::getLanguage(), getMemberList(), getOutputFileBase(), Html, LayoutDocManager::instance(), m_classes, m_docname, m_exceptions, m_fileVersion, m_interfaces, m_structs, name(), OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), qPrint(), MemberVector::sort(), OutputList::startContents(), startFile(), startMemberDeclarations(), startMemberDocumentation(), OutputList::startProjectNumber(), startTitle(), theTranslator, title(), LayoutDocEntryMemberDecl::title(), LayoutDocEntryMemberDef::title(), LayoutDocEntrySection::title(), LayoutDocEntryMemberDecl::type, LayoutDocEntryMemberDef::type, writeAuthorSection(), writeBriefDescription(), writeClassDeclarations(), writeConcepts(), writeDetailedDescription(), writeIncludedByGraph(), writeIncludeFiles(), writeIncludeGraph(), writeInlineClasses(), writeMemberDeclarations(), writeMemberDocumentation(), writeMemberGroups(), writeMemberPages(), writeNamespaceDeclarations(), DefinitionMutable::writeNavigationPath(), and writeSourceLink().

◆ writeIncludedByGraph()

void FileDefImpl::writeIncludedByGraph ( OutputList & ol)
private

Definition at line 657 of file filedef.cpp.

658{
659 if (Config_getBool(HAVE_DOT) && m_hasIncludedByGraph /*&& Config_getBool(INCLUDED_BY_GRAPH)*/)
660 {
661 //printf("Graph for file %s\n",qPrint(name()));
662 DotInclDepGraph incDepGraph(this,TRUE);
663 if (incDepGraph.isTooBig())
664 {
665 warn_uncond("Included by graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
666 qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
667 }
668 else if (!incDepGraph.isTrivial())
669 {
670 ol.startTextBlock();
674 ol.endInclDepGraph(incDepGraph);
675 ol.enableAll();
676 ol.endTextBlock(TRUE);
677 }
678 //incDepGraph.writeGraph(Config_getString(HTML_OUTPUT),fd->getOutputFileBase());
679 }
680}
void startInclDepGraph()
Definition outputlist.h:651
void endInclDepGraph(DotInclDepGraph &g)
Definition outputlist.h:653
virtual QCString trInclByDepGraph()=0
#define Config_getInt(name)
Definition config.h:34
#define warn_uncond(fmt,...)
Definition message.h:79

References Config_getBool, Config_getInt, OutputList::disable(), OutputList::enableAll(), OutputList::endInclDepGraph(), OutputList::endTextBlock(), DotInclDepGraph::isTooBig(), DotInclDepGraph::isTrivial(), m_hasIncludedByGraph, Man, name(), DotInclDepGraph::numNodes(), OutputList::parseText(), qPrint(), OutputList::startInclDepGraph(), OutputList::startTextBlock(), theTranslator, TRUE, and warn_uncond.

Referenced by writeDocumentation().

◆ writeIncludeFiles()

void FileDefImpl::writeIncludeFiles ( OutputList & ol)
private

Definition at line 583 of file filedef.cpp.

584{
585 if (!m_includeList.empty())
586 {
588 for (const auto &ii : m_includeList)
589 {
590 const FileDef *fd=ii.fileDef;
591 ol.startTypewriter();
592 SrcLangExt lang = fd ? fd->getLanguage() : SrcLangExt::Cpp;
593 ol.docify(::includeStatement(lang,ii.kind));
594 ol.docify(::includeOpen(lang,ii.kind));
596 ol.docify(ii.includeName);
597 ol.enableAll();
599
600 // Here we use the include file name as it appears in the file.
601 // we could also we the name as it is used within doxygen,
602 // then we should have used fd->docName() instead of ii->includeName
603 if (fd && fd->isLinkable())
604 {
607 QCString(),ii.includeName);
608 }
609 else
610 {
611 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(ii.includeName);
612 if (ii.kind==IncludeKind::ImportModule && mod && mod->isLinkable())
613 {
615 QCString(),ii.includeName);
616 }
617 else
618 {
619 ol.docify(ii.includeName);
620 }
621 }
622
623 ol.enableAll();
624 ol.docify(::includeClose(lang,ii.kind));
625 ol.endTypewriter();
626 ol.lineBreak();
627 }
628 ol.endTextBlock();
629 }
630}
virtual bool isLinkable() const =0
virtual QCString getReference() const =0
virtual QCString getOutputFileBase() const =0
virtual QCString includeName() const =0
virtual bool generateSourceFile() const =0
static ModuleManager & instance()
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
void startTypewriter()
Definition outputlist.h:450
void endTypewriter()
Definition outputlist.h:452
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:560
QCString includeClose(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:86
QCString includeStatement(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:56
QCString includeOpen(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:73
@ ImportModule
Definition filedef.h:55

References Cpp, OutputList::disable(), OutputList::disableAllBut(), OutputList::docify(), OutputList::enableAll(), OutputList::endTextBlock(), OutputList::endTypewriter(), FileDef::generateSourceFile(), Definition::getLanguage(), Definition::getOutputFileBase(), ModuleManager::getPrimaryInterface(), Definition::getReference(), Html, ImportModule, includeClose(), FileDef::includeName(), includeOpen(), includeStatement(), ModuleManager::instance(), Definition::isLinkable(), OutputList::lineBreak(), m_includeList, OutputList::startTextBlock(), OutputList::startTypewriter(), TRUE, and OutputList::writeObjectLink().

Referenced by writeDocumentation().

◆ writeIncludeGraph()

void FileDefImpl::writeIncludeGraph ( OutputList & ol)
private

Definition at line 632 of file filedef.cpp.

633{
634 if (Config_getBool(HAVE_DOT) && m_hasIncludeGraph /*&& Config_getBool(INCLUDE_GRAPH)*/)
635 {
636 //printf("Graph for file %s\n",qPrint(name()));
637 DotInclDepGraph incDepGraph(this,FALSE);
638 if (incDepGraph.isTooBig())
639 {
640 warn_uncond("Include graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
641 qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
642 }
643 else if (!incDepGraph.isTrivial())
644 {
645 ol.startTextBlock();
649 ol.endInclDepGraph(incDepGraph);
650 ol.enableAll();
651 ol.endTextBlock(TRUE);
652 }
653 //incDepGraph.writeGraph(Config_getString(HTML_OUTPUT),fd->getOutputFileBase());
654 }
655}
virtual QCString trInclDepGraph(const QCString &fName)=0

References Config_getBool, Config_getInt, OutputList::disable(), OutputList::enableAll(), OutputList::endInclDepGraph(), OutputList::endTextBlock(), FALSE, DotInclDepGraph::isTooBig(), DotInclDepGraph::isTrivial(), m_hasIncludeGraph, Man, name(), DotInclDepGraph::numNodes(), OutputList::parseText(), qPrint(), OutputList::startInclDepGraph(), OutputList::startTextBlock(), theTranslator, TRUE, and warn_uncond.

Referenced by writeDocumentation().

◆ writeInlineClasses()

void FileDefImpl::writeInlineClasses ( OutputList & ol)
private

Definition at line 717 of file filedef.cpp.

718{
719 // temporarily undo the disabling could be done by startMemberDocumentation()
720 // as a result of setting SEPARATE_MEMBER_PAGES to YES; see bug730512
721 bool isEnabled = ol.isEnabled(OutputType::Html);
723
724 m_classes.writeDocumentation(ol,this);
725
726 // restore the initial state if needed
727 if (!isEnabled) ol.disable(OutputType::Html);
728}
bool isEnabled(OutputType o)

References OutputList::disable(), OutputList::enable(), Html, OutputList::isEnabled(), and m_classes.

Referenced by writeDocumentation().

◆ writeMemberDeclarations()

void FileDefImpl::writeMemberDeclarations ( OutputList & ol,
MemberListType lt,
const QCString & title )
private

Definition at line 1767 of file filedef.cpp.

1768{
1769 bool optVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
1770 MemberList * ml = getMemberList(lt);
1771 if (ml)
1772 {
1773 if (optVhdl) // use specific declarations function
1774 {
1775
1776 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,nullptr,this,nullptr,nullptr);
1777 }
1778 else
1779 {
1780 ml->writeDeclarations(ol,nullptr,nullptr,this,nullptr,nullptr,title,QCString());
1781 }
1782 }
1783}
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const QCString &title, const QCString &subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true) const
Writes the list of members to the output.
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)

References Config_getBool, getMemberList(), title(), MemberList::writeDeclarations(), and VhdlDocGen::writeVhdlDeclarations().

Referenced by writeDocumentation().

◆ writeMemberDocumentation()

void FileDefImpl::writeMemberDocumentation ( OutputList & ol,
MemberListType lt,
const QCString & title )
private

Definition at line 1785 of file filedef.cpp.

1786{
1787 MemberList * ml = getMemberList(lt);
1788 if (ml) ml->writeDocumentation(ol,name(),this,title);
1789}
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, bool showEnumValues=FALSE, bool showInline=FALSE) const

References getMemberList(), name(), title(), and MemberList::writeDocumentation().

Referenced by writeDocumentation().

◆ writeMemberGroups()

void FileDefImpl::writeMemberGroups ( OutputList & ol)
private

Definition at line 758 of file filedef.cpp.

759{
760 /* write user defined member groups */
761 for (const auto &mg : m_memberGroups)
762 {
763 if (!mg->allMembersInSameSection() || !m_subGrouping)
764 {
765 mg->writeDeclarations(ol,nullptr,nullptr,this,nullptr,nullptr);
766 }
767 }
768}

References m_memberGroups, and m_subGrouping.

Referenced by writeDocumentation().

◆ writeMemberPages()

void FileDefImpl::writeMemberPages ( OutputList & ol)
overridevirtual

Implements FileDef.

Definition at line 1050 of file filedef.cpp.

1051{
1052 ol.pushGeneratorState();
1054
1055 for (const auto &ml : m_memberLists)
1056 {
1057 if (ml->listType().isDocumentation())
1058 {
1059 ml->writeDocumentationPage(ol,name(),this);
1060 }
1061 }
1062
1063 ol.popGeneratorState();
1064}

References OutputList::disableAllBut(), Html, m_memberLists, name(), OutputList::popGeneratorState(), and OutputList::pushGeneratorState().

Referenced by writeDocumentation().

◆ writeNamespaceDeclarations()

void FileDefImpl::writeNamespaceDeclarations ( OutputList & ol,
const QCString & title,
bool isConstantGroup )
private

Definition at line 698 of file filedef.cpp.

700{
701 // write list of namespaces
702 m_namespaces.writeDeclaration(ol,title,isConstantGroup);
703}

References m_namespaces, and title().

Referenced by writeDocumentation().

◆ writeQuickMemberLinks()

void FileDefImpl::writeQuickMemberLinks ( OutputList & ol,
const MemberDef * currentMd ) const
overridevirtual

Reimplemented from DefinitionMixin< FileDef >.

Definition at line 1066 of file filedef.cpp.

1067{
1068 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1069
1070 ol.writeString(" <div class=\"navtab\">\n");
1071 ol.writeString(" <table>\n");
1072
1073 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1074 if (allMemberList)
1075 {
1076 for (const auto &md : *allMemberList)
1077 {
1078 if (md->getFileDef()==this && md->getNamespaceDef()==nullptr && md->isLinkable() && !md->isEnumValue())
1079 {
1080 if (md->isLinkableInProject())
1081 {
1082 QCString fn=md->getOutputFileBase();
1084 if (md==currentMd) // selected item => highlight
1085 {
1086 ol.writeString(" <tr><td class=\"navtabHL\">");
1087 }
1088 else
1089 {
1090 ol.writeString(" <tr><td class=\"navtab\">");
1091 }
1092 ol.writeString("<a class=\"navtab\" ");
1093 ol.writeString("href=\"");
1094 if (createSubDirs) ol.writeString("../../");
1095 ol.writeString(fn+"#"+md->anchor());
1096 ol.writeString("\">");
1097 ol.writeString(convertToHtml(md->localName()));
1098 ol.writeString("</a>");
1099 ol.writeString("</td></tr>\n");
1100 }
1101 }
1102 }
1103 }
1104
1105 ol.writeString(" </table>\n");
1106 ol.writeString(" </div>\n");
1107}
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4317
void createSubDirs(const Dir &d)
Definition util.cpp:3994
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

References addHtmlExtensionIfMissing(), Config_getBool, convertToHtml(), createSubDirs(), getMemberList(), and OutputList::writeString().

◆ writeSourceBody()

void FileDefImpl::writeSourceBody ( OutputList & ol,
ClangTUParser * clangParser )
overridevirtual

Implements FileDef.

Definition at line 1163 of file filedef.cpp.

1164{
1165 bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
1166 OutputCodeList devNullList;
1167 devNullList.add<DevNullCodeGenerator>();
1168#if USE_LIBCLANG
1169 if (Doxygen::clangAssistedParsing && clangParser &&
1171 {
1172 auto &codeOL = ol.codeGenerators();
1173 codeOL.startCodeFragment("DoxyCode");
1174 clangParser->switchToFile(this);
1175 clangParser->writeSources(codeOL,this);
1176 codeOL.endCodeFragment("DoxyCode");
1177 }
1178 else
1179#endif
1180 {
1182 intf->resetCodeParserState();
1183 auto &codeOL = ol.codeGenerators();
1184 codeOL.startCodeFragment("DoxyCode");
1185 bool needs2PassParsing =
1186 Doxygen::parseSourcesNeeded && // we need to parse (filtered) sources for cross-references
1187 !filterSourceFiles && // but user wants to show sources as-is
1188 !getFileFilter(absFilePath(),TRUE).isEmpty(); // and there is a filter used while parsing
1189
1190 if (needs2PassParsing)
1191 {
1192 // parse code for cross-references only (see bug707641)
1193 intf->parseCode(devNullList,QCString(),
1195 getLanguage(),
1196 Config_getBool(STRIP_CODE_COMMENTS),
1197 FALSE,QCString(),this
1198 );
1199 }
1200 intf->parseCode(codeOL,QCString(),
1201 fileToString(absFilePath(),filterSourceFiles,TRUE),
1202 getLanguage(), // lang
1203 Config_getBool(STRIP_CODE_COMMENTS),
1204 FALSE, // isExampleBlock
1205 QCString(), // exampleName
1206 this, // fileDef
1207 -1, // startLine
1208 -1, // endLine
1209 FALSE, // inlineFragment
1210 nullptr, // memberDef
1211 TRUE, // showLineNumbers
1212 nullptr, // searchCtx
1213 !needs2PassParsing // collectXRefs
1214 );
1215 codeOL.endCodeFragment("DoxyCode");
1216 }
1217}
static bool parseSourcesNeeded
Definition doxygen.h:123
void startCodeFragment(const QCString &style)
Definition outputlist.h:278
const OutputCodeList & codeGenerators() const
Definition outputlist.h:357
QCString getFileFilter(const QCString &name, bool isSourceCode)
Definition util.cpp:1342

References absFilePath(), OutputCodeList::add(), Doxygen::clangAssistedParsing, OutputList::codeGenerators(), Config_getBool, Cpp, FALSE, fileToString(), DefinitionMixin< FileDef >::getDefFileExtension(), getFileFilter(), DefinitionMixin< FileDef >::getLanguage(), QCString::isEmpty(), ObjC, Doxygen::parserManager, Doxygen::parseSourcesNeeded, OutputCodeList::startCodeFragment(), and TRUE.

◆ writeSourceFooter()

void FileDefImpl::writeSourceFooter ( OutputList & ol)
overridevirtual

Implements FileDef.

Definition at line 1219 of file filedef.cpp.

1220{
1221 ol.endContents();
1222 endFileWithNavPath(ol,this);
1223 ol.enableAll();
1224}

References OutputList::enableAll(), OutputList::endContents(), and endFileWithNavPath().

◆ writeSourceHeader()

void FileDefImpl::writeSourceHeader ( OutputList & ol)
overridevirtual

Write a source listing of this file to the output

Implements FileDef.

Definition at line 1110 of file filedef.cpp.

1111{
1112 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1113 QCString title = m_docname;
1114 if (!m_fileVersion.isEmpty())
1115 {
1116 title+=(" ("+m_fileVersion+")");
1117 }
1118 QCString pageTitle = theTranslator->trSourceFile(title);
1120
1121 bool isDocFile = isDocumentationFile();
1122 bool genSourceFile = !isDocFile && generateSourceFile();
1123 if (getDirDef())
1124 {
1126 !generateTreeView,
1127 !isDocFile && genSourceFile ? QCString() : getOutputFileBase(),
1128 0);
1129 if (!generateTreeView)
1130 {
1132 ol.endQuickIndices();
1133 }
1135 ol.parseText(name());
1137 }
1138 else
1139 {
1140 startFile(ol,getSourceFileBase(),QCString(),pageTitle,HighlightedItem::FileVisible,false,
1141 !isDocFile && genSourceFile ? QCString() : getOutputFileBase(),
1142 0);
1144 ol.parseText(title);
1145 endTitle(ol,getSourceFileBase(),QCString());
1146 }
1147
1148 ol.startContents();
1149
1150 if (isLinkable())
1151 {
1152 ol.startTextLink(getOutputFileBase(),QCString());
1154 ol.endTextLink();
1155
1156 ol.pushGeneratorState();
1158 ol.writeString("\\par\n");
1159 ol.popGeneratorState();
1160 }
1161}
bool generateSourceFile() const override
Definition filedef.cpp:1563
bool isLinkable() const override
Definition filedef.cpp:150
virtual QCString trSourceFile(const QCString &filename)=0
virtual QCString trGotoDocumentation()=0

References Config_getBool, OutputList::disable(), OutputList::disableAllBut(), OutputList::endQuickIndices(), OutputList::endTextLink(), endTitle(), FileVisible, generateSourceFile(), getDirDef(), getOutputFileBase(), getSourceFileBase(), isDocumentationFile(), isLinkable(), m_docname, m_fileVersion, Man, name(), OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), RTF, OutputList::startContents(), startFile(), OutputList::startTextLink(), startTitle(), theTranslator, title(), DefinitionMutable::writeNavigationPath(), and OutputList::writeString().

◆ writeSourceLink()

void FileDefImpl::writeSourceLink ( OutputList & ol)
private

Definition at line 683 of file filedef.cpp.

684{
685 //printf("%s: generateSourceFile()=%d\n",qPrint(name()),generateSourceFile());
686 if (generateSourceFile())
687 {
689 ol.startParagraph();
690 ol.startTextLink(includeName(),QCString());
692 ol.endTextLink();
693 ol.endParagraph();
694 ol.enableAll();
695 }
696}
QCString includeName() const override
Definition filedef.cpp:1692
virtual QCString trGotoSourceCode()=0

References OutputList::disableAllBut(), OutputList::enableAll(), OutputList::endParagraph(), OutputList::endTextLink(), generateSourceFile(), Html, includeName(), OutputList::parseText(), OutputList::startParagraph(), OutputList::startTextLink(), and theTranslator.

Referenced by writeDocumentation().

◆ writeSummaryLinks()

void FileDefImpl::writeSummaryLinks ( OutputList & ol) const
overridevirtual

Reimplemented from DefinitionMixin< FileDef >.

Definition at line 782 of file filedef.cpp.

783{
786 bool first=TRUE;
787 SrcLangExt lang=getLanguage();
788 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
789 {
790 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
791 if (lde->kind()==LayoutDocEntry::FileClasses && m_classes.declVisible() && ls)
792 {
793 QCString label = "nested-classes";
794 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
795 first=FALSE;
796 }
797 else if (lde->kind()==LayoutDocEntry::FileInterfaces && m_interfaces.declVisible() && ls)
798 {
799 QCString label = "interfaces";
800 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
801 first=FALSE;
802 }
803 else if (lde->kind()==LayoutDocEntry::FileStructs && m_structs.declVisible() && ls)
804 {
805 QCString label = "structs";
806 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
807 first=FALSE;
808 }
809 else if (lde->kind()==LayoutDocEntry::FileExceptions && m_exceptions.declVisible() && ls)
810 {
811 QCString label = "exceptions";
812 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
813 first=FALSE;
814 }
815 else if (lde->kind()==LayoutDocEntry::FileNamespaces && m_namespaces.declVisible(false) && ls)
816 {
817 QCString label = "namespaces";
818 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
819 first=FALSE;
820 }
821 else if (lde->kind()==LayoutDocEntry::FileConcepts && m_concepts.declVisible() && ls)
822 {
823 QCString label = "concepts";
824 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
825 first=FALSE;
826 }
827 else if (lde->kind()==LayoutDocEntry::MemberDecl)
828 {
829 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
830 if (lmd)
831 {
832 MemberList * ml = getMemberList(lmd->type);
833 if (ml && ml->declVisible())
834 {
835 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
836 first=FALSE;
837 }
838 }
839 }
840 }
841 if (!first)
842 {
843 ol.writeString(" </div>\n");
844 }
846}
MemberListType listType() const
Definition memberlist.h:113
bool declVisible() const
constexpr const char * toLabel() const
Definition types.h:240
void writeSummaryLink(const QCString &file, const QCString &anchor, const QCString &title, bool first)
Definition outputlist.h:615

References MemberList::declVisible(), OutputList::disableAllBut(), FALSE, DefinitionMixin< FileDef >::getLanguage(), getMemberList(), Html, LayoutDocManager::instance(), MemberList::listType(), m_classes, m_concepts, m_exceptions, m_interfaces, m_namespaces, m_structs, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), LayoutDocEntryMemberDecl::title(), LayoutDocEntrySection::title(), MemberListType::toLabel(), TRUE, LayoutDocEntryMemberDecl::type, OutputList::writeString(), and OutputList::writeSummaryLink().

◆ writeTagFile()

void FileDefImpl::writeTagFile ( TextStream & t)
overridevirtual

Implements FileDef.

Definition at line 373 of file filedef.cpp.

374{
375 QCString fn=getOutputFileBase();
377 tagFile << " <compound kind=\"file\">\n";
378 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
379 tagFile << " <path>" << convertToXML(stripFromPath(getPath())) << "</path>\n";
380 tagFile << " <filename>" << fn << "</filename>\n";
381 for (const auto &ii : m_includeList)
382 {
383 const FileDef *fd=ii.fileDef;
384 if (fd && fd->isLinkable() && !fd->isReference())
385 {
386 QCString attr = includeTagFileAttributes(fd->getLanguage(),ii.kind);
387 tagFile << " <includes id=\""
388 << convertToXML(fd->getOutputFileBase()) << "\" "
389 << "name=\"" << convertToXML(fd->name()) << "\" "
390 << attr << ">"
391 << convertToXML(ii.includeName)
392 << "</includes>\n";
393 }
394 }
395 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
396 {
397 switch (lde->kind())
398 {
399 case LayoutDocEntry::FileClasses:
400 {
402 }
403 break;
404 case LayoutDocEntry::FileInterfaces:
405 {
407 }
408 break;
409 case LayoutDocEntry::FileStructs:
410 {
412 }
413 break;
414 case LayoutDocEntry::FileExceptions:
415 {
417 }
418 break;
419 case LayoutDocEntry::FileConcepts:
420 {
421 for (const auto *nd : m_concepts)
422 {
423 if (nd->isLinkableInProject())
424 {
425 tagFile << " <concept>" << convertToXML(nd->name()) << "</concept>\n";
426 }
427 }
428 }
429 break;
430 case LayoutDocEntry::FileNamespaces:
431 {
432 for (const auto *nd : m_namespaces)
433 {
434 if (nd->isLinkableInProject())
435 {
436 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
437 }
438 }
439 }
440 break;
441 case LayoutDocEntry::MemberDecl:
442 {
443 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
444 if (lmd)
445 {
446 MemberList * ml = getMemberList(lmd->type);
447 if (ml)
448 {
449 ml->writeTagFile(tagFile,false,false);
450 }
451 }
452 }
453 break;
454 case LayoutDocEntry::MemberGroups:
455 {
456 for (const auto &mg : m_memberGroups)
457 {
458 mg->writeTagFile(tagFile);
459 }
460 }
461 break;
462 default:
463 break;
464 }
465 }
466
468 tagFile << " </compound>\n";
469}
void writeDocAnchorsToTagFile(TextStream &fs) const override
QCString getPath() const override
Definition filedef.cpp:147
void writeClassesToTagFile(TextStream &t, const ClassLinkedRefMap &list)
Definition filedef.cpp:571
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
QCString includeTagFileAttributes(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:104

References addHtmlExtensionIfMissing(), convertToXML(), Definition::getLanguage(), getMemberList(), Definition::getOutputFileBase(), getOutputFileBase(), getPath(), includeTagFileAttributes(), LayoutDocManager::instance(), Definition::isLinkable(), Definition::isReference(), m_classes, m_concepts, m_exceptions, m_includeList, m_interfaces, m_memberGroups, m_namespaces, m_structs, Definition::name(), name(), stripFromPath(), LayoutDocEntryMemberDecl::type, writeClassesToTagFile(), DefinitionMixin< FileDef >::writeDocAnchorsToTagFile(), and MemberList::writeTagFile().

Member Data Documentation

◆ m_classes

◆ m_concepts

ConceptLinkedRefMap FileDefImpl::m_concepts
private

◆ m_dir

DirDef* FileDefImpl::m_dir = nullptr
private

Definition at line 252 of file filedef.cpp.

Referenced by FileDefImpl(), getDirDef(), and setDirDef().

◆ m_docname

QCString FileDefImpl::m_docname
private

Definition at line 247 of file filedef.cpp.

Referenced by docName(), FileDefImpl(), writeDocumentation(), and writeSourceHeader().

◆ m_exceptions

ClassLinkedRefMap FileDefImpl::m_exceptions
private

◆ m_fileName

QCString FileDefImpl::m_fileName
private

Definition at line 246 of file filedef.cpp.

Referenced by FileDefImpl(), fileName(), and name().

◆ m_filePath

QCString FileDefImpl::m_filePath
private

Definition at line 242 of file filedef.cpp.

Referenced by absFilePath(), acquireFileVersion(), FileDefImpl(), and getSourceFileBase().

◆ m_fileVersion

QCString FileDefImpl::m_fileVersion
private

◆ m_hasIncludedByGraph

bool FileDefImpl::m_hasIncludedByGraph = Config_getBool(INCLUDED_BY_GRAPH)
private

Definition at line 264 of file filedef.cpp.

Referenced by hasIncludedByGraph(), overrideIncludedByGraph(), and writeIncludedByGraph().

◆ m_hasIncludeGraph

bool FileDefImpl::m_hasIncludeGraph = Config_getBool(INCLUDE_GRAPH)
private

Definition at line 263 of file filedef.cpp.

Referenced by hasIncludeGraph(), overrideIncludeGraph(), and writeIncludeGraph().

◆ m_inclByDepFileName

QCString FileDefImpl::m_inclByDepFileName
private

Definition at line 244 of file filedef.cpp.

Referenced by includedByDependencyGraphFileName(), and setDiskNameLocal().

◆ m_inclDepFileName

QCString FileDefImpl::m_inclDepFileName
private

Definition at line 243 of file filedef.cpp.

Referenced by includeDependencyGraphFileName(), and setDiskNameLocal().

◆ m_includedByList

IncludeInfoList FileDefImpl::m_includedByList
private

Definition at line 238 of file filedef.cpp.

Referenced by addIncludedByDependency(), includedByFileList(), and sortMemberLists().

◆ m_includedByMap

IncludeInfoMap FileDefImpl::m_includedByMap
private

Definition at line 237 of file filedef.cpp.

Referenced by addIncludedByDependency(), and generateSourceFile().

◆ m_includeList

IncludeInfoList FileDefImpl::m_includeList
private

◆ m_includeMap

IncludeInfoMap FileDefImpl::m_includeMap
private

Definition at line 235 of file filedef.cpp.

Referenced by addIncludeDependency(), and isIncluded().

◆ m_interfaces

ClassLinkedRefMap FileDefImpl::m_interfaces
private

◆ m_isSource

bool FileDefImpl::m_isSource
private

Definition at line 250 of file filedef.cpp.

Referenced by FileDefImpl(), and isSource().

◆ m_memberGroups

◆ m_memberLists

◆ m_moduleDef

ModuleDef* FileDefImpl::m_moduleDef = nullptr
private

Definition at line 253 of file filedef.cpp.

Referenced by getModuleDef(), and setModuleDef().

◆ m_namespaces

◆ m_outputDiskName

QCString FileDefImpl::m_outputDiskName
private

Definition at line 245 of file filedef.cpp.

Referenced by getOutputFileBase(), getSourceFileBase(), and setDiskNameLocal().

◆ m_path

QCString FileDefImpl::m_path
private

Definition at line 241 of file filedef.cpp.

Referenced by FileDefImpl(), and getPath().

◆ m_srcDefMap

DefinitionLineMap FileDefImpl::m_srcDefMap
private

Definition at line 248 of file filedef.cpp.

Referenced by addSourceRef(), and getSourceDefinition().

◆ m_srcMemberMap

MemberDefLineMap FileDefImpl::m_srcMemberMap
private

Definition at line 249 of file filedef.cpp.

Referenced by addSourceRef(), and getSourceMember().

◆ m_structs

ClassLinkedRefMap FileDefImpl::m_structs
private

◆ m_subGrouping

bool FileDefImpl::m_subGrouping
private

Definition at line 262 of file filedef.cpp.

Referenced by addMembersToMemberGroup(), FileDefImpl(), subGrouping(), and writeMemberGroups().

◆ m_usingDeclList

LinkedRefMap<const Definition> FileDefImpl::m_usingDeclList
private

◆ m_usingDirList

LinkedRefMap<NamespaceDef> FileDefImpl::m_usingDirList
private

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