Doxygen
Loading...
Searching...
No Matches
classdef.cpp File Reference
#include <cstdio>
#include <algorithm>
#include "types.h"
#include "classdef.h"
#include "classlist.h"
#include "entry.h"
#include "doxygen.h"
#include "membername.h"
#include "message.h"
#include "config.h"
#include "util.h"
#include "diagram.h"
#include "language.h"
#include "htmlhelp.h"
#include "example.h"
#include "outputlist.h"
#include "dot.h"
#include "dotclassgraph.h"
#include "dotrunner.h"
#include "defargs.h"
#include "debug.h"
#include "docparser.h"
#include "searchindex.h"
#include "vhdldocgen.h"
#include "layout.h"
#include "arguments.h"
#include "memberlist.h"
#include "groupdef.h"
#include "filedef.h"
#include "namespacedef.h"
#include "membergroup.h"
#include "definitionimpl.h"
#include "symbolresolver.h"
#include "fileinfo.h"
#include "trace.h"
#include "moduledef.h"
+ Include dependency graph for classdef.cpp:

Go to the source code of this file.

Classes

class  ClassDefImpl
 Implementation of the ClassDef interface. More...
 
class  ClassDefAliasImpl
 

Functions

static QCString makeQualifiedNameWithTemplateParameters (const ClassDef *cd, const ArgumentLists *actualParams, uint32_t *actualParamIndex)
 
static QCString makeDisplayName (const ClassDef *cd, bool includeScope)
 
static QCString getCompoundTypeString (SrcLangExt lang, ClassDef::CompoundType compType, bool isJavaEnum)
 
std::unique_ptr< ClassDefcreateClassDef (const QCString &fileName, int startLine, int startColumn, const QCString &name, ClassDef::CompoundType ct, const QCString &ref, const QCString &fName, bool isSymbol, bool isJavaEnum)
 Factory method to create a new ClassDef object.
 
std::unique_ptr< ClassDefcreateClassDefAlias (const Definition *newScope, const ClassDef *cd)
 
static void writeInheritanceSpecifier (OutputList &ol, const BaseClassDef &bcd)
 
static void searchTemplateSpecs (const Definition *d, ArgumentLists &result, QCString &name, SrcLangExt lang)
 
static bool hasNonReferenceSuperClassRec (const ClassDef *cd, int level)
 
static bool isStandardFunc (const MemberDef *md)
 
ClassDeftoClassDef (Definition *d)
 
ClassDeftoClassDef (DefinitionMutable *md)
 
const ClassDeftoClassDef (const Definition *d)
 
ClassDefMutabletoClassDefMutable (Definition *d)
 
ClassDefgetClass (const QCString &n)
 
bool classHasVisibleRoot (const BaseClassList &bcl)
 
bool classHasVisibleChildren (const ClassDef *cd)
 
bool classVisibleInIndex (const ClassDef *cd)
 
int minClassDistance (const ClassDef *cd, const ClassDef *bcd, int level)
 
Protection classInheritedProtectionLevel (const ClassDef *cd, const ClassDef *bcd, Protection prot, int level)
 

Function Documentation

◆ classHasVisibleChildren()

bool classHasVisibleChildren ( const ClassDef * cd)

Definition at line 5442 of file classdef.cpp.

5443{
5444 BaseClassList bcl;
5445
5446 if (cd->getLanguage()==SrcLangExt::VHDL) // reverse baseClass/subClass relation
5447 {
5448 if (cd->baseClasses().empty()) return FALSE;
5449 bcl=cd->baseClasses();
5450 }
5451 else
5452 {
5453 if (cd->subClasses().empty()) return FALSE;
5454 bcl=cd->subClasses();
5455 }
5456
5457 for (const auto &bcd : bcl)
5458 {
5459 if (bcd.classDef->isVisibleInHierarchy())
5460 {
5461 return TRUE;
5462 }
5463 }
5464 return FALSE;
5465}
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
std::vector< BaseClassDef > BaseClassList
Definition classdef.h:81
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References ClassDef::baseClasses(), FALSE, Definition::getLanguage(), ClassDef::subClasses(), TRUE, and VHDL.

Referenced by writeClassTreeForList(), and writeClassTreeToOutput().

◆ classHasVisibleRoot()

bool classHasVisibleRoot ( const BaseClassList & bcl)

Definition at line 5431 of file classdef.cpp.

5432{
5433 for (const auto &bcd : bcl)
5434 {
5435 const ClassDef *cd=bcd.classDef;
5436 if (cd->isVisibleInHierarchy()) return true;
5437 if (classHasVisibleRoot(cd->baseClasses())) return true;
5438 }
5439 return false;
5440}
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual bool isVisibleInHierarchy() const =0
the class is visible in a class diagram, or class hierarchy
bool classHasVisibleRoot(const BaseClassList &bcl)

References ClassDef::baseClasses(), classHasVisibleRoot(), and ClassDef::isVisibleInHierarchy().

Referenced by DotGfxHierarchyTable::addClassList(), DotGfxHierarchyTable::addHierarchy(), classHasVisibleRoot(), countClassesInTreeList(), writeClassTreeForList(), and writeClassTreeToOutput().

◆ classInheritedProtectionLevel()

Protection classInheritedProtectionLevel ( const ClassDef * cd,
const ClassDef * bcd,
Protection prot,
int level )

Definition at line 5501 of file classdef.cpp.

5502{
5503 if (bcd->categoryOf()) // use class that is being extended in case of
5504 // an Objective-C category
5505 {
5506 bcd=bcd->categoryOf();
5507 }
5508 if (cd==bcd)
5509 {
5510 goto exit;
5511 }
5512 if (level==256)
5513 {
5514 err("Internal inconsistency: found class {} seem to have a recursive "
5515 "inheritance relation! Please send a bug report to doxygen@gmail.com\n",cd->name());
5516 }
5517 else if (prot!=Protection::Private)
5518 {
5519 for (const auto &bcdi : cd->baseClasses())
5520 {
5521 Protection baseProt = classInheritedProtectionLevel(bcdi.classDef,bcd,bcdi.prot,level+1);
5522 if (baseProt==Protection::Private) prot=Protection::Private;
5523 else if (baseProt==Protection::Protected) prot=Protection::Protected;
5524 }
5525 }
5526exit:
5527 //printf("classInheritedProtectionLevel(%s,%s)=%d\n",qPrint(cd->name()),qPrint(bcd->name()),prot);
5528 return prot;
5529}
virtual ClassDef * categoryOf() const =0
Returns the class of which this is a category (Objective-C only)
virtual const QCString & name() const =0
Protection classInheritedProtectionLevel(const ClassDef *cd, const ClassDef *bcd, Protection prot, int level)
#define err(fmt,...)
Definition message.h:127
Protection
Protection level of members.
Definition types.h:26
@ Private
Definition types.h:26
@ Protected
Definition types.h:26

References ClassDef::baseClasses(), ClassDef::categoryOf(), classInheritedProtectionLevel(), err, Definition::name(), Private, and Protected.

Referenced by classInheritedProtectionLevel().

◆ classVisibleInIndex()

bool classVisibleInIndex ( const ClassDef * cd)

Definition at line 5467 of file classdef.cpp.

5468{
5469 bool allExternals = Config_getBool(ALLEXTERNALS);
5470 return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
5471}
virtual bool isLinkable() const =0
virtual bool isLinkableInProject() const =0
#define Config_getBool(name)
Definition config.h:33

References Config_getBool, Definition::isLinkable(), and Definition::isLinkableInProject().

Referenced by writeClassTree().

◆ createClassDef()

std::unique_ptr< ClassDef > createClassDef ( const QCString & fileName,
int startLine,
int startColumn,
const QCString & name,
ClassDef::CompoundType ct,
const QCString & ref,
const QCString & fName,
bool isSymbol,
bool isJavaEnum )

Factory method to create a new ClassDef object.

Definition at line 558 of file classdef.cpp.

563{
564 return std::make_unique<ClassDefImpl>(fileName,startLine,startColumn,name,ct,ref,fName,isSymbol,isJavaEnum);
565}

Referenced by addClassToContext(), createTagLessInstance(), findClassRelation(), findUsedClassesForClass(), findUsingDeclarations(), and ClassDefMutable::sortAllMembersList().

◆ createClassDefAlias()

std::unique_ptr< ClassDef > createClassDefAlias ( const Definition * newScope,
const ClassDef * cd )

Definition at line 785 of file classdef.cpp.

786{
787 auto acd = std::make_unique<ClassDefAliasImpl>(newScope,cd);
788 //printf("cd name=%s localName=%s qualifiedName=%s qualifiedNameWith=%s displayName()=%s\n",
789 // qPrint(acd->name()),qPrint(acd->localName()),qPrint(acd->qualifiedName()),
790 // qPrint(acd->qualifiedNameWithTemplateParameters()),qPrint(acd->displayName()));
791 return acd;
792}

Referenced by ClassDefAliasImpl::deepCopy(), findUsingDeclImports(), resolveClassNestingRelations(), and ClassDefMutable::sortAllMembersList().

◆ getClass()

◆ getCompoundTypeString()

static QCString getCompoundTypeString ( SrcLangExt lang,
ClassDef::CompoundType compType,
bool isJavaEnum )
static

Definition at line 146 of file classdef.cpp.

147{
148 if (lang==SrcLangExt::Fortran)
149 {
150 switch (compType)
151 {
152 case ClassDef::Class: return "module";
153 case ClassDef::Struct: return "type";
154 case ClassDef::Union: return "union";
155 case ClassDef::Interface: return "interface";
156 case ClassDef::Protocol: return "protocol";
157 case ClassDef::Category: return "category";
158 case ClassDef::Exception: return "exception";
159 default: return "unknown";
160 }
161 }
162 else
163 {
164 switch (compType)
165 {
166 case ClassDef::Class: return isJavaEnum ? "enum" : "class";
167 case ClassDef::Struct: return "struct";
168 case ClassDef::Union: return "union";
169 case ClassDef::Interface: return lang==SrcLangExt::ObjC ? "class" : "interface";
170 case ClassDef::Protocol: return "protocol";
171 case ClassDef::Category: return "category";
172 case ClassDef::Exception: return "exception";
173 case ClassDef::Service: return "service";
174 case ClassDef::Singleton: return "singleton";
175 default: return "unknown";
176 }
177 }
178}
@ Singleton
Definition classdef.h:117
@ Interface
Definition classdef.h:112
@ Exception
Definition classdef.h:115
@ Fortran
Definition types.h:53

References ClassDef::Category, ClassDef::Class, ClassDef::Exception, Fortran, ClassDef::Interface, ObjC, ClassDef::Protocol, ClassDef::Service, ClassDef::Singleton, ClassDef::Struct, and ClassDef::Union.

Referenced by ClassDefImpl::ClassDefImpl(), ClassDefImpl::compoundTypeString(), and ClassDefImpl::deepCopy().

◆ hasNonReferenceSuperClassRec()

static bool hasNonReferenceSuperClassRec ( const ClassDef * cd,
int level )
static

Definition at line 3439 of file classdef.cpp.

3440{
3441 bool found=!cd->isReference() && cd->isLinkableInProject() && !cd->isHidden();
3442 if (found)
3443 {
3444 return TRUE; // we're done if this class is not a reference
3445 }
3446 for (const auto &ibcd : cd->subClasses())
3447 {
3448 const ClassDef *bcd=ibcd.classDef;
3449 if (level>256)
3450 {
3451 err("Possible recursive class relation while inside {} and looking for base class {}\n",cd->name(),bcd->name());
3452 return FALSE;
3453 }
3454 // recurse into the super class branch
3455 found = found || hasNonReferenceSuperClassRec(bcd,level+1);
3456 if (!found)
3457 {
3458 // look for template instances that might have non-reference super classes
3459 for (const auto &cil : bcd->getTemplateInstances())
3460 {
3461 // recurse into the template instance branch
3462 found = hasNonReferenceSuperClassRec(cil.classDef,level+1);
3463 if (found) break;
3464 }
3465 }
3466 else
3467 {
3468 break;
3469 }
3470 }
3471 return found;
3472}
virtual const TemplateInstanceList & getTemplateInstances() const =0
Returns a sorted dictionary with all template instances found for this template class.
virtual bool isHidden() const =0
virtual bool isReference() const =0
static bool hasNonReferenceSuperClassRec(const ClassDef *cd, int level)
bool found
Definition util.cpp:984

References err, FALSE, found, ClassDef::getTemplateInstances(), hasNonReferenceSuperClassRec(), Definition::isHidden(), Definition::isLinkableInProject(), Definition::isReference(), Definition::name(), ClassDef::subClasses(), and TRUE.

Referenced by ClassDefImpl::hasNonReferenceSuperClass(), and hasNonReferenceSuperClassRec().

◆ isStandardFunc()

static bool isStandardFunc ( const MemberDef * md)
static

Definition at line 3677 of file classdef.cpp.

3678{
3679 return md->name()=="operator=" || // assignment operator
3680 md->isConstructor() || // constructor
3681 md->isDestructor(); // destructor
3682}
virtual bool isDestructor() const =0
virtual bool isConstructor() const =0

References MemberDef::isConstructor(), MemberDef::isDestructor(), and Definition::name().

Referenced by ClassDefImpl::mergeMembersFromBaseClasses().

◆ makeDisplayName()

static QCString makeDisplayName ( const ClassDef * cd,
bool includeScope )
static

Definition at line 107 of file classdef.cpp.

108{
109 //bool optimizeOutputForJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
110 SrcLangExt lang = cd->getLanguage();
111 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
112 QCString n;
113 if (lang==SrcLangExt::VHDL)
114 {
116 }
117 else
118 {
119 if (includeScope)
120 {
122 }
123 else
124 {
125 n=cd->className();
126 }
127 }
128 if (cd->isAnonymous())
129 {
131 }
133 if (sep!="::")
134 {
135 n=substitute(n,"::",sep);
136 }
137 if (cd->compoundType()==ClassDef::Protocol && n.endsWith("-p"))
138 {
139 n="<"+n.left(n.length()-2)+">";
140 }
141 return n;
142}
virtual QCString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
virtual QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const =0
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
virtual bool isAnonymous() const =0
This is an alternative implementation of QCString.
Definition qcstring.h:101
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
bool endsWith(const char *s) const
Definition qcstring.h:509
QCString left(size_t len) const
Definition qcstring.h:214
static QCString getClassName(const ClassDef *)
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
SrcLangExt
Language as given by extension.
Definition types.h:42
QCString removeAnonymousScopes(const QCString &str)
Definition util.cpp:172
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6326

References ClassDef::className(), ClassDef::compoundType(), QCString::endsWith(), VhdlDocGen::getClassName(), Definition::getLanguage(), getLanguageSpecificSeparator(), Definition::isAnonymous(), QCString::left(), QCString::length(), ClassDef::Protocol, ClassDef::qualifiedNameWithTemplateParameters(), removeAnonymousScopes(), substitute(), and VHDL.

Referenced by ClassDefAliasImpl::displayName(), and ClassDefImpl::displayName().

◆ makeQualifiedNameWithTemplateParameters()

static QCString makeQualifiedNameWithTemplateParameters ( const ClassDef * cd,
const ArgumentLists * actualParams,
uint32_t * actualParamIndex )
static

Definition at line 56 of file classdef.cpp.

58{
59 //bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
60 bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
61 //printf("qualifiedNameWithTemplateParameters() localName=%s\n",qPrint(cd->localName()));
62 QCString scName;
63 const Definition *d=cd->getOuterScope();
64 if (d)
65 {
67 {
68 const ClassDef *ocd=toClassDef(d);
69 scName = ocd->qualifiedNameWithTemplateParameters(actualParams,actualParamIndex);
70 }
71 else if (!hideScopeNames)
72 {
73 scName = d->qualifiedName();
74 }
75 }
76
77 SrcLangExt lang = cd->getLanguage();
78 QCString scopeSeparator = getLanguageSpecificSeparator(lang);
79 if (!scName.isEmpty()) scName+=scopeSeparator;
80
81 bool isSpecialization = cd->localName().find('<')!=-1;
82 QCString clName = cd->className();
83 scName+=clName;
84 if (lang!=SrcLangExt::CSharp && !cd->templateArguments().empty())
85 {
86 if (actualParams && *actualParamIndex<actualParams->size())
87 {
88 const ArgumentList &al = actualParams->at(*actualParamIndex);
90 {
91 scName+=tempArgListToString(al,lang);
92 }
93 (*actualParamIndex)++;
94 }
95 else
96 {
98 {
99 scName+=tempArgListToString(cd->templateArguments(),lang);
100 }
101 }
102 }
103 //printf("qualifiedNameWithTemplateParameters: scope=%s qualifiedName=%s\n",qPrint(name()),qPrint(scName));
104 return scName;
105}
This class represents an function or template argument list.
Definition arguments.h:60
bool empty() const
Definition arguments.h:92
Argument & at(size_t i)
Definition arguments.h:100
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
The common base class of all entity definitions found in the sources.
Definition definition.h:76
virtual const QCString & localName() const =0
virtual DefType definitionType() const =0
virtual QCString qualifiedName() const =0
virtual Definition * getOuterScope() const =0
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
ClassDef * toClassDef(Definition *d)
static bool isSpecialization(const ArgumentLists &srcTempArgLists, const ArgumentLists &dstTempArgLists)
Definition doxygen.cpp:5920
@ CSharp
Definition types.h:46
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1219

References ArgumentList::at(), ClassDef::className(), Config_getBool, CSharp, Definition::definitionType(), ArgumentList::empty(), QCString::find(), Definition::getLanguage(), getLanguageSpecificSeparator(), Definition::getOuterScope(), QCString::isEmpty(), isSpecialization(), Definition::localName(), Definition::qualifiedName(), ClassDef::qualifiedNameWithTemplateParameters(), tempArgListToString(), ClassDef::templateArguments(), toClassDef(), and Definition::TypeClass.

Referenced by ClassDefAliasImpl::qualifiedNameWithTemplateParameters(), and ClassDefImpl::qualifiedNameWithTemplateParameters().

◆ minClassDistance()

int minClassDistance ( const ClassDef * cd,
const ClassDef * bcd,
int level )

Definition at line 5477 of file classdef.cpp.

5478{
5479 const int maxInheritanceDepth = 100000;
5480 if (bcd->categoryOf()) // use class that is being extended in case of
5481 // an Objective-C category
5482 {
5483 bcd=bcd->categoryOf();
5484 }
5485 if (cd==bcd) return level;
5486 if (level==256)
5487 {
5488 warn_uncond("class {} seem to have a recursive inheritance relation!\n",cd->name());
5489 return -1;
5490 }
5491 int m=maxInheritanceDepth;
5492 for (const auto &bcdi : cd->baseClasses())
5493 {
5494 int mc=minClassDistance(bcdi.classDef,bcd,level+1);
5495 if (mc<m) m=mc;
5496 if (m<0) break;
5497 }
5498 return m;
5499}
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)
#define warn_uncond(fmt,...)
Definition message.h:122
const int maxInheritanceDepth
Definition util.cpp:156

References ClassDef::baseClasses(), ClassDef::categoryOf(), maxInheritanceDepth, minClassDistance(), Definition::name(), and warn_uncond.

Referenced by getDefsOld(), ClassDefImpl::getMemberByName(), and minClassDistance().

◆ searchTemplateSpecs()

static void searchTemplateSpecs ( const Definition * d,
ArgumentLists & result,
QCString & name,
SrcLangExt lang )
static

Definition at line 1465 of file classdef.cpp.

1469{
1471 {
1472 if (d->getOuterScope())
1473 {
1474 searchTemplateSpecs(d->getOuterScope(),result,name,lang);
1475 }
1476 const ClassDef *cd=toClassDef(d);
1477 if (!name.isEmpty()) name+="::";
1478 QCString clName = d->localName();
1479 if (clName.endsWith("-p"))
1480 {
1481 clName = clName.left(clName.length()-2);
1482 }
1483 name+=clName;
1484 bool isSpecialization = d->localName().find('<')!=-1;
1485 if (!cd->templateArguments().empty())
1486 {
1487 result.push_back(cd->templateArguments());
1488 if (!isSpecialization)
1489 {
1490 name+=tempArgListToString(cd->templateArguments(),lang);
1491 }
1492 }
1493 }
1494 else
1495 {
1496 name+=d->qualifiedName();
1497 }
1498}
static void searchTemplateSpecs(const Definition *d, ArgumentLists &result, QCString &name, SrcLangExt lang)

References Definition::definitionType(), ArgumentList::empty(), QCString::endsWith(), QCString::find(), Definition::getOuterScope(), QCString::isEmpty(), isSpecialization(), QCString::left(), QCString::length(), Definition::localName(), Definition::qualifiedName(), searchTemplateSpecs(), tempArgListToString(), ClassDef::templateArguments(), toClassDef(), and Definition::TypeClass.

Referenced by searchTemplateSpecs(), and ClassDefImpl::writeTemplateSpec().

◆ toClassDef() [1/3]

const ClassDef * toClassDef ( const Definition * d)

Definition at line 5396 of file classdef.cpp.

5397{
5398 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5399 {
5400 return static_cast<const ClassDef*>(d);
5401 }
5402 else
5403 {
5404 return nullptr;
5405 }
5406}
Implementation of the ClassDef interface.
Definition classdef.cpp:185

◆ toClassDef() [2/3]

◆ toClassDef() [3/3]

ClassDef * toClassDef ( DefinitionMutable * md)

Definition at line 5383 of file classdef.cpp.

5384{
5385 Definition *d = toDefinition(md);
5386 if (d && typeid(*d)==typeid(ClassDefImpl))
5387 {
5388 return static_cast<ClassDef*>(d);
5389 }
5390 else
5391 {
5392 return nullptr;
5393 }
5394}
Definition * toDefinition(DefinitionMutable *dm)

References toDefinition().

◆ toClassDefMutable()

ClassDefMutable * toClassDefMutable ( Definition * d)

Definition at line 5408 of file classdef.cpp.

5409{
5410 if (d && typeid(*d)==typeid(ClassDefImpl))
5411 {
5412 return static_cast<ClassDefMutable*>(d);
5413 }
5414 else
5415 {
5416 return nullptr;
5417 }
5418}

Referenced by addClassAndNestedClasses(), addClassToContext(), addClassToGroups(), ModuleDefImpl::addClassToModule(), ModuleManager::addClassToModule(), addListReferences(), addMembersToMemberGroup(), ClassDefImpl::addMembersToTemplateInstance(), addMemberToGroups(), ClassDefImpl::addTypeConstraint(), buildCompleteMemberLists(), computeMemberReferences(), computeTemplateClassRelations(), VhdlDocGen::computeVhdlComponentRelations(), ClassDefImpl::countInheritedDecMembers(), countMembers(), createTagLessInstance(), createTemplateInstanceMembers(), ClassDefImpl::deepCopy(), distributeClassGroupRelations(), distributeMemberGroupDocumentation(), findClassRelation(), findSectionsInDocumentation(), findTagLessClasses(), findTemplateInstanceRelation(), findUsedClassesForClass(), findUsingDeclarations(), findUsingDeclImports(), generateClassDocs(), generateClassOrGlobalLink(), generateNamespaceClassDocs(), MemberDefImpl::getClassDefMutable(), getClassMutable(), ClassDefImpl::hideDerivedVariablesInPython(), insertMemberAlias(), ClassDefImpl::insertTemplateInstance(), ClassDefImpl::insertUsedFile(), ClassDefImpl::internalInsertMember(), mergeCategories(), ClassDefImpl::mergeCategory(), ClassDefImpl::mergeMembers(), ClassDefImpl::mergeMembersFromBaseClasses(), SymbolResolver::resolveClassMutable(), resolveClassNestingRelations(), setAnonymousEnumType(), ClassDefImpl::setGroupDefForAllMembers(), ClassDefMutable::sortAllMembersList(), sortMemberLists(), ClassDefImpl::writeInheritedMemberDeclarations(), and writeTagFile().

◆ writeInheritanceSpecifier()

static void writeInheritanceSpecifier ( OutputList & ol,
const BaseClassDef & bcd )
static

Definition at line 1404 of file classdef.cpp.

1405{
1407 {
1408 ol.startTypewriter();
1409 ol.docify(" [");
1410 StringVector sl;
1411 if (bcd.prot==Protection::Protected) sl.emplace_back("protected");
1412 else if (bcd.prot==Protection::Private) sl.emplace_back("private");
1413 if (bcd.virt==Specifier::Virtual) sl.emplace_back("virtual");
1414 bool first=true;
1415 for (const auto &s : sl)
1416 {
1417 if (!first) ol.docify(", ");
1418 ol.docify(s.c_str());
1419 first=false;
1420 }
1421 ol.docify("]");
1422 ol.endTypewriter();
1423 }
1424}
void docify(const QCString &s)
Definition outputlist.h:438
void startTypewriter()
Definition outputlist.h:450
void endTypewriter()
Definition outputlist.h:452
std::vector< std::string > StringVector
Definition containers.h:33
Specifier virt
Virtualness of the inheritance relation: Normal, or Virtual.
Definition classdef.h:75
Protection prot
Protection level of the inheritance relation: Public, Protected, or Private.
Definition classdef.h:70
@ Public
Definition types.h:26
@ Virtual
Definition types.h:29
@ Normal
Definition types.h:29

References OutputList::docify(), OutputList::endTypewriter(), Normal, Private, BaseClassDef::prot, Protected, Public, OutputList::startTypewriter(), BaseClassDef::virt, and Virtual.

Referenced by ClassDefImpl::writeInheritanceGraph().