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
 
class  ClassDefImpl::IMPL
 Private data associated with a ClassDef object. More...
 

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 5383 of file classdef.cpp.

5384{
5385 BaseClassList bcl;
5386
5387 if (cd->getLanguage()==SrcLangExt::VHDL) // reverse baseClass/subClass relation
5388 {
5389 if (cd->baseClasses().empty()) return FALSE;
5390 bcl=cd->baseClasses();
5391 }
5392 else
5393 {
5394 if (cd->subClasses().empty()) return FALSE;
5395 bcl=cd->subClasses();
5396 }
5397
5398 for (const auto &bcd : bcl)
5399 {
5400 if (bcd.classDef->isVisibleInHierarchy())
5401 {
5402 return TRUE;
5403 }
5404 }
5405 return FALSE;
5406}
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 5372 of file classdef.cpp.

5373{
5374 for (const auto &bcd : bcl)
5375 {
5376 const ClassDef *cd=bcd.classDef;
5377 if (cd->isVisibleInHierarchy()) return true;
5378 if (classHasVisibleRoot(cd->baseClasses())) return true;
5379 }
5380 return false;
5381}
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 5443 of file classdef.cpp.

5444{
5445 if (bcd->categoryOf()) // use class that is being extended in case of
5446 // an Objective-C category
5447 {
5448 bcd=bcd->categoryOf();
5449 }
5450 if (cd==bcd)
5451 {
5452 goto exit;
5453 }
5454 if (level==256)
5455 {
5456 err("Internal inconsistency: found class %s seem to have a recursive "
5457 "inheritance relation! Please send a bug report to doxygen@gmail.com\n",qPrint(cd->name()));
5458 }
5459 else if (prot!=Protection::Private)
5460 {
5461 for (const auto &bcdi : cd->baseClasses())
5462 {
5463 Protection baseProt = classInheritedProtectionLevel(bcdi.classDef,bcd,bcdi.prot,level+1);
5464 if (baseProt==Protection::Private) prot=Protection::Private;
5465 else if (baseProt==Protection::Protected) prot=Protection::Protected;
5466 }
5467 }
5468exit:
5469 //printf("classInheritedProtectionLevel(%s,%s)=%d\n",qPrint(cd->name()),qPrint(bcd->name()),prot);
5470 return prot;
5471}
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:84
const char * qPrint(const char *s)
Definition qcstring.h:672
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, Protected, and qPrint().

Referenced by classInheritedProtectionLevel().

◆ classVisibleInIndex()

bool classVisibleInIndex ( const ClassDef * cd)

Definition at line 5408 of file classdef.cpp.

5409{
5410 bool allExternals = Config_getBool(ALLEXTERNALS);
5411 return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
5412}
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 412 of file classdef.cpp.

417{
418 return std::make_unique<ClassDefImpl>(fileName,startLine,startColumn,name,ct,ref,fName,isSymbol,isJavaEnum);
419}

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 642 of file classdef.cpp.

643{
644 auto acd = std::make_unique<ClassDefAliasImpl>(newScope,cd);
645 //printf("cd name=%s localName=%s qualifiedName=%s qualifiedNameWith=%s displayName()=%s\n",
646 // qPrint(acd->name()),qPrint(acd->localName()),qPrint(acd->qualifiedName()),
647 // qPrint(acd->qualifiedNameWithTemplateParameters()),qPrint(acd->displayName()));
648 return acd;
649}

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 147 of file classdef.cpp.

148{
149 if (lang==SrcLangExt::Fortran)
150 {
151 switch (compType)
152 {
153 case ClassDef::Class: return "module";
154 case ClassDef::Struct: return "type";
155 case ClassDef::Union: return "union";
156 case ClassDef::Interface: return "interface";
157 case ClassDef::Protocol: return "protocol";
158 case ClassDef::Category: return "category";
159 case ClassDef::Exception: return "exception";
160 default: return "unknown";
161 }
162 }
163 else
164 {
165 switch (compType)
166 {
167 case ClassDef::Class: return isJavaEnum ? "enum" : "class";
168 case ClassDef::Struct: return "struct";
169 case ClassDef::Union: return "union";
170 case ClassDef::Interface: return lang==SrcLangExt::ObjC ? "class" : "interface";
171 case ClassDef::Protocol: return "protocol";
172 case ClassDef::Category: return "category";
173 case ClassDef::Exception: return "exception";
174 case ClassDef::Service: return "service";
175 case ClassDef::Singleton: return "singleton";
176 default: return "unknown";
177 }
178 }
179}
@ 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 3449 of file classdef.cpp.

3450{
3451 bool found=!cd->isReference() && cd->isLinkableInProject() && !cd->isHidden();
3452 if (found)
3453 {
3454 return TRUE; // we're done if this class is not a reference
3455 }
3456 for (const auto &ibcd : cd->subClasses())
3457 {
3458 const ClassDef *bcd=ibcd.classDef;
3459 if (level>256)
3460 {
3461 err("Possible recursive class relation while inside %s and looking for base class %s\n",qPrint(cd->name()),qPrint(bcd->name()));
3462 return FALSE;
3463 }
3464 // recurse into the super class branch
3465 found = found || hasNonReferenceSuperClassRec(bcd,level+1);
3466 if (!found)
3467 {
3468 // look for template instances that might have non-reference super classes
3469 for (const auto &cil : bcd->getTemplateInstances())
3470 {
3471 // recurse into the template instance branch
3472 found = hasNonReferenceSuperClassRec(cil.classDef,level+1);
3473 if (found) break;
3474 }
3475 }
3476 else
3477 {
3478 break;
3479 }
3480 }
3481 return found;
3482}
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(), qPrint(), ClassDef::subClasses(), and TRUE.

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

◆ isStandardFunc()

static bool isStandardFunc ( const MemberDef * md)
static

Definition at line 3685 of file classdef.cpp.

3686{
3687 return md->name()=="operator=" || // assignment operator
3688 md->isConstructor() || // constructor
3689 md->isDestructor(); // destructor
3690}
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 108 of file classdef.cpp.

109{
110 //bool optimizeOutputForJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
111 SrcLangExt lang = cd->getLanguage();
112 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
113 QCString n;
114 if (lang==SrcLangExt::VHDL)
115 {
117 }
118 else
119 {
120 if (includeScope)
121 {
123 }
124 else
125 {
126 n=cd->className();
127 }
128 }
129 if (cd->isAnonymous())
130 {
132 }
134 if (sep!="::")
135 {
136 n=substitute(n,"::",sep);
137 }
138 if (cd->compoundType()==ClassDef::Protocol && n.endsWith("-p"))
139 {
140 n="<"+n.left(n.length()-2)+">";
141 }
142 return n;
143}
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:6230

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
83 QCString clName = cd->className();
84 scName+=clName;
85 if (!cd->templateArguments().empty())
86 {
87 if (actualParams && *actualParamIndex<actualParams->size())
88 {
89 const ArgumentList &al = actualParams->at(*actualParamIndex);
91 {
92 scName+=tempArgListToString(al,lang);
93 }
94 (*actualParamIndex)++;
95 }
96 else
97 {
99 {
100 scName+=tempArgListToString(cd->templateArguments(),lang);
101 }
102 }
103 }
104 //printf("qualifiedNameWithTemplateParameters: scope=%s qualifiedName=%s\n",qPrint(name()),qPrint(scName));
105 return scName;
106}
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:5881
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1219

References ArgumentList::at(), ClassDef::className(), Config_getBool, 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 5418 of file classdef.cpp.

5419{
5420 const int maxInheritanceDepth = 100000;
5421 if (bcd->categoryOf()) // use class that is being extended in case of
5422 // an Objective-C category
5423 {
5424 bcd=bcd->categoryOf();
5425 }
5426 if (cd==bcd) return level;
5427 if (level==256)
5428 {
5429 warn_uncond("class %s seem to have a recursive "
5430 "inheritance relation!\n",qPrint(cd->name()));
5431 return -1;
5432 }
5433 int m=maxInheritanceDepth;
5434 for (const auto &bcdi : cd->baseClasses())
5435 {
5436 int mc=minClassDistance(bcdi.classDef,bcd,level+1);
5437 if (mc<m) m=mc;
5438 if (m<0) break;
5439 }
5440 return m;
5441}
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)
#define warn_uncond(fmt,...)
Definition message.h:79
const int maxInheritanceDepth
Definition util.cpp:156

References ClassDef::baseClasses(), ClassDef::categoryOf(), maxInheritanceDepth, minClassDistance(), Definition::name(), qPrint(), 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 1475 of file classdef.cpp.

1479{
1481 {
1482 if (d->getOuterScope())
1483 {
1484 searchTemplateSpecs(d->getOuterScope(),result,name,lang);
1485 }
1486 const ClassDef *cd=toClassDef(d);
1487 if (!name.isEmpty()) name+="::";
1488 QCString clName = d->localName();
1489 if (clName.endsWith("-p"))
1490 {
1491 clName = clName.left(clName.length()-2);
1492 }
1493 name+=clName;
1494 bool isSpecialization = d->localName().find('<')!=-1;
1495 if (!cd->templateArguments().empty())
1496 {
1497 result.push_back(cd->templateArguments());
1498 if (!isSpecialization)
1499 {
1500 name+=tempArgListToString(cd->templateArguments(),lang);
1501 }
1502 }
1503 }
1504 else
1505 {
1506 name+=d->qualifiedName();
1507 }
1508}
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(), DefinitionMixin< ClassDefMutable >::name(), 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 5337 of file classdef.cpp.

5338{
5339 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5340 {
5341 return static_cast<const ClassDef*>(d);
5342 }
5343 else
5344 {
5345 return nullptr;
5346 }
5347}
Implementation of the ClassDef interface.
Definition classdef.cpp:186

◆ toClassDef() [2/3]

◆ toClassDef() [3/3]

ClassDef * toClassDef ( DefinitionMutable * md)

Definition at line 5324 of file classdef.cpp.

5325{
5326 Definition *d = toDefinition(md);
5327 if (d && typeid(*d)==typeid(ClassDefImpl))
5328 {
5329 return static_cast<ClassDef*>(d);
5330 }
5331 else
5332 {
5333 return nullptr;
5334 }
5335}
Definition * toDefinition(DefinitionMutable *dm)

References DefinitionMutable::toDefinition.

◆ toClassDefMutable()

ClassDefMutable * toClassDefMutable ( Definition * d)

Definition at line 5349 of file classdef.cpp.

5350{
5351 if (d && typeid(*d)==typeid(ClassDefImpl))
5352 {
5353 return static_cast<ClassDefMutable*>(d);
5354 }
5355 else
5356 {
5357 return nullptr;
5358 }
5359}

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(), insertMemberAlias(), ClassDefImpl::insertTemplateInstance(), ClassDefImpl::insertUsedFile(), 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 1414 of file classdef.cpp.

1415{
1417 {
1418 ol.startTypewriter();
1419 ol.docify(" [");
1420 StringVector sl;
1421 if (bcd.prot==Protection::Protected) sl.emplace_back("protected");
1422 else if (bcd.prot==Protection::Private) sl.emplace_back("private");
1423 if (bcd.virt==Specifier::Virtual) sl.emplace_back("virtual");
1424 bool first=true;
1425 for (const auto &s : sl)
1426 {
1427 if (!first) ol.docify(", ");
1428 ol.docify(s.c_str());
1429 first=false;
1430 }
1431 ol.docify("]");
1432 ol.endTypewriter();
1433 }
1434}
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().