Doxygen
namespacedef.cpp 文件参考
#include "namespacedef.h"
#include "outputlist.h"
#include "util.h"
#include "language.h"
#include "classdef.h"
#include "classlist.h"
#include "memberlist.h"
#include "doxygen.h"
#include "message.h"
#include "docparser.h"
#include "searchindex.h"
#include "vhdldocgen.h"
#include "layout.h"
#include "membergroup.h"
#include "config.h"
#include "definitionimpl.h"
#include "membername.h"
#include "conceptdef.h"
+ namespacedef.cpp 的引用(Include)关系图:

浏览源代码.

class  NamespaceDefImpl
 
class  NamespaceDefAliasImpl
 

函数

static QCString makeDisplayName (const NamespaceDef *nd, bool includeScope)
 
NamespaceDefMutablecreateNamespaceDef (const QCString &defFileName, int defLine, int defColumn, const QCString &name, const QCString &ref, const QCString &refFile, const QCString &type, bool isPublished)
 Factory method to create new NamespaceDef instance 更多...
 
NamespaceDefcreateNamespaceDefAlias (const Definition *newScope, const NamespaceDef *nd)
 Factory method to create an alias of an existing namespace. 更多...
 
NamespaceDeftoNamespaceDef (Definition *d)
 
NamespaceDeftoNamespaceDef (DefinitionMutable *md)
 
const NamespaceDeftoNamespaceDef (const Definition *d)
 
NamespaceDefMutabletoNamespaceDefMutable (Definition *d)
 
NamespaceDefMutabletoNamespaceDefMutable (const Definition *d)
 
NamespaceDefgetResolvedNamespace (const QCString &name)
 
bool namespaceHasNestedNamespace (const NamespaceDef *nd)
 
bool namespaceHasNestedConcept (const NamespaceDef *nd)
 
bool namespaceHasNestedClass (const NamespaceDef *nd, bool filterClasses, ClassDef::CompoundType ct)
 

函数说明

◆ createNamespaceDef()

NamespaceDefMutable* createNamespaceDef ( const QCString defFileName,
int  defLine,
int  defColumn,
const QCString name,
const QCString ref,
const QCString refFile,
const QCString type,
bool  isPublished 
)

Factory method to create new NamespaceDef instance

在文件 namespacedef.cpp163 行定义.

167 {
168  return new NamespaceDefImpl(defFileName,defLine,defColumn,name,ref,refFile,type,isPublished);
169 }

被这些函数引用 adjustConfiguration(), buildNamespaceList(), buildScopeFromQualifiedName() , 以及 findUsingDirectives().

◆ createNamespaceDefAlias()

NamespaceDef* createNamespaceDefAlias ( const Definition newScope,
const NamespaceDef nd 
)

Factory method to create an alias of an existing namespace.

Used for inline namespaces.

在文件 namespacedef.cpp244 行定义.

245 {
246  NamespaceDef *alnd = new NamespaceDefAliasImpl(newScope,nd);
247  //printf("alnd name=%s localName=%s qualifiedName=%s displayName()=%s\n",
248  // qPrint(alnd->name()),qPrint(alnd->localName()),qPrint(alnd->qualifiedName()),
249  // qPrint(alnd->displayName()));
250  return alnd;
251 }

被这些函数引用 buildNamespaceList().

◆ getResolvedNamespace()

NamespaceDef* getResolvedNamespace ( const QCString name)

在文件 namespacedef.cpp1606 行定义.

1607 {
1608  if (name.isEmpty()) return 0;
1609  auto it = Doxygen::namespaceAliasMap.find(name.str());
1610  if (it!=Doxygen::namespaceAliasMap.end())
1611  {
1612  int count=0; // recursion detection guard
1613  StringUnorderedMap::iterator it2;
1614  while ((it2=Doxygen::namespaceAliasMap.find(it->second))!=Doxygen::namespaceAliasMap.end() &&
1615  count<10)
1616  {
1617  it=it2;
1618  count++;
1619  }
1620  if (count==10)
1621  {
1622  warn_uncond("possible recursive namespace alias detected for %s!\n",qPrint(name));
1623  }
1624  return Doxygen::namespaceLinkedMap->find(it->second);
1625  }
1626  else
1627  {
1628  return Doxygen::namespaceLinkedMap->find(name);
1629  }
1630 }

引用了 end(), LinkedMap< T, Hash, KeyEqual, Map >::find(), QCString::isEmpty(), Doxygen::namespaceAliasMap, Doxygen::namespaceLinkedMap, qPrint(), QCString::str() , 以及 warn_uncond().

被这些函数引用 addMemberFunction(), extractNamespaceName(), findUsedNamespace(), findUsingDirectives(), getResolvedNamespaceMutable() , 以及 writeAlphabeticalClassList().

◆ makeDisplayName()

static QCString makeDisplayName ( const NamespaceDef nd,
bool  includeScope 
)
static

在文件 namespacedef.cpp38 行定义.

39 {
40  QCString result=includeScope ? nd->name() : nd->localName();
41  SrcLangExt lang = nd->getLanguage();
43  if (sep!="::")
44  {
45  result = substitute(result,"::",sep);
46  }
47  //printf("makeDisplayName() %s->%s lang=%d\n",qPrint(name()),qPrint(result),lang);
48  return result;
49 }

引用了 Definition::getLanguage(), getLanguageSpecificSeparator(), NamespaceDef::localName(), Definition::name() , 以及 substitute().

被这些函数引用 NamespaceDefImpl::displayName() , 以及 NamespaceDefAliasImpl::displayName().

◆ namespaceHasNestedClass()

bool namespaceHasNestedClass ( const NamespaceDef nd,
bool  filterClasses,
ClassDef::CompoundType  ct 
)

在文件 namespacedef.cpp1666 行定义.

1667 {
1668  //printf(">namespaceHasVisibleChild(%s,includeClasses=%d)\n",qPrint(nd->name()),includeClasses);
1669  for (const auto &cnd : nd->getNamespaces())
1670  {
1671  if (namespaceHasNestedClass(cnd,filterClasses,ct))
1672  {
1673  //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case2\n",qPrint(nd->name()),includeClasses);
1674  return TRUE;
1675  }
1676  }
1677 
1678  ClassLinkedRefMap list = nd->getClasses();
1679  if (filterClasses)
1680  {
1681  if (ct == ClassDef::Interface)
1682  {
1683  list = nd->getInterfaces();
1684  }
1685  else if (ct == ClassDef::Struct)
1686  {
1687  list = nd->getStructs();
1688  }
1689  else if (ct == ClassDef::Exception)
1690  {
1691  list = nd->getExceptions();
1692  }
1693  }
1694 
1695  for (const auto &cd : list)
1696  {
1697  if (cd->isLinkableInProject() && cd->templateMaster()==0)
1698  {
1699  //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case3\n",qPrint(nd->name()),includeClasses);
1700  return TRUE;
1701  }
1702  }
1703  return FALSE;
1704 }

引用了 ClassDef::Exception, FALSE, NamespaceDef::getClasses(), NamespaceDef::getExceptions(), NamespaceDef::getInterfaces(), NamespaceDef::getNamespaces(), NamespaceDef::getStructs(), ClassDef::Interface, namespaceHasNestedClass(), ClassDef::Struct , 以及 TRUE.

被这些函数引用 NestingContext::Private::addNamespace(), namespaceHasNestedClass(), writeClassTreeInsideNamespaceElement() , 以及 writeNamespaceTreeElement().

◆ namespaceHasNestedConcept()

bool namespaceHasNestedConcept ( const NamespaceDef nd)

在文件 namespacedef.cpp1646 行定义.

1647 {
1648  for (const auto &cnd : nd->getNamespaces())
1649  {
1650  if (namespaceHasNestedConcept(cnd))
1651  {
1652  //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case2\n",qPrint(nd->name()),includeClasses);
1653  return true;
1654  }
1655  }
1656  for (const auto &cnd : nd->getConcepts())
1657  {
1658  if (cnd->isLinkableInProject())
1659  {
1660  return true;
1661  }
1662  }
1663  return false;
1664 }

引用了 NamespaceDef::getConcepts(), NamespaceDef::getNamespaces() , 以及 namespaceHasNestedConcept().

被这些函数引用 NestingContext::Private::addNamespace(), namespaceHasNestedConcept(), writeConceptTreeInsideNamespaceElement() , 以及 writeNamespaceTreeElement().

◆ namespaceHasNestedNamespace()

bool namespaceHasNestedNamespace ( const NamespaceDef nd)

在文件 namespacedef.cpp1634 行定义.

1635 {
1636  for (const auto &cnd : nd->getNamespaces())
1637  {
1638  if (cnd->isLinkableInProject() && !cnd->isAnonymous())
1639  {
1640  return true;
1641  }
1642  }
1643  return false;
1644 }

引用了 NamespaceDef::getNamespaces().

被这些函数引用 NestingContext::Private::addNamespace() , 以及 writeNamespaceTreeElement().

◆ toNamespaceDef() [1/3]

const NamespaceDef* toNamespaceDef ( const Definition d)

在文件 namespacedef.cpp1567 行定义.

1568 {
1569  if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1570  {
1571  return static_cast<const NamespaceDef*>(d);
1572  }
1573  else
1574  {
1575  return 0;
1576  }
1577 }

◆ toNamespaceDef() [2/3]

◆ toNamespaceDef() [3/3]

NamespaceDef* toNamespaceDef ( DefinitionMutable md)

在文件 namespacedef.cpp1553 行定义.

1554 {
1555  Definition *d = toDefinition(md);
1556  if (d && typeid(*d)==typeid(NamespaceDefImpl))
1557  {
1558  return static_cast<NamespaceDef*>(d);
1559  }
1560  else
1561  {
1562  return 0;
1563  }
1564 }

引用了 toDefinition().

◆ toNamespaceDefMutable() [1/2]

NamespaceDefMutable* toNamespaceDefMutable ( const Definition d)

在文件 namespacedef.cpp1591 行定义.

1592 {
1593  if (d && typeid(*d)==typeid(NamespaceDefImpl))
1594  {
1595  return const_cast<NamespaceDefMutable*>(static_cast<const NamespaceDefMutable*>(d));
1596  }
1597  else
1598  {
1599  return 0;
1600  }
1601 }

◆ toNamespaceDefMutable() [2/2]

toDefinition
Definition * toDefinition(DefinitionMutable *dm)
Definition: definition.cpp:1950
namespaceHasNestedConcept
bool namespaceHasNestedConcept(const NamespaceDef *nd)
Definition: namespacedef.cpp:1646
NamespaceDefAliasImpl
Definition: namespacedef.cpp:173
Doxygen::namespaceAliasMap
static StringUnorderedMap namespaceAliasMap
Definition: doxygen.h:95
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
NamespaceDef::localName
virtual QCString localName() const =0
NamespaceDef
An abstract interface of a namespace symbol.
Definition: namespacedef.h:54
NamespaceDef::getExceptions
virtual ClassLinkedRefMap getExceptions() const =0
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
namespaceHasNestedClass
bool namespaceHasNestedClass(const NamespaceDef *nd, bool filterClasses, ClassDef::CompoundType ct)
Definition: namespacedef.cpp:1666
ClassDef::Interface
@ Interface
Definition: classdef.h:110
NamespaceDef::getInterfaces
virtual ClassLinkedRefMap getInterfaces() const =0
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
QCString::str
std::string str() const
Definition: qcstring.h:442
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
warn_uncond
void warn_uncond(const char *fmt,...)
Definition: message.cpp:194
NamespaceDef::getClasses
virtual ClassLinkedRefMap getClasses() const =0
NamespaceDefImpl
Definition: namespacedef.cpp:52
Definition::name
virtual QCString name() const =0
getLanguageSpecificSeparator
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang
Definition: util.cpp:6545
TRUE
#define TRUE
Definition: qcstring.h:36
ClassDef::Struct
@ Struct
Definition: classdef.h:108
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
NamespaceDef::getNamespaces
virtual NamespaceLinkedRefMap getNamespaces() const =0
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
NamespaceDef::getConcepts
virtual ConceptLinkedRefMap getConcepts() const =0
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
Doxygen::namespaceLinkedMap
static NamespaceLinkedMap * namespaceLinkedMap
Definition: doxygen.h:97
NamespaceDefMutable
Definition: namespacedef.h:106
NamespaceDef::getStructs
virtual ClassLinkedRefMap getStructs() const =0
ClassDef::Exception
@ Exception
Definition: classdef.h:113
ClassLinkedRefMap
Definition: classlist.h:30
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108