Doxygen
Loading...
Searching...
No Matches
memberdef.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2015 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16
17#include <stdio.h>
18#include <assert.h>
19#include <mutex>
20
21#include "md5.h"
22#include "memberdef.h"
23#include "membername.h"
24#include "doxygen.h"
25#include "util.h"
26#include "code.h"
27#include "message.h"
28#include "htmlhelp.h"
29#include "language.h"
30#include "outputlist.h"
31#include "example.h"
32#include "membergroup.h"
33#include "groupdef.h"
34#include "defargs.h"
35#include "docparser.h"
36#include "dot.h"
37#include "dotcallgraph.h"
38#include "searchindex.h"
39#include "parserintf.h"
40#include "vhdldocgen.h"
41#include "arguments.h"
42#include "memberlist.h"
43#include "namespacedef.h"
44#include "moduledef.h"
45#include "filedef.h"
46#include "config.h"
47#include "definitionimpl.h"
48#include "regex.h"
49#include "trace.h"
50
51//-----------------------------------------------------------------------------
52
53class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
54{
55 public:
56 MemberDefImpl(const QCString &defFileName,int defLine,int defColumn,
57 const QCString &type,const QCString &name,const QCString &args,
58 const QCString &excp,Protection prot,Specifier virt,bool stat,
59 Relationship related,MemberType t,const ArgumentList &tal,
60 const ArgumentList &al,const QCString &metaData);
61 ~MemberDefImpl() override = default;
63
64 DefType definitionType() const override { return TypeMember; }
65 MemberDef *resolveAlias() override { return this; }
66 const MemberDef *resolveAlias() const override { return this; }
67 CodeSymbolType codeSymbolType() const override;
68 std::unique_ptr<MemberDef> deepCopy() const override;
69 void moveTo(Definition *) override;
70 QCString getOutputFileBase() const override;
71 QCString getReference() const override;
72 QCString anchor() const override;
73 QCString declaration() const override;
74 QCString definition() const override;
75 QCString typeString() const override;
76 QCString argsString() const override;
77 QCString excpString() const override;
78 QCString bitfieldString() const override;
79 QCString extraTypeChars() const override;
80 const QCString &initializer() const override;
81 int initializerLines() const override;
82 TypeSpecifier getMemberSpecifiers() const override;
83 VhdlSpecifier getVhdlSpecifiers() const override;
84 const MemberList *getSectionList(const Definition *) const override;
85 QCString displayDefinition() const override;
86 const ClassDef *getClassDef() const override;
87 ClassDef *getClassDef() override;
88 const FileDef *getFileDef() const override;
89 FileDef *getFileDef() override;
90 const NamespaceDef* getNamespaceDef() const override;
91 NamespaceDef* getNamespaceDef() override;
92 const GroupDef *getGroupDef() const override;
93 GroupDef *getGroupDef() override;
94 const ModuleDef *getModuleDef() const override;
95 ClassDef *accessorClass() const override;
96 QCString getReadAccessor() const override;
97 QCString getWriteAccessor() const override;
98 Grouping::GroupPri_t getGroupPri() const override;
99 QCString getGroupFileName() const override;
100 int getGroupStartLine() const override;
101 bool getGroupHasDocs() const override;
102 QCString qualifiedName() const override;
103 QCString objCMethodName(bool localLink,bool showStatic) const override;
104 Protection protection() const override;
105 Specifier virtualness(int count=0) const override;
106 MemberType memberType() const override;
107 QCString memberTypeName() const override;
108 bool isSignal() const override;
109 bool isSlot() const override;
110 bool isVariable() const override;
111 bool isEnumerate() const override;
112 bool isEnumValue() const override;
113 bool isTypedef() const override;
114 bool isSequence() const override;
115 bool isDictionary() const override;
116 bool isFunction() const override;
117 bool isFunctionPtr() const override;
118 bool isDefine() const override;
119 bool isFriend() const override;
120 bool isDCOP() const override;
121 bool isProperty() const override;
122 bool isEvent() const override;
123 bool isRelated() const override;
124 bool isForeign() const override;
125 bool isStatic() const override;
126 bool isInline() const override;
127 bool isExplicit() const override;
128 bool isMutable() const override;
129 bool isGettable() const override;
130 bool isPrivateGettable() const override;
131 bool isProtectedGettable() const override;
132 bool isSettable() const override;
133 bool isPrivateSettable() const override;
134 bool isProtectedSettable() const override;
135 bool isReadable() const override;
136 bool isWritable() const override;
137 bool isAddable() const override;
138 bool isRemovable() const override;
139 bool isRaisable() const override;
140 bool isFinal() const override;
141 bool isAbstract() const override;
142 bool isOverride() const override;
143 bool isInitonly() const override;
144 bool isOptional() const override;
145 bool isRequired() const override;
146 bool isNonAtomic() const override;
147 bool isCopy() const override;
148 bool isAssign() const override;
149 bool isRetain() const override;
150 bool isWeak() const override;
151 bool isStrong() const override;
152 bool isEnumStruct() const override;
153 bool isUnretained() const override;
154 bool isNew() const override;
155 bool isSealed() const override;
156 bool isImplementation() const override;
157 bool isExternal() const override;
158 bool isTypeAlias() const override;
159 bool isDefault() const override;
160 bool isDelete() const override;
161 bool isNoExcept() const override;
162 bool isAttribute() const override;
163 bool isUNOProperty() const override;
164 bool isReadonly() const override;
165 bool isBound() const override;
166 bool isConstrained() const override;
167 bool isTransient() const override;
168 bool isMaybeVoid() const override;
169 bool isMaybeDefault() const override;
170 bool isMaybeAmbiguous() const override;
171 bool isPublished() const override;
172 bool isTemplateSpecialization() const override;
173 bool isObjCMethod() const override;
174 bool isObjCProperty() const override;
175 bool isCSharpProperty() const override;
176 bool isConstructor() const override;
177 bool isDestructor() const override;
178 bool hasOneLineInitializer() const override;
179 bool hasMultiLineInitializer() const override;
180 bool isCallable() const override;
181 bool isStrongEnumValue() const override;
182 bool livesInsideEnum() const override;
183 bool isSliceLocal() const override;
184 bool isNoDiscard() const override;
185 bool isConstExpr() const override;
186 bool isConstEval() const override;
187 bool isConstInit() const override;
188 int numberOfFlowKeyWords() const override;
189 bool isFriendToHide() const override;
190 bool isNotFriend() const override;
191 bool isFunctionOrSignalSlot() const override;
192 bool isRelatedOrFriend() const override;
193 bool isLinkableInProject() const override;
194 bool isLinkable() const override;
195 bool hasDocumentation() const override;
196 bool hasUserDocumentation() const override;
197 bool isDeleted() const override;
198 bool isBriefSectionVisible() const override;
199 bool isDetailedSectionVisible(MemberListContainer container) const override;
200 bool hasDetailedDescription() const override;
201 bool isFriendClass() const override;
202 bool isDocumentedFriendClass() const override;
203 const MemberDef *reimplements() const override;
204 const MemberVector &reimplementedBy() const override;
205 bool isReimplementedBy(const ClassDef *cd) const override;
206 ClassDef *relatedAlso() const override;
207 bool hasDocumentedEnumValues() const override;
208 const MemberDef *getAnonymousEnumType() const override;
209 bool isDocsForDefinition() const override;
210 const MemberDef *getEnumScope() const override;
211 const MemberVector &enumFieldList() const override;
212 void setEnumBaseType(const QCString &type) override;
213 QCString enumBaseType() const override;
214 bool hasExamples() const override;
215 const ExampleList &getExamples() const override;
216 bool isPrototype() const override;
217 const ArgumentList &argumentList() const override;
218 const ArgumentList &declArgumentList() const override;
219 const ArgumentList &templateArguments() const override;
220 const ArgumentLists &definitionTemplateParameterLists() const override;
221 std::optional<ArgumentList> formalTemplateArguments() const override;
222 int getMemberGroupId() const override;
223 MemberGroup *getMemberGroup() const override;
224 bool fromAnonymousScope() const override;
225 MemberDef *fromAnonymousMember() const override;
226 bool hasCallGraph() const override;
227 bool hasCallerGraph() const override;
228 bool hasReferencesRelation() const override;
229 bool hasReferencedByRelation() const override;
230 bool hasEnumValues() const override;
231 bool hasInlineSource() const override;
232 QCString sourceRefName() const override;
233 const MemberDef *templateMaster() const override;
234 QCString getScopeString() const override;
235 ClassDef *getClassDefOfAnonymousType() const override;
236 bool isTypedefValCached() const override;
237 const ClassDef *getCachedTypedefVal() const override;
238 QCString getCachedTypedefTemplSpec() const override;
239 QCString getCachedResolvedTypedef() const override;
240 MemberDef *memberDefinition() const override;
241 MemberDef *memberDeclaration() const override;
242 const MemberDef *inheritsDocsFrom() const override;
243 const MemberDef *getGroupAlias() const override;
244 ClassDef *category() const override;
245 const MemberDef *categoryRelation() const override;
246 QCString displayName(bool=TRUE) const override;
247 QCString getDeclType() const override;
248 StringVector getLabels(const Definition *container) const override;
249 const ArgumentList &typeConstraints() const override;
250 QCString requiresClause() const override;
251 QCString documentation() const override;
252 QCString briefDescription(bool abbr=FALSE) const override;
253 QCString fieldType() const override;
254 bool isReference() const override;
255 QCString getDeclFileName() const override;
256 int getDeclLine() const override;
257 int getDeclColumn() const override;
258 void setMemberType(MemberType t) override;
259 void setDefinition(const QCString &d) override;
260 void setFileDef(FileDef *fd) override;
261 void setAnchor() override;
262 void setProtection(Protection p) override;
263 void setMemberSpecifiers(TypeSpecifier s) override;
264 void setVhdlSpecifiers(VhdlSpecifier s) override;
265 void mergeMemberSpecifiers(TypeSpecifier s) override;
266 void setInitializer(const QCString &i) override;
267 void setBitfields(const QCString &s) override;
268 void setMaxInitLines(int lines) override;
269 void setMemberClass(ClassDef *cd) override;
270 void setSectionList(const Definition *container,const MemberList *sl) override;
272 const QCString &fileName,int startLine,bool hasDocs,
273 MemberDef *member=nullptr) override;
274 void setReadAccessor(const QCString &r) override;
275 void setWriteAccessor(const QCString &w) override;
276 void setTemplateSpecialization(bool b) override;
277 void makeRelated() override;
278 void makeForeign() override;
279 void setInheritsDocsFrom(const MemberDef *md) override;
280 void setTagInfo(const TagInfo *i) override;
281 void setArgsString(const QCString &as) override;
282 void setReimplements(MemberDef *md) override;
283 void insertReimplementedBy(MemberDef *md) override;
284 void setRelatedAlso(ClassDef *cd) override;
285 void insertEnumField(MemberDef *md) override;
286 void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE) override;
287 void setEnumClassScope(ClassDef *cd) override;
288 void setDocumentedEnumValues(bool value) override;
289 void setAnonymousEnumType(const MemberDef *md) override;
290 bool addExample(const QCString &anchor,const QCString &name,const QCString &file) override;
291 void setPrototype(bool p,const QCString &df,int line, int column) override;
292 void setExplicitExternal(bool b,const QCString &df,int line,int column) override;
293 void setDeclFile(const QCString &df,int line,int column) override;
294 void moveArgumentList(std::unique_ptr<ArgumentList> al) override;
295 void moveDeclArgumentList(std::unique_ptr<ArgumentList> al) override;
296 void setDefinitionTemplateParameterLists(const ArgumentLists &lists) override;
297 void setTypeConstraints(const ArgumentList &al) override;
298 void setType(const QCString &t) override;
299 void setAccessorType(ClassDef *cd,const QCString &t) override;
300 void setNamespace(NamespaceDef *nd) override;
301 void setMemberGroup(MemberGroup *grp) override;
302 void setMemberGroupId(int id) override;
303 void makeImplementationDetail() override;
304 void setFromAnonymousScope(bool b) override;
305 void setFromAnonymousMember(MemberDef *m) override;
306 void overrideCallGraph(bool e) override;
307 void overrideCallerGraph(bool e) override;
308 void overrideReferencedByRelation(bool e) override;
309 void overrideReferencesRelation(bool e) override;
310 void overrideEnumValues(bool e) override;
311 void overrideInlineSource(bool e) override;
312 void setTemplateMaster(const MemberDef *mt) override;
313 void setFormalTemplateArguments(const ArgumentList &al) override;
314 void addListReference(Definition *d) override;
315 void setDocsForDefinition(bool b) override;
316 void setGroupAlias(const MemberDef *md) override;
317 void cacheTypedefVal(const ClassDef *val,const QCString &templSpec,const QCString &resolvedType) override;
318 void invalidateTypedefValCache() override;
319 void invalidateCachedArgumentTypes() override;
320 void setMemberDefinition(MemberDef *md) override;
321 void setMemberDeclaration(MemberDef *md) override;
322 void copyArgumentNames(const MemberDef *bmd) override;
323 void setCategory(ClassDef *) override;
324 void setCategoryRelation(const MemberDef *) override;
325 void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE) override;
326 void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine) override;
327 void setInbodyDocumentation(const QCString &d,const QCString &inbodyFile,int inbodyLine) override;
328 void setHidden(bool b) override;
329 void setRequiresClause(const QCString &req) override;
330 void incrementFlowKeyWordCount() override;
332 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
333 bool inGroup, int indentLevel,const ClassDef *inheritFrom=nullptr,const QCString &inheritId=QCString()) const override;
334 void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol,
335 const QCString &scopeName,const Definition *container,
336 bool inGroup,bool showEnumValues=FALSE,bool
337 showInline=FALSE) const override;
338 void writeMemberDocSimple(OutputList &ol,const Definition *container) const override;
339 void writeEnumDeclaration(OutputList &typeDecl,
340 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const override;
341 void writeTagFile(TextStream &,bool useQualifiedName,bool showNamespaceMembers) const override;
342 void warnIfUndocumented() const override;
343 void warnIfUndocumentedParams() const override;
344 bool visibleInIndex() const override;
345 void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const override;
346 std::unique_ptr<MemberDef> createTemplateInstanceMember(const ArgumentList &formalArgs,
347 const std::unique_ptr<ArgumentList> &actualArgs) const override;
348 void findSectionsInDocumentation() override;
349 void writeLink(OutputList &ol,
350 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
351 bool onlyText=FALSE) const override;
352 void resolveUnnamedParameters(const MemberDef *md) override;
353 void addQualifiers(const StringVector &qualifiers) override;
354 StringVector getQualifiers() const override;
356 void setModuleDef(ModuleDef *mod) override;
357
358 private:
362 void _writeGroupInclude(OutputList &ol,bool inGroup) const;
363 void _writeMultiLineInitializer(OutputList &ol,const QCString &scopeName) const;
364 void _writeCallGraph(OutputList &ol) const;
365 void _writeCallerGraph(OutputList &ol) const;
366 void _writeReimplements(OutputList &ol) const;
367 bool _isReimplements() const;
368 void _writeReimplementedBy(OutputList &ol) const;
369 size_t _countReimplementedBy() const;
370 void _writeExamples(OutputList &ol) const;
371 void _writeTypeConstraints(OutputList &ol) const;
372 void _writeEnumValues(OutputList &ol,const Definition *container,
373 const QCString &cfname,const QCString &ciname,
374 const QCString &cname) const;
375 void _writeCategoryRelation(OutputList &ol) const;
376 void _writeTagData(const DefType) const;
377 void _writeTemplatePrefix(OutputList &ol, const Definition *def,
378 const ArgumentList &al, bool writeReqClause=true) const;
379 bool _hasVisibleCallGraph() const;
380 bool _hasVisibleCallerGraph() const;
381 bool _isAnonymousBitField() const;
382
383
384 void init(Definition *def,const QCString &t,const QCString &a,const QCString &e,
385 Protection p,Specifier v,bool s,Relationship r,
386 MemberType mt,const ArgumentList &tal,
387 const ArgumentList &al,const QCString &meta
388 );
389
390 uint8_t m_isLinkableCached; // 0 = not cached, 1=FALSE, 2=TRUE
391 uint8_t m_isConstructorCached; // 0 = not cached, 1=FALSE, 2=TRUE
392 uint8_t m_isDestructorCached; // 1 = not cached, 1=FALSE, 2=TRUE
393
394 ClassDef *m_classDef = nullptr; // member of or related to
395 FileDef *m_fileDef = nullptr; // member of file definition
396 NamespaceDef *m_nspace = nullptr; // the namespace this member is in.
398
399 const MemberDef *m_enumScope = nullptr; // the enclosing scope, if this is an enum field
400 bool m_livesInsideEnum = false;
401 const MemberDef *m_annEnumType = nullptr; // the anonymous enum that is the type of this member
402 MemberVector m_enumFields; // enumeration fields
403
404 MemberDef *m_redefines = nullptr; // the members that this member redefines
405 MemberVector m_redefinedBy; // the list of members that redefine this one
406
407 MemberDef *m_memDef = nullptr; // member definition for this declaration
408 MemberDef *m_memDec = nullptr; // member declaration for this definition
409 ClassDef *m_relatedAlso = nullptr; // points to class marked by relatedAlso
410
411 ExampleList m_examples; // a dictionary of all examples for quick access
412
413 QCString m_type; // return actual type
414 QCString m_accessorType; // return type that tell how to get to this member
415 ClassDef *m_accessorClass = nullptr; // class that this member accesses (for anonymous types)
416 QCString m_args; // function arguments/variable array specifiers
417 QCString m_def; // member definition in code (fully qualified name)
418 QCString m_anc; // HTML anchor name
419 Specifier m_virt = Specifier::Normal; // normal/virtual/pure virtual
420 Protection m_prot = Protection::Public; // protection type [Public/Protected/Private]
421 QCString m_decl; // member declaration in class
422
423 QCString m_bitfields; // struct member bitfields
424 QCString m_read; // property read accessor
425 QCString m_write; // property write accessor
426 QCString m_exception; // exceptions that can be thrown
427 QCString m_initializer; // initializer
428 QCString m_extraTypeChars; // extra type info found after the argument list
429 QCString m_enumBaseType; // base type of the enum (C++11)
430 QCString m_requiresClause; // requires clause (C++20)
431 int m_initLines = 0; // number of lines in the initializer
432
433 TypeSpecifier m_memSpec; // The specifiers present for this member
435 MemberType m_mtype = MemberType::Define; // returns the kind of member
436 int m_maxInitLines = 0; // when the initializer will be displayed
437 int m_userInitLines = 0; // result of explicit \hideinitializer or \showinitializer
439
440 ArgumentList m_defArgList; // argument list of this member definition
441 ArgumentList m_declArgList; // argument list of this member declaration
442
443 ArgumentList m_tArgList; // template argument list of function template
444 ArgumentList m_typeConstraints; // type constraints for template parameters
445 const MemberDef *m_templateMaster = nullptr;
446 std::optional<ArgumentList> m_formalTemplateArguments;
447 ArgumentLists m_defTmpArgLists; // lists of template argument lists
448 // (for template functions in nested template classes)
449
450 QCString m_metaData; // Slice metadata.
451
452 mutable ClassDef *m_cachedAnonymousType = nullptr; // if the member has an anonymous compound
453 // as its type then this is computed by
454 // getClassDefOfAnonymousType() and
455 // cached here.
456 std::map<const Definition *,const MemberList *> m_sectionMap;
457
458 const MemberDef *m_groupAlias = nullptr; // Member containing the definition
459 int m_grpId = 0; // group id
460 MemberGroup *m_memberGroup = nullptr; // group's member definition
461 GroupDef *m_group = nullptr; // group in which this member is in
463 QCString m_groupFileName; // file where this grouping was defined
464 int m_groupStartLine = 0; // line " " " " "
466
471
472 // documentation inheritance
473 const MemberDef *m_docProvider = nullptr;
474
475 // to store the output file base from tag files
477
478 // to store extra qualifiers
480
481 // objective-c
482 bool m_implOnly = false; // function found in implementation but not
483 // in the interface
484 mutable bool m_hasDocumentedParams = false; // guard to show only the first warning, acts as cache
485 mutable bool m_hasDocumentedReturnType = false; // guard to show only the first warning, acts as cache
486 bool m_isDMember = false;
487 Relationship m_related = Relationship::Member; // relationship of this to the class
488 bool m_stat = false; // is it a static function?
489 bool m_proto = false; // is it a prototype?
490 bool m_docEnumValues = false; // is an enum with documented enum values.
491
492 bool m_annScope = false; // member is part of an anonymous scope
493 mutable bool m_hasDetailedDescriptionCached = false;
495 // const member.
496 bool m_hasCallGraph = false;
497 bool m_hasCallerGraph = false;
500 bool m_hasInlineSource = false;
501 bool m_hasEnumValues = false;
502 bool m_explExt = false; // member was explicitly declared external
503 bool m_tspec = false; // member is a template specialization
504 bool m_groupHasDocs = false; // true if the entry that caused the grouping was documented
505 bool m_docsForDefinition = false; // TRUE => documentation block is put before
506 // definition.
507 // FALSE => block is put before declaration.
511 int m_declLine = -1;
512 int m_declColumn = -1;
514};
515
516std::unique_ptr<MemberDef> createMemberDef(const QCString &defFileName,int defLine,int defColumn,
517 const QCString &type,const QCString &name,const QCString &args,
518 const QCString &excp,Protection prot,Specifier virt,bool stat,
519 Relationship related,MemberType t,const ArgumentList &tal,
520 const ArgumentList &al,const QCString &metaData)
521{
522 return std::make_unique<MemberDefImpl>(defFileName,defLine,defColumn,type,name,args,excp,prot,virt,
523 stat,related,t,tal,al,metaData);
524}
525
526//-----------------------------------------------------------------------------
527
529{
530 public:
531 MemberDefAliasImpl(const Definition *newScope,const MemberDef *md)
532 : DefinitionAliasMixin(newScope,md), m_memberGroup(nullptr) { init(); }
533 ~MemberDefAliasImpl() override { deinit(); }
535
536 DefType definitionType() const override { return TypeMember; }
537
538 const MemberDef *getMdAlias() const { return toMemberDef(getAlias()); }
539 MemberDef *getMdAlias() { return toMemberDef(const_cast<Definition*>(getAlias())); }
540 MemberDef *resolveAlias() override { return const_cast<MemberDef*>(getMdAlias()); }
541 const MemberDef *resolveAlias() const override { return getMdAlias(); }
542
543 std::unique_ptr<MemberDef> deepCopy() const override {
545 }
546 void moveTo(Definition *) override {}
547
548 const QCString &name() const override
549 { return getMdAlias()->name(); }
551 { return getMdAlias()->codeSymbolType(); }
553 { return getMdAlias()->getOutputFileBase(); }
554 QCString getReference() const override
555 { return getMdAlias()->getReference(); }
556 QCString anchor() const override
557 { return getMdAlias()->anchor(); }
558 QCString declaration() const override
559 { return getMdAlias()->declaration(); }
560 QCString definition() const override
561 { return getMdAlias()->definition(); }
562 QCString typeString() const override
563 { return getMdAlias()->typeString(); }
564 QCString argsString() const override
565 { return getMdAlias()->argsString(); }
566 QCString excpString() const override
567 { return getMdAlias()->excpString(); }
568 QCString bitfieldString() const override
569 { return getMdAlias()->bitfieldString(); }
570 QCString extraTypeChars() const override
571 { return getMdAlias()->extraTypeChars(); }
572 const QCString &initializer() const override
573 { return getMdAlias()->initializer(); }
574 int initializerLines() const override
575 { return getMdAlias()->initializerLines(); }
579 { return getMdAlias()->getVhdlSpecifiers(); }
580 const MemberList *getSectionList(const Definition *container) const override
581 { return getMdAlias()->getSectionList(container); }
583 { return getMdAlias()->displayDefinition(); }
584
585 const ClassDef *getClassDef() const override
586 { return getMdAlias()->getClassDef(); }
588 { return getMdAlias()->getClassDef(); }
589
590 const FileDef *getFileDef() const override
591 { return getMdAlias()->getFileDef(); }
592 FileDef *getFileDef() override
593 { return getMdAlias()->getFileDef(); }
594
595 const ModuleDef *getModuleDef() const override
596 { return getMdAlias()->getModuleDef(); }
597
598 const NamespaceDef* getNamespaceDef() const override
599 { return getMdAlias()->getNamespaceDef(); }
601 { return getMdAlias()->getNamespaceDef(); }
602
603 const ClassDef *accessorClass() const override
604 { return getMdAlias()->accessorClass(); }
605 QCString getReadAccessor() const override
606 { return getMdAlias()->getReadAccessor(); }
607 QCString getWriteAccessor() const override
608 { return getMdAlias()->getWriteAccessor(); }
609 const GroupDef *getGroupDef() const override
610 { return getMdAlias()->getGroupDef(); }
612 { return getMdAlias()->getGroupDef(); }
614 { return getMdAlias()->getGroupPri(); }
615 QCString getGroupFileName() const override
616 { return getMdAlias()->getGroupFileName(); }
617 int getGroupStartLine() const override
618 { return getMdAlias()->getGroupStartLine(); }
619 bool getGroupHasDocs() const override
620 { return getMdAlias()->getGroupHasDocs(); }
621 QCString qualifiedName() const override
622 { return getMdAlias()->qualifiedName(); }
623 QCString objCMethodName(bool localLink,bool showStatic) const override
624 { return getMdAlias()->objCMethodName(localLink,showStatic); }
625 Protection protection() const override
626 { return getMdAlias()->protection(); }
627 Specifier virtualness(int /* count */) const override
628 { return getMdAlias()->virtualness(); }
629 MemberType memberType() const override
630 { return getMdAlias()->memberType(); }
631 QCString memberTypeName() const override
632 { return getMdAlias()->memberTypeName(); }
633 bool isSignal() const override
634 { return getMdAlias()->isSignal(); }
635 bool isSlot() const override
636 { return getMdAlias()->isSlot(); }
637 bool isVariable() const override
638 { return getMdAlias()->isVariable(); }
639 bool isEnumerate() const override
640 { return getMdAlias()->isEnumerate(); }
641 bool isEnumValue() const override
642 { return getMdAlias()->isEnumValue(); }
643 bool isTypedef() const override
644 { return getMdAlias()->isTypedef(); }
645 bool isSequence() const override
646 { return getMdAlias()->isSequence(); }
647 bool isDictionary() const override
648 { return getMdAlias()->isDictionary(); }
649 bool isFunction() const override
650 { return getMdAlias()->isFunction(); }
651 bool isFunctionPtr() const override
652 { return getMdAlias()->isFunctionPtr(); }
653 bool isDefine() const override
654 { return getMdAlias()->isDefine(); }
655 bool isFriend() const override
656 { return getMdAlias()->isFriend(); }
657 bool isDCOP() const override
658 { return getMdAlias()->isDCOP(); }
659 bool isProperty() const override
660 { return getMdAlias()->isProperty(); }
661 bool isEvent() const override
662 { return getMdAlias()->isEvent(); }
663 bool isRelated() const override
664 { return getMdAlias()->isRelated(); }
665 bool isForeign() const override
666 { return getMdAlias()->isForeign(); }
667 bool isStatic() const override
668 { return getMdAlias()->isStatic(); }
669 bool isInline() const override
670 { return getMdAlias()->isInline(); }
671 bool isExplicit() const override
672 { return getMdAlias()->isExplicit(); }
673 bool isMutable() const override
674 { return getMdAlias()->isMutable(); }
675 bool isGettable() const override
676 { return getMdAlias()->isGettable(); }
677 bool isPrivateGettable() const override
678 { return getMdAlias()->isPrivateGettable(); }
679 bool isProtectedGettable() const override
680 { return getMdAlias()->isProtectedGettable(); }
681 bool isSettable() const override
682 { return getMdAlias()->isSettable(); }
683 bool isPrivateSettable() const override
684 { return getMdAlias()->isPrivateSettable(); }
685 bool isProtectedSettable() const override
686 { return getMdAlias()->isProtectedSettable(); }
687 bool isReadable() const override
688 { return getMdAlias()->isReadable(); }
689 bool isWritable() const override
690 { return getMdAlias()->isWritable(); }
691 bool isAddable() const override
692 { return getMdAlias()->isAddable(); }
693 bool isRemovable() const override
694 { return getMdAlias()->isRemovable(); }
695 bool isRaisable() const override
696 { return getMdAlias()->isRaisable(); }
697 bool isFinal() const override
698 { return getMdAlias()->isFinal(); }
699 bool isAbstract() const override
700 { return getMdAlias()->isAbstract(); }
701 bool isOverride() const override
702 { return getMdAlias()->isOverride(); }
703 bool isInitonly() const override
704 { return getMdAlias()->isInitonly(); }
705 bool isOptional() const override
706 { return getMdAlias()->isOptional(); }
707 bool isRequired() const override
708 { return getMdAlias()->isRequired(); }
709 bool isNonAtomic() const override
710 { return getMdAlias()->isNonAtomic(); }
711 bool isCopy() const override
712 { return getMdAlias()->isCopy(); }
713 bool isAssign() const override
714 { return getMdAlias()->isAssign(); }
715 bool isRetain() const override
716 { return getMdAlias()->isRetain(); }
717 bool isWeak() const override
718 { return getMdAlias()->isWeak(); }
719 bool isStrong() const override
720 { return getMdAlias()->isStrong(); }
721 bool isEnumStruct() const override
722 { return getMdAlias()->isEnumStruct(); }
723 bool isUnretained() const override
724 { return getMdAlias()->isUnretained(); }
725 bool isNew() const override
726 { return getMdAlias()->isNew(); }
727 bool isSealed() const override
728 { return getMdAlias()->isSealed(); }
729 bool isImplementation() const override
730 { return getMdAlias()->isImplementation(); }
731 bool isExternal() const override
732 { return getMdAlias()->isExternal(); }
733 bool isTypeAlias() const override
734 { return getMdAlias()->isTypeAlias(); }
735 bool isDefault() const override
736 { return getMdAlias()->isDefault(); }
737 bool isDelete() const override
738 { return getMdAlias()->isDelete(); }
739 bool isNoExcept() const override
740 { return getMdAlias()->isNoExcept(); }
741 bool isAttribute() const override
742 { return getMdAlias()->isAttribute(); }
743 bool isUNOProperty() const override
744 { return getMdAlias()->isUNOProperty(); }
745 bool isReadonly() const override
746 { return getMdAlias()->isReadable(); }
747 bool isBound() const override
748 { return getMdAlias()->isBound(); }
749 bool isConstrained() const override
750 { return getMdAlias()->isConstrained(); }
751 bool isTransient() const override
752 { return getMdAlias()->isTransient(); }
753 bool isMaybeVoid() const override
754 { return getMdAlias()->isMaybeVoid(); }
755 bool isMaybeDefault() const override
756 { return getMdAlias()->isMaybeDefault(); }
757 bool isMaybeAmbiguous() const override
758 { return getMdAlias()->isMaybeAmbiguous(); }
759 bool isPublished() const override
760 { return getMdAlias()->isPublished(); }
761 bool isTemplateSpecialization() const override
762 { return getMdAlias()->isTemplateSpecialization(); }
763 bool isObjCMethod() const override
764 { return getMdAlias()->isObjCMethod(); }
765 bool isObjCProperty() const override
766 { return getMdAlias()->isObjCProperty(); }
767 bool isCSharpProperty() const override
768 { return getMdAlias()->isCSharpProperty(); }
769 bool isConstructor() const override
770 { return getMdAlias()->isConstructor(); }
771 bool isDestructor() const override
772 { return getMdAlias()->isDestructor(); }
773 bool hasOneLineInitializer() const override
774 { return getMdAlias()->hasOneLineInitializer(); }
775 bool hasMultiLineInitializer() const override
776 { return getMdAlias()->hasMultiLineInitializer(); }
777 bool isCallable() const override
778 { return getMdAlias()->isCallable(); }
779 bool isStrongEnumValue() const override
780 { return getMdAlias()->isStrongEnumValue(); }
781 bool livesInsideEnum() const override
782 { return getMdAlias()->livesInsideEnum(); }
783 bool isSliceLocal() const override
784 { return getMdAlias()->isSliceLocal(); }
785 bool isNoDiscard() const override
786 { return getMdAlias()->isNoDiscard(); }
787 bool isConstExpr() const override
788 { return getMdAlias()->isConstExpr(); }
789 bool isConstEval() const override
790 { return getMdAlias()->isConstEval(); }
791 bool isConstInit() const override
792 { return getMdAlias()->isConstInit(); }
793 int numberOfFlowKeyWords() const override
794 { return getMdAlias()->numberOfFlowKeyWords(); }
795 bool isFriendToHide() const override
796 { return getMdAlias()->isFriendToHide(); }
797 bool isNotFriend() const override
798 { return getMdAlias()->isNotFriend(); }
799 bool isFunctionOrSignalSlot() const override
800 { return getMdAlias()->isFunctionOrSignalSlot(); }
801 bool isRelatedOrFriend() const override
802 { return getMdAlias()->isRelatedOrFriend(); }
803 bool isLinkableInProject() const override
804 { return getMdAlias()->isLinkableInProject(); }
805 bool isLinkable() const override
806 { return getMdAlias()->isLinkable(); }
807 bool hasDocumentation() const override
808 { return getMdAlias()->hasDocumentation(); }
809 bool hasUserDocumentation() const override
810 { return getMdAlias()->hasUserDocumentation(); }
811 bool isDeleted() const override
812 { return getMdAlias()->isDeleted(); }
813 bool isBriefSectionVisible() const override
814 { return getMdAlias()->isBriefSectionVisible(); }
815 bool isDetailedSectionVisible(MemberListContainer container) const override
816 { return getMdAlias()->isDetailedSectionVisible(container); }
817 bool hasDetailedDescription() const override
818 { return getMdAlias()->hasDetailedDescription(); }
819 bool isFriendClass() const override
820 { return getMdAlias()->isFriendClass(); }
821 bool isDocumentedFriendClass() const override
822 { return getMdAlias()->isDocumentedFriendClass(); }
823 const MemberDef *reimplements() const override
824 { return getMdAlias()->reimplements(); }
825 const MemberVector &reimplementedBy() const override
826 { return getMdAlias()->reimplementedBy(); }
827 bool isReimplementedBy(const ClassDef *cd) const override
828 { return getMdAlias()->isReimplementedBy(cd); }
829 ClassDef *relatedAlso() const override
830 { return getMdAlias()->relatedAlso(); }
831 bool hasDocumentedEnumValues() const override
832 { return getMdAlias()->hasDocumentedEnumValues(); }
833 const MemberDef *getAnonymousEnumType() const override
834 { return getMdAlias()->getAnonymousEnumType(); }
835 bool isDocsForDefinition() const override
836 { return getMdAlias()->isDocsForDefinition(); }
837 const MemberDef *getEnumScope() const override
838 { return getMdAlias()->getEnumScope(); }
839 const MemberVector &enumFieldList() const override
840 { return getMdAlias()->enumFieldList(); }
841 QCString enumBaseType() const override
842 { return getMdAlias()->enumBaseType(); }
843 bool hasExamples() const override
844 { return getMdAlias()->hasExamples(); }
845 const ExampleList &getExamples() const override
846 { return getMdAlias()->getExamples(); }
847 bool isPrototype() const override
848 { return getMdAlias()->isPrototype(); }
849 const ArgumentList &argumentList() const override
850 { return getMdAlias()->argumentList(); }
851 const ArgumentList &declArgumentList() const override
852 { return getMdAlias()->declArgumentList(); }
853 const ArgumentList &templateArguments() const override
854 { return getMdAlias()->templateArguments(); }
857 std::optional<ArgumentList> formalTemplateArguments() const override
858 { return getMdAlias()->formalTemplateArguments(); }
859 int getMemberGroupId() const override
860 { return getMdAlias()->getMemberGroupId(); }
861 MemberGroup *getMemberGroup() const override
862 { return m_memberGroup; }
863 bool fromAnonymousScope() const override
864 { return getMdAlias()->fromAnonymousScope(); }
866 { return getMdAlias()->fromAnonymousMember(); }
867 bool hasCallGraph() const override
868 { return getMdAlias()->hasCallGraph(); }
869 bool hasCallerGraph() const override
870 { return getMdAlias()->hasCallerGraph(); }
871 bool hasReferencesRelation() const override
872 { return getMdAlias()->hasReferencesRelation(); }
873 bool hasReferencedByRelation() const override
874 { return getMdAlias()->hasReferencedByRelation(); }
875 bool hasInlineSource() const override
876 { return getMdAlias()->hasInlineSource(); }
877 QCString sourceRefName() const override
878 { return getMdAlias()->sourceRefName(); }
879 bool hasEnumValues() const override
880 { return getMdAlias()->hasEnumValues(); }
882 { return getMdAlias()->getQualifiers(); }
883 const MemberDef *templateMaster() const override
884 { return getMdAlias()->templateMaster(); }
885 QCString getScopeString() const override
886 { return getMdAlias()->getScopeString(); }
889 bool isTypedefValCached() const override
890 { return getMdAlias()->isTypedefValCached(); }
891 const ClassDef *getCachedTypedefVal() const override
892 { return getMdAlias()->getCachedTypedefVal(); }
897 MemberDef *memberDefinition() const override
898 { return getMdAlias()->memberDefinition(); }
899 MemberDef *memberDeclaration() const override
900 { return getMdAlias()->memberDeclaration(); }
901 const MemberDef *inheritsDocsFrom() const override
902 { return getMdAlias()->inheritsDocsFrom(); }
903 const MemberDef *getGroupAlias() const override
904 { return getMdAlias()->getGroupAlias(); }
905 ClassDef *category() const override
906 { return getMdAlias()->category(); }
907 const MemberDef *categoryRelation() const override
908 { return getMdAlias()->categoryRelation(); }
909 QCString displayName(bool b=TRUE) const override
910 { return getMdAlias()->displayName(b); }
911 QCString getDeclType() const override
912 { return getMdAlias()->getDeclType(); }
913 StringVector getLabels(const Definition *container) const override
914 { return getMdAlias()->getLabels(container); }
915 const ArgumentList &typeConstraints() const override
916 { return getMdAlias()->typeConstraints(); }
917 QCString documentation() const override
918 { return getMdAlias()->documentation(); }
919 QCString briefDescription(bool /* abbr=FALSE */) const override
920 { return getMdAlias()->briefDescription(); }
921 QCString fieldType() const override
922 { return getMdAlias()->fieldType(); }
923 bool isReference() const override
924 { return getMdAlias()->isReference(); }
925 QCString getDeclFileName() const override
926 { return getMdAlias()->getDeclFileName(); }
927 int getDeclLine() const override
928 { return getMdAlias()->getDeclLine(); }
929 int getDeclColumn() const override
930 { return getMdAlias()->getDeclColumn(); }
931 QCString requiresClause() const override
932 { return getMdAlias()->requiresClause(); }
933 bool visibleInIndex() const override
934 { return getMdAlias()->visibleInIndex(); }
935
936 void warnIfUndocumented() const override {}
937 void warnIfUndocumentedParams() const override {}
938 void detectUndocumentedParams(bool /* hasParamCommand */,bool /* hasReturnCommand */) const override {}
939 void setMemberGroup(MemberGroup *grp) override { m_memberGroup = grp; }
940 std::unique_ptr<MemberDef> createTemplateInstanceMember(const ArgumentList &formalArgs,
941 const std::unique_ptr<ArgumentList> &actualArgs) const override
942 { return getMdAlias()->createTemplateInstanceMember(formalArgs,actualArgs); }
943
945 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
946 bool inGroup, int indentLevel, const ClassDef *inheritFrom=nullptr,const QCString &inheritId=QCString()) const override
947 {
948 getMdAlias()->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritFrom,inheritId);
949 }
951 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const override
952 {
953 getMdAlias()->writeEnumDeclaration(typeDecl,cd,nd,fd,gd,mod);
954 }
956 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
957 bool onlyText=FALSE) const override
958 {
959 getMdAlias()->writeLink(ol,cd,nd,fd,gd,mod,onlyText);
960 }
961 private:
962 MemberGroup *m_memberGroup; // group's member definition
963};
964
965
966std::unique_ptr<MemberDef> createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd)
967{
968 auto amd = std::make_unique<MemberDefAliasImpl>(newScope,aliasMd);
969 //printf("amd: name=%s displayName=%s\n",qPrint(amd->name()),qPrint(amd->displayName()));
970 return amd;
971}
972
973//-----------------------------------------------------------------------------
974
975static QCString addTemplateNames(const QCString &s,const QCString &n,const QCString &t)
976{
977 QCString result;
978 QCString clRealName=n;
979 int p=0,i=0;
980 if ((i=clRealName.find('<'))!=-1)
981 {
982 clRealName=clRealName.left(i); // strip template specialization
983 }
984 if ((i=clRealName.findRev("::"))!=-1)
985 {
986 clRealName=clRealName.right(clRealName.length()-i-2);
987 }
988 while ((i=s.find(clRealName,p))!=-1)
989 {
990 result+=s.mid(p,i-p);
991 size_t j=clRealName.length()+i;
992 if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j))))
993 { // add template names
994 //printf("Adding %s+%s\n",qPrint(clRealName),qPrint(t));
995 result+=clRealName+t;
996 }
997 else
998 { // template names already present
999 //printf("Adding %s\n",qPrint(clRealName));
1000 result+=clRealName;
1001 }
1002 p=i+static_cast<int>(clRealName.length());
1003 }
1004 result+=s.right(s.length()-p);
1005 //printf("addTemplateNames(%s,%s,%s)=%s\n",qPrint(s),qPrint(n),qPrint(t),qPrint(result));
1006 return result;
1007}
1008
1009// ol.startMemberDocName has already been done before this is called.
1010// when this function returns TRUE, ol.endParameterList will be called.
1011//
1012// typical sequence:
1013// ol.startMemberDoc
1014// ol.startMemberDocName
1015// --- enter writeDefArgumentList
1016// ol.endMemberDocName
1017// ol.startParameterList
1018// ...
1019// ol.startParameterType(first=TRUE)
1020// ol.endParameterType
1021// ol.startParameterName
1022// ol.endParameterName
1023// ol.startParameterExtra
1024// ol.startParameterDefVal [optional]
1025// ol.endParameterDefVal [optional]
1026// ol.endParameterExtra(last==FALSE)
1027// ...
1028// ol.startParameterType(first=FALSE)
1029// ol.endParameterType
1030// ol.startParameterName
1031// ol.endParameterName
1032// ol.startParameterExtra
1033// ol.endParameterExtra(last==TRUE)
1034// ...
1035// --- leave writeDefArgumentList with return value TRUE
1036// ol.endParameterList
1037// ol.endMemberDoc(hasArgs=TRUE)
1038//
1039// For an empty list the function should return FALSE, the sequence is
1040// ol.startMemberDoc
1041// ol.startMemberDocName
1042// --- enter writeDefArgumentList
1043// --- leave writeDefArgumentList with return value FALSE
1044// ol.endMemberDocName
1045// ol.endMemberDoc(hasArgs=FALSE);
1046//
1047
1048static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const MemberDef *md)
1049{
1050 const ArgumentList &defArgList=(md->isDocsForDefinition()) ?
1051 md->argumentList() : md->declArgumentList();
1052 //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d hasParameters()=%d (%s)\n",
1053 // qPrint(md->name()),md->isDocsForDefinition(),defArgList.hasParameters(),qPrint(argListToString(defArgList)));
1054 if (!defArgList.hasParameters() || md->isProperty() || md->isTypedef())
1055 {
1056 return FALSE; // member has no function like argument list
1057 }
1058
1059 bool isDefine = md->isDefine();
1060 if (!isDefine) ol.docify(" ");
1061
1062 //printf("writeDefArgList(%d)\n",defArgList->count());
1063 ol.endMemberDocName();
1065 //printf("===> name=%s isDefine=%d\n",qPrint(md->name()),md->isDefine());
1066
1067 QCString cName;
1068 if (scope)
1069 {
1070 cName=scope->name();
1071 int il=cName.find('<');
1072 int ir=cName.findRev('>');
1073 if (il!=-1 && ir!=-1 && ir>il)
1074 {
1075 cName=cName.mid(il,ir-il+1);
1076 //printf("1. cName=%s\n",qPrint(cName));
1077 }
1078 else if (scope->definitionType()==Definition::TypeClass)
1079 {
1080 cName=tempArgListToString((toClassDef(scope))->templateArguments(),
1081 scope->getLanguage());
1082 //printf("2. cName=%s\n",qPrint(cName));
1083 }
1084 else // no template specifier
1085 {
1086 cName.clear();
1087 }
1088 }
1089 //printf("~~~ %s cName=%s\n",qPrint(md->name()),qPrint(cName));
1090
1092
1093 bool first=TRUE;
1094 bool paramTypeStarted=FALSE;
1095 auto alIt = defArgList.begin();
1096 while (alIt!=defArgList.end())
1097 {
1098 Argument a = *alIt;
1099 if (isDefine || first)
1100 {
1101 ol.startParameterType(first,QCString());
1102 paramTypeStarted=true;
1103 if (isDefine)
1104 {
1105 ol.endParameterType();
1107 }
1108 }
1109
1110 if (!a.attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
1111 {
1112 ol.docify(a.attrib+" ");
1113 }
1114
1115 QCString atype = a.type;
1116 if (sep!="::") { atype=substitute(atype,"::",sep); }
1117
1118 int funcPtrPos=-1;
1119 {
1120 if (md->isObjCMethod()) { atype.prepend("("); atype.append(")"); }
1121 if (atype!="...")
1122 {
1123 if (!cName.isEmpty() && scope && scope!=Doxygen::globalScope)
1124 {
1125 atype=addTemplateNames(atype,scope->name(),cName);
1126 }
1127 funcPtrPos = atype.find("*)(");
1128 if (funcPtrPos!=-1) funcPtrPos++;
1129 linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,
1130 funcPtrPos==-1 ? atype : atype.left(funcPtrPos));
1131 }
1132 }
1133
1134 if (!isDefine)
1135 {
1136 if (paramTypeStarted)
1137 {
1138 ol.endParameterType();
1139 paramTypeStarted=FALSE;
1140 }
1141 ol.startParameterName(defArgList.size()<2);
1142 }
1143 else
1144 {
1145 ol.endParameterName();
1146 }
1147
1148 if (atype=="...")
1149 {
1150 ol.docify(atype);
1151 }
1152 else if (!a.name.isEmpty()) // argument has a name
1153 {
1154 ol.docify(a.name);
1155 }
1156 if (!isDefine)
1157 {
1158 if (funcPtrPos!=-1)
1159 {
1161 }
1162 ol.endParameterName();
1163 }
1165 if (funcPtrPos!=-1)
1166 {
1167 linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,
1168 atype.mid(funcPtrPos));
1169 }
1170 if (!a.array.isEmpty())
1171 {
1172 ol.docify(a.array);
1173 }
1174 if (!a.defval.isEmpty()) // write the default value
1175 {
1176 QCString n=a.defval;
1177 if (scope && scope!=Doxygen::globalScope && !cName.isEmpty())
1178 {
1179 n=addTemplateNames(n,scope->name(),cName);
1180 }
1181 ol.startParameterDefVal(" = ");
1183 ol.endParameterDefVal();
1184 }
1185 ++alIt;
1186 if (alIt!=defArgList.end())
1187 {
1188 a = *alIt;
1189 if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
1190 if (!isDefine)
1191 {
1192 QCString key;
1193 if (md->isObjCMethod() && a.attrib.length()>=2)
1194 {
1195 //printf("Found parameter keyword %s\n",a.qPrint(attrib));
1196 // strip [ and ]
1197 key=a.attrib.mid(1,a.attrib.length()-2);
1198 if (key!=",") key+=":"; // for normal keywords add colon
1199 }
1200 ol.endParameterExtra(false,false,!md->isObjCMethod());
1201 ol.startParameterType(FALSE,key);
1202 paramTypeStarted=TRUE;
1203 }
1204 else // isDefine
1205 {
1206 ol.endParameterExtra(false,false,true);
1207 }
1208 }
1209 first=FALSE;
1210 }
1211 if (first)
1212 {
1213 ol.startParameterName(defArgList.size()<2);
1214 ol.endParameterName();
1216 }
1217 ol.endParameterExtra(TRUE,defArgList.size()<2,!md->isObjCMethod());
1218 if (!md->extraTypeChars().isEmpty())
1219 {
1220 ol.docify(md->extraTypeChars());
1221 }
1222 if (defArgList.constSpecifier())
1223 {
1224 ol.docify(" const");
1225 }
1226 if (defArgList.volatileSpecifier())
1227 {
1228 ol.docify(" volatile");
1229 }
1230 if (defArgList.refQualifier()==RefQualifierType::LValue)
1231 {
1232 ol.docify(" &");
1233 }
1234 else if (defArgList.refQualifier()==RefQualifierType::RValue)
1235 {
1236 ol.docify(" &&");
1237 }
1238 if (!defArgList.trailingReturnType().isEmpty())
1239 {
1241 scope, // scope
1242 md->getBodyDef(), // fileScope
1243 md, // self
1244 defArgList.trailingReturnType(), // text
1245 FALSE // autoBreak
1246 );
1247
1248 }
1249 return TRUE;
1250}
1251
1253 OutputList &ol, const ClassDef *cd, const MemberDef *md, QCString const& exception)
1254{
1255 // this is ordinary exception spec - there must be a '('
1256 //printf("exception='%s'\n",qPrint(exception));
1257 int index = exception.find('(');
1258 if (index!=-1)
1259 {
1260 ol.exceptionEntry(exception.left(index),false);
1261 ++index; // paren in second column so skip it here
1262 for (int comma = exception.find(',', index); comma!=-1; )
1263 {
1264 ++comma; // include comma
1266 exception.mid(index,comma-index));
1267 ol.exceptionEntry(QCString(),false);
1268 index=comma;
1269 comma = exception.find(',', index);
1270 }
1271 int close = exception.find(')', index);
1272 if (close!=-1)
1273 {
1274 QCString type=removeRedundantWhiteSpace(exception.mid(index,close-index));
1275 linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,type);
1276 ol.exceptionEntry(QCString(),true);
1277 }
1278 else
1279 {
1280 warn(md->getDefFileName(),md->getDefLine(),
1281 "missing ) in exception list on member {}",md->name());
1282 }
1283 }
1284 else // Java Exception
1285 {
1286 ol.docify(" ");
1287 linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,exception);
1288 }
1289}
1290
1291static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberDef *md)
1292{
1293 QCString exception(QCString(md->excpString()).stripWhiteSpace());
1294 if ('{'==exception.at(0))
1295 {
1296 // this is an UNO IDL attribute - need special handling
1297 int index = exception.find(';');
1298 int oldIndex = 1;
1299 while (-1 != index) // there should be no more than 2 (set / get)
1300 {
1301 // omit '{' and ';' -> "set raises (...)"
1302 writeExceptionListImpl(ol,cd,md,exception.mid(oldIndex,index-oldIndex));
1303 oldIndex=index+1;
1304 index = exception.find(';',oldIndex);
1305 }
1306 // the rest is now just '}' - omit that
1307 }
1308 else
1309 {
1310 writeExceptionListImpl(ol,cd,md,exception);
1311 }
1312}
1313
1314//-----------------------------------------------------------------------------
1315//-----------------------------------------------------------------------------
1316//-----------------------------------------------------------------------------
1317
1319 const QCString &t,const QCString &a,const QCString &e,
1320 Protection p,Specifier v,bool s,Relationship r,
1321 MemberType mt,const ArgumentList &tal,
1322 const ArgumentList &al,const QCString &meta
1323 )
1324{
1325 m_classDef=nullptr;
1326 m_fileDef=nullptr;
1327 m_moduleDef=nullptr;
1328 m_redefines=nullptr;
1329 m_relatedAlso=nullptr;
1330 m_accessorClass=nullptr;
1331 m_nspace=nullptr;
1332 m_memDef=nullptr;
1333 m_memDec=nullptr;
1334 m_group=nullptr;
1335 m_grpId=-1;
1336 m_enumScope=nullptr;
1338 m_hasCallGraph = Config_getBool(CALL_GRAPH);
1339 m_hasCallerGraph = Config_getBool(CALLER_GRAPH);
1340 m_hasReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION);
1341 m_hasReferencesRelation = Config_getBool(REFERENCES_RELATION);
1342 m_hasEnumValues = Config_getBool(SHOW_ENUM_VALUES);
1343 m_hasInlineSource = Config_getBool(INLINE_SOURCES);
1344 m_initLines=0;
1345 m_type=t;
1346 if (mt==MemberType::Typedef) m_type.stripPrefix("typedef ");
1347 // type.stripPrefix("struct ");
1348 // type.stripPrefix("class " );
1349 // type.stripPrefix("union " );
1351 m_args=a;
1353 if (m_type.isEmpty()) m_decl=d->name()+m_args; else m_decl=m_type+" "+d->name()+m_args;
1354
1355 m_memberGroup=nullptr;
1356 m_virt=v;
1357 m_prot=p;
1358 m_related=r;
1359 m_stat=s;
1360 m_mtype=mt;
1361 m_exception=e;
1362 m_proto=FALSE;
1366 m_annMemb=nullptr;
1367 m_annEnumType=nullptr;
1368 m_groupAlias=nullptr;
1370 m_tspec=FALSE;
1371 m_cachedAnonymousType=nullptr;
1372 m_maxInitLines=Config_getInt(MAX_INITIALIZER_LINES);
1373 m_userInitLines=-1;
1375 // copy function template arguments (if any)
1376 m_tArgList = tal;
1377 //printf("new member al=%p\n",al);
1378 // copy function definition arguments (if any)
1379 m_defArgList = al;
1380 // convert function declaration arguments (if any)
1381 if (!m_args.isEmpty())
1382 {
1384 //printf("setDeclArgList %s to %s const=%d\n",qPrint(args),
1385 // qPrint(argListToString(declArgList)),declArgList->constSpecifier);
1386 }
1387 m_metaData = meta;
1388 m_templateMaster = nullptr;
1391 m_cachedTypedefValue = nullptr;
1393 m_groupMember = nullptr;
1396 m_docProvider = nullptr;
1398}
1399
1400
1401//-----------------------------------------------------------------------------
1402//-----------------------------------------------------------------------------
1403//-----------------------------------------------------------------------------
1404
1405/*! Creates a new member definition.
1406 *
1407 * \param df File containing the definition of this member.
1408 * \param dl Line at which the member definition was found.
1409 * \param dc Column at which the member definition was found.
1410 * \param t A string representing the type of the member.
1411 * \param na A string representing the name of the member.
1412 * \param a A string representing the arguments of the member.
1413 * \param e A string representing the throw clause of the members.
1414 * \param p The protection context of the member, possible values are:
1415 * \c Public, \c Protected, \c Private.
1416 * \param v The degree of 'virtualness' of the member, possible values are:
1417 * \c Normal, \c Virtual, \c Pure.
1418 * \param s A boolean that is true iff the member is static.
1419 * \param r The relationship between the class and the member.
1420 * \param mt The kind of member. See #MemberType for a list of
1421 * all types.
1422 * \param tal The template arguments of this member.
1423 * \param al The arguments of this member. This is a structured form of
1424 * the string past as argument \a a.
1425 * \param meta Slice metadata.
1426 */
1427
1429 const QCString &t,const QCString &na,const QCString &a,const QCString &e,
1431 const ArgumentList &tal,const ArgumentList &al,const QCString &meta
1433{
1434 //printf("MemberDefImpl::MemberDef(%s)\n",qPrint(na));
1435 init(this,t,a,e,p,v,s,r,mt,tal,al,meta);
1439}
1440
1441std::unique_ptr<MemberDef> MemberDefImpl::deepCopy() const
1442{
1443 std::unique_ptr<MemberDefImpl> result(new MemberDefImpl(
1446 // first copy base members
1447 result->DefinitionMixin<MemberDefMutable>::operator=(*this);
1448 // then copy other members
1449 result->m_typeConstraints = m_typeConstraints ;
1450 result->m_declArgList = m_declArgList ;
1451 result->m_classDef = m_classDef ;
1452 result->m_fileDef = m_fileDef ;
1453 result->m_moduleDef = m_moduleDef ;
1454 result->m_nspace = m_nspace ;
1455 result->m_enumScope = m_enumScope ;
1456 result->m_livesInsideEnum = m_livesInsideEnum ;
1457 result->m_annEnumType = m_annEnumType ;
1458 result->m_enumFields = m_enumFields ;
1459 result->m_redefines = m_redefines ;
1460 result->m_redefinedBy = m_redefinedBy ;
1461 result->m_memDef = m_memDef ;
1462 result->m_memDec = m_memDec ;
1463 result->m_relatedAlso = m_relatedAlso ;
1464 result->m_examples = m_examples ;
1465 result->m_accessorType = m_accessorType ;
1466 result->m_accessorClass = m_accessorClass ;
1467 result->m_def = m_def ;
1468 result->m_anc = m_anc ;
1469 result->m_decl = m_decl ;
1470 result->m_bitfields = m_bitfields ;
1471 result->m_read = m_read ;
1472 result->m_write = m_write ;
1473 result->m_exception = m_exception ;
1474 result->m_initializer = m_initializer ;
1475 result->m_extraTypeChars = m_extraTypeChars ;
1476 result->m_enumBaseType = m_enumBaseType ;
1477 result->m_requiresClause = m_requiresClause ;
1478 result->m_initLines = m_initLines ;
1479 result->m_memSpec = m_memSpec ;
1480 result->m_vhdlSpec = m_vhdlSpec ;
1481 result->m_maxInitLines = m_maxInitLines ;
1482 result->m_userInitLines = m_userInitLines ;
1483 result->m_annMemb = m_annMemb ;
1484 result->m_defArgList = m_defArgList ;
1485 result->m_declArgList = m_declArgList ;
1486 result->m_tArgList = m_tArgList ;
1487 result->m_typeConstraints = m_typeConstraints ;
1488 result->m_templateMaster = m_templateMaster ;
1489 result->m_formalTemplateArguments = m_formalTemplateArguments ;
1490 result->m_defTmpArgLists = m_defTmpArgLists ;
1491 result->m_cachedAnonymousType = m_cachedAnonymousType ;
1492 result->m_sectionMap = m_sectionMap ;
1493 result->m_groupAlias = m_groupAlias ;
1494 result->m_grpId = m_grpId ;
1495 result->m_memberGroup = m_memberGroup ;
1496 result->m_group = m_group ;
1497 result->m_grouppri = m_grouppri ;
1498 result->m_groupFileName = m_groupFileName ;
1499 result->m_groupStartLine = m_groupStartLine ;
1500 result->m_groupMember = m_groupMember ;
1501 result->m_isTypedefValCached = m_isTypedefValCached ;
1502 result->m_cachedTypedefValue = m_cachedTypedefValue ;
1503 result->m_cachedTypedefTemplSpec = m_cachedTypedefTemplSpec ;
1504 result->m_cachedResolvedType = m_cachedResolvedType ;
1505 result->m_docProvider = m_docProvider ;
1506 result->m_explicitOutputFileBase = m_explicitOutputFileBase ;
1507 result->m_qualifiers = m_qualifiers ;
1508 result->m_implOnly = m_implOnly ;
1509 result->m_hasDocumentedParams = m_hasDocumentedParams ;
1510 result->m_hasDocumentedReturnType = m_hasDocumentedReturnType ;
1511 result->m_isDMember = m_isDMember ;
1512 result->m_proto = m_proto ;
1513 result->m_docEnumValues = m_docEnumValues ;
1514 result->m_annScope = m_annScope ;
1515 result->m_hasDetailedDescriptionCached = m_hasDetailedDescriptionCached ;
1516 result->m_detailedDescriptionCachedValue = m_detailedDescriptionCachedValue ;
1517 result->m_hasCallGraph = m_hasCallGraph ;
1518 result->m_hasCallerGraph = m_hasCallerGraph ;
1519 result->m_hasReferencedByRelation = m_hasReferencedByRelation ;
1520 result->m_hasReferencesRelation = m_hasReferencesRelation ;
1521 result->m_hasEnumValues = m_hasEnumValues ;
1522 result->m_hasInlineSource = m_hasInlineSource ;
1523 result->m_explExt = m_explExt ;
1524 result->m_tspec = m_tspec ;
1525 result->m_groupHasDocs = m_groupHasDocs ;
1526 result->m_docsForDefinition = m_docsForDefinition ;
1527 result->m_category = m_category ;
1528 result->m_categoryRelation = m_categoryRelation ;
1529 result->m_declFileName = m_declFileName ;
1530 result->m_declLine = m_declLine ;
1531 result->m_declColumn = m_declColumn ;
1532 result->m_numberOfFlowKW = m_numberOfFlowKW ;
1533 result->setDefinitionTemplateParameterLists(m_defTmpArgLists);
1534
1535 result->m_isLinkableCached = 0;
1536 result->m_isConstructorCached = 0;
1537 result->m_isDestructorCached = 0;
1538 return result;
1539}
1540
1542{
1543 setOuterScope(scope);
1545 {
1546 m_classDef = toClassDef(scope);
1547 }
1548 else if (scope->definitionType()==Definition::TypeFile)
1549 {
1550 m_fileDef = toFileDef(scope);
1551 }
1552 else if (scope->definitionType()==Definition::TypeModule)
1553 {
1554 m_moduleDef = toModuleDef(scope);
1555 }
1556 else if (scope->definitionType()==Definition::TypeNamespace)
1557 {
1558 m_nspace = toNamespaceDef(scope);
1559 }
1562}
1563
1564
1569
1571{
1572 if (m_templateMaster)
1573 {
1575 if (mdm)
1576 {
1577 mdm->insertReimplementedBy(md);
1578 }
1579 }
1580 if (!m_redefinedBy.contains(md))
1581 {
1582 m_redefinedBy.inSort(md);
1583 }
1584}
1585
1587{
1588 return m_redefines;
1589}
1590
1592{
1593 return m_redefinedBy;
1594}
1595
1597{
1598 if (cd)
1599 {
1600 for (const auto &md : m_redefinedBy)
1601 {
1602 const ClassDef *mcd = md->getClassDef();
1603 if (mcd)
1604 {
1605 if (cd==mcd || cd->isBaseClass(mcd,TRUE))
1606 {
1607 return TRUE;
1608 }
1609 }
1610 }
1611 }
1612 return FALSE;
1613}
1614
1616{
1617 m_enumFields.push_back(md);
1618}
1619
1620bool MemberDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
1621{
1622 //printf("%s::addExample(%s,%s,%s)\n",qPrint(name()),anchor,nameStr,file);
1623 return m_examples.inSort(Example(anchor,nameStr,file));
1624}
1625
1627{
1628 return !m_examples.empty();
1629}
1630
1632{
1633 QCString n = name();
1635
1636 if (!s.isEmpty())
1637 {
1638 n.prepend(s+"::");
1639 }
1640 else if (isStatic() && getFileDef())
1641 {
1642 n.prepend(getFileDef()->name()+":");
1643 }
1644 if (isCallable())
1645 {
1646 n.append(argsString());
1647 }
1648 return n;
1649}
1650
1652{
1653 bool separateMemberPages = Config_getBool(SEPARATE_MEMBER_PAGES);
1654 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
1655 QCString baseName;
1656
1657 //printf("Member: %s: templateMaster=%p group=%p classDef=%p nspace=%p fileDef=%p\n",
1658 // qPrint(name()),m_templateMaster,m_group,m_classDef,
1659 // m_nspace,m_fileDef);
1660 const NamespaceDef *nspace = getNamespaceDef();
1661 const FileDef *fileDef = getFileDef();
1662 const ClassDef *classDef = getClassDef();
1663 const ModuleDef *moduleDef = getModuleDef();
1664 const GroupDef *groupDef = getGroupDef();
1665 if (!m_explicitOutputFileBase.isEmpty())
1666 {
1668 }
1669 else if (templateMaster())
1670 {
1672 }
1673 else if (groupDef)
1674 {
1675 baseName=groupDef->getOutputFileBase();
1676 }
1677 else if (classDef)
1678 {
1679 baseName=classDef->getOutputFileBase();
1680 if (inlineSimpleClasses && classDef->isSimple())
1681 {
1682 return baseName;
1683 }
1684 }
1685 else if (nspace && (nspace->isLinkable() || nspace->isAnonymous()))
1686 {
1687 baseName=nspace->getOutputFileBase();
1688 }
1689 else if (fileDef)
1690 {
1691 baseName=fileDef->getOutputFileBase();
1692 }
1693 else if (moduleDef)
1694 {
1695 baseName=moduleDef->getOutputFileBase();
1696 }
1697
1698 if (baseName.isEmpty())
1699 {
1701 "Internal inconsistency: member {} does not belong to any container!",name()
1702 );
1703 return "dummy";
1704 }
1705 else if (separateMemberPages && hasDetailedDescription())
1706 {
1707 if (getEnumScope()) // enum value, which is part of enum's documentation
1708 {
1709 baseName+="_"+getEnumScope()->anchor();
1710 }
1711 else
1712 {
1713 baseName+="_"+anchor();
1714 }
1715 }
1716 return baseName;
1717}
1718
1720{
1722 if (!ref.isEmpty())
1723 {
1724 return ref;
1725 }
1726 const NamespaceDef *nspace = getNamespaceDef();
1727 const FileDef *fileDef = getFileDef();
1728 const ClassDef *classDef = getClassDef();
1729 const ModuleDef *moduleDef = getModuleDef();
1730 const GroupDef *groupDef = getGroupDef();
1731 if (templateMaster())
1732 {
1733 return templateMaster()->getReference();
1734 }
1735 else if (groupDef)
1736 {
1737 return groupDef->getReference();
1738 }
1739 else if (classDef)
1740 {
1741 return classDef->getReference();
1742 }
1743 else if (nspace)
1744 {
1745 return nspace->getReference();
1746 }
1747 else if (moduleDef)
1748 {
1749 return moduleDef->getReference();
1750 }
1751 else if (fileDef)
1752 {
1753 return fileDef->getReference();
1754 }
1755 return "";
1756}
1757
1759{
1760 QCString result=m_anc;
1761 if (m_groupAlias) return m_groupAlias->anchor();
1762 if (m_templateMaster) return m_templateMaster->anchor();
1763 if (m_enumScope && m_enumScope!=this) // avoid recursion for C#'s public enum E { E, F }
1764 {
1765 result.prepend(m_enumScope->anchor());
1766 }
1767 if (getGroupDef())
1768 {
1769 if (m_groupMember)
1770 {
1771 result=m_groupMember->anchor();
1772 }
1773 else if (getReference().isEmpty())
1774 {
1775 result.prepend("g");
1776 }
1777 }
1778 return result;
1779}
1780
1782{
1783 AUTO_TRACE("name={}",qualifiedName());
1784 bool extractStatic = Config_getBool(EXTRACT_STATIC);
1785 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
1786 m_isLinkableCached = 2; // linkable
1787 //printf("MemberDefImpl::isLinkableInProject(name=%s)\n",qPrint(name()));
1788 if (isHidden())
1789 {
1790 AUTO_TRACE_ADD("is hidden");
1792 return;
1793 }
1794 if (templateMaster())
1795 {
1796 AUTO_TRACE_ADD("has master template");
1798 return;
1799 }
1800 if (isAnonymous())
1801 {
1802 AUTO_TRACE_ADD("name invalid");
1803 m_isLinkableCached = 1; // not a valid or a dummy name
1804 return;
1805 }
1806 if (!hasDocumentation() || isReference())
1807 {
1808 AUTO_TRACE_ADD("no docs or reference");
1809 m_isLinkableCached = 1; // no documentation
1810 return;
1811 }
1812 const GroupDef *groupDef = getGroupDef();
1813 const ClassDef *classDef = getClassDef();
1814 if (groupDef && !groupDef->isLinkableInProject())
1815 {
1816 AUTO_TRACE_ADD("in not linkable group");
1817 m_isLinkableCached = 1; // group but group not linkable
1818 return;
1819 }
1820 if (!groupDef && classDef && !classDef->isLinkableInProject())
1821 {
1822 AUTO_TRACE_ADD("in not linkable class");
1823 m_isLinkableCached = 1; // in class but class not linkable
1824 return;
1825 }
1826 const NamespaceDef *nspace = getNamespaceDef();
1827 const FileDef *fileDef = getFileDef();
1828 if (!groupDef && nspace /*&& m_related==Relationship::Member*/ && !nspace->isLinkableInProject()
1829 && (fileDef==nullptr || !fileDef->isLinkableInProject()))
1830 {
1831 AUTO_TRACE_ADD("in not linkable namespace");
1832 m_isLinkableCached = 1; // in namespace but namespace not linkable
1833 return;
1834 }
1835 if (!groupDef && !nspace &&
1836 /*m_related==Relationship::Member &&*/ !classDef &&
1837 fileDef && !fileDef->isLinkableInProject())
1838 {
1839 AUTO_TRACE_ADD("in not linkable file");
1840 m_isLinkableCached = 1; // in file (and not in namespace) but file not linkable
1841 return;
1842 }
1844 !(m_prot==Protection::Private && (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual))
1845 {
1846 AUTO_TRACE_ADD("private and invisible");
1847 m_isLinkableCached = 1; // hidden due to protection
1848 return;
1849 }
1850 if (m_stat && classDef==nullptr && !extractStatic)
1851 {
1852 AUTO_TRACE_ADD("static and invisible");
1853 m_isLinkableCached = 1; // hidden due to staticness
1854 return;
1855 }
1856 AUTO_TRACE_ADD("linkable");
1857 return; // linkable!
1858}
1859
1865
1871
1877
1883
1885{
1886 if (m_isLinkableCached==0)
1887 {
1888 MemberDefImpl *that = const_cast<MemberDefImpl*>(this);
1890 }
1892 return m_isLinkableCached==2;
1893}
1894
1896{
1897 if (m_templateMaster)
1898 {
1899 return m_templateMaster->isLinkable();
1900 }
1901 else
1902 {
1903 return isLinkableInProject() || isReference();
1904 }
1905}
1906
1907
1912
1914 const ClassDef *,const NamespaceDef *,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
1915 bool onlyText) const
1916{
1917 SrcLangExt lang = getLanguage();
1918 bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
1920 QCString n = name();
1921 const ClassDef *classDef = getClassDef();
1922 const ModuleDef *moduleDef = getModuleDef();
1923 const NamespaceDef *nspace = getNamespaceDef();
1924 if (!hideScopeNames)
1925 {
1926 if (m_enumScope && m_livesInsideEnum && getGroupDef()!=nullptr)
1927 {
1928 n.prepend(m_enumScope->displayName()+sep);
1929 }
1930 if (classDef && gd && !isRelated())
1931 {
1932 n.prepend(classDef->displayName()+sep);
1933 }
1934 else if (nspace && (gd || fd || moduleDef))
1935 {
1936 n.prepend(nspace->displayName()+sep);
1937 }
1938 }
1939
1940 if (isObjCMethod())
1941 {
1942 if (isStatic()) ol.docify("+ "); else ol.docify("- ");
1943 }
1944 if (!onlyText && (isLinkable() || hasDetailedDescription())) // write link
1945 {
1946 if (m_mtype==MemberType::EnumValue && getGroupDef()==nullptr && // enum value is not grouped
1947 getEnumScope() && getEnumScope()->getGroupDef()) // but its container is
1948 {
1949 const GroupDef *enumValGroup = getEnumScope()->getGroupDef();
1950 ol.writeObjectLink(enumValGroup->getReference(),
1951 enumValGroup->getOutputFileBase(),
1952 anchor(),n);
1953 }
1954 else
1955 {
1957 }
1958 }
1959 else // write only text
1960 {
1961 ol.startBold();
1962 ol.docify(n);
1963 ol.endBold();
1964 }
1965}
1966
1968
1969/*! If this member has an anonymous class/struct/union as its type, then
1970 * this method will return the ClassDef that describes this return type.
1971 */
1973{
1974 std::lock_guard<std::mutex> lock(g_cachedAnonymousTypeMutex);
1975 //printf("%s:getClassDefOfAnonymousType() cache=%s\n",qPrint(name()),
1976 // m_cachedAnonymousType?qPrint(m_cachedAnonymousType->name()):"<empty>");
1978
1979 QCString cname;
1980 if (getClassDef()!=nullptr)
1981 {
1982 cname=getClassDef()->name();
1983 }
1984 else if (getNamespaceDef()!=nullptr)
1985 {
1986 cname=getNamespaceDef()->name();
1987 }
1988 QCString ltype(m_type);
1989 // strip 'friend' keyword from ltype
1990 ltype.stripPrefix("friend ");
1991
1992 // search for the last anonymous scope in the member type
1993 ClassDef *annoClassDef=nullptr;
1994
1995 // match expression if it contains at least one @1 marker, e.g.
1996 // 'struct A::@1::@2::B' matches 'A::@1::@2::B' but 'struct A::B' does not match.
1997 std::string stype = ltype.str();
1998 static const reg::Ex r(R"([\w@:]*@\d+[\w@:]*)");
1999 reg::Match match;
2000 if (reg::search(stype,match,r)) // found anonymous scope in type
2001 {
2002 QCString annName = match.str();
2003
2004 // if inside a class or namespace try to prepend the scope name
2005 if (!cname.isEmpty() && annName.left(cname.length()+2)!=cname+"::")
2006 {
2007 QCString ts=stripAnonymousNamespaceScope(cname+"::"+annName);
2008 annoClassDef=getClass(ts);
2009 }
2010 // if not found yet, try without scope name
2011 if (annoClassDef==nullptr)
2012 {
2014 annoClassDef=getClass(ts);
2015 }
2016 }
2017 m_cachedAnonymousType = annoClassDef;
2018 return annoClassDef;
2019}
2020
2021/*! This methods returns TRUE iff the brief section (also known as
2022 * declaration section) is visible in the documentation.
2023 */
2025{
2026 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2027 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2028 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2029 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
2030 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2031 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
2032
2033 //printf("Member %s grpId=%d docs=%s file=%s args=%s\n",
2034 // qPrint(name()),
2035 // 0,"", //grpId,grpId==-1?"<none>":Doxygen::memberDocDict[grpId]->data(),
2036 // "", //qPrint(getFileDef()->name()),
2037 // argsString());
2038
2039 bool hasDocs = hasDocumentation();
2040
2041 // only include static members with file/namespace scope if
2042 // explicitly enabled in the config file
2043 bool visibleIfStatic = !(getClassDef()==nullptr &&
2044 isStatic() &&
2045 !extractStatic
2046 );
2047
2048 // only include members is the are documented or
2049 // HIDE_UNDOC_MEMBERS is NO in the config file
2050 bool visibleIfDocumented = (!hideUndocMembers ||
2051 hasDocs ||
2053 );
2054
2055 // hide members with no detailed description and brief descriptions
2056 // explicitly disabled.
2057 bool visibleIfEnabled = !(hideUndocMembers &&
2058 documentation().isEmpty() &&
2059 !briefMemberDesc &&
2060 !repeatBrief
2061 );
2062
2063 // Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true
2064 bool visibleIfFriendCompound = !(hideFriendCompounds &&
2065 isFriend() /*&&
2066 (m_type=="friend class" ||
2067 m_type=="friend struct" ||
2068 m_type=="friend union"
2069 )*/
2070 );
2071
2072 // only include members that are non-private unless EXTRACT_PRIVATE is
2073 // set to YES or the member is part of a group. And as a special case,
2074 // private *documented* virtual members are shown if EXTRACT_PRIV_VIRTUAL
2075 // is set to YES
2076 bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
2079 (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual && hasDocs)
2080 );
2081
2082 // hide member if it overrides a member in a superclass and has no
2083 // documentation of its own
2084 //bool visibleIfDocVirtual = !reimplements() ||
2085 // !Config_getBool(INHERIT_DOCS) ||
2086 // hasDocs;
2087
2088 // true if this member is a constructor or destructor
2089 bool cOrDTor = isConstructor() || isDestructor();
2090
2091 // hide default constructors or destructors (no args) without
2092 // documentation
2093 bool visibleIfNotDefaultCDTor = !(cOrDTor &&
2094 (m_defArgList.empty() ||
2095 m_defArgList.front().type == "void"
2096 ) &&
2097 !hasDocs
2098 );
2099
2100
2101 //printf("visibleIfStatic=%d visibleIfDocumented=%d visibleIfEnabled=%d "
2102 // "visibleIfPrivate=%d visibleIfNotDefaultCDTor=%d "
2103 // "visibleIfFriendCompound=%d !annScope=%d\n",
2104 // visibleIfStatic,visibleIfDocumented,
2105 // visibleIfEnabled,visibleIfPrivate,visibleIfNotDefaultCDTor,
2106 // visibleIfFriendCompound,!m_annScope);
2107
2108 bool visible = visibleIfStatic && visibleIfDocumented &&
2109 visibleIfEnabled && visibleIfPrivate &&
2110 /*visibleIfDocVirtual &&*/ visibleIfNotDefaultCDTor &&
2111 visibleIfFriendCompound &&
2112 !m_annScope && !isHidden();
2113 //printf("MemberDefImpl::isBriefSectionVisible() %d\n",visible);
2114 return visible;
2115}
2116
2118{
2119 SrcLangExt lang = getLanguage();
2120 QCString ltype(m_type);
2121 if (lang==SrcLangExt::Cpp && isEnumerate() && isStrong())
2122 {
2123 if (isEnumStruct())
2124 {
2125 ltype+=" struct";
2126 }
2127 else
2128 {
2129 ltype+=" class";
2130 }
2131 }
2133 {
2134 ltype.prepend("typedef ");
2135 }
2136 if (isTypeAlias())
2137 {
2138 ltype="using";
2139 }
2140 // strip 'friend' keyword from ltype
2141 ltype.stripPrefix("friend ");
2142 if (ltype=="@") // rename type from enum values
2143 {
2144 ltype="";
2145 }
2146 else
2147 {
2148 if (isObjCMethod())
2149 {
2150 ltype.prepend("(");
2151 ltype.append(")");
2152 }
2153 }
2154 return ltype;
2155}
2156
2158 const ArgumentList &al, bool writeReqClause) const
2159{
2160 ol.docify("template<");
2161 for (auto it = al.begin(); it!=al.end();)
2162 {
2163 Argument a = *it;
2165 def, // scope
2166 getFileDef(), // fileScope
2167 this, // self
2168 a.type, // text
2169 FALSE // autoBreak
2170 );
2171 if (!a.name.isEmpty())
2172 {
2173 ol.docify(" ");
2174 ol.docify(a.name);
2175 }
2176 if (!a.defval.isEmpty())
2177 {
2178 ol.docify(" = ");
2179 ol.docify(a.defval);
2180 }
2181 ++it;
2182 if (it!=al.end()) ol.docify(", ");
2183 }
2184 ol.docify("> ");
2185 if (writeReqClause && !m_requiresClause.isEmpty())
2186 {
2187 ol.lineBreak();
2188 ol.docify("requires ");
2190 def, // scope
2191 getFileDef(), // fileScope
2192 this, // self
2193 m_requiresClause, // text
2194 FALSE // autoBreak
2195 );
2196 }
2197}
2198
2200{
2201 if (exception.isEmpty()) return args; // no exception, nothing to combine args
2202 int pos = args.findRev(')');
2203 int eqPos = pos!=-1 ? args.find('=',pos) : -1; // look for '=' in '(args) = something'
2204 if (eqPos==-1) return args+" "+exception; // append exception at the end
2205 return args.left(eqPos)+" "+exception+" "+args.mid(eqPos); // insert exception before =
2206}
2207
2209{
2210 return !m_bitfields.isEmpty() && name().startsWith("__pad"); // anonymous bitfield
2211}
2212
2214 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
2215 bool inGroup, int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId) const
2216{
2217 //printf("> %s MemberDefImpl::writeDeclaration() inGroup=%d inheritId=%s\n",qPrint(qualifiedName()),inGroup,qPrint(inheritId));
2218
2219 // hide enum value, since they appear already as part of the enum, unless they
2220 // are explicitly grouped.
2221 if (!inGroup && m_mtype==MemberType::EnumValue) return;
2222
2223 const Definition *d=nullptr;
2224 ASSERT (cd!=nullptr || nd!=nullptr || fd!=nullptr || gd!=nullptr || mod!=nullptr); // member should belong to something
2225 if (cd) d=cd;
2226 else if (nd) d=nd;
2227 else if (fd) d=fd;
2228 else d=gd;
2229 if (d==gd || d==mod) // see bug 753608
2230 {
2231 if (getClassDef()) d = getClassDef();
2232 else if (getNamespaceDef()) d = getNamespaceDef();
2233 else if (getFileDef()) d = getFileDef();
2234 }
2235 else if (d==fd) // see issue #9850, namespace member can be shown in file scope as well
2236 {
2237 if (getNamespaceDef()) d = getNamespaceDef();
2238 }
2239 if (d==nullptr)
2240 {
2241 err("No context could be derived for member '{}'\n",name());
2242 return; // should not happen
2243 }
2244
2245 QCString cname = d->name();
2246 QCString cdname = d->displayName();
2247 QCString cfname = getOutputFileBase();
2248
2249 // search for the last anonymous scope in the member type
2250 ClassDef *annoClassDef=getClassDefOfAnonymousType();
2251
2253
2254 // start a new member declaration
2255 bool isAnonType = annoClassDef || m_annMemb || m_annEnumType;
2259 ol.startMemberItem(anchor(), anonType, inheritId);
2260
2261
2262 // If there is no detailed description we need to write the anchor here.
2263 bool detailsVisible = hasDetailedDescription();
2264 bool writeAnchor = (inGroup || getGroupDef()==nullptr) && // only write anchors for member that have no details and are
2265 !detailsVisible && !m_annMemb && // rendered inside the group page or are not grouped at all
2266 inheritId.isEmpty();
2267
2268 if (writeAnchor)
2269 {
2270 QCString doxyArgs=argsString();
2271 QCString doxyName=name();
2272 if (!cname.isEmpty())
2273 {
2275 }
2276 ol.startDoxyAnchor(cfname,cname,anchor(),doxyName,doxyArgs);
2277 ol.addLabel(cfname,anchor());
2278 }
2279
2280 if (!detailsVisible)
2281 {
2282 ol.pushGeneratorState();
2286 ol.docify("\n");
2287 ol.popGeneratorState();
2288 }
2289
2290 if (annoClassDef || m_annMemb)
2291 {
2292 for (int j=0;j<indentLevel;j++)
2293 {
2295 }
2296 }
2297
2298 // *** write template lists
2299 if (m_tArgList.hasParameters() && getLanguage()==SrcLangExt::Cpp)
2300 {
2301 if (!isAnonType) ol.startMemberTemplateParams();
2303 if (!isAnonType) ol.endMemberTemplateParams(anchor(),inheritId);
2304 }
2305
2306
2307 // *** write type
2308 QCString ltype(m_type);
2310 {
2311 ltype.prepend("typedef ");
2312 }
2313 if (isTypeAlias())
2314 {
2315 ltype="using";
2316 }
2317 // strip 'friend' keyword from ltype
2318 ltype.stripPrefix("friend ");
2319 static const reg::Ex r(R"(@\d+)");
2320 reg::Match match;
2321 std::string stype = ltype.str();
2322 bool endAnonScopeNeeded=FALSE;
2323 if (reg::search(stype,match,r)) // member has an anonymous type
2324 {
2325 int i = static_cast<int>(match.position());
2326 int l = static_cast<int>(match.length());
2327 //printf("annoClassDef=%p annMemb=%p scopeName='%s' anonymous='%s'\n",
2328 // annoClassDef,annMemb,qPrint(cname),qPrint(ltype.mid(i,l)));
2329
2330 if (annoClassDef) // type is an anonymous compound
2331 {
2332 int ir=i+l;
2333 //printf("<<<<<<<<<<<<<<\n");
2334 ol.startAnonTypeScope(indentLevel);
2335 annoClassDef->writeDeclaration(ol,m_annMemb,inGroup,indentLevel+1,inheritedFrom,inheritId);
2336 //printf(">>>>>>>>>>>>>> startMemberItem(2)\n");
2338 ol.startMemberItem(anchor(),anonType,inheritId);
2339 for (int j=0;j< indentLevel;j++)
2340 {
2342 }
2343 QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace();
2344 //printf(">>>>>> ltype='%s' varName='%s'\n",qPrint(ltype),qPrint(varName));
2345 ol.docify("}");
2346 if (varName.isEmpty() && isAnonymous())
2347 {
2348 ol.docify(";");
2349 }
2350 else if (!varName.isEmpty() && (varName.at(0)=='*' || varName.at(0)=='&'))
2351 {
2352 ol.docify(" ");
2353 ol.docify(varName);
2354 }
2355 endAnonScopeNeeded=TRUE;
2356 }
2357 else
2358 {
2359 if (getAnonymousEnumType()) // type is an anonymous enum
2360 {
2362 d, // scope
2363 getBodyDef(), // fileScope
2364 this, // self
2365 ltype.left(i), // text
2366 FALSE // autoBreak
2367 );
2368 getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
2369 //ol+=*getAnonymousEnumType()->enumDecl();
2370 linkifyText(TextGeneratorOLImpl(ol),d,getFileDef(),this,ltype.right(ltype.length()-i-l),TRUE);
2371 }
2372 else
2373 {
2374 ltype = ltype.left(i) + " { ... } " + removeAnonymousScopes(ltype.right(ltype.length()-i-l));
2376 d, // scope
2377 getBodyDef(), // fileScope
2378 this, // self
2379 ltype, // text
2380 FALSE // autoBreak
2381 );
2382 }
2383 }
2384 }
2385 else if (ltype=="@") // rename type from enum values
2386 {
2387 ltype="";
2388 }
2389 else
2390 {
2391 if (isObjCMethod())
2392 {
2393 ltype.prepend("(");
2394 ltype.append(")");
2395 }
2397 d, // scope
2398 getBodyDef(), // fileScope
2399 this, // self
2400 ltype, // text
2401 FALSE // autoBreak
2402 );
2403 }
2404 bool htmlOn = ol.isEnabled(OutputType::Html);
2405 if (htmlOn && !ltype.isEmpty())
2406 {
2408 }
2409 if (!ltype.isEmpty()) ol.docify(" ");
2410 if (htmlOn)
2411 {
2413 }
2414
2415 if (m_annMemb)
2416 {
2417 ol.pushGeneratorState();
2420 ol.popGeneratorState();
2421 }
2422 else
2423 {
2424 ol.insertMemberAlign(m_tArgList.hasParameters());
2425 }
2426
2427 // *** write name
2428 if (!isAnonymous() && !_isAnonymousBitField()) // hide anonymous stuff
2429 {
2430 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2431 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2433 bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
2437 extractPrivateVirtual && hasDocumentation()
2438 ));
2439 //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",qPrint(name()),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation());
2440 if (!name().isEmpty() && // name valid
2441 (hasDetailedDescription() || isReference()) && // has docs
2442 visibleIfPrivate &&
2443 !(isStatic() && getClassDef()==nullptr && !extractStatic) // hidden due to static-ness
2444 )
2445 {
2446 if (annMemb)
2447 {
2448 //printf("anchor=%s ann_anchor=%s\n",anchor(),annMemb->anchor());
2449 annMemb->writeLink(ol,
2450 annMemb->getClassDef(),
2451 annMemb->getNamespaceDef(),
2452 annMemb->getFileDef(),
2453 annMemb->getGroupDef(),
2454 annMemb->getModuleDef());
2455 }
2456 else
2457 {
2458 //printf("writeLink %s->%d\n",qPrint(name),hasDocumentation());
2459 const ClassDef *rcd = cd;
2460 if (isReference() && getClassDef()) rcd = getClassDef();
2461 writeLink(ol,rcd,nd,fd,gd,mod);
2462 }
2463 }
2464 else if (isDocumentedFriendClass())
2465 // if the member is an undocumented friend declaration for some class,
2466 // then maybe we can link to the class
2467 {
2468 writeLink(ol,getClass(name()),nullptr,nullptr,nullptr,nullptr);
2469 }
2470 else
2471 // there is a brief member description and brief member
2472 // descriptions are enabled or there is no detailed description.
2473 {
2474 const ClassDef *rcd = cd;
2475 if (isReference() && getClassDef()) rcd = getClassDef();
2476 writeLink(ol,rcd,nd,fd,gd,mod,TRUE);
2477 }
2478 }
2479
2480 // *** write arguments
2481 if (!argsString().isEmpty() && !isObjCMethod())
2482 {
2483 if (!isDefine() && !isTypedef()) ol.writeString(" ");
2485 d, // scope
2486 getBodyDef(), // fileScope
2487 this, // self
2488 isDefine() ?
2489 substitute(argsString(),",",", ") :
2490 isTypedef() ?
2491 substitute(argsString(),")(",") (") :
2493 m_annMemb!=nullptr, // autoBreak
2494 TRUE, // external
2495 FALSE, // keepSpaces
2496 indentLevel
2497 );
2498 }
2499
2500 // *** write bitfields
2501 if (!m_bitfields.isEmpty()) // add bitfields
2502 {
2504 }
2505 else if (hasOneLineInitializer()
2506 //!init.isEmpty() && initLines==0 && // one line initializer
2507 //((maxInitLines>0 && userInitLines==-1) || userInitLines>0) // enabled by default or explicitly
2508 ) // add initializer
2509 {
2510 if (isTypeAlias()) // using statement
2511 {
2512 ol.writeString(" = ");
2513 linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_initializer.simplifyWhiteSpace());
2514 }
2515 else if (!isDefine())
2516 {
2517 //ol.writeString(" = ");
2518 ol.writeString(" ");
2519 linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_initializer.simplifyWhiteSpace());
2520 }
2521 else
2522 {
2525 }
2526 }
2527
2528
2530 {
2531 ol.startTypewriter();
2532 ol.docify(" [implementation]");
2533 ol.endTypewriter();
2534 }
2535
2536 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2537
2538 if (isProperty() && (isSettable() || isGettable() ||
2541 {
2542 ol.writeLatexSpacing();
2543 ol.startTypewriter();
2544 ol.docify(" [");
2545 StringVector sl;
2546
2547 if (isGettable()) sl.emplace_back("get");
2548 if (isProtectedGettable()) sl.emplace_back("protected get");
2549 if (isSettable()) sl.emplace_back("set");
2550 if (isProtectedSettable()) sl.emplace_back("protected set");
2551 if (extractPrivate)
2552 {
2553 if (isPrivateGettable()) sl.emplace_back("private get");
2554 if (isPrivateSettable()) sl.emplace_back("private set");
2555 }
2556 bool first=true;
2557 for (const auto &s : sl)
2558 {
2559 if (!first)
2560 {
2561 ol.docify(", ");
2562 }
2563 first=false;
2564 ol.docify(s.c_str());
2565 }
2566 ol.docify("]");
2567 ol.endTypewriter();
2568 }
2569
2570 if (isEvent() && (isAddable() || isRemovable() || isRaisable()))
2571 {
2572 ol.writeLatexSpacing();
2573 ol.startTypewriter();
2574 ol.docify(" [");
2575 StringVector sl;
2576 if (isAddable()) sl.emplace_back("add");
2577 if (isRemovable()) sl.emplace_back("remove");
2578 if (isRaisable()) sl.emplace_back("raise");
2579 bool first=true;
2580 for (const auto &s : sl)
2581 {
2582 if (!first)
2583 {
2584 ol.docify(", ");
2585 }
2586 first=false;
2587 ol.docify(s.c_str());
2588 }
2589 ol.docify("]");
2590 ol.endTypewriter();
2591 }
2592
2593 if (writeAnchor)
2594 {
2595 ol.endDoxyAnchor(cfname,anchor());
2596 }
2597
2598 //printf("endMember %s annoClassDef=%p annEnumType=%p\n",
2599 // qPrint(name()),annoClassDef,annEnumType);
2600 ol.endMemberItem(anonType);
2601 if (endAnonScopeNeeded)
2602 {
2603 ol.endAnonTypeScope(indentLevel);
2604 }
2605
2606 // write brief description
2607 if (!briefDescription().isEmpty() &&
2608 Config_getBool(BRIEF_MEMBER_DESC)
2609 )
2610 {
2611 auto parser { createDocParser() };
2612 auto ast { validatingParseDoc(*parser.get(),
2613 briefFile(),briefLine(),
2616 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
2617 if (!ast->isEmpty())
2618 {
2619 ol.startMemberDescription(anchor(),inheritId);
2620 ol.writeDoc(ast.get(),getOuterScope()?getOuterScope():d,this);
2621 if (detailsVisible) // add More.. link only when both brief and details are visible
2622 {
2623 if (!isAnonymous()) // hide anonymous stuff
2624 {
2625 ol.pushGeneratorState();
2627 ol.docify(" ");
2629 if (annMemb)
2630 {
2631 ol.startTextLink(annMemb->getOutputFileBase(),annMemb->anchor());
2632 ol.parseText(theTranslator->trMore());
2633 ol.endTextLink();
2634 }
2635 ol.popGeneratorState();
2636 }
2637 }
2638 // for RTF we need to add an extra empty paragraph
2639 ol.pushGeneratorState();
2641 ol.startParagraph();
2642 ol.endParagraph();
2643 ol.popGeneratorState();
2645 }
2646 }
2647
2648 ol.endMemberDeclaration(anchor(),inheritId);
2649
2651 //printf("< %s MemberDefImpl::writeDeclaration() inGroup=%d\n",qPrint(qualifiedName()),inGroup);
2652}
2653
2655
2657{
2658 std::lock_guard<std::mutex> lock(g_hasDetailedDescriptionMutex);
2659 //printf(">hasDetailedDescription(cached=%d)\n",m_hasDetailedDescriptionCached);
2661 {
2662 bool extractAll = Config_getBool(EXTRACT_ALL);
2663 bool alwaysDetailedSec = Config_getBool(ALWAYS_DETAILED_SEC);
2664 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2665 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
2666 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2667 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2668 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2669 bool inlineSources = hasInlineSource();
2670
2671 // the member has detailed documentation because the user added some comments
2672 bool docFilter =
2673 // extract all is enabled
2674 extractAll ||
2675 // has detailed docs
2676 !documentation().isEmpty() ||
2677 // has inbody docs
2679 // is an enum with values that are documented
2681 // is documented enum value
2682 (m_mtype==MemberType::EnumValue && !briefDescription().isEmpty()) ||
2683 // has brief description that is part of the detailed description
2684 (!briefDescription().isEmpty() && // has brief docs
2685 (alwaysDetailedSec && // they are visible in
2686 (repeatBrief || // detailed section or
2687 !briefMemberDesc // they are explicitly not
2688 ) // shown in brief section
2689 )
2690 ) ||
2691 // has one or more documented arguments
2693 m_templateMaster->argumentList().hasDocumentation() :
2694 m_defArgList.hasDocumentation());
2695
2696 // generate function guard
2697 // ================== =======
2698 // _writeGroupInclude -> ignored in calculation
2699 // multiLineInitializer() -> hasMultiLineInitializer()
2700 // _writeReimplements -> _isReimplements()
2701 // _writeReimplementedBy -> _countReimplementedBy()>0
2702 // _writeExamples -> hasExamples()
2703 // _writeTypeConstraints -> m_typeConstraints.hasParameters()
2704 // writeSourceDef -> !getSourceFileBase().isEmpty();
2705 // writeInlineCode -> hasInlineSource() && hasSources()
2706 // writeSourceRefs -> hasReferencesRelation() && hasSourceRefs()
2707 // writeSourceReffedBy -> hasReferencedByRelation() && hasSourceReffedBy()
2708 // _writeCallGraph -> _hasVisibleCallGraph()
2709 // _writeCallerGraph -> _hasVisibleCallerGraph()
2710
2711 // the member has detailed documentation because there is some generated info
2712 bool docInfo =
2713 // has a multi-line initialization block
2715 // reimplements / reimplemented by
2717 // examples
2718 hasExamples() ||
2719 // type constraints
2720 m_typeConstraints.hasParameters() ||
2721 // has source definition
2723 // has inline sources
2724 (inlineSources && hasSources()) ||
2725 // has references
2728 // call graph
2730 // caller graph
2732
2733 if (!hideUndocMembers) // if HIDE_UNDOC_MEMBERS is NO we also show the detailed section
2734 // if there is only some generated info
2735 {
2736 docFilter = docFilter || docInfo;
2737 }
2738
2739 // this is not a global static or global statics should be extracted
2740 bool staticFilter = getClassDef()!=nullptr || !isStatic() || extractStatic;
2741
2742 // a module does not contain details for members, so either the namespace or file should be linkable
2743 bool moduleFilter = getModuleDef()==nullptr || (getFileDef() && getFileDef()->isLinkable()) ||
2745
2746 // only include members that are non-private unless EXTRACT_PRIVATE is
2747 // set to YES or the member is part of a group
2748 bool privateFilter = protectionLevelVisible(protection()) || m_mtype==MemberType::Friend ||
2749 (m_prot==Protection::Private && (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual);
2750
2751 // hide friend (class|struct|union) member if HIDE_FRIEND_COMPOUNDS
2752 // is true
2753 bool friendCompoundFilter = !(Config_getBool(HIDE_FRIEND_COMPOUNDS) && isFriend());
2754
2756 (docFilter && staticFilter && moduleFilter && privateFilter && friendCompoundFilter && !isHidden());
2757 //printf("docFilter=%d docInfo=%d staticFilter=%d privateFilter=%d friendCompoundFilter=%d !isHidden()=%d",
2758 // docFilter,docInfo,staticFilter,privateFilter,friendCompoundFilter,!isHidden());
2760 }
2761 //printf("<hasDetailedDescription(cached=%d)\n",m_hasDetailedDescriptionCached);
2763}
2764
2766{
2767 bool separateMemPages = Config_getBool(SEPARATE_MEMBER_PAGES);
2768 bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
2769 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2770 bool groupFilter = getGroupDef()==nullptr || container==MemberListContainer::Group || separateMemPages;
2771 bool fileFilter = getNamespaceDef()==nullptr || !getNamespaceDef()->isLinkable() || container!=MemberListContainer::File;
2772 bool simpleFilter = (hasBriefDescription() || !hideUndocMembers) && inlineSimpleStructs &&
2773 getClassDef()!=nullptr && getClassDef()->isSimple();
2774
2775 bool visible = hasDetailedDescription() && groupFilter && fileFilter &&
2776 !isReference();
2777 bool result = visible || simpleFilter;
2778 //printf("%s::isDetailedSectionVisible: %d groupFilter=%d fileFilter=%d\n",
2779 // qPrint(name()),result,groupFilter,fileFilter);
2780 return result;
2781}
2782
2784{
2785 StringVector sl;
2786 bool inlineInfo = Config_getBool(INLINE_INFO);
2787
2788 Specifier lvirt=virtualness();
2789 if ((!isObjCMethod() || isOptional() || isRequired()) &&
2791 isFriend() || isRelated() ||
2792 (isInline() && inlineInfo) ||
2793 isSignal() || isSlot() ||
2794 isStatic() || isExternal() ||
2795 isExported() ||
2796 (getClassDef() && getClassDef()!=container && container->definitionType()==TypeClass) ||
2797 TypeSpecifier(m_memSpec).setInline(false)!=TypeSpecifier()
2798 )
2799 )
2800 {
2801 // write the member specifier list
2802 //ol.writeLatexSpacing();
2803 //ol.startTypewriter();
2804 //ol.docify(" [");
2805 SrcLangExt lang = getLanguage();
2806 bool optVhdl = lang==SrcLangExt::VHDL;
2807 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2808 if (optVhdl)
2809 {
2810 sl.push_back(theTranslator->trVhdlType(getVhdlSpecifiers(),TRUE).str());
2811 }
2812 else
2813 {
2814 if (isFriend()) sl.emplace_back("friend");
2815 else if (isRelated()) sl.emplace_back("related");
2816 else
2817 {
2818 if (isExternal()) sl.emplace_back("extern");
2819 if (inlineInfo && isInline()) sl.emplace_back("inline");
2820 if (isExplicit()) sl.emplace_back("explicit");
2821 if (isMutable()) sl.emplace_back("mutable");
2822 if (isStatic()) sl.emplace_back("static");
2823 if (isGettable()) sl.emplace_back("get");
2824 if (isProtectedGettable()) sl.emplace_back("protected get");
2825 if (isSettable()) sl.emplace_back("set");
2826 if (isProtectedSettable()) sl.emplace_back("protected set");
2827 if (extractPrivate)
2828 {
2829 if (isPrivateGettable()) sl.emplace_back("private get");
2830 if (isPrivateSettable()) sl.emplace_back("private set");
2831 }
2832 if (isNoDiscard()) sl.emplace_back("nodiscard");
2833 if (isConstExpr()) sl.emplace_back("constexpr");
2834 if (isConstEval()) sl.emplace_back("consteval");
2835 if (isConstInit()) sl.emplace_back("constinit");
2836 if (isAddable()) sl.emplace_back("add");
2837 if (!isUNOProperty() && isRemovable()) sl.emplace_back("remove");
2838 if (isRaisable()) sl.emplace_back("raise");
2839 if (isReadable()) sl.emplace_back("read");
2840 if (isWritable()) sl.emplace_back("write");
2841 if (isFinal()) sl.emplace_back("final");
2842 if (isAbstract()) sl.emplace_back("abstract");
2843 if (isOverride()) sl.emplace_back("override");
2844 if (isInitonly()) sl.emplace_back("initonly");
2845 if (isSealed()) sl.emplace_back("sealed");
2846 if (isNew()) sl.emplace_back("new");
2847 if (isOptional()) sl.emplace_back("optional");
2848 if (isRequired()) sl.emplace_back("required");
2849 if (isExported()) sl.emplace_back("export");
2850
2851 if (isNonAtomic()) sl.emplace_back("nonatomic");
2852 else if (isObjCProperty()) sl.emplace_back("atomic");
2853
2854 // mutual exclusive Objective 2.0 property attributes
2855 if (isAssign()) sl.emplace_back("assign");
2856 else if (isCopy()) sl.emplace_back("copy");
2857 else if (isRetain()) sl.emplace_back("retain");
2858 else if (isWeak()) sl.emplace_back("weak");
2859 else if (lang!=SrcLangExt::CSharp && isStrong()) sl.emplace_back("strong");
2860 else if (isUnretained()) sl.emplace_back("unsafe_unretained");
2861
2862 if (!isObjCMethod())
2863 {
2864 if (protection()==Protection::Protected) sl.emplace_back("protected");
2865 else if (protection()==Protection::Private) sl.emplace_back("private");
2866 else if (protection()==Protection::Package) sl.emplace_back("package");
2867
2868 if (lvirt==Specifier::Virtual) sl.emplace_back("virtual");
2869 else if (lvirt==Specifier::Pure) sl.emplace_back("pure virtual");
2870 if (isSignal()) sl.emplace_back("signal");
2871 if (isSlot()) sl.emplace_back("slot");
2872 if (isDefault()) sl.emplace_back("default");
2873 if (isDelete()) sl.emplace_back("delete");
2874 if (isNoExcept()) sl.emplace_back("noexcept");
2875 if (isAttribute()) sl.emplace_back("attribute");
2876 if (isUNOProperty()) sl.emplace_back("property");
2877 if (isReadonly()) sl.emplace_back("readonly");
2878 if (isBound()) sl.emplace_back("bound");
2879 if (isUNOProperty() && isRemovable()) sl.emplace_back("removable");
2880 if (isConstrained()) sl.emplace_back("constrained");
2881 if (isTransient()) sl.emplace_back("transient");
2882 if (isMaybeVoid()) sl.emplace_back("maybevoid");
2883 if (isMaybeDefault()) sl.emplace_back("maybedefault");
2884 if (isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
2885 if (isPublished()) sl.emplace_back("published"); // enum
2886 }
2888 {
2889 sl.emplace_back("implementation");
2890 }
2891 }
2892 if (getClassDef() &&
2893 container->definitionType()==TypeClass &&
2894 getClassDef()!=container &&
2895 !isRelated()
2896 )
2897 {
2898 sl.emplace_back("inherited");
2899 }
2900 }
2901 }
2902 else if (isObjCMethod() && isImplementation())
2903 {
2904 sl.emplace_back("implementation");
2905 }
2906
2907 for (const auto &sx : m_qualifiers)
2908 {
2909 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2910 if (!alreadyAdded)
2911 {
2912 sl.push_back(sx);
2913 }
2914 }
2915
2916 return sl;
2917}
2918
2920{
2921 // write call graph
2923 {
2924 DotCallGraph callGraph(this,FALSE);
2925 if (callGraph.isTooBig())
2926 {
2927 warn_uncond("Call graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
2928 qualifiedName(), callGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
2929 }
2930 else if (!callGraph.isTrivial())
2931 {
2932 msg("Generating call graph for function {}\n",qualifiedName());
2934 ol.startCallGraph();
2935 ol.parseText(theTranslator->trCallGraph());
2936 ol.endCallGraph(callGraph);
2937 ol.enableAll();
2938 }
2939 }
2940}
2941
2943{
2945 {
2946 DotCallGraph callerGraph(this, TRUE);
2947 if (callerGraph.isTooBig())
2948 {
2949 warn_uncond("Caller graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
2950 qualifiedName(), callerGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
2951 }
2952 else if (!callerGraph.isTrivial())
2953 {
2954 msg("Generating caller graph for function {}\n",qualifiedName());
2956 ol.startCallGraph();
2957 ol.parseText(theTranslator->trCallerGraph());
2958 ol.endCallGraph(callerGraph);
2959 ol.enableAll();
2960 }
2961 }
2962}
2963
2965{
2966 const MemberDef *bmd=reimplements();
2967 const ClassDef *bcd=nullptr;
2968 if (bmd && (bcd=bmd->getClassDef()))
2969 {
2970 // write class that contains a member that is reimplemented by this one
2971 if (bcd->isLinkable())
2972 {
2973 return true;
2974 }
2975 }
2976 return false;
2977}
2979{
2980 const MemberDef *bmd=reimplements();
2981 const ClassDef *bcd=nullptr;
2982 if (bmd && (bcd=bmd->getClassDef()))
2983 {
2984 // write class that contains a member that is reimplemented by this one
2985 if (bcd->isLinkable())
2986 {
2987 ol.startParagraph();
2988 QCString reimplFromLine;
2990 {
2991 reimplFromLine = theTranslator->trReimplementedFromList(1);
2992 }
2993 else
2994 {
2995 reimplFromLine = theTranslator->trImplementedFromList(1);
2996 }
2997 int markerPos = reimplFromLine.find("@0");
2998 if (markerPos!=-1) // should always pass this.
2999 {
3000 ol.parseText(reimplFromLine.left(markerPos)); //text left from marker
3001 if (bmd->isLinkable()) // replace marker with link
3002 {
3003 //Definition *bd=bmd->group;
3004 //if (bd==0) bd=bcd;
3006 bmd->anchor(),bcd->displayName());
3007
3008 //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
3009 // bmd->anchor(),bcd->name());
3010 if ( bmd->isLinkableInProject() )
3011 {
3012 writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
3013 }
3014 }
3015 else
3016 {
3018 QCString(),bcd->displayName());
3019 if (bcd->isLinkableInProject()/* && !Config_getBool(PDF_HYPERLINKS)*/ )
3020 {
3021 writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor());
3022 }
3023 }
3024 ol.parseText(reimplFromLine.right(
3025 reimplFromLine.length()-markerPos-2)); // text right from marker
3026
3027 }
3028 else
3029 {
3030 err("translation error: no marker in trReimplementsFromList()\n");
3031 }
3032 ol.endParagraph();
3033 }
3034 }
3035}
3036
3038{
3039 const MemberVector &bml=reimplementedBy();
3040 size_t count=0;
3041 for (const auto &bmd : bml)
3042 {
3043 const ClassDef *bcd=bmd->getClassDef();
3044 // count the members that directly inherit from md and for
3045 // which the member and class are visible in the docs.
3046 if ( bcd && bmd->isLinkable() && bcd->isLinkable() )
3047 {
3048 count++;
3049 }
3050 }
3051 return count;
3052}
3053
3055{
3056 const MemberVector &bml=reimplementedBy();
3057 size_t count = _countReimplementedBy();
3058 if (count>0)
3059 {
3060 auto replaceFunc = [&bml,&ol](size_t entryIndex)
3061 {
3062 size_t cnt=0;
3063 auto it = bml.begin();
3064 // find the entryIndex-th documented entry in the inheritance list.
3065 const MemberDef *bmd = nullptr;
3066 const ClassDef *bcd = nullptr;
3067 while (it!=bml.end())
3068 {
3069 bmd = *it;
3070 bcd = bmd->getClassDef();
3071 if ( bmd->isLinkable() && bcd->isLinkable())
3072 {
3073 if (cnt==entryIndex) break;
3074 cnt++;
3075 }
3076 ++it;
3077 }
3078
3079 if (bcd && bmd) // write link for marker
3080 {
3081 //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
3082 // bmd->anchor(),bcd->name());
3084 bmd->anchor(),bcd->displayName());
3085
3086 if (bmd->isLinkableInProject() )
3087 {
3088 writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
3089 }
3090 }
3091 };
3092
3093 QCString reimplInLine;
3094 if (m_virt==Specifier::Pure || (getClassDef() && getClassDef()->compoundType()==ClassDef::Interface))
3095 {
3096 reimplInLine = theTranslator->trImplementedInList(static_cast<int>(count));
3097 }
3098 else
3099 {
3100 reimplInLine = theTranslator->trReimplementedInList(static_cast<int>(count));
3101 }
3102
3103 // write the list of classes that overwrite this member
3104 ol.startParagraph();
3105 writeMarkerList(ol,
3106 reimplInLine.str(),
3107 count,
3108 replaceFunc);
3109 ol.endParagraph();
3110 }
3111}
3112
3114{
3115 if (getClassDef()) // this should be a member of a class/category
3116 {
3117 //printf("%s: category %s relation %s class=%s categoryOf=%s\n",
3118 // qPrint(name()),
3119 // m_category ? qPrint(m_category->name()) : "<none>",
3120 // m_categoryRelation ? qPrint(m_categoryRelation->name()) : "<none>",
3121 // qPrint(m_classDef->name()),
3122 // m_classDef->categoryOf() ? qPrint(m_classDef->categoryOf()->name()) : "<none>"
3123 // );
3124 QCString text;
3125 QCString ref;
3126 QCString file;
3127 QCString anc;
3128 QCString name;
3129 int i=-1;
3130 if (m_categoryRelation && m_categoryRelation->isLinkable())
3131 {
3132 if (m_category)
3133 {
3134 // this member is in a normal class and implements method categoryRelation from category
3135 // so link to method 'categoryRelation' with 'provided by category 'category' text.
3136 text = theTranslator->trProvidedByCategory();
3137 name = m_category->displayName();
3138 }
3139 else if (getClassDef()->categoryOf())
3140 {
3141 // this member is part of a category so link to the corresponding class member of the class we extend
3142 // so link to method 'categoryRelation' with 'extends class 'classDef->categoryOf()'
3143 text = theTranslator->trExtendsClass();
3145 }
3146 i=text.find("@0");
3147 if (i!=-1)
3148 {
3149 const MemberDef *md = m_categoryRelation;
3150 ref = md->getReference();
3151 file = md->getOutputFileBase();
3152 anc = md->anchor();
3153 }
3154 }
3155 if (i!=-1 && !name.isEmpty())
3156 {
3157 ol.startParagraph();
3158 ol.parseText(text.left(i));
3159 ol.writeObjectLink(ref,file,anc,name);
3160 ol.parseText(text.mid(i+2));
3161 ol.endParagraph();
3162 }
3163 }
3164}
3165
3167{
3168 // write the list of examples that use this member
3169 if (hasExamples())
3170 {
3171 ol.startExamples();
3172 ol.startDescForItem();
3174 ol.endDescForItem();
3175 ol.endExamples();
3176 }
3177}
3178
3180{
3181 if (m_typeConstraints.hasParameters())
3182 {
3184 }
3185}
3186
3188 const QCString &cfname,const QCString &ciname,
3189 const QCString &cname) const
3190{
3191 // For enum, we also write the documented enum values
3192 if (isEnumerate())
3193 {
3194 bool first=true;
3195 //printf("** %s: enum values=%zu\n",qPrint(name()),enumFieldList().size());
3196 bool hasInits = false;
3197 if (hasEnumValues())
3198 {
3199 for (const auto &fmd : enumFieldList())
3200 {
3201 if (fmd->isLinkable())
3202 {
3203 if (!fmd->initializer().isEmpty())
3204 {
3205 hasInits = true;
3206 break;
3207 }
3208 }
3209 }
3210 }
3211 for (const auto &fmd : enumFieldList())
3212 {
3213 //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
3214 if (fmd->isLinkable())
3215 {
3216 if (first)
3217 {
3218 ol.startDescTable(theTranslator->trEnumerationValues(),hasInits);
3219 first=false;
3220 }
3221
3222 ol.startDescTableRow();
3223 ol.addIndexItem(fmd->name(),ciname);
3224 ol.addIndexItem(ciname,fmd->name());
3225
3227 ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString());
3228 ol.addLabel(cfname,fmd->anchor());
3229 ol.docify(fmd->name());
3231 ol.writeString(" ");
3232 ol.enableAll();
3233 ol.endDoxyAnchor(cfname,fmd->anchor());
3234 ol.endDescTableTitle();
3235 if (hasInits)
3236 {
3237 ol.startDescTableInit();
3238 if (!fmd->initializer().isEmpty())
3239 {
3240 QCString initStr = fmd->initializer().stripWhiteSpace();
3241 if (initStr.startsWith("=")) initStr = initStr.mid(1).stripWhiteSpace();
3243 ol.writeString("(");
3244 ol.enableAll();
3245 ol.docify(initStr);
3247 ol.writeString(")");
3248 ol.enableAll();
3249 }
3250 ol.endDescTableInit();
3251 }
3252 ol.startDescTableData();
3253
3254 bool hasBrief = !fmd->briefDescription().isEmpty();
3255 bool hasDetails = !fmd->documentation().isEmpty();
3256
3257 if (hasBrief)
3258 {
3259 ol.generateDoc(fmd->briefFile(),fmd->briefLine(),
3260 getOuterScope()?getOuterScope():container,
3261 fmd,fmd->briefDescription(),TRUE,FALSE,
3262 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
3263 }
3264 if (hasDetails)
3265 {
3266 ol.generateDoc(fmd->docFile(),fmd->docLine(),
3267 getOuterScope()?getOuterScope():container,
3268 fmd,fmd->documentation()+"\n",TRUE,FALSE,
3269 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
3270 }
3271 ol.endDescTableData();
3272 ol.endDescTableRow();
3273 }
3274 }
3275 if (!first)
3276 {
3277 ol.endDescTable();
3278 }
3279 }
3280}
3281
3282// match from the start of the scope until the last marker
3283static const reg::Ex reAnonymous(R"([\w:@]*@\d+)");
3284
3286{
3287 QCString ldef = definition();
3288 QCString title = name();
3289 if (isEnumerate())
3290 {
3291 if (isAnonymous())
3292 {
3293 ldef = title = "anonymous enum";
3294 if (!m_enumBaseType.isEmpty())
3295 {
3296 ldef+=" : "+m_enumBaseType;
3297 }
3298 }
3299 else
3300 {
3301 ldef.prepend("enum ");
3302 if (isSliceLocal())
3303 {
3304 ldef.prepend("local ");
3305 }
3306 }
3307 }
3308 else if (isEnumValue())
3309 {
3310 if (isAnonymous())
3311 {
3312 ldef=ldef.mid(2);
3313 }
3314 }
3315
3316 std::string sdef = ldef.str();
3317 reg::Match match;
3318 if (reg::search(sdef,match,reAnonymous))
3319 {
3320 ldef = match.prefix().str() + " { ... } " + removeAnonymousScopes(match.suffix().str());
3321 }
3322
3323 const ClassDef *cd=getClassDef();
3324 if (cd && cd->isObjectiveC())
3325 {
3326 // strip scope name
3327 int ep = ldef.find("::");
3328 if (ep!=-1)
3329 {
3330 int sp=ldef.findRev(' ',ep);
3331 if (sp!=-1)
3332 {
3333 ldef=ldef.left(sp+1)+ldef.mid(ep+2);
3334 }
3335 }
3336 // strip keywords
3337 int dp = ldef.find(':');
3338 if (dp!=-1)
3339 {
3340 ldef=ldef.left(dp+1);
3341 }
3342 int l=static_cast<int>(ldef.length());
3343 //printf("start >%s<\n",qPrint(ldef));
3344 int i=l-1;
3345 while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
3346 while (i>=0 && isspace(static_cast<uint8_t>(ldef.at(i)))) i--;
3347 if (i>0)
3348 {
3349 // insert branches around the type
3350 ldef = "("+ldef.left(i+1)+")"+ldef.mid(i+1);
3351 }
3352 //printf("end >%s< i=%d\n",qPrint(ldef),i);
3353 if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
3354 }
3355 SrcLangExt lang = getLanguage();
3357 return substitute(ldef,"::",sep);
3358}
3359
3361{
3362 // only write out the include file if this is not part of a class or file
3363 // definition
3364 bool showGroupedMembInc = Config_getBool(SHOW_GROUPED_MEMB_INC);
3365 const FileDef *fd = getFileDef();
3366 QCString nm;
3367 if (fd) nm = getFileDef()->docName();
3368 if (inGroup && fd && showGroupedMembInc && !nm.isEmpty())
3369 {
3370 ol.startParagraph();
3371 ol.startTypewriter();
3372 SrcLangExt lang = getLanguage();
3373 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
3374 if (isIDLorJava)
3375 {
3376 ol.docify("import ");
3377 }
3378 else
3379 {
3380 ol.docify("#include ");
3381 }
3382
3383 if (isIDLorJava) ol.docify("\""); else ol.docify("<");
3384
3385 if (fd->isLinkable())
3386 {
3387 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),fd->anchor(),nm);
3388 }
3389 else
3390 {
3391 ol.docify(nm);
3392 }
3393
3394 if (isIDLorJava) ol.docify("\""); else ol.docify(">");
3395
3396 ol.endTypewriter();
3397 ol.endParagraph();
3398 }
3399}
3400
3402{
3403 //printf("md=%s initLines=%d init='%s'\n",qPrint(name()),initLines,qPrint(init));
3404 ol.startBold();
3406 ol.parseText(theTranslator->trDefineValue());
3407 else
3408 ol.parseText(theTranslator->trInitialValue());
3409 ol.endBold();
3410 QCString langCorrected = getDefFileExtension();
3412 if (srcLangExt == SrcLangExt::Lex)
3413 {
3414 langCorrected = ".doxygen_lex_c";
3415 srcLangExt = SrcLangExt::Cpp;
3416 }
3417 auto intf = Doxygen::parserManager->getCodeParser(langCorrected);
3418 intf->resetCodeParserState();
3419 auto &codeOL = ol.codeGenerators();
3420 codeOL.startCodeFragment("DoxyCode");
3421 intf->parseCode(codeOL,scopeName,m_initializer,srcLangExt,Config_getBool(STRIP_CODE_COMMENTS),FALSE,QCString(),getFileDef(),
3422 -1,-1,TRUE,this,FALSE,this);
3423 codeOL.endCodeFragment("DoxyCode");
3424}
3425
3426/*! Writes the "detailed documentation" section of this member to
3427 * all active output formats.
3428 */
3430 int memCount,int memTotal,
3431 OutputList &ol,
3432 const QCString &scName,
3433 const Definition *container,
3434 bool inGroup,
3435 bool /* showEnumValues */,
3436 bool showInline
3437 ) const
3438{
3439 // if this member is in a group find the real scope name.
3440 bool hasParameterList = FALSE;
3441
3442 //printf("MemberDefImpl::writeDocumentation(): name='%s' hasDocs='%d' containerType=%d inGroup=%d sectionLinkable=%d\n",
3443 // qPrint(name()),hasDocs,container->definitionType(),inGroup,hasDetailedDescription());
3444
3445 //if ( !hasDocs ) return;
3446 //if (isEnumValue() && !showEnumValues) return;
3447
3448 SrcLangExt lang = getLanguage();
3449 //printf("member=%s lang=%d\n",qPrint(name()),lang);
3450 bool optVhdl = lang==SrcLangExt::VHDL;
3452
3453 QCString scopeName = scName;
3454 QCString memAnchor = anchor();
3455 QCString ciname = container->displayName();
3456 const Definition *scopedContainer = container; // see bug 753608
3457 if (container->definitionType()==TypeGroup)
3458 {
3459 if (getClassDef()) { scopeName=getClassDef()->displayName(); scopedContainer=getClassDef(); }
3460 else if (getNamespaceDef()) { scopeName=getNamespaceDef()->displayName(); scopedContainer=getNamespaceDef(); }
3461 else if (getFileDef()) { scopeName=getFileDef()->displayName(); scopedContainer=getFileDef(); }
3462 ciname = (toGroupDef(container))->groupTitle();
3463 }
3464 else if (container->definitionType()==TypeFile && getNamespaceDef() && getNamespaceDef()->isLinkable())
3465 { // member is in a namespace, but is written as part of the file documentation
3466 // as well, so we need to make sure its anchor is unique (it is not really used).
3467 memAnchor.prepend("file_");
3468 }
3469
3470 QCString cname = container->name();
3471 QCString cfname = getOutputFileBase();
3472
3473 // get member name
3474 QCString doxyName=name();
3475 // prepend scope if there is any. TODO: make this optional for C only docs
3476 if (!scopeName.isEmpty())
3477 {
3478 doxyName.prepend(scopeName+sep);
3479 }
3480 QCString doxyArgs=argsString();
3481
3482 QCString ldef = definition();
3483 QCString title = name();
3484 //printf("member '%s' def='%s'\n",qPrint(name()),qPrint(ldef));
3485 if (isEnumerate())
3486 {
3487 if (title.at(0)=='@')
3488 {
3489 ldef = title = "anonymous enum";
3490 if (!m_enumBaseType.isEmpty())
3491 {
3492 ldef+=" : "+m_enumBaseType;
3493 }
3494 }
3495 else
3496 {
3497 if (lang==SrcLangExt::Cpp)
3498 {
3499 if (isEnumStruct()) ldef.prepend("struct ");
3500 else if (isStrong()) ldef.prepend("class ");
3501 }
3502 ldef.prepend("enum ");
3503 if (isSliceLocal())
3504 {
3505 ldef.prepend("local ");
3506 }
3507 }
3508 }
3509 else if (isEnumValue())
3510 {
3511 if (ldef.at(0)=='@')
3512 {
3513 ldef=ldef.mid(2);
3514 }
3515 }
3516 else if (isFunction() && !isObjCMethod())
3517 {
3518 title += "()";
3519 }
3520 if (lang == SrcLangExt::Slice)
3521 {
3522 // Remove the container scope from the member name.
3523 QCString prefix = scName + sep;
3524 int pos = ldef.findRev(prefix.data());
3525 if(pos != -1)
3526 {
3527 ldef.remove(pos, prefix.length());
3528 }
3529 }
3530 ldef.stripPrefix("constexpr ");
3531 ldef.stripPrefix("consteval ");
3532 ldef.stripPrefix("constinit ");
3533
3534 //----------------------------------------
3535
3536 ol.pushGeneratorState();
3537
3538 bool htmlEndLabelTable=FALSE;
3539 StringVector sl = getLabels(scopedContainer);
3540
3541 static const reg::Ex r(R"(@\d+)");
3542 reg::Match match;
3543 std::string sdef = ldef.str();
3544 if ((isVariable() || isTypedef()) && reg::search(sdef,match,r))
3545 {
3546 // find enum type and insert it in the definition
3547 bool found=false;
3548 for (const auto &vmd : *ml)
3549 {
3550 if (vmd->isEnumerate() && match.str()==vmd->name())
3551 {
3552 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3553 ol.startMemberDoc(ciname,name(),memAnchor,name(),memCount,memTotal,showInline);
3554 ol.addLabel(cfname, memAnchor);
3555 std::string prefix = match.prefix().str();
3556 std::string suffix = match.suffix().str();
3557 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,prefix.c_str());
3558 vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef(),getModuleDef());
3559 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,suffix.c_str());
3560
3561 found=true;
3562 break;
3563 }
3564 }
3565 if (!found) // anonymous compound
3566 {
3567 ClassDef *annoClassDef=getClassDefOfAnonymousType();
3568 QCString typeName;
3569 if (annoClassDef) typeName=annoClassDef->compoundTypeString();
3570 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3571 ol.startMemberDoc(ciname,name(),memAnchor,"["+typeName+"]",memCount,memTotal,showInline);
3572 ol.addLabel(cfname, memAnchor);
3573 // search for the last anonymous compound name in the definition
3574
3576 if (reg::search(sdef,match,reAnonymous))
3577 {
3578 std::string prefix = match.prefix().str();
3579 std::string suffix = match.suffix().str();
3580 ol.docify(prefix.c_str());
3581 ol.docify(" { ... } ");
3582 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,removeAnonymousScopes(suffix.c_str()));
3583 }
3584 else
3585 {
3586 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef);
3587 }
3588 }
3589 }
3590 else // not an enum value or anonymous compound
3591 {
3592 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3593 ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline);
3594 ol.addLabel(cfname, memAnchor);
3595
3596 if (!m_metaData.isEmpty() && getLanguage()==SrcLangExt::Slice)
3597 {
3599 ol.docify(m_metaData);
3601 }
3602
3603 const ClassDef *cd=getClassDef();
3604 const NamespaceDef *nd=getNamespaceDef();
3605 if (!m_defTmpArgLists.empty() && lang==SrcLangExt::Cpp)
3606 // definition has explicit template parameter declarations
3607 {
3608 for (const ArgumentList &tal : m_defTmpArgLists)
3609 {
3610 if (!tal.empty())
3611 {
3613 _writeTemplatePrefix(ol,scopedContainer,tal);
3615 }
3616 }
3617 }
3618 else // definition gets it template parameters from its class
3619 // (since no definition was found)
3620 {
3621 if (cd && lang==SrcLangExt::Cpp && !isTemplateSpecialization())
3622 {
3623 for (const ArgumentList &tal : cd->getTemplateParameterLists())
3624 {
3625 if (!tal.empty())
3626 {
3628 _writeTemplatePrefix(ol,scopedContainer,tal,false);
3630 }
3631 }
3632 }
3633 if (m_tArgList.hasParameters() && lang==SrcLangExt::Cpp) // function template prefix
3634 {
3636 _writeTemplatePrefix(ol,scopedContainer,m_tArgList);
3638 }
3639 }
3640
3641 if (!sl.empty())
3642 {
3643 ol.pushGeneratorState();
3644 ol.disableAll();
3646 ol.writeString("<table class=\"mlabels\">\n");
3647 ol.writeString(" <tr>\n");
3648 ol.writeString(" <td class=\"mlabels-left\">\n");
3649 ol.popGeneratorState();
3650 htmlEndLabelTable=TRUE;
3651 }
3652
3654 if (cd && cd->isObjectiveC())
3655 {
3656 // strip scope name
3657 int ep = ldef.find("::");
3658 if (ep!=-1)
3659 {
3660 int sp=ldef.findRev(' ',ep);
3661 if (sp!=-1)
3662 {
3663 ldef=ldef.left(sp+1)+ldef.mid(ep+2);
3664 } else {
3665 ldef=ldef.mid(ep+2);
3666 }
3667 }
3668 // strip keywords
3669 int dp = ldef.find(':');
3670 if (dp!=-1)
3671 {
3672 ldef=ldef.left(dp+1);
3673 }
3674 int dl=static_cast<int>(ldef.length());
3675 //printf("start >%s<\n",qPrint(ldef));
3676 int i=dl-1;
3677 while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
3678 while (i>=0 && isspace(static_cast<uint8_t>(ldef.at(i)))) i--;
3679 if (i>0)
3680 {
3681 // insert branches around the type
3682 ldef="("+ldef.left(i+1)+")"+ldef.mid(i+1);
3683 }
3684 //printf("end >%s< i=%d\n",qPrint(ldef),i);
3685 if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
3686 }
3687
3688 if (optVhdl)
3689 {
3690 hasParameterList=VhdlDocGen::writeVHDLTypeDocumentation(this,scopedContainer,ol);
3691 }
3692 else if (lang==SrcLangExt::Slice)
3693 {
3694 // Eliminate the self-reference.
3695 int pos = ldef.findRev(' ');
3696 if (pos<0) pos=0;
3697 if (pos>0)
3698 {
3700 scopedContainer,
3701 getBodyDef(),
3702 this,
3703 ldef.left(pos)
3704 );
3705 }
3706 ol.docify(ldef.mid(pos));
3707 const Definition *scope = cd;
3708 if (scope==nullptr) scope = nd;
3709 hasParameterList=writeDefArgumentList(ol,scope,this);
3710 }
3711 else
3712 {
3714 scopedContainer,
3715 getBodyDef(),
3716 this,
3717 substitute(ldef,"::",sep)
3718 );
3719 const Definition *scope = cd;
3720 if (scope==nullptr) scope = nd;
3721 hasParameterList=writeDefArgumentList(ol,scope,this);
3722 }
3723
3724 if (hasOneLineInitializer()) // add initializer
3725 {
3726 if (isTypeAlias())
3727 {
3728 ol.docify(" = ");
3729 QCString init = m_initializer.simplifyWhiteSpace();
3730 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,init);
3731 }
3732 else if (!isDefine())
3733 {
3734 ol.docify(" ");
3735 QCString init = m_initializer.simplifyWhiteSpace();
3736 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,init);
3737 }
3738 else
3739 {
3741 linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,m_initializer);
3742 }
3743 }
3744 if (!excpString().isEmpty()) // add exception list
3745 {
3746 writeExceptionList(ol,cd,this);
3747 hasParameterList=true; // call endParameterList below
3748 }
3749 }
3750
3751 ol.pushGeneratorState();
3753 if (!sl.empty())
3754 {
3755 ol.startLabels();
3756 size_t count=0;
3757 for (const auto &s : sl)
3758 {
3759 count++;
3760 ol.writeLabel(s.c_str(),count==sl.size());
3761 }
3762 ol.endLabels();
3763 }
3764 ol.popGeneratorState();
3765
3766 if (hasParameterList)
3767 {
3768 ol.endParameterList();
3769 ol.endMemberDoc(TRUE);
3770 }
3771 else
3772 {
3773 ol.endMemberDocName();
3774 ol.endMemberDoc(FALSE);
3775 }
3776
3777 // for HTML write the labels here
3778 ol.pushGeneratorState();
3779 ol.disableAll();
3781 if (htmlEndLabelTable)
3782 {
3783 ol.writeString(" </td>\n");
3784 ol.writeString(" <td class=\"mlabels-right\">\n");
3785 ol.startLabels();
3786 size_t count=0;
3787 for (const auto &s : sl)
3788 {
3789 count++;
3790 ol.writeLabel(s.c_str(),count==sl.size());
3791 }
3792 ol.endLabels();
3793 ol.writeString(" </td>\n");
3794 ol.writeString(" </tr>\n");
3795 ol.writeString("</table>\n");
3796 }
3797 ol.writeString("</div>");
3798 ol.popGeneratorState();
3799
3800
3801 ol.endDoxyAnchor(cfname,memAnchor);
3802 ol.startIndent();
3803
3804 _writeGroupInclude(ol,inGroup);
3805
3806 /* write multi-line initializer (if any) */
3808
3809 /* write brief description */
3810 QCString brief = briefDescription();
3811 if (!brief.isEmpty() &&
3812 (Config_getBool(REPEAT_BRIEF) ||
3813 !Config_getBool(BRIEF_MEMBER_DESC)
3814 )
3815 )
3816 {
3817 ol.startParagraph();
3819 scopedContainer,this,
3820 brief,FALSE,FALSE,
3821 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
3822 ol.endParagraph();
3823 }
3824
3825 /* write detailed description */
3826 QCString detailed = documentation();
3827 if (!detailed.isEmpty() ||
3828 !inbodyDocumentation().isEmpty())
3829 {
3830 // write vhdl inline code with or without option INLINE_SOURCE
3831 if (optVhdl && VhdlDocGen::isMisc(this))
3832 {
3833 VhdlDocGen::writeSource(this,ol,cname);
3834 return;
3835 }
3836 else
3837 {
3838 ol.generateDoc(docFile(),docLine(),scopedContainer,this,detailed+"\n",TRUE,FALSE,
3839 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
3840 }
3841
3842 if (!inbodyDocumentation().isEmpty())
3843 {
3845 scopedContainer,this,
3847 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
3848 }
3849 }
3850 else if (!brief.isEmpty() && (Config_getBool(REPEAT_BRIEF) || !Config_getBool(BRIEF_MEMBER_DESC)))
3851 {
3852 if (!inbodyDocumentation().isEmpty())
3853 {
3854 ol.generateDoc(inbodyFile(),inbodyLine(),scopedContainer,this,inbodyDocumentation()+"\n",TRUE,FALSE,
3855 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
3856 }
3857 }
3858
3859
3860 //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n",
3861 // defArgList,
3862 // defArgList?defArgList->hasDocumentation():-1);
3863 const ArgumentList &docArgList = m_templateMaster ?
3864 m_templateMaster->argumentList() :
3866 ol.generateDoc(
3867 docFile(),docLine(),
3868 scopedContainer,
3869 this, // memberDef
3870 inlineArgListToDoc(docArgList), // docStr
3871 TRUE, // indexWords
3872 FALSE, // isExample
3873 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
3874 );
3875
3876 _writeEnumValues(ol,scopedContainer,cfname,ciname,cname);
3880 _writeExamples(ol);
3882 QCString scopeStr = getScopeString();
3883 writeSourceDef(ol);
3884 writeInlineCode(ol,scopeStr);
3885 if (hasReferencesRelation()) writeSourceRefs(ol,scopeStr);
3886 if (hasReferencedByRelation()) writeSourceReffedBy(ol,scopeStr);
3887 _writeCallGraph(ol);
3889
3890 ol.endIndent();
3891
3892 // enable LaTeX again
3893 //if (Config_getBool(EXTRACT_ALL) && !hasDocs) ol.enable(OutputType::Latex);
3894 ol.popGeneratorState();
3895
3897}
3898
3899// strip scope and field name from the type
3900// example: "struct N<K::J>::S.v.c" will become "struct v"
3902{
3904 if (ts.endsWith("::")) ts = ts.left(ts.length()-2);
3905 static const reg::Ex re1(R"(\a\w*::)"); // non-template version
3906 static const reg::Ex re2(R"(\a\w*<[^>]*>::)"); // template version
3907 reg::Match match;
3908 std::string t = ts.str();
3909 while (reg::search(t,match,re2) || reg::search(t,match,re1))
3910 {
3911 t = match.prefix().str() + match.suffix().str(); // remove the matched part
3912 }
3913 //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),t.c_str());
3914 return QCString(t);
3915}
3916
3918{
3919 QCString type = m_accessorType;
3920 if (type.isEmpty())
3921 {
3922 type = m_type;
3923 }
3924
3925 if (isTypedef() && getLanguage() != SrcLangExt::Slice) type.prepend("typedef ");
3926 return simplifyTypeForTable(type);
3927}
3928
3930{
3931 Definition *scope = getOuterScope();
3932 QCString doxyName = name();
3933 QCString doxyArgs = argsString();
3934 QCString memAnchor = anchor();
3935 QCString cfname = getOutputFileBase();
3936 QCString cname;
3937 if (scope) cname = scope->name();
3938 if (doxyName.at(0)=='@')
3939 {
3940 doxyName="__unnamed__";
3941 }
3942
3944 //printf("===> %s::anonymous: %s\n",qPrint(name()),cd?qPrint(cd->name()):"<none>");
3945
3946 if (container && container->definitionType()==Definition::TypeClass &&
3947 !(toClassDef(container))->isJavaEnum())
3948 {
3950 ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
3951 ol.addLabel(cfname,memAnchor);
3952
3953 QCString ts = fieldType();
3954
3955 if (isFunctionPtr())
3956 ts = m_type + m_args;
3957
3958 if (cd) // cd points to an anonymous struct pointed to by this member
3959 // so we add a link to it from the type column.
3960 {
3961 int i=0;
3962 const char *prefixes[] = { "struct ","union ","class ", nullptr };
3963 const char **p = prefixes;
3964 while (*p)
3965 {
3966 int l=qstrlen(*p);
3967 if (ts.left(l)==*p)
3968 {
3969 ol.writeString(*p);
3970 i=l;
3971 }
3972 p++;
3973 }
3975 cd->getOutputFileBase(),
3976 cd->anchor(),ts.mid(i));
3977 }
3978 else // use standard auto linking
3979 {
3981 scope, // scope
3982 getBodyDef(), // fileScope
3983 this, // self
3984 ts // text
3985 );
3986 }
3987 ol.endDoxyAnchor(cfname,memAnchor);
3989 }
3990
3992 ol.docify(doxyName);
3993 if (isVariable() && !argsString().isEmpty() && !isObjCMethod() && !isFunctionPtr())
3994 {
3996 }
3997 if (!m_bitfields.isEmpty()) // add bitfields
3998 {
4000 }
4001 if (hasOneLineInitializer() && !isDefine())
4002 {
4003 ol.writeString(" ");
4004 linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,m_initializer.simplifyWhiteSpace());
4005 }
4007
4009
4010 QCString brief = briefDescription();
4011 QCString detailed = documentation();
4012
4013 /* write brief description */
4014 if (!brief.isEmpty())
4015 {
4017 getOuterScope()?getOuterScope():container,this,
4018 brief,FALSE,FALSE,
4019 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
4020 }
4021
4022 /* write detailed description */
4023 if (!detailed.isEmpty())
4024 {
4025 if (!brief.isEmpty())
4026 {
4028 ol.lineBreak();
4030 }
4032 getOuterScope()?getOuterScope():container,this,
4033 detailed+"\n",FALSE,FALSE,
4034 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
4035
4036 }
4037
4038 ol.endInlineMemberDoc();
4039}
4040
4042{
4043 switch (m_mtype)
4044 {
4045 case MemberType::Define: return "macro definition";
4046 case MemberType::Function: return "function";
4047 case MemberType::Variable: return "variable";
4048 case MemberType::Typedef: return "typedef";
4049 case MemberType::Enumeration: return "enumeration";
4050 case MemberType::EnumValue: return "enumvalue";
4051 case MemberType::Signal: return "signal";
4052 case MemberType::Slot: return "slot";
4053 case MemberType::Friend: return "friend";
4054 case MemberType::DCOP: return "dcop";
4055 case MemberType::Property: return "property";
4056 case MemberType::Event: return "event";
4057 case MemberType::Interface: return "interface";
4058 case MemberType::Service: return "service";
4059 case MemberType::Sequence: return "sequence";
4060 case MemberType::Dictionary: return "dictionary";
4061 default: return "unknown";
4062 }
4063}
4064
4066{
4067 /*
4068 * Removed bug_303020:
4069 * if (m_memberGroup) return;
4070 */
4071 const ClassDef *cd = getClassDef();
4072 const NamespaceDef *nd = getNamespaceDef();
4073 const FileDef *fd = getFileDef();
4074 const GroupDef *gd = getGroupDef();
4075 const Definition *d=nullptr;
4076 QCString t;
4077 if (cd)
4078 {
4079 t=cd->compoundTypeString();
4080 d=cd;
4081 }
4082 else if (nd)
4083 {
4084 t=nd->compoundTypeString();
4085 d=nd;
4086 }
4087 else if (gd)
4088 {
4089 t="group";
4090 d=gd;
4091 }
4092 else
4093 {
4094 t="file";
4095 d=fd;
4096 }
4097 bool extractAll = Config_getBool(EXTRACT_ALL);
4098
4099 //printf("%s:warnIfUndoc: hasUserDocs=%d isFriendClass=%d protection=%d isRef=%d isDel=%d\n",
4100 // qPrint(name()),
4101 // hasUserDocumentation(),isFriendClass(),protectionLevelVisible(m_prot),isReference(),isDeleted());
4102 if ((!hasUserDocumentation() && !extractAll) &&
4103 !isFriendClass() &&
4104 name().find('@')==-1 && d && d->name().find('@')==-1 &&
4107 !isReference() && !isDeleted()
4108 )
4109 {
4110 SrcLangExt lang = getLanguage();
4112 warn_undoc(getDefFileName(),getDefLine(),"Member {}{} ({}) of {} {} is not documented.",
4114 substitute(d->name(),"::",sep));
4115 }
4116 else if (!hasDetailedDescription())
4117 {
4119 }
4120
4121 // if it is an enum, we check that its members are documented
4122 if (!extractAll && isEnumerate() && Config_getBool(WARN_IF_UNDOC_ENUM_VAL))
4123 {
4124 for (const auto &fmd : enumFieldList())
4125 {
4126 if (!fmd->isLinkableInProject())
4127 {
4128 SrcLangExt lang = getLanguage();
4130 warn(fmd->getDefFileName(),fmd->getDefLine(), "Documentation for enum member '{}{}{}' is missing.",
4131 qualifiedName(),sep,fmd->name());
4132 }
4133 }
4134 }
4135}
4136
4138{
4139 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
4140 bool extractStatic = Config_getBool(EXTRACT_STATIC);
4141 return (!isAnonymous() &&
4142 (!hideUndocMembers || hasDocumentation()) &&
4143 (!isStatic() || extractStatic) &&
4144 isLinkable()
4145 );
4146}
4147
4149{
4150 QCString ret = trailRet;
4151
4152 ret = ret.stripWhiteSpace();
4153 if (ret.startsWith("->"))
4154 {
4155 ret = ret.mid(2).stripWhiteSpace();
4156 return ret;
4157 }
4158 return trailRet;
4159}
4160
4162
4163void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const
4164{
4165 bool isPython = getLanguage()==SrcLangExt::Python;
4166
4167 // this function is called while parsing the documentation. A member can have multiple
4168 // documentation blocks, which could be handled by multiple threads, hence this guard.
4169 std::lock_guard<std::mutex> lock(g_detectUndocumentedParamsMutex);
4170
4171 if (!m_hasDocumentedParams && hasParamCommand)
4172 {
4173 //printf("%s:hasDocumentedParams=TRUE;\n",qPrint(name()));
4174 m_hasDocumentedParams = true;
4175 }
4176 else if (!m_hasDocumentedParams)
4177 {
4178 const ArgumentList &al = argumentList();
4179 const ArgumentList &declAl = declArgumentList();
4180 bool allDoc=TRUE; // no parameter => all parameters are documented
4181 if ( // member has parameters
4182 al.hasParameters() // with at least one parameter (that is not void)
4183 )
4184 {
4185 // see if all parameters have documentation
4186 for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
4187 {
4188 Argument a = *it;
4189 if (!a.name.isEmpty() && a.type!="void" &&
4190 !(isPython && (a.name=="self" || a.name=="cls"))
4191 )
4192 {
4193 allDoc = !a.docs.isEmpty();
4194 }
4195 //printf("a->type=%s a->name=%s doc=%s\n",
4196 // qPrint(a->type),qPrint(a->name),qPrint(a->docs));
4197 }
4198 if (!allDoc && declAl.empty()) // try declaration arguments as well
4199 {
4200 allDoc=true;
4201 for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
4202 {
4203 Argument a = *it;
4204 if (!a.name.isEmpty() && a.type!="void" &&
4205 !(isPython && (a.name=="self" || a.name=="cls"))
4206 )
4207 {
4208 allDoc = !a.docs.isEmpty();
4209 }
4210 //printf("a->name=%s doc=%s\n",qPrint(a->name),qPrint(a->docs));
4211 }
4212 }
4213 }
4214 if (allDoc)
4215 {
4216 //printf("%s:hasDocumentedParams=TRUE;\n",qPrint(name()));
4217 m_hasDocumentedParams = true;
4218 }
4219 }
4220
4221 //printf("Member %s hasDocumentedReturnType=%d hasReturnCommand=%d\n",
4222 // qPrint(name()),m_hasDocumentedReturnType,hasReturnCommand);
4224}
4225
4227{
4228 QCString returnType = typeString();
4229 bool isFortran = getLanguage()==SrcLangExt::Fortran;
4230 bool isFortranSubroutine = isFortran && returnType.find("subroutine")!=-1;
4231
4232 bool isVoidReturn = returnType=="void" || returnType.endsWith(" void");
4233 if (!isVoidReturn && (returnType=="auto" || returnType.endsWith(" auto")))
4234 {
4236 if (!defArgList.trailingReturnType().isEmpty())
4237 {
4238 QCString strippedTrailingReturn = stripTrailingReturn(defArgList.trailingReturnType());
4239 isVoidReturn = (strippedTrailingReturn=="void") || (strippedTrailingReturn.endsWith(" void"));
4240 }
4241 }
4242 if (!Config_getBool(EXTRACT_ALL) &&
4243 Config_getBool(WARN_IF_UNDOCUMENTED) &&
4244 Config_getBool(WARN_NO_PARAMDOC) &&
4245 isFunction() &&
4246 !isDeleted() &&
4247 !isReference() &&
4249 {
4251 {
4253 "parameters of member {} are not documented",
4254 qualifiedName());
4255 }
4257 hasDocumentation() && !returnType.isEmpty() &&
4258 !( // not one of the cases where nothing is returned
4259 isVoidReturn || // void return type
4260 isFortranSubroutine || // fortran subroutine
4261 isConstructor() || // a constructor
4262 isDestructor() // or destructor
4263 )
4264 )
4265 {
4267 "return type of member {} is not documented",
4268 qualifiedName());
4269 }
4270 }
4271 if (Config_getBool(WARN_IF_DOC_ERROR) &&
4273 (isVoidReturn || // void return type
4274 isFortranSubroutine || // fortran subroutine
4275 isConstructor() || // a constructor
4276 isDestructor())) // or destructor
4277 {
4278 warn_doc_error(docFile(),docLine(),"found documented return type for {} that does not return anything",
4279 qualifiedName());
4280 }
4281}
4282
4284{
4285 ClassDef *fcd=nullptr;
4286 QCString baseName=name();
4287 int i=baseName.find('<');
4288 if (i!=-1) baseName=baseName.left(i);
4289 return (isFriendClass() &&
4290 (fcd=getClass(baseName)) && fcd->isLinkable());
4291}
4292
4294{
4295 return m_defArgList.isDeleted();
4296}
4297
4299{
4301 (m_mtype==MemberType::Enumeration && m_docEnumValues) || // has enum values
4302 (m_defArgList.hasDocumentation()); // has doc arguments
4303}
4304
4305
4310
4312{
4313 QCString result;
4314 if (isStrong()) result=name();
4315 else if (getClassDef()) result=getClassDef()->displayName();
4316 else if (getNamespaceDef()) result=getNamespaceDef()->displayName();
4317 return result;
4318}
4319
4321{
4322 QCString memAnchor = name();
4323 if (!m_args.isEmpty()) memAnchor+=m_args;
4324 if (m_memSpec.isAlias()) // this is for backward compatibility
4325 {
4326 memAnchor.prepend(" = "+m_initializer);
4327 }
4328 memAnchor.prepend(definition()); // actually the method name is now included
4329 // twice, which is silly, but we keep it this way for backward
4330 // compatibility.
4331
4332
4333 // include number of template arguments as well,
4334 // to distinguish between two template
4335 // specializations that only differ in the template parameters.
4336 if (m_tArgList.hasParameters())
4337 {
4338 char buf[20];
4339 qsnprintf(buf,20,"%d:",static_cast<int>(m_tArgList.size()));
4340 buf[19]='\0';
4341 memAnchor.prepend(buf);
4342 }
4343 if (!m_requiresClause.isEmpty())
4344 {
4345 memAnchor+=" "+m_requiresClause;
4346 }
4347
4348 // convert to md5 hash
4349 uint8_t md5_sig[16];
4350 char sigStr[33];
4351 MD5Buffer(memAnchor.data(),static_cast<unsigned int>(memAnchor.length()),md5_sig);
4352 MD5SigToString(md5_sig,sigStr);
4353 m_anc = QCString("a")+sigStr;
4354}
4355
4357 const QCString &fileName,int startLine,
4358 bool hasDocs,MemberDef *member)
4359{
4360 //printf("%s MemberDefImpl::setGroupDef(%s)\n",qPrint(name()),qPrint(gd->name()));
4361 m_group=gd;
4362 m_grouppri=pri;
4363 m_groupFileName=fileName;
4364 m_groupStartLine=startLine;
4365 m_groupHasDocs=hasDocs;
4366 m_groupMember=member;
4368}
4369
4384
4392
4394{
4395 m_nspace=nd;
4396 setOuterScope(nd);
4397}
4398
4400 const ArgumentList &formalArgs,const std::unique_ptr<ArgumentList> &actualArgs) const
4401{
4402 //printf(" Member %s %s %s\n",qPrint(typeString()),qPrint(name()),qPrint(argsString()));
4403 std::unique_ptr<ArgumentList> actualArgList = std::make_unique<ArgumentList>(m_defArgList);
4404 if (!m_defArgList.empty())
4405 {
4406 // replace formal arguments with actuals
4407 for (Argument &arg : *actualArgList)
4408 {
4409 arg.type = substituteTemplateArgumentsInString(arg.type,formalArgs,actualArgs.get());
4410 }
4411 actualArgList->setTrailingReturnType(
4412 substituteTemplateArgumentsInString(actualArgList->trailingReturnType(),formalArgs,actualArgs.get()));
4413 }
4414
4415 QCString methodName=name();
4416 if (methodName.startsWith("operator ")) // conversion operator
4417 {
4418 methodName=substituteTemplateArgumentsInString(methodName,formalArgs,actualArgs.get());
4419 }
4420
4421 auto imd = createMemberDef(
4423 substituteTemplateArgumentsInString(m_type,formalArgs,actualArgs.get()),
4424 methodName,
4425 substituteTemplateArgumentsInString(m_args,formalArgs,actualArgs.get()),
4428 ArgumentList(), ArgumentList(), ""
4429 );
4430 auto mmd = toMemberDefMutable(imd.get());
4431 mmd->moveArgumentList(std::move(actualArgList));
4432 mmd->setDefinition(substituteTemplateArgumentsInString(m_def,formalArgs,actualArgs.get()));
4433 mmd->setBodyDef(getBodyDef());
4434 mmd->setBodySegment(getDefLine(),getStartBodyLine(),getEndBodyLine());
4435 mmd->setFormalTemplateArguments(formalArgs);
4436
4437 // TODO: init other member variables (if needed).
4438 // TODO: reimplemented info
4439 return imd;
4440}
4441
4443{
4444 //printf("%s: init=%s, initLines=%d maxInitLines=%d userInitLines=%d\n",
4445 // qPrint(name()),qPrint(m_initializer),m_initLines,
4446 // m_maxInitLines,m_userInitLines);
4447 bool isFuncLikeMacro = m_mtype==MemberType::Define && m_defArgList.hasParameters();
4448 return !m_initializer.isEmpty() && m_initLines==0 && // one line initializer
4449 !isFuncLikeMacro &&
4450 ((m_maxInitLines>0 && m_userInitLines==-1) || m_userInitLines>0); // enabled by default or explicitly
4451}
4452
4454{
4455 //printf("initLines=%d userInitLines=%d maxInitLines=%d\n",
4456 // initLines,userInitLines,maxInitLines);
4457 bool isFuncLikeMacro = m_mtype==MemberType::Define && m_defArgList.hasParameters();
4458 return (m_initLines>0 || (!m_initializer.isEmpty() && isFuncLikeMacro)) &&
4459 ((m_initLines<m_maxInitLines && m_userInitLines==-1) // implicitly enabled
4460 || m_initLines<m_userInitLines // explicitly enabled
4461 );
4462}
4463
4465{
4467 int l=static_cast<int>(m_initializer.length());
4468 int p=l-1;
4469 while (p>=0 && isspace(static_cast<uint8_t>(m_initializer.at(p)))) p--;
4470 m_initializer=m_initializer.left(p+1);
4471 m_initLines=m_initializer.contains('\n');
4472 //printf("%s::setInitializer(%s)\n",qPrint(name()),qPrint(m_initializer));
4473}
4474
4476{
4477 bool optimizeOutputForC = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
4478 //bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
4479 //bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
4480 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
4481 SrcLangExt lang = getLanguage();
4482 if (!isLinkableInProject()) return;
4483 QCString memLabel;
4484 if (optimizeOutputForC)
4485 {
4486 memLabel=theTranslator->trGlobal(TRUE,TRUE);
4487 }
4488 else if (lang==SrcLangExt::Fortran)
4489 {
4490 memLabel=theTranslator->trSubprogram(TRUE,TRUE);
4491 }
4492 else
4493 {
4494 memLabel=theTranslator->trMember(TRUE,TRUE);
4495 }
4496 QCString memName = name();
4499 (toClassDef(pd))->displayName() : pd->name();
4501 QCString memArgs;
4502 if (!isRelated()
4503 /* && commented out as a result of bug 597016
4504 (
4505 (!hideScopeNames && // there is a scope
4506 pd && pd!=Doxygen::globalScope) // and we can show it
4507 ||
4508 (pd=getClassDef()) // it's a class so we
4509 // show the scope anyway
4510 )
4511 */
4512 )
4513 {
4514 if (isObjCMethod())
4515 {
4516 memName = "[" + pd->name() + " " + name() + "]";
4517 }
4518 else
4519 {
4520 if (pd!=Doxygen::globalScope) memName.prepend(pdName+sep);
4521 memArgs = argsString();
4522 }
4523 }
4524 const RefItemVector &xrefItems = xrefListItems();
4525 if (sep!="::")
4526 {
4527 memName = substitute(memName,"::",sep);
4528 }
4529 addRefItem(xrefItems,
4530 qualifiedName()+argsString(), // argsString is needed for overloaded functions (see bug 609624)
4531 memLabel,
4532 getOutputFileBase()+"#"+anchor(),memName,memArgs,pd);
4533}
4534
4536{
4537 auto it = m_sectionMap.find(container);
4538 return it!=m_sectionMap.end() ? it->second : nullptr;
4539}
4540
4542{
4543 //printf("MemberDefImpl::setSectionList(%s,%p) name=%s\n",qPrint(d->name()),sl,qPrint(name()));
4544 m_sectionMap.emplace(container,sl);
4545}
4546
4548{
4549 if (count>25)
4550 {
4552 "Internal inconsistency: recursion detected in overload relation for member {}!",name());
4553 return Specifier::Normal;
4554 }
4555 Specifier v = m_virt;
4556 const MemberDef *rmd = reimplements();
4557 while (rmd && v==Specifier::Normal)
4558 {
4560 rmd = rmd->reimplements();
4561 }
4562 return v;
4563}
4564
4565void MemberDefImpl::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers) const
4566{
4567 if (!isLinkableInProject()) return;
4568 if (!showNamespaceMembers && getNamespaceDef()) return;
4569 tagFile << " <member kind=\"";
4570 switch (m_mtype)
4571 {
4572 case MemberType::Define: tagFile << "define"; break;
4573 case MemberType::EnumValue: tagFile << "enumvalue"; break;
4574 case MemberType::Property: tagFile << "property"; break;
4575 case MemberType::Event: tagFile << "event"; break;
4576 case MemberType::Variable: tagFile << "variable"; break;
4577 case MemberType::Typedef: tagFile << "typedef"; break;
4578 case MemberType::Enumeration: tagFile << "enumeration"; break;
4579 case MemberType::Function: tagFile << "function"; break;
4580 case MemberType::Signal: tagFile << "signal"; break;
4581 case MemberType::Friend: tagFile << "friend"; break;
4582 case MemberType::DCOP: tagFile << "dcop"; break;
4583 case MemberType::Slot: tagFile << "slot"; break;
4584 case MemberType::Interface: tagFile << "interface"; break;
4585 case MemberType::Service: tagFile << "service"; break;
4586 case MemberType::Sequence: tagFile << "sequence"; break;
4587 case MemberType::Dictionary: tagFile << "dictionary"; break;
4588 }
4590 {
4591 tagFile << "\" protection=\"";
4592 if (m_prot==Protection::Protected) tagFile << "protected";
4593 else if (m_prot==Protection::Package) tagFile << "package";
4594 else /* Private */ tagFile << "private";
4595 }
4597 {
4598 tagFile << "\" virtualness=\"";
4599 if (m_virt==Specifier::Virtual) tagFile << "virtual";
4600 else /* Pure */ tagFile << "pure";
4601 }
4602 if (isStatic())
4603 {
4604 tagFile << "\" static=\"yes";
4605 }
4606 tagFile << "\">\n";
4607 if (typeString()!=QCString("@"))
4608 {
4609 tagFile << " <type>" << convertToXML(typeString()) << "</type>\n";
4610 }
4613 tagFile << " <name>" << convertToXML(useQualifiedName ? qualifiedName() : name()) << "</name>\n";
4614 tagFile << " <anchorfile>" << convertToXML(fn) << "</anchorfile>\n";
4615 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
4616 QCString idStr = id();
4617 if (!idStr.isEmpty())
4618 {
4619 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
4620 }
4621 tagFile << " <arglist>" << convertToXML(argsString()) << "</arglist>\n";
4622 if (isStrong())
4623 {
4624 for (const auto &fmd : m_enumFields)
4625 {
4626 if (!fmd->isReference())
4627 {
4628 tagFile << " <enumvalue file=\"" << convertToXML(fn);
4629 tagFile << "\" anchor=\"" << convertToXML(fmd->anchor());
4630 idStr = fmd->id();
4631 if (!idStr.isEmpty())
4632 {
4633 tagFile << "\" clangid=\"" << convertToXML(idStr);
4634 }
4635 tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>\n";
4636 }
4637 }
4638 }
4639 writeDocAnchorsToTagFile(tagFile);
4640 tagFile << " </member>\n";
4641}
4642
4644{
4645 m_isConstructorCached=1; // FALSE
4646 if (getClassDef())
4647 {
4648 if (m_isDMember) // for D
4649 {
4650 m_isConstructorCached = name()=="this" ? 2 : 1;
4651 return;
4652 }
4653 else if (getLanguage()==SrcLangExt::PHP) // for PHP
4654 {
4655 m_isConstructorCached = name()=="__construct" ? 2 : 1;
4656 return;
4657 }
4658 else if (name()=="__init__" &&
4659 getLanguage()==SrcLangExt::Python) // for Python
4660 {
4661 m_isConstructorCached = 2; // TRUE
4662 return;
4663 }
4664 else // for other languages
4665 {
4666 QCString locName = getClassDef()->localName();
4667 int i=locName.find('<');
4668 if (i==-1) // not a template class
4669 {
4670 m_isConstructorCached = name()==locName ? 2 : 1;
4671 }
4672 else
4673 {
4674 m_isConstructorCached = name()==locName.left(i) ? 2 : 1;
4675 }
4676 return;
4677 }
4678 }
4679}
4680
4682{
4683 if (m_isConstructorCached==0)
4684 {
4685 MemberDefImpl *that = const_cast<MemberDefImpl*>(this);
4686 that->_computeIsConstructor();
4687 }
4689 return m_isConstructorCached==2;
4690
4691}
4692
4694{
4695 bool isDestructor = false;
4696 if (m_isDMember) // for D
4697 {
4698 isDestructor = name()=="~this";
4699 }
4700 else if (getLanguage()==SrcLangExt::PHP) // for PHP
4701 {
4702 isDestructor = name()=="__destruct";
4703 }
4704 else if (name()=="__del__" &&
4705 getLanguage()==SrcLangExt::Python) // for Python
4706 {
4707 isDestructor = true;
4708 }
4709 else if (getLanguage()==SrcLangExt::Fortran) // for Fortran
4710 {
4711 isDestructor = typeString()=="final";
4712 }
4713 else // other languages
4714 {
4715 isDestructor =
4716 (name().find('~')!=-1 || name().find('!')!=-1) // The ! is for C++/CLI
4717 && name().find("operator")==-1;
4718 }
4720}
4721
4723{
4724 if (m_isDestructorCached==0)
4725 {
4726 MemberDefImpl *that=const_cast<MemberDefImpl*>(this);
4727 that->_computeIsDestructor();
4728 }
4730 return m_isDestructorCached==2;
4731}
4732
4734 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const
4735{
4736 int enumMemCount=0;
4737
4738 uint32_t numVisibleEnumValues=0;
4739 for (const auto &fmd : m_enumFields)
4740 {
4741 if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
4742 }
4743 if (numVisibleEnumValues==0 && !isBriefSectionVisible())
4744 {
4745 return;
4746 }
4747
4748 QCString n = name();
4749 int i=n.findRev("::");
4750 if (i!=-1) n=n.right(n.length()-i-2); // strip scope (TODO: is this needed?)
4751 if (n[0]!='@') // not an anonymous enum
4752 {
4754 {
4755 //_writeTagData(compoundType);
4756 writeLink(typeDecl,cd,nd,fd,gd,mod);
4757 }
4758 else
4759 {
4760 typeDecl.startBold();
4761 typeDecl.docify(n);
4762 typeDecl.endBold();
4763 }
4764 typeDecl.writeChar(' ');
4765 }
4766 if (!m_enumBaseType.isEmpty())
4767 {
4768 typeDecl.writeChar(':');
4769 typeDecl.writeChar(' ');
4770 typeDecl.docify(m_enumBaseType);
4771 typeDecl.writeChar(' ');
4772 }
4773
4774 uint32_t enumValuesPerLine = static_cast<uint32_t>(Config_getInt(ENUM_VALUES_PER_LINE));
4775 if (numVisibleEnumValues>0 && enumValuesPerLine>0)
4776 {
4777 typeDecl.docify("{ ");
4778
4779 auto it = m_enumFields.begin();
4780 if (it!=m_enumFields.end())
4781 {
4782 const MemberDef *fmd=*it;
4783 bool fmdVisible = fmd->isBriefSectionVisible();
4784 bool first=true;
4785 while (fmd)
4786 {
4787 if (fmdVisible)
4788 {
4789 if (!first)
4790 {
4791 typeDecl.writeString(", ");
4792 }
4793 /* in html we start a new line after a number of items */
4794 if (numVisibleEnumValues>enumValuesPerLine
4795 && (enumMemCount%enumValuesPerLine)==0
4796 )
4797 {
4798 typeDecl.pushGeneratorState();
4800 typeDecl.enable(OutputType::Latex);
4801 typeDecl.enable(OutputType::Docbook);
4802 typeDecl.lineBreak();
4803 typeDecl.disable(OutputType::Latex);
4804 typeDecl.disable(OutputType::Docbook);
4805 typeDecl.writeString("&#160;&#160;");
4806 typeDecl.popGeneratorState();
4807 }
4808
4809 if (fmd->hasDocumentation()) // enum value has docs
4810 {
4811 fmd->writeLink(typeDecl,cd,nd,fd,gd,mod);
4812 }
4813 else // no docs for this enum value
4814 {
4815 typeDecl.startBold();
4816 typeDecl.docify(fmd->name());
4817 typeDecl.endBold();
4818 }
4819 if (fmd->hasOneLineInitializer()) // enum value has initializer
4820 {
4821 //typeDecl.writeString(" = ");
4822 typeDecl.writeString(" ");
4823 typeDecl.parseText(fmd->initializer());
4824 }
4825 first=false;
4826 }
4827
4828 bool prevVisible = fmdVisible;
4829 ++it;
4830 if (it!=m_enumFields.end())
4831 {
4832 fmd=*it;
4833 }
4834 else
4835 {
4836 fmd=nullptr;
4837 }
4838 if (prevVisible)
4839 {
4840 typeDecl.disable(OutputType::Man);
4841 typeDecl.writeString("\n"); // to prevent too long lines in LaTeX
4842 typeDecl.enable(OutputType::Man);
4843 enumMemCount++;
4844 }
4845 }
4846 if (numVisibleEnumValues>enumValuesPerLine)
4847 {
4848 typeDecl.pushGeneratorState();
4850 typeDecl.lineBreak();
4851 typeDecl.popGeneratorState();
4852 }
4853 }
4854 typeDecl.docify(" }");
4855 }
4856}
4857
4858void MemberDefImpl::moveArgumentList(std::unique_ptr<ArgumentList> al)
4859{
4860 m_defArgList = *al;
4861}
4862
4863void MemberDefImpl::moveDeclArgumentList(std::unique_ptr<ArgumentList> al)
4864{
4865 m_declArgList = *al;
4866}
4867
4872
4874{
4875 m_type = t;
4876}
4877
4879{
4880 m_accessorClass = cd;
4881 m_accessorType = t;
4882}
4883
4888
4895
4901
4907
4913
4919
4924
4929
4931{
4932 if (getClassDef() && getClassDef()->isObjectiveC() && isFunction()) return TRUE;
4933 return FALSE;
4934}
4935
4937{
4938 if (getClassDef() && getClassDef()->isObjectiveC() && isProperty()) return TRUE;
4939 return FALSE;
4940}
4941
4943{
4944 if (getClassDef() && getClassDef()->isCSharp() && isProperty()) return TRUE;
4945 return FALSE;
4946}
4947
4949{
4950 if (isObjCMethod())
4951 {
4952 QCString qm;
4953 if (isStatic()) qm="+"; else qm="-";
4954 qm+="[";
4955 qm+=getClassDef()->name()+" ";
4956 qm+=name();
4957 qm+="]";
4958 return qm;
4959 }
4960 else if (m_enumScope && m_enumScope->isStrong())
4961 {
4962 return m_enumScope->qualifiedName()+
4964 localName();
4965 }
4966 else
4967 {
4969 }
4970}
4971
4973{
4974 if (ti)
4975 {
4976 //printf("%s: Setting tag name=%s anchor=%s\n",qPrint(name()),qPrint(ti->tagName),qPrint(ti->anchor));
4977 m_anc=ti->anchor;
4978 setReference(ti->tagName);
4980 }
4981}
4982
4983QCString MemberDefImpl::objCMethodName(bool localLink,bool showStatic) const
4984{
4985 QCString qm;
4986 if (showStatic)
4987 {
4988 if (isStatic()) qm="+ "; else qm="- ";
4989 }
4990 qm+=name();
4991 if (!localLink) // link to method of same class
4992 {
4993 qm+=" (";
4994 qm+=getClassDef()->name();
4995 qm+=")";
4996 }
4997 return qm;
4998}
4999
5001{
5002 return m_decl;
5003}
5004
5006{
5007 return m_def;
5008}
5009
5014
5016{
5017 return m_type;
5018}
5019
5021{
5022 return m_args;
5023}
5024
5026{
5027 return m_exception;
5028}
5029
5031{
5032 return m_bitfields;
5033}
5034
5036{
5037 return m_initializer;
5038}
5039
5041{
5042 return m_initLines;
5043}
5044
5049
5054
5056{
5057 return m_classDef;
5058}
5059
5064
5069
5071{
5072 return m_fileDef;
5073}
5074
5076{
5077 return m_fileDef;
5078}
5079
5081{
5082 return m_nspace;
5083}
5084
5089
5091{
5092 return m_read;
5093}
5094
5096{
5097 return m_write;
5098}
5099
5101{
5102 return m_group;
5103}
5104
5106{
5107 return m_group;
5108}
5109
5111{
5112 return m_moduleDef;
5113}
5114
5119
5124
5126{
5127 return m_groupStartLine;
5128}
5129
5131{
5132 return m_groupHasDocs;
5133}
5134
5136{
5137 return m_prot;
5138}
5139
5141{
5142 return m_mtype;
5143}
5144
5146{
5148}
5149
5151{
5152 return m_mtype==MemberType::Slot;
5153}
5154
5156{
5158}
5159
5161{
5163}
5164
5166{
5168}
5169
5171{
5173}
5174
5176{
5178}
5179
5181{
5183}
5184
5186{
5188}
5189
5191{
5192 return m_mtype==MemberType::Variable && QCString(argsString()).find(")(")!=-1;
5193}
5194
5196{
5198}
5199
5201{
5203}
5204
5206{
5207 return m_mtype==MemberType::DCOP;
5208}
5209
5211{
5213}
5214
5216{
5217 return m_mtype==MemberType::Event;
5218}
5219
5221{
5223}
5224
5226{
5228}
5229
5231{
5232 return m_stat;
5233}
5234
5236{
5237 return m_memSpec.isInline();
5238}
5239
5241{
5242 return m_memSpec.isExplicit();
5243}
5244
5246{
5247 return m_memSpec.isMutable();
5248}
5249
5251{
5252 return m_memSpec.isGettable();
5253}
5254
5256{
5257 return m_memSpec.isPrivateGettable();
5258}
5259
5261{
5262 return m_memSpec.isProtectedGettable();
5263}
5264
5266{
5267 return m_memSpec.isSettable();
5268}
5269
5271{
5272 return m_memSpec.isPrivateSettable();
5273}
5274
5276{
5277 return m_memSpec.isProtectedSettable();
5278}
5279
5281{
5282 return m_memSpec.isAddable();
5283}
5284
5286{
5287 return m_memSpec.isRemovable();
5288}
5289
5291{
5292 return m_memSpec.isRaisable();
5293}
5294
5296{
5297 return m_memSpec.isReadable();
5298}
5299
5301{
5302 return m_memSpec.isWritable();
5303}
5304
5306{
5307 return m_memSpec.isFinal();
5308}
5309
5311{
5312 return m_memSpec.isNew();
5313}
5314
5316{
5317 return m_memSpec.isSealed();
5318}
5319
5321{
5322 return m_memSpec.isOverride();
5323}
5324
5326{
5327 return m_memSpec.isInitonly();
5328}
5329
5331{
5332 return m_memSpec.isAbstract();
5333}
5334
5336{
5337 return m_memSpec.isOptional();
5338}
5339
5341{
5342 return m_memSpec.isRequired();
5343}
5344
5346{
5347 return m_memSpec.isNonAtomic();
5348}
5349
5351{
5352 return m_memSpec.isCopy();
5353}
5354
5356{
5357 return m_memSpec.isAssign();
5358}
5359
5361{
5362 return m_memSpec.isRetain();
5363}
5364
5366{
5367 return m_memSpec.isWeak();
5368}
5369
5371{
5372 return m_memSpec.isStrong();
5373}
5374
5376{
5377 return m_memSpec.isEnumStruct();
5378}
5379
5381{
5383 m_enumScope &&
5384 m_enumScope->isStrong();
5385}
5386
5388{
5389 return m_memSpec.isUnretained();
5390}
5391
5393{
5394 return m_memSpec.isAlias();
5395}
5396
5398{
5399 return m_memSpec.isDefault();
5400}
5401
5403{
5404 return m_memSpec.isDelete();
5405}
5406
5408{
5409 return m_memSpec.isNoExcept();
5410}
5411
5413{
5414 return m_memSpec.isAttribute();
5415}
5416
5418{
5419 return m_memSpec.isProperty();
5420}
5421
5423{
5424 return m_memSpec.isReadonly();
5425}
5426
5428{
5429 return m_memSpec.isBound();
5430}
5431
5433{
5434 return m_memSpec.isConstrained();
5435}
5436
5438{
5439 return m_memSpec.isTransient();
5440}
5441
5443{
5444 return m_memSpec.isMaybeVoid();
5445}
5446
5448{
5449 return m_memSpec.isMaybeDefault();
5450}
5451
5453{
5454 return m_memSpec.isMaybeAmbiguous();
5455}
5456
5458{
5459 return m_memSpec.isPublished();
5460}
5461
5462
5464{
5465 return m_implOnly;
5466}
5467
5469{
5470 return m_explExt;
5471}
5472
5474{
5475 return m_tspec;
5476}
5477
5479{
5480 return isFunction() ||
5481 isSlot() ||
5482 isSignal() ||
5483 isConstructor() ||
5484 isDestructor() ||
5485 isObjCMethod() ||
5486 isFriend();
5487}
5488
5490{
5491 return m_relatedAlso;
5492}
5493
5495{
5496 return m_docEnumValues;
5497}
5498
5500{
5501 return m_annEnumType;
5502}
5503
5505{
5506 return m_docsForDefinition;
5507}
5508
5510{
5511 return m_enumScope;
5512}
5513
5515{
5516 return m_livesInsideEnum;
5517}
5518
5520{
5521 return m_memSpec.isLocal();
5522}
5523
5525{
5526 return m_memSpec.isNoDiscard();
5527}
5528
5530{
5531 return m_memSpec.isConstExpr();
5532}
5533
5535{
5536 return m_memSpec.isConstEval();
5537}
5538
5540{
5541 return m_memSpec.isConstInit();
5542}
5543
5545{
5546 return m_enumFields;
5547}
5548
5550{
5551 return m_examples;
5552}
5553
5555{
5556 return m_proto;
5557}
5558
5560{
5561 return m_defArgList;
5562}
5563
5565{
5566 return m_declArgList;
5567}
5568
5570{
5571 ArgumentList &decAl = m_declArgList;
5572 ArgumentList &defAl = m_defArgList;
5573 const ArgumentList &decAlSrc = md->declArgumentList();
5574 const ArgumentList &defAlSrc = md->argumentList();
5575 auto decSrc = decAlSrc.begin(), defSrc = defAlSrc.begin();
5576 for (auto decIt = decAl.begin(), defIt = defAl.begin();
5577 decIt != decAl.end() && defIt != defAl.end() && decSrc != decAlSrc.end() && defSrc != defAlSrc.end();
5578 ++decIt, ++defIt, ++decSrc, ++defSrc++)
5579 {
5580 Argument &decA = *decIt;
5581 Argument &defA = *defIt;
5582 const Argument &decAS = *decSrc;
5583 const Argument &defAS = *defSrc;
5584 if (decA.name.isEmpty())
5585 {
5586 if (!defA.name.isEmpty())
5587 {
5588 decA.name = defA.name;
5589 }
5590 else if (!decAS.name.isEmpty())
5591 {
5592 decA.name = decAS.name;
5593 }
5594 else if (!defAS.name.isEmpty())
5595 {
5596 decA.name = defAS.name;
5597 }
5598 }
5599 if (defA.name.isEmpty())
5600 {
5601 if (!decA.name.isEmpty())
5602 {
5603 defA.name = decA.name;
5604 }
5605 else if (!decAS.name.isEmpty())
5606 {
5607 defA.name = decAS.name;
5608 }
5609 else if (!defAS.name.isEmpty())
5610 {
5611 defA.name = defAS.name;
5612 }
5613 }
5614 }
5615}
5616
5618{
5619 return m_tArgList;
5620}
5621
5626
5628{
5629 return m_grpId;
5630}
5631
5636
5638{
5639 return m_annScope;
5640}
5641
5643{
5644 return m_hasCallGraph;
5645}
5646
5648{
5649 bool enabled = m_hasCallGraph &&
5650 (isFunction() || isSlot() || isSignal()) &&
5651 Config_getBool(HAVE_DOT);
5652 if (enabled)
5653 {
5654 bool trivial = DotCallGraph::isTrivial(this,FALSE);
5655 return !trivial;
5656 }
5657 return FALSE;
5658}
5659
5661{
5662 return m_hasCallerGraph;
5663}
5664
5666{
5667 bool enabled = m_hasCallerGraph &&
5668 (isFunction() || isSlot() || isSignal()) &&
5669 Config_getBool(HAVE_DOT);
5670 if (enabled)
5671 {
5672 bool trivial = DotCallGraph::isTrivial(this,TRUE);
5673 return !trivial;
5674 }
5675 return FALSE;
5676}
5677
5682
5687
5689{
5690 return m_hasInlineSource;
5691}
5692
5694{
5695 return m_hasEnumValues;
5696}
5697
5699{
5700 return m_templateMaster;
5701}
5702
5703std::optional<ArgumentList> MemberDefImpl::formalTemplateArguments() const
5704{
5706}
5707
5709{
5710 return m_isTypedefValCached;
5711}
5712
5717
5722
5724{
5725 //printf("MemberDefImpl::getCachedResolvedTypedef()=%s\n",qPrint(m_cachedResolvedType));
5726 return m_cachedResolvedType;
5727}
5728
5730{
5731 return m_memDef;
5732}
5733
5735{
5736 return m_memDec;
5737}
5738
5740{
5741 return m_docProvider;
5742}
5743
5745{
5746 return m_groupAlias;
5747}
5748
5753
5755{
5756 return m_declLine;
5757}
5758
5760{
5761 return m_declColumn;
5762}
5763
5764
5765//----------------------------------------------
5766
5772
5774{
5775 m_def=d;
5776}
5777
5785
5787{
5788 m_moduleDef=mod;
5789}
5790
5796
5801
5806
5811
5816
5818{
5819 for (const auto &sx : qualifiers)
5820 {
5821 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5822 if (!alreadyAdded)
5823 {
5824 m_qualifiers.push_back(sx);
5825 }
5826 }
5827}
5828
5833
5835{
5836 if (lines!=-1)
5837 {
5838 m_userInitLines=lines;
5839 }
5840}
5841
5843{
5844 m_read=r;
5845}
5846
5848{
5849 m_write=w;
5850}
5851
5853{
5854 m_tspec=b;
5855}
5856
5862
5868
5870{
5871 m_docProvider = md;
5872}
5873
5875{
5876 m_args = as;
5877}
5878
5883
5890
5892{
5893 m_docEnumValues=value;
5894}
5895
5897{
5898 m_annEnumType = md;
5899}
5900
5901void MemberDefImpl::setPrototype(bool p,const QCString &df,int line,int column)
5902{
5903 m_proto=p;
5904 if (p)
5905 {
5906 setDeclFile(df,line,column);
5907 }
5908 else
5909 {
5910 setDefFile(df,line,column);
5911 }
5912}
5913
5914void MemberDefImpl::setExplicitExternal(bool b,const QCString &df,int line,int column)
5915{
5916 m_explExt=b;
5917 if (b)
5918 {
5919 setDeclFile(df,line,column);
5920 }
5921 else
5922 {
5923 setDefFile(df,line,column);
5924 }
5925}
5926
5927void MemberDefImpl::setDeclFile(const QCString &df,int line,int column)
5928{
5929 m_declFileName = df;
5930 m_declLine = line;
5931 m_declColumn = column;
5932}
5933
5935{
5936 m_grpId=id;
5937}
5938
5943
5945{
5946 m_annScope=b;
5947}
5948
5953
5958
5964
5969
5974
5976{
5977 m_groupAlias = md;
5978}
5979
5984
5989
5994
5996{
5997 return m_category;
5998}
5999
6001{
6002 m_category = def;
6003}
6004
6006{
6007 return m_categoryRelation;
6008}
6009
6014
6016{
6017 m_enumBaseType = type;
6018}
6019
6021{
6022 return m_enumBaseType;
6023}
6024
6026{
6027 m_requiresClause = req;
6028}
6029
6034
6035void MemberDefImpl::cacheTypedefVal(const ClassDef*val, const QCString & templSpec, const QCString &resolvedType)
6036{
6039 m_cachedTypedefTemplSpec=templSpec;
6040 m_cachedResolvedType=resolvedType;
6041 //printf("MemberDefImpl::cacheTypedefVal=%s m_impl=%p\n",qPrint(m_cachedResolvedType),m_impl);
6042}
6043
6045{
6046 {
6047 const ArgumentList &srcAl = bmd->argumentList();
6048 ArgumentList &dstAl = m_defArgList;
6049 auto srcIt = srcAl.begin();
6050 auto dstIt = dstAl.begin();
6051 while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
6052 {
6053 Argument &argDst = *dstIt;
6054 const Argument &argSrc = *srcIt;
6055 argDst.name = argSrc.name;
6056 argDst.docs = argSrc.docs;
6057 ++srcIt;
6058 ++dstIt;
6059 }
6060 }
6061
6062 {
6063 const ArgumentList &srcAl = bmd->declArgumentList();
6064 ArgumentList &dstAl = m_declArgList;
6065 auto srcIt = srcAl.begin();
6066 auto dstIt = dstAl.begin();
6067
6068 while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
6069 {
6070 Argument &argDst = *dstIt;
6071 const Argument &argSrc = *srcIt;
6072 argDst.name = argSrc.name;
6073 argDst.docs = argSrc.docs;
6074 ++srcIt;
6075 ++dstIt;
6076 }
6077 }
6078}
6079
6081{
6082 for (Argument &a : al)
6083 {
6084 a.canType.clear();
6085 }
6086}
6087
6093
6098
6100{
6101 return m_numberOfFlowKW;
6102}
6103
6104//----------------
6105
6107{
6108 return DefinitionMixin::name();
6109}
6110
6111//----------------
6112
6114{
6115 for (auto decIt = decAl.begin(), defIt = defAl.begin();
6116 decIt!= decAl.end() && defIt!= defAl.end();
6117 ++decIt, ++defIt)
6118 {
6119 Argument &decA = *decIt;
6120 Argument &defA = *defIt;
6121 if (decA.docs.isEmpty() && !defA.docs.isEmpty())
6122 {
6123 decA.docs = defA.docs;
6124 }
6125 else if (defA.docs.isEmpty() && !decA.docs.isEmpty())
6126 {
6127 defA.docs = decA.docs;
6128 }
6129 if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
6130 {
6131 if (decA.name.isEmpty() && !defA.name.isEmpty())
6132 {
6133 decA.name = defA.name;
6134 }
6135 else if (defA.name.isEmpty() && !decA.name.isEmpty())
6136 {
6137 defA.name = decA.name;
6138 }
6139 }
6140 }
6141}
6142
6144{
6145 AUTO_TRACE("mdec='{}' mdef='{}' mdec.isPrototype={} mdef.isPrototype={}",
6146 mdec->name(), mdef->name(), mdec->isPrototype(), mdef->isPrototype());
6147 if (
6148 (mdef->isFunction() && !mdef->isStatic() && !mdef->isPrototype()) ||
6149 (mdef->isVariable() && !mdef->isExternal() && !mdef->isStatic())
6150 )
6151 {
6152 bool sameNumTemplateArgs = mdef->templateArguments().size()==mdec->templateArguments().size();
6153
6154 ArgumentList &mdefAl = const_cast<ArgumentList&>(mdef->argumentList());
6155 ArgumentList &mdecAl = const_cast<ArgumentList&>(mdec->argumentList());
6156 if (sameNumTemplateArgs &&
6157 matchArguments2(mdef->getOuterScope(),mdef->getFileDef(),&mdefAl,
6158 mdec->getOuterScope(),mdec->getFileDef(),&mdecAl,
6159 TRUE,mdef->getLanguage()
6160 )
6161 ) /* match found */
6162 {
6163 AUTO_TRACE_ADD("combining definition and declaration");
6164
6165 if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
6166 {
6167 mdec->resolveUnnamedParameters(mdef);
6168 }
6169
6170 // first merge argument documentation
6171 transferArgumentDocumentation(mdecAl,mdefAl);
6172
6173 /* copy documentation between function definition and declaration */
6174 if (!mdec->briefDescription().isEmpty())
6175 {
6176 mdef->setBriefDescription(mdec->briefDescription(),mdec->briefFile(),mdec->briefLine());
6177 }
6178 else if (!mdef->briefDescription().isEmpty())
6179 {
6180 mdec->setBriefDescription(mdef->briefDescription(),mdef->briefFile(),mdef->briefLine());
6181 }
6182 if (!mdef->documentation().isEmpty())
6183 {
6184 //printf("transferring docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
6185 mdec->setDocumentation(mdef->documentation(),mdef->docFile(),mdef->docLine());
6187 if (mdefAl.hasParameters())
6188 {
6189 auto mdefAlComb = stringToArgumentList(mdef->getLanguage(),mdef->argsString());
6190 transferArgumentDocumentation(mdefAl,*mdefAlComb);
6191 mdec->moveArgumentList(std::move(mdefAlComb));
6192 }
6193 }
6194 else if (!mdec->documentation().isEmpty())
6195 {
6196 //printf("transferring docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
6197 mdef->setDocumentation(mdec->documentation(),mdec->docFile(),mdec->docLine());
6199 if (mdecAl.hasParameters())
6200 {
6201 auto mdecAlComb = stringToArgumentList(mdec->getLanguage(),mdec->argsString());
6202 transferArgumentDocumentation(mdecAl,*mdecAlComb);
6203 mdef->moveDeclArgumentList(std::move(mdecAlComb));
6204 }
6205 }
6206 if (!mdef->inbodyDocumentation().isEmpty())
6207 {
6208 mdec->setInbodyDocumentation(mdef->inbodyDocumentation(),mdef->inbodyFile(),mdef->inbodyLine());
6209 }
6210 else if (!mdec->inbodyDocumentation().isEmpty())
6211 {
6212 mdef->setInbodyDocumentation(mdec->inbodyDocumentation(),mdec->inbodyFile(),mdec->inbodyLine());
6213 }
6214 if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
6215 {
6216 //printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
6217 mdef->setBodySegment(mdec->getDefLine(),mdec->getStartBodyLine(),mdec->getEndBodyLine());
6218 mdef->setBodyDef(mdec->getBodyDef());
6219 //mdef->setBodyMember(mdec);
6220 }
6221 else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
6222 {
6223 //printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
6224 mdec->setBodySegment(mdef->getDefLine(),mdef->getStartBodyLine(),mdef->getEndBodyLine());
6225 mdec->setBodyDef(mdef->getBodyDef());
6226 //mdec->setBodyMember(mdef);
6227 }
6230
6231 // copy group info.
6232 if (mdec->getGroupDef()==nullptr && mdef->getGroupDef()!=nullptr)
6233 {
6234 mdec->setGroupDef(mdef->getGroupDef(),
6235 mdef->getGroupPri(),
6236 mdef->docFile(),
6237 mdef->docLine(),
6238 mdef->hasDocumentation(),
6239 mdef
6240 );
6241 }
6242 else if (mdef->getGroupDef()==nullptr && mdec->getGroupDef()!=nullptr)
6243 {
6244 mdef->setGroupDef(mdec->getGroupDef(),
6245 mdec->getGroupPri(),
6246 mdec->docFile(),
6247 mdec->docLine(),
6248 mdec->hasDocumentation(),
6249 mdec
6250 );
6251 }
6252
6253
6254 mdec->mergeRefItems(mdef);
6255 mdef->mergeRefItems(mdec);
6256
6257 mdef->setMemberDeclaration(mdec);
6258 mdec->setMemberDefinition(mdef);
6259
6260 mergeMemberOverrideOptions(mdec,mdef);
6261
6262 mdef->addQualifiers(mdec->getQualifiers());
6263 mdec->addQualifiers(mdef->getQualifiers());
6264 }
6265 }
6266}
6267
6269{
6270 if (m_templateMaster)
6271 {
6272 return m_templateMaster->briefDescription(abbr);
6273 }
6274 else
6275 {
6277 }
6278}
6279
6281{
6282 if (m_templateMaster)
6283 {
6284 return m_templateMaster->documentation();
6285 }
6286 else
6287 {
6289 }
6290}
6291
6293{
6294 if (m_templateMaster)
6295 {
6296 return m_templateMaster->hasUserDocumentation();
6297 }
6298 else
6299 {
6301 }
6302}
6303
6305{
6306 return m_typeConstraints;
6307}
6308
6310{
6311 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
6312 bool isFriendToHide = hideFriendCompounds &&
6313 (m_type=="friend class" ||
6314 m_type=="friend struct" ||
6315 m_type=="friend union");
6316 return isFriendToHide;
6317}
6318
6320{
6321 return (isFriend() &&
6322 (m_type=="friend class" || m_type=="friend struct" ||
6323 m_type=="friend union"));
6324}
6325
6326
6328{
6329 return !(isFriend() && isFriendToHide());
6330}
6331
6333{
6334 return isFunction() || isSlot() || isSignal();
6335}
6336
6338{
6339 return isRelated() || isForeign() || (isFriend() && !isFriendToHide());
6340}
6341
6343{
6345 (m_templateMaster && m_templateMaster->isReference());
6346}
6347
6371
6372//-------------------------------------------------------------------------------
6373// Helpers
6374
6376
6378{
6379 MemberDefMutable *src = toMemberDefMutable(const_cast<MemberDef*>(s));
6380 MemberDefMutable *dst = toMemberDefMutable(const_cast<MemberDef*>(d));
6381 if (src==nullptr || dst==nullptr) return;
6382 //printf("--> addDocCrossReference src=%s,dst=%s\n",qPrint(src->name()),qPrint(dst->name()));
6383 if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
6384 if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
6385 src->isCallable()
6386 )
6387 {
6388 QCString sourceRefName = src->sourceRefName();
6391
6392 // ---- critical section
6393 std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
6394 dst->addSourceReferencedBy(src,sourceRefName);
6395 if (mdDef)
6396 {
6397 mdDef->addSourceReferencedBy(src,sourceRefName);
6398 }
6399 if (mdDecl)
6400 {
6401 mdDecl->addSourceReferencedBy(src,sourceRefName);
6402 }
6403 // ---- end critical section
6404 }
6405 if ((src->hasReferencesRelation() || src->hasCallGraph()) &&
6406 src->isCallable()
6407 )
6408 {
6409 QCString sourceRefName = dst->sourceRefName();
6412
6413 // ---- critical section
6414 std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
6415 src->addSourceReferences(dst,sourceRefName);
6416 if (mdDef)
6417 {
6418 mdDef->addSourceReferences(dst,sourceRefName);
6419 }
6420 if (mdDecl)
6421 {
6422 mdDecl->addSourceReferences(dst,sourceRefName);
6423 }
6424 // ---- end critical section
6425 }
6426}
6427
6428// --- Cast functions
6429//
6431{
6432 if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6433 {
6434 return static_cast<MemberDef*>(d);
6435 }
6436 else
6437 {
6438 return nullptr;
6439 }
6440}
6441
6443{
6444 Definition *d = toDefinition(md);
6445 if (d && typeid(*d)==typeid(MemberDefImpl))
6446 {
6447 return static_cast<MemberDef*>(d);
6448 }
6449 else
6450 {
6451 return nullptr;
6452 }
6453}
6454
6456{
6457 if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6458 {
6459 return static_cast<const MemberDef*>(d);
6460 }
6461 else
6462 {
6463 return nullptr;
6464 }
6465}
6466
6468{
6469 if (d && typeid(*d)==typeid(MemberDefImpl))
6470 {
6471 return static_cast<MemberDefMutable*>(d);
6472 }
6473 else
6474 {
6475 return nullptr;
6476 }
6477}
6478
constexpr auto prefix
Definition anchor.cpp:44
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:138
This class represents an function or template argument list.
Definition arguments.h:60
RefQualifierType refQualifier() const
Definition arguments.h:109
iterator end()
Definition arguments.h:87
bool hasParameters() const
Definition arguments.h:69
QCString trailingReturnType() const
Definition arguments.h:107
size_t size() const
Definition arguments.h:93
bool constSpecifier() const
Definition arguments.h:104
bool empty() const
Definition arguments.h:92
iterator begin()
Definition arguments.h:86
bool volatileSpecifier() const
Definition arguments.h:105
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual QCString compoundTypeString() const =0
Returns the type of compound as a string.
virtual int isBaseClass(const ClassDef *bcd, bool followInstances, const QCString &templSpec=QCString()) const =0
Returns TRUE iff bcd is a direct or indirect base class of this class.
virtual ArgumentLists getTemplateParameterLists() const =0
Returns the template parameter lists that form the template declaration of this class.
virtual bool isObjectiveC() const =0
Returns TRUE if this class is implemented in Objective-C.
virtual bool isSimple() const =0
virtual ClassDef * categoryOf() const =0
Returns the class of which this is a category (Objective-C only)
virtual void writeDeclaration(OutputList &ol, const MemberDef *md, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const =0
@ Interface
Definition classdef.h:112
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
const Definition * getAlias() const
const Definition * getScope() const
DefinitionAliasMixin(const Definition *scope, const Definition *alias)
The common base class of all entity definitions found in the sources.
Definition definition.h:76
virtual QCString docFile() const =0
virtual const QCString & localName() const =0
virtual int getEndBodyLine() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual QCString getDefFileName() const =0
virtual bool isLinkable() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual int inbodyLine() const =0
virtual const FileDef * getBodyDef() const =0
virtual int briefLine() const =0
virtual bool hasDocumentation() const =0
virtual bool isLinkableInProject() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual bool hasUserDocumentation() const =0
virtual bool isAnonymous() const =0
virtual QCString getReference() const =0
virtual QCString documentation() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual QCString briefFile() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual int getStartBodyLine() const =0
virtual bool isReference() const =0
virtual QCString inbodyDocumentation() const =0
virtual QCString inbodyFile() const =0
virtual const QCString & name() const =0
bool isReference() const override
const QCString & name() const override
void writeSourceDef(OutputList &ol) const override
bool hasUserDocumentation() const override
QCString inbodyFile() const override
QCString getDefFileName() const override
void writeSourceRefs(OutputList &ol, const QCString &scopeName) const override
bool hasBriefDescription() const override
QCString docFile() const override
QCString getDefFileExtension() const override
QCString briefFile() const override
QCString qualifiedName() const override
void setOuterScope(Definition *def) override
void setDocumentation(const QCString &doc, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE) override
void setReference(const QCString &r) override
QCString getSourceFileBase() const override
const RefItemVector & xrefListItems() const override
QCString briefDescription(bool abbreviate=FALSE) const override
bool hasSourceReffedBy() const override
void setBriefDescription(const QCString &brief, const QCString &briefFile, int briefLine) override
void writeSourceReffedBy(OutputList &ol, const QCString &scopeName) const override
Definition * getOuterScope() const override
void setInbodyDocumentation(const QCString &doc, const QCString &docFile, int docLine) override
QCString getReference() const override
DefinitionMixin(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
const QCString & localName() const override
void writeInlineCode(OutputList &ol, const QCString &scopeName) const override
const FileDef * getBodyDef() const override
void setDefFile(const QCString &df, int defLine, int defColumn) override
QCString inbodyDocumentation() const override
void setHidden(bool b) override
QCString documentation() const override
void writeDocAnchorsToTagFile(TextStream &fs) const override
bool hasDocumentation() const override
SrcLangExt getLanguage() const override
virtual void setBodySegment(int defLine, int bls, int ble)=0
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
virtual void addSourceReferences(MemberDef *d, const QCString &sourceRefName)=0
virtual void setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)=0
virtual void mergeRefItems(Definition *d)=0
virtual void setBodyDef(const FileDef *fd)=0
virtual void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)=0
virtual void addSourceReferencedBy(MemberDef *d, const QCString &sourceRefName)=0
Representation of an call graph.
int numNodes() const
bool isTooBig() const
bool isTrivial() const
static bool suppressDocWarnings
Definition doxygen.h:132
static bool parseSourcesNeeded
Definition doxygen.h:123
static ParserManager * parserManager
Definition doxygen.h:131
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
A model of a file symbol.
Definition filedef.h:99
virtual const QCString & docName() const =0
A model of a group of symbols.
Definition groupdef.h:52
bool hasEnumValues() const override
bool isConstEval() const override
const ClassDef * getCachedTypedefVal() const override
NamespaceDef * getNamespaceDef() override
const NamespaceDef * getNamespaceDef() const override
bool hasExamples() const override
GroupDef * getGroupDef() override
QCString getDeclFileName() const override
QCString argsString() const override
bool isSettable() const override
bool isConstrained() const override
bool getGroupHasDocs() const override
const ClassDef * getClassDef() const override
const MemberDef * inheritsDocsFrom() const override
bool hasCallerGraph() const override
QCString enumBaseType() const override
bool isConstInit() const override
bool isFinal() const override
const MemberDef * reimplements() const override
bool isOptional() const override
QCString getOutputFileBase() const override
bool isTypeAlias() const override
bool isRequired() const override
bool isRemovable() const override
void setMemberGroup(MemberGroup *grp) override
bool isDeleted() const override
bool isPrivateGettable() const override
bool isSignal() const override
MemberDef * memberDeclaration() const override
bool isFriendClass() const override
const MemberDef * getGroupAlias() const override
bool isStrongEnumValue() const override
bool isAssign() const override
QCString getReadAccessor() const override
int getGroupStartLine() const override
std::unique_ptr< MemberDef > deepCopy() const override
bool isUNOProperty() const override
void warnIfUndocumented() const override
bool hasUserDocumentation() const override
bool isSliceLocal() const override
const ArgumentLists & definitionTemplateParameterLists() const override
bool isPublished() const override
bool isSequence() const override
bool isDictionary() const override
bool isVariable() const override
FileDef * getFileDef() override
ClassDef * getClassDefOfAnonymousType() const override
QCString getCachedResolvedTypedef() const override
const MemberDef * templateMaster() const override
void warnIfUndocumentedParams() const override
bool isExternal() const override
bool isProperty() const override
bool isWritable() const override
bool isDocumentedFriendClass() const override
bool isConstExpr() const override
int initializerLines() const override
bool isMaybeVoid() const override
int getMemberGroupId() const override
bool isInitonly() const override
const ExampleList & getExamples() const override
bool hasOneLineInitializer() const override
bool isProtectedGettable() const override
bool hasDocumentation() const override
bool livesInsideEnum() const override
QCString declaration() const override
bool hasCallGraph() const override
bool isCopy() const override
int getDeclLine() const override
bool isEnumerate() const override
void writeLink(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool onlyText=FALSE) const override
const QCString & initializer() const override
bool isReference() const override
TypeSpecifier getMemberSpecifiers() const override
QCString getReference() const override
bool hasMultiLineInitializer() const override
QCString getCachedTypedefTemplSpec() const override
bool isDocsForDefinition() const override
Grouping::GroupPri_t getGroupPri() const override
bool isTypedefValCached() const override
const ClassDef * accessorClass() const override
bool isRaisable() const override
bool isUnretained() const override
bool isGettable() const override
const MemberVector & enumFieldList() const override
bool isObjCProperty() const override
int getDeclColumn() const override
const ArgumentList & declArgumentList() const override
bool isCallable() const override
bool isDefine() const override
bool isLinkableInProject() const override
bool hasDetailedDescription() const override
bool isFriendToHide() const override
QCString excpString() const override
QCString getDeclType() const override
QCString briefDescription(bool) const override
QCString objCMethodName(bool localLink, bool showStatic) const override
const GroupDef * getGroupDef() const override
bool isDestructor() const override
bool isNoDiscard() const override
bool hasDocumentedEnumValues() const override
bool isBound() const override
void detectUndocumentedParams(bool, bool) const override
bool fromAnonymousScope() const override
bool isFunctionPtr() const override
StringVector getLabels(const Definition *container) const override
QCString memberTypeName() const override
std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const override
bool isAddable() const override
QCString getScopeString() const override
QCString getGroupFileName() const override
QCString extraTypeChars() const override
const ArgumentList & argumentList() const override
const ArgumentList & typeConstraints() const override
Specifier virtualness(int) const override
bool isFunctionOrSignalSlot() const override
bool isDefault() const override
bool isPrototype() const override
bool isAttribute() const override
MemberDef * memberDefinition() const override
bool isTypedef() const override
bool isNoExcept() const override
QCString displayDefinition() const override
bool isInline() const override
bool isRelatedOrFriend() const override
bool hasReferencesRelation() const override
bool isStrong() const override
const MemberDef * getMdAlias() const
bool isObjCMethod() const override
bool isAbstract() const override
bool isStatic() const override
bool isPrivateSettable() const override
bool isSealed() const override
bool isRelated() const override
MemberDef * getMdAlias()
bool isOverride() const override
bool isForeign() const override
bool isImplementation() const override
QCString anchor() const override
const MemberVector & reimplementedBy() const override
VhdlSpecifier getVhdlSpecifiers() const override
bool isMaybeDefault() const override
MemberType memberType() const override
bool isLinkable() const override
bool isProtectedSettable() const override
bool isReadonly() const override
const MemberDef * categoryRelation() const override
ClassDef * getClassDef() override
MemberDefAliasImpl(const Definition *newScope, const MemberDef *md)
const MemberDef * getEnumScope() const override
Protection protection() const override
bool isSlot() const override
const QCString & name() const override
bool isDelete() const override
bool isReadable() const override
bool isEvent() const override
QCString definition() const override
bool isNonAtomic() const override
QCString getWriteAccessor() const override
QCString bitfieldString() const override
DefType definitionType() const override
bool isReimplementedBy(const ClassDef *cd) const override
bool isDCOP() const override
void writeEnumDeclaration(OutputList &typeDecl, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod) const override
bool isDetailedSectionVisible(MemberListContainer container) const override
bool isNotFriend() const override
void writeDeclaration(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool inGroup, int indentLevel, const ClassDef *inheritFrom=nullptr, const QCString &inheritId=QCString()) const override
const MemberList * getSectionList(const Definition *container) const override
bool isTemplateSpecialization() const override
QCString typeString() const override
const ModuleDef * getModuleDef() const override
bool isExplicit() const override
CodeSymbolType codeSymbolType() const override
MemberDef * fromAnonymousMember() const override
bool isConstructor() const override
bool isTransient() const override
int numberOfFlowKeyWords() const override
bool isFriend() const override
bool isWeak() const override
bool isMutable() const override
QCString requiresClause() const override
MemberDef * resolveAlias() override
const FileDef * getFileDef() const override
QCString fieldType() const override
std::optional< ArgumentList > formalTemplateArguments() const override
const MemberDef * resolveAlias() const override
bool isEnumValue() const override
bool isNew() const override
const MemberDef * getAnonymousEnumType() const override
bool isMaybeAmbiguous() const override
bool hasReferencedByRelation() const override
bool isCSharpProperty() const override
bool hasInlineSource() const override
ClassDef * category() const override
void moveTo(Definition *) override
MemberGroup * getMemberGroup() const override
MemberGroup * m_memberGroup
bool isFunction() const override
QCString displayName(bool b=TRUE) const override
bool visibleInIndex() const override
QCString sourceRefName() const override
ClassDef * relatedAlso() const override
bool isRetain() const override
bool isEnumStruct() const override
QCString documentation() const override
bool isBriefSectionVisible() const override
const ArgumentList & templateArguments() const override
~MemberDefAliasImpl() override
StringVector getQualifiers() const override
QCString qualifiedName() const override
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual QCString typeString() const =0
virtual bool isConstExpr() const =0
virtual bool getGroupHasDocs() const =0
virtual const MemberDef * getAnonymousEnumType() const =0
virtual bool isConstEval() const =0
virtual bool isInitonly() const =0
virtual bool isSignal() const =0
virtual bool isNoExcept() const =0
virtual QCString requiresClause() const =0
virtual bool isDestructor() const =0
virtual bool hasDetailedDescription() const =0
virtual bool isAssign() const =0
virtual bool isExplicit() const =0
virtual MemberDef * memberDefinition() const =0
virtual bool isNew() const =0
virtual QCString declaration() const =0
virtual QCString getCachedResolvedTypedef() const =0
virtual bool isObjCMethod() const =0
virtual bool hasDocumentedEnumValues() const =0
virtual MemberDef * memberDeclaration() const =0
virtual bool isMaybeVoid() const =0
virtual bool isConstructor() const =0
virtual bool isFriend() const =0
virtual void writeEnumDeclaration(OutputList &typeDecl, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod) const =0
virtual const ClassDef * accessorClass() const =0
virtual bool isForeign() const =0
virtual bool isSealed() const =0
virtual QCString definition() const =0
virtual bool hasExamples() const =0
virtual QCString enumBaseType() const =0
virtual bool isDelete() const =0
virtual void writeDeclaration(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *md, bool inGroup, int indentLevel=0, const ClassDef *inheritFrom=nullptr, const QCString &inheritId=QCString()) const =0
virtual int numberOfFlowKeyWords() const =0
virtual const MemberDef * inheritsDocsFrom() const =0
virtual bool isDefault() const =0
virtual bool isRelated() const =0
virtual bool isDocumentedFriendClass() const =0
virtual bool isConstInit() const =0
virtual bool fromAnonymousScope() const =0
virtual bool isDeleted() const =0
virtual const ClassDef * getCachedTypedefVal() const =0
virtual bool isRelatedOrFriend() const =0
virtual QCString fieldType() const =0
virtual QCString excpString() const =0
virtual bool isSequence() const =0
virtual bool isEnumStruct() const =0
virtual const ClassDef * getClassDef() const =0
virtual bool visibleInIndex() const =0
virtual const MemberDef * getGroupAlias() const =0
virtual bool isOverride() const =0
virtual bool hasReferencesRelation() const =0
virtual const ArgumentList & templateArguments() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isSettable() const =0
virtual MemberDef * fromAnonymousMember() const =0
virtual bool isCSharpProperty() const =0
virtual bool isRetain() const =0
virtual bool isAddable() const =0
virtual bool isTypedef() const =0
virtual ClassDef * category() const =0
virtual bool isSlot() const =0
virtual const MemberVector & enumFieldList() const =0
virtual bool hasCallGraph() const =0
virtual const FileDef * getFileDef() const =0
virtual bool isInline() const =0
virtual bool isEvent() const =0
virtual const ArgumentList & argumentList() const =0
virtual QCString extraTypeChars() const =0
virtual bool isWritable() const =0
virtual bool isMaybeAmbiguous() const =0
virtual bool isPrivateGettable() const =0
virtual bool isStrongEnumValue() const =0
virtual VhdlSpecifier getVhdlSpecifiers() const =0
virtual const MemberVector & reimplementedBy() const =0
virtual int getGroupStartLine() const =0
virtual bool isFunction() const =0
virtual bool isRequired() const =0
virtual bool isAttribute() const =0
virtual bool isExternal() const =0
virtual QCString sourceRefName() const =0
virtual bool isCopy() const =0
virtual QCString displayDefinition() const =0
virtual QCString getScopeString() const =0
virtual int getMemberGroupId() const =0
virtual bool isDictionary() const =0
virtual int getDeclLine() const =0
virtual bool isTypeAlias() const =0
virtual QCString getDeclType() const =0
virtual int getDeclColumn() const =0
virtual bool isStatic() const =0
virtual const MemberDef * reimplements() const =0
virtual bool isMaybeDefault() const =0
virtual bool livesInsideEnum() const =0
virtual QCString getWriteAccessor() const =0
virtual bool hasInlineSource() const =0
virtual bool isTemplateSpecialization() const =0
virtual bool isPrivateSettable() const =0
virtual StringVector getQualifiers() const =0
virtual QCString getCachedTypedefTemplSpec() const =0
virtual QCString bitfieldString() const =0
virtual bool isRaisable() const =0
virtual bool isRemovable() const =0
virtual bool isTypedefValCached() const =0
virtual bool isConstrained() const =0
virtual bool isDocsForDefinition() const =0
virtual bool isBound() const =0
virtual bool hasEnumValues() const =0
virtual bool isFriendToHide() const =0
virtual bool isReimplementedBy(const ClassDef *cd) const =0
virtual bool isNonAtomic() const =0
virtual const ModuleDef * getModuleDef() const =0
virtual bool isDefine() const =0
virtual ClassDef * getClassDefOfAnonymousType() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual bool isPublished() const =0
virtual bool isFunctionPtr() const =0
virtual std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const =0
virtual bool hasCallerGraph() const =0
virtual Grouping::GroupPri_t getGroupPri() const =0
virtual QCString getDeclFileName() const =0
virtual const ArgumentList & typeConstraints() const =0
virtual bool isProtectedSettable() const =0
virtual bool isImplementation() const =0
virtual bool isProtectedGettable() const =0
virtual QCString objCMethodName(bool localLink, bool showStatic) const =0
virtual bool hasOneLineInitializer() const =0
virtual const MemberDef * templateMaster() const =0
virtual std::optional< ArgumentList > formalTemplateArguments() const =0
virtual bool isObjCProperty() const =0
virtual bool isTransient() const =0
virtual const MemberList * getSectionList(const Definition *container) const =0
virtual bool hasMultiLineInitializer() const =0
virtual Protection protection() const =0
virtual TypeSpecifier getMemberSpecifiers() const =0
virtual bool isOptional() const =0
virtual QCString getReadAccessor() const =0
virtual bool isEnumerate() const =0
virtual bool isGettable() const =0
virtual MemberType memberType() const =0
virtual bool hasReferencedByRelation() const =0
virtual bool isFunctionOrSignalSlot() const =0
virtual bool isReadable() const =0
virtual bool isWeak() const =0
virtual bool isNoDiscard() const =0
virtual QCString memberTypeName() const =0
virtual bool isUnretained() const =0
virtual QCString getGroupFileName() const =0
virtual void writeLink(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *md, bool onlyText=FALSE) const =0
virtual ClassDef * relatedAlso() const =0
virtual bool isBriefSectionVisible() const =0
virtual const ArgumentLists & definitionTemplateParameterLists() const =0
virtual StringVector getLabels(const Definition *container) const =0
virtual bool isVariable() const =0
virtual bool isNotFriend() const =0
virtual bool isDCOP() const =0
virtual bool isStrong() const =0
virtual QCString argsString() const =0
virtual bool isSliceLocal() const =0
virtual Specifier virtualness(int count=0) const =0
virtual bool isUNOProperty() const =0
virtual const MemberDef * categoryRelation() const =0
virtual int initializerLines() const =0
virtual bool isFinal() const =0
virtual const ArgumentList & declArgumentList() const =0
virtual const ExampleList & getExamples() const =0
virtual bool isAbstract() const =0
virtual bool isMutable() const =0
virtual bool isFriendClass() const =0
virtual bool isCallable() const =0
virtual bool isDetailedSectionVisible(MemberListContainer container) const =0
virtual const MemberDef * getEnumScope() const =0
virtual bool isEnumValue() const =0
virtual bool isPrototype() const =0
virtual bool isProperty() const =0
virtual const QCString & initializer() const =0
bool _hasVisibleCallerGraph() const
void writeDocumentation(const MemberList *ml, int memCount, int memTotal, OutputList &ol, const QCString &scopeName, const Definition *container, bool inGroup, bool showEnumValues=FALSE, bool showInline=FALSE) const override
void _writeCallerGraph(OutputList &ol) const
void insertReimplementedBy(MemberDef *md) override
bool isDCOP() const override
QCString sourceRefName() const override
VhdlSpecifier m_vhdlSpec
bool isDetailedSectionVisible(MemberListContainer container) const override
bool _isReimplements() const
bool isFunction() const override
int getDeclColumn() const override
void overrideReferencesRelation(bool e) override
const MemberDef * reimplements() const override
MemberType m_mtype
int getMemberGroupId() const override
bool isProperty() const override
bool visibleInIndex() const override
const ArgumentList & argumentList() const override
void setDocumentedEnumValues(bool value) override
bool m_detailedDescriptionCachedValue
bool isTypedefValCached() const override
bool isInline() const override
const ExampleList & getExamples() const override
ArgumentLists m_defTmpArgLists
bool isFriendToHide() const override
void setFromAnonymousScope(bool b) override
bool fromAnonymousScope() const override
void invalidateTypedefValCache() override
ClassDef * accessorClass() const override
bool isFriendClass() const override
void setNamespace(NamespaceDef *nd) override
void setProtection(Protection p) override
const NamespaceDef * getNamespaceDef() const override
void setHidden(bool b) override
void _writeEnumValues(OutputList &ol, const Definition *container, const QCString &cfname, const QCString &ciname, const QCString &cname) const
void _writeTypeConstraints(OutputList &ol) const
bool isSliceLocal() const override
QCString m_args
void makeRelated() override
int getGroupStartLine() const override
void warnIfUndocumented() const override
bool m_hasReferencedByRelation
void setDefinition(const QCString &d) override
QCString objCMethodName(bool localLink, bool showStatic) const override
void setMemberType(MemberType t) override
QCString getWriteAccessor() const override
const ArgumentList & typeConstraints() const override
DefType definitionType() const override
Definition memberdef.cpp:64
void setEnumBaseType(const QCString &type) override
bool isDestructor() const override
StringVector getQualifiers() const override
QCString qualifiedName() const override
Specifier m_virt
void setAnonymousEnumType(const MemberDef *md) override
bool isOptional() const override
void _writeExamples(OutputList &ol) const
void moveTo(Definition *) override
bool isCallable() const override
QCString getCachedResolvedTypedef() const override
QCString anchor() const override
bool isBriefSectionVisible() const override
QCString m_anc
const MemberDef * m_categoryRelation
void init(Definition *def, const QCString &t, const QCString &a, const QCString &e, Protection p, Specifier v, bool s, Relationship r, MemberType mt, const ArgumentList &tal, const ArgumentList &al, const QCString &meta)
bool addExample(const QCString &anchor, const QCString &name, const QCString &file) override
void setCategoryRelation(const MemberDef *) override
bool isReference() const override
QCString extraTypeChars() const override
Protection m_prot
QCString getDeclType() const override
void warnIfUndocumentedParams() const override
VhdlSpecifier getVhdlSpecifiers() const override
bool _hasVisibleCallGraph() const
void setFormalTemplateArguments(const ArgumentList &al) override
ClassDef * m_category
bool isDefine() const override
void findSectionsInDocumentation() override
ClassDef * getClassDefOfAnonymousType() const override
QCString briefDescription(bool abbr=FALSE) const override
void setFileDef(FileDef *fd) override
const MemberDef * resolveAlias() const override
Definition memberdef.cpp:66
ArgumentList m_declArgList
std::unique_ptr< MemberDef > deepCopy() const override
void makeForeign() override
MemberDef * m_memDec
uint8_t m_isConstructorCached
bool hasMultiLineInitializer() const override
bool hasCallGraph() const override
QCString memberTypeName() const override
void _writeReimplementedBy(OutputList &ol) const
bool isNew() const override
void setMaxInitLines(int lines) override
void writeDeclaration(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool inGroup, int indentLevel, const ClassDef *inheritFrom=nullptr, const QCString &inheritId=QCString()) const override
bool isDocsForDefinition() const override
const QCString & initializer() const override
void setEnumClassScope(ClassDef *cd) override
bool isUnretained() const override
MemberDef * m_annMemb
bool isGettable() const override
MemberGroup * getMemberGroup() const override
bool hasUserDocumentation() const override
std::optional< ArgumentList > formalTemplateArguments() const override
std::map< const Definition *, const MemberList * > m_sectionMap
bool isEnumValue() const override
bool isObjCMethod() const override
MemberDef * memberDefinition() const override
bool m_isTypedefValCached
bool m_hasDocumentedReturnType
void setFromAnonymousMember(MemberDef *m) override
QCString m_extraTypeChars
StringVector m_qualifiers
void overrideCallGraph(bool e) override
void setInheritsDocsFrom(const MemberDef *md) override
void setAccessorType(ClassDef *cd, const QCString &t) override
void setType(const QCString &t) override
Specifier virtualness(int count=0) const override
ClassDefMutable * getClassDefMutable() override
QCString m_type
bool hasDetailedDescription() const override
void setMemberGroupId(int id) override
QCString bitfieldString() const override
bool isCSharpProperty() const override
void setSectionList(const Definition *container, const MemberList *sl) override
QCString definition() const override
bool isRaisable() const override
void setTemplateMaster(const MemberDef *mt) override
void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE) override
std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const override
const GroupDef * getGroupDef() const override
bool isRelatedOrFriend() const override
void insertEnumField(MemberDef *md) override
bool isMutable() const override
bool isPublished() const override
bool isLinkableInProject() const override
bool isProtectedSettable() const override
QCString getDeclFileName() const override
void setMemberGroup(MemberGroup *grp) override
void setMemberDeclaration(MemberDef *md) override
QCString enumBaseType() const override
bool isUNOProperty() const override
bool m_hasDocumentedParams
ModuleDef * m_moduleDef
bool m_hasReferencesRelation
void _computeIsConstructor()
QCString displayName(bool=TRUE) const override
size_t _countReimplementedBy() const
bool isRequired() const override
const MemberVector & reimplementedBy() const override
bool isStrong() const override
bool m_hasInlineSource
MemberDef * fromAnonymousMember() const override
void moveDeclArgumentList(std::unique_ptr< ArgumentList > al) override
bool isTypeAlias() const override
void setMemberClass(ClassDef *cd) override
QCString m_initializer
QCString excpString() const override
const MemberDef * templateMaster() const override
void setDocsForDefinition(bool b) override
const ClassDef * getCachedTypedefVal() const override
int initializerLines() const override
void setBitfields(const QCString &s) override
bool getGroupHasDocs() const override
const MemberDef * getEnumScope() const override
bool m_hasCallerGraph
QCString argsString() const override
bool isMaybeDefault() const override
QCString m_groupFileName
NamespaceDef * m_nspace
bool isReimplementedBy(const ClassDef *cd) const override
StringVector getLabels(const Definition *container) const override
bool isTransient() const override
ArgumentList m_defArgList
bool m_docsForDefinition
MemberDef * memberDeclaration() const override
std::optional< ArgumentList > m_formalTemplateArguments
bool isInitonly() const override
bool isAddable() const override
QCString m_read
bool isRelated() const override
void moveArgumentList(std::unique_ptr< ArgumentList > al) override
QCString m_decl
const ClassDef * m_cachedTypedefValue
MemberDef * m_redefines
QCString m_accessorType
void setCategory(ClassDef *) override
uint8_t m_isDestructorCached
MemberType memberType() const override
QCString getScopeString() const override
Protection protection() const override
bool isConstructor() const override
void setGroupAlias(const MemberDef *md) override
bool isEnumerate() const override
const ArgumentList & templateArguments() const override
bool isCopy() const override
bool isReadonly() const override
QCString declaration() const override
ClassDef * m_accessorClass
void setTagInfo(const TagInfo *i) override
const ArgumentLists & definitionTemplateParameterLists() const override
void _writeTemplatePrefix(OutputList &ol, const Definition *def, const ArgumentList &al, bool writeReqClause=true) const
bool isStatic() const override
void writeTagFile(TextStream &, bool useQualifiedName, bool showNamespaceMembers) const override
ClassDef * m_classDef
MemberDef * resolveAlias() override
Definition memberdef.cpp:65
bool isFinal() const override
QCString m_requiresClause
bool isAttribute() const override
const MemberDef * m_enumScope
bool isDictionary() const override
bool isSlot() const override
bool hasInlineSource() const override
void addListReference(Definition *d) override
void setAnchor() override
Relationship m_related
QCString m_bitfields
MemberGroup * m_memberGroup
const MemberDef * m_groupAlias
bool isRetain() const override
MemberVector m_redefinedBy
ClassDef * category() const override
void overrideEnumValues(bool e) override
bool isDocumentedFriendClass() const override
bool isConstEval() const override
bool hasReferencesRelation() const override
void _writeTagData(const DefType) const
void overrideReferencedByRelation(bool e) override
bool isEnumStruct() const override
bool hasEnumValues() const override
void setInbodyDocumentation(const QCString &d, const QCString &inbodyFile, int inbodyLine) override
bool isExplicit() const override
void _writeCategoryRelation(OutputList &ol) const
void setTemplateSpecialization(bool b) override
bool isTemplateSpecialization() const override
void setInitializer(const QCString &i) override
QCString fieldType() const override
const MemberDef * inheritsDocsFrom() const override
int getDeclLine() const override
void setTypeConstraints(const ArgumentList &al) override
void setVhdlSpecifiers(VhdlSpecifier s) override
bool isImplementation() const override
void _writeMultiLineInitializer(OutputList &ol, const QCString &scopeName) const
bool livesInsideEnum() const override
bool isDelete() const override
void setEnumScope(MemberDef *md, bool livesInsideEnum=FALSE) override
QCString getCachedTypedefTemplSpec() const override
void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr) override
bool isNoExcept() const override
QCString getOutputFileBase() const override
bool isWeak() const override
const MemberDef * getAnonymousEnumType() const override
const ModuleDef * getModuleDef() const override
void setRequiresClause(const QCString &req) override
bool isNoDiscard() const override
void setPrototype(bool p, const QCString &df, int line, int column) override
GroupDef * m_group
void incrementFlowKeyWordCount() override
const MemberDef * getGroupAlias() const override
bool isConstInit() const override
void setModuleDef(ModuleDef *mod) override
QCString m_metaData
TypeSpecifier m_memSpec
TypeSpecifier getMemberSpecifiers() const override
bool hasReferencedByRelation() const override
void setDeclFile(const QCString &df, int line, int column) override
void makeImplementationDetail() override
Grouping::GroupPri_t getGroupPri() const override
bool isLinkable() const override
bool hasDocumentation() const override
int numberOfFlowKeyWords() const override
bool isProtectedGettable() const override
bool m_hasDetailedDescriptionCached
void setDefinitionTemplateParameterLists(const ArgumentLists &lists) override
ExampleList m_examples
const ArgumentList & declArgumentList() const override
void invalidateCachedArgumentTypes() override
bool _isAnonymousBitField() const
QCString m_cachedTypedefTemplSpec
void detectUndocumentedParams(bool hasParamCommand, bool hasReturnCommand) const override
ClassDef * m_relatedAlso
const MemberDef * m_annEnumType
bool isWritable() const override
const MemberDef * m_templateMaster
bool isSealed() const override
void setWriteAccessor(const QCString &w) override
bool isAbstract() const override
bool isPrivateSettable() const override
void setArgsString(const QCString &as) override
QCString getReference() const override
bool isSequence() const override
void _computeLinkableInProject()
MemberDefImpl(const QCString &defFileName, int defLine, int defColumn, const QCString &type, const QCString &name, const QCString &args, const QCString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const QCString &metaData)
QCString m_enumBaseType
Grouping::GroupPri_t m_grouppri
void setRelatedAlso(ClassDef *cd) override
bool hasExamples() const override
void resolveUnnamedParameters(const MemberDef *md) override
void setMemberDefinition(MemberDef *md) override
void writeMemberDocSimple(OutputList &ol, const Definition *container) const override
void cacheTypedefVal(const ClassDef *val, const QCString &templSpec, const QCString &resolvedType) override
QCString documentation() const override
bool isSignal() const override
bool isMaybeVoid() const override
void _writeReimplements(OutputList &ol) const
bool isMaybeAmbiguous() const override
bool hasOneLineInitializer() const override
const MemberList * getSectionList(const Definition *) const override
void setReadAccessor(const QCString &r) override
bool isForeign() const override
void addQualifiers(const StringVector &qualifiers) override
QCString typeString() const override
bool isAssign() const override
bool isStrongEnumValue() const override
void _computeIsDestructor()
bool isNotFriend() const override
void copyArgumentNames(const MemberDef *bmd) override
bool isRemovable() const override
bool isDeleted() const override
MemberDef * m_memDef
MemberDef * m_groupMember
bool isFriend() const override
bool m_livesInsideEnum
ArgumentList m_typeConstraints
ClassDef * relatedAlso() const override
void setReimplements(MemberDef *md) override
MemberVector m_enumFields
void writeEnumDeclaration(OutputList &typeDecl, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod) const override
bool isConstExpr() const override
QCString getGroupFileName() const override
bool isExternal() const override
const FileDef * getFileDef() const override
bool isNonAtomic() const override
const MemberDef * categoryRelation() const override
const MemberVector & enumFieldList() const override
const ClassDef * getClassDef() const override
QCString m_def
bool isFunctionOrSignalSlot() const override
void overrideInlineSource(bool e) override
void overrideCallerGraph(bool e) override
bool isPrivateGettable() const override
void setExplicitExternal(bool b, const QCString &df, int line, int column) override
bool isEvent() const override
ClassDef * m_cachedAnonymousType
void setMemberSpecifiers(TypeSpecifier s) override
bool isFunctionPtr() const override
QCString m_cachedResolvedType
bool hasCallerGraph() const override
bool isObjCProperty() const override
bool isPrototype() const override
bool isTypedef() const override
QCString m_write
void _writeGroupInclude(OutputList &ol, bool inGroup) const
FileDef * m_fileDef
bool hasDocumentedEnumValues() const override
~MemberDefImpl() override=default
uint8_t m_isLinkableCached
QCString m_declFileName
QCString m_exception
bool isVariable() const override
void mergeMemberSpecifiers(TypeSpecifier s) override
ArgumentList m_tArgList
QCString requiresClause() const override
bool isConstrained() const override
bool isReadable() const override
QCString getReadAccessor() const override
void writeLink(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool onlyText=FALSE) const override
QCString m_explicitOutputFileBase
void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine) override
bool isDefault() const override
void _writeCallGraph(OutputList &ol) const
bool isOverride() const override
const MemberDef * m_docProvider
bool isSettable() const override
bool isBound() const override
CodeSymbolType codeSymbolType() const override
QCString displayDefinition() const override
virtual void setMemberDeclaration(MemberDef *md)=0
virtual void resolveUnnamedParameters(const MemberDef *md)=0
virtual void setDocsForDefinition(bool b)=0
virtual void mergeMemberSpecifiers(TypeSpecifier s)=0
virtual void addQualifiers(const StringVector &qualifiers)=0
virtual void moveDeclArgumentList(std::unique_ptr< ArgumentList > al)=0
virtual void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr)=0
virtual void setMemberDefinition(MemberDef *md)=0
virtual void moveArgumentList(std::unique_ptr< ArgumentList > al)=0
virtual void insertReimplementedBy(MemberDef *md)=0
A class representing a group of members.
Definition membergroup.h:43
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:109
A vector of MemberDef object.
Definition memberlist.h:35
iterator end() noexcept
Definition memberlist.h:56
iterator begin() noexcept
Definition memberlist.h:54
An abstract interface of a namespace symbol.
virtual QCString compoundTypeString() const =0
void startCodeFragment(const QCString &style)
Definition outputlist.h:278
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
bool isEnabled(OutputType o)
void endIndent()
Definition outputlist.h:585
void writeString(const QCString &text)
Definition outputlist.h:412
void startMemberDeclaration()
Definition outputlist.h:570
void startMemberDoc(const QCString &clName, const QCString &memName, const QCString &anchor, const QCString &title, int memCount, int memTotal, bool showInline)
Definition outputlist.h:532
void endDescTableRow()
Definition outputlist.h:633
void startMemberDocName(bool align)
Definition outputlist.h:679
void endParameterExtra(bool last, bool one, bool bracket)
Definition outputlist.h:693
void writeChar(char c)
Definition outputlist.h:530
void disable(OutputType o)
void endMemberTemplateParams(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:500
void endMemberDocName()
Definition outputlist.h:681
void endMemberDoc(bool hasArgs)
Definition outputlist.h:536
void startDescTableInit()
Definition outputlist.h:639
void startCallGraph()
Definition outputlist.h:655
void endDescTable()
Definition outputlist.h:629
void startParameterExtra()
Definition outputlist.h:691
const OutputCodeList & codeGenerators() const
Definition outputlist.h:357
void startParameterList(bool openBracket)
Definition outputlist.h:699
void writeLatexSpacing()
Definition outputlist.h:546
void enable(OutputType o)
void endInlineMemberType()
Definition outputlist.h:727
void endMemberDescription()
Definition outputlist.h:568
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:440
void startInlineMemberType()
Definition outputlist.h:725
void startInlineMemberDoc()
Definition outputlist.h:733
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md)
Definition outputlist.h:384
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:566
void endDescTableTitle()
Definition outputlist.h:637
void endDoxyAnchor(const QCString &fn, const QCString &anchor)
Definition outputlist.h:542
void docify(const QCString &s)
Definition outputlist.h:438
void startIndent()
Definition outputlist.h:583
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:408
void endDescForItem()
Definition outputlist.h:550
void endExamples()
Definition outputlist.h:581
void exceptionEntry(const QCString &prefix, bool closeBracket)
Definition outputlist.h:703
void endParagraph()
Definition outputlist.h:410
void endDescTableData()
Definition outputlist.h:645
void addIndexItem(const QCString &s1, const QCString &s2)
Definition outputlist.h:591
void disableAll()
void startDescTableTitle()
Definition outputlist.h:635
void startExamples()
Definition outputlist.h:579
void endInlineMemberDoc()
Definition outputlist.h:735
void endMemberDocPrefixItem()
Definition outputlist.h:677
void startParameterDefVal(const char *separator)
Definition outputlist.h:695
void startAnonTypeScope(int i1)
Definition outputlist.h:490
void endTextLink()
Definition outputlist.h:445
void startBold()
Definition outputlist.h:562
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:496
void startDescTable(const QCString &title, const bool hasInits)
Definition outputlist.h:627
void startTypewriter()
Definition outputlist.h:450
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 addLabel(const QCString &fName, const QCString &anchor)
Definition outputlist.h:544
void startDescTableData()
Definition outputlist.h:643
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:518
void startDescForItem()
Definition outputlist.h:548
void endParameterDefVal()
Definition outputlist.h:697
void startParameterType(bool first, const QCString &key)
Definition outputlist.h:683
void disableAllBut(OutputType o)
void endParameterName()
Definition outputlist.h:689
void popGeneratorState()
void endBold()
Definition outputlist.h:564
void startDoxyAnchor(const QCString &fName, const QCString &manName, const QCString &anchor, const QCString &name, const QCString &args)
Definition outputlist.h:538
void endLabels()
Definition outputlist.h:741
void endParameterList()
Definition outputlist.h:701
void endCallGraph(DotCallGraph &g)
Definition outputlist.h:657
void startInlineMemberName()
Definition outputlist.h:729
void writeLabel(const QCString &l, bool isLast)
Definition outputlist.h:739
void startLabels()
Definition outputlist.h:737
void endParameterType()
Definition outputlist.h:685
void startMemberDocPrefixItem()
Definition outputlist.h:675
void endAnonTypeScope(int i1)
Definition outputlist.h:492
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:572
void startParameterName(bool one)
Definition outputlist.h:687
void enableAll()
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:494
void endTypewriter()
Definition outputlist.h:452
void endInlineMemberName()
Definition outputlist.h:731
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:560
void parseText(const QCString &textStr)
void writeNonBreakableSpace(int num)
Definition outputlist.h:625
void endDescTableInit()
Definition outputlist.h:641
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:443
void startDescTableRow()
Definition outputlist.h:631
void startMemberTemplateParams()
Definition outputlist.h:498
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:407
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
bool startsWith(const char *s) const
Definition qcstring.h:492
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
QCString lower() const
Definition qcstring.h:234
bool endsWith(const char *s) const
Definition qcstring.h:509
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
QCString & remove(size_t index, size_t len)
Definition qcstring.h:427
const std::string & str() const
Definition qcstring.h:537
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition qcstring.cpp:185
QCString & append(char c)
Definition qcstring.h:381
QCString right(size_t len) const
Definition qcstring.h:219
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
QCString left(size_t len) const
Definition qcstring.h:214
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:198
void clear()
Definition qcstring.h:169
Implements TextGeneratorIntf for an OutputDocInterface stream.
Definition util.h:77
Text streaming class that buffers data.
Definition textstream.h:36
Wrapper class for a number of boolean properties.
Definition types.h:492
static bool writeVHDLTypeDocumentation(const MemberDef *mdef, const Definition *d, OutputList &ol)
static void writeSource(const MemberDef *mdef, OutputList &ol, const QCString &cname)
static bool isMisc(const MemberDef *mdef)
ClassDefMutable * toClassDefMutable(Definition *d)
ClassDef * getClass(const QCString &n)
ClassDef * toClassDef(Definition *d)
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:153
#define Config_getInt(name)
Definition config.h:34
#define Config_getBool(name)
Definition config.h:33
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::vector< std::string > StringVector
Definition containers.h:33
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=nullptr)
Definition defargs.l:814
Definition * toDefinition(DefinitionMutable *dm)
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:47
#define AUTO_TRACE(...)
Definition docnode.cpp:46
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
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)
static void setAnonymousEnumType()
Definition doxygen.cpp:8941
static void writeTagFile()
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1894
GroupDef * toGroupDef(Definition *d)
Translator * theTranslator
Definition language.cpp:71
static QCString simplifyTypeForTable(const QCString &s)
static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberDef *md)
static void writeExceptionListImpl(OutputList &ol, const ClassDef *cd, const MemberDef *md, QCString const &exception)
static QCString stripTrailingReturn(const QCString &trailRet)
static QCString combineArgsAndException(QCString args, QCString exception)
static bool writeDefArgumentList(OutputList &ol, const Definition *scope, const MemberDef *md)
static std::mutex g_hasDetailedDescriptionMutex
static std::mutex g_docCrossReferenceMutex
std::unique_ptr< MemberDef > createMemberDefAlias(const Definition *newScope, const MemberDef *aliasMd)
static void invalidateCachedTypesInArgumentList(ArgumentList &al)
static std::mutex g_detectUndocumentedParamsMutex
static void transferArgumentDocumentation(ArgumentList &decAl, ArgumentList &defAl)
void addDocCrossReference(const MemberDef *s, const MemberDef *d)
static std::mutex g_cachedAnonymousTypeMutex
MemberDefMutable * toMemberDefMutable(Definition *d)
void combineDeclarationAndDefinition(MemberDefMutable *mdec, MemberDefMutable *mdef)
static QCString addTemplateNames(const QCString &s, const QCString &n, const QCString &t)
MemberDef * toMemberDef(Definition *d)
static const reg::Ex reAnonymous(R"([\w:@]*@\d+)")
std::unique_ptr< MemberDef > createMemberDef(const QCString &defFileName, int defLine, int defColumn, const QCString &type, const QCString &name, const QCString &args, const QCString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const QCString &metaData)
Factory method to create a new instance of a MemberDef.
#define warn_undoc(file, line, fmt,...)
Definition message.h:102
#define warn_uncond(fmt,...)
Definition message.h:122
#define warn(file, line, fmt,...)
Definition message.h:97
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
ModuleDef * toModuleDef(Definition *d)
NamespaceDef * toNamespaceDef(Definition *d)
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:748
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
#define qsnprintf
Definition qcstring.h:49
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
uint32_t qstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
Definition qcstring.h:58
#define ASSERT(x)
Definition qcstring.h:39
std::vector< RefItem * > RefItemVector
Definition reflist.h:133
Web server based search engine.
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
This class contains the information about the argument of a function or template.
Definition arguments.h:27
QCString type
Definition arguments.h:37
QCString name
Definition arguments.h:39
QCString defval
Definition arguments.h:41
QCString docs
Definition arguments.h:42
QCString array
Definition arguments.h:40
QCString attrib
Definition arguments.h:36
Data associated with an example.
Definition example.h:29
GroupPri_t
Grouping priority.
Definition types.h:68
@ GROUPING_AUTO_DEF
membership in group was defined via @defgroup
Definition types.h:72
This struct is used to capture the tag file information for an Entry.
Definition entry.h:103
QCString anchor
Definition entry.h:106
QCString fileName
Definition entry.h:105
QCString tagName
Definition entry.h:104
CodeSymbolType
Definition types.h:319
MemberType
Definition types.h:390
@ Enumeration
Definition types.h:395
@ EnumValue
Definition types.h:396
@ Dictionary
Definition types.h:406
@ Interface
Definition types.h:403
@ 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
@ Service
Definition types.h:404
MemberListContainer
Definition types.h:310
Protection
Protection level of members.
Definition types.h:26
@ Package
Definition types.h:26
@ Public
Definition types.h:26
@ Private
Definition types.h:26
@ Protected
Definition types.h:26
SrcLangExt
Language as given by extension.
Definition types.h:42
@ CSharp
Definition types.h:46
@ Fortran
Definition types.h:53
@ Python
Definition types.h:52
@ Slice
Definition types.h:59
Relationship
Kind of member relationship.
Definition types.h:38
Specifier
Virtualness of a member.
Definition types.h:29
@ Virtual
Definition types.h:29
@ Normal
Definition types.h:29
@ Pure
Definition types.h:29
VhdlSpecifier
Definition types.h:548
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:578
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5645
bool protectionLevelVisible(Protection prot)
Definition util.cpp:6366
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
Definition util.cpp:4791
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:5851
QCString stripAnonymousNamespaceScope(const QCString &s)
Definition util.cpp:241
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1219
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:5242
void writePageRef(OutputList &ol, const QCString &cn, const QCString &mn)
Definition util.cpp:270
bool found
Definition util.cpp:984
QCString removeAnonymousScopes(const QCString &str)
Definition util.cpp:172
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:1931
QCString stripExtension(const QCString &fName)
Definition util.cpp:5361
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4352
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6326
void mergeMemberOverrideOptions(MemberDefMutable *md1, MemberDefMutable *md2)
Definition util.cpp:7285
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:1103
QCString inlineArgListToDoc(const ArgumentList &al)
Definition util.cpp:1156
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition util.cpp:904
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:1127
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5339
A bunch of utility functions.
bool isId(int c)
Definition util.h:206