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 final : 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 isThreadLocal() const override;
130 bool isGettable() const override;
131 bool isPrivateGettable() const override;
132 bool isProtectedGettable() const override;
133 bool isSettable() const override;
134 bool isPrivateSettable() const override;
135 bool isProtectedSettable() const override;
136 bool isReadable() const override;
137 bool isWritable() const override;
138 bool isAddable() const override;
139 bool isRemovable() const override;
140 bool isRaisable() const override;
141 bool isFinal() const override;
142 bool isAbstract() const override;
143 bool isOverride() const override;
144 bool isInitonly() const override;
145 bool isOptional() const override;
146 bool isRequired() const override;
147 bool isNonAtomic() const override;
148 bool isCopy() const override;
149 bool isAssign() const override;
150 bool isRetain() const override;
151 bool isWeak() const override;
152 bool isStrong() const override;
153 bool isEnumStruct() const override;
154 bool isUnretained() const override;
155 bool isNew() const override;
156 bool isSealed() const override;
157 bool isImplementation() const override;
158 bool isExternal() const override;
159 bool isTypeAlias() const override;
160 bool isDefault() const override;
161 bool isDelete() const override;
162 bool isNoExcept() const override;
163 bool isAttribute() const override;
164 bool isUNOProperty() const override;
165 bool isReadonly() const override;
166 bool isBound() const override;
167 bool isConstrained() const override;
168 bool isTransient() const override;
169 bool isMaybeVoid() const override;
170 bool isMaybeDefault() const override;
171 bool isMaybeAmbiguous() const override;
172 bool isPublished() const override;
173 bool isTemplateSpecialization() const override;
174 bool isObjCMethod() const override;
175 bool isObjCProperty() const override;
176 bool isCSharpProperty() const override;
177 bool isConstructor() const override;
178 bool isDestructor() const override;
179 bool hasOneLineInitializer() const override;
180 bool hasMultiLineInitializer() const override;
181 bool isCallable() const override;
182 bool isStrongEnumValue() const override;
183 bool livesInsideEnum() const override;
184 bool isSliceLocal() const override;
185 bool isNoDiscard() const override;
186 bool isConstExpr() const override;
187 bool isConstEval() const override;
188 bool isConstInit() const override;
189 int numberOfFlowKeyWords() const override;
190 bool isFriendToHide() const override;
191 bool isNotFriend() const override;
192 bool isFunctionOrSignalSlot() const override;
193 bool isRelatedOrFriend() const override;
194 bool isLinkableInProject() const override;
195 bool isLinkable() const override;
196 bool hasDocumentation() const override;
197 bool hasUserDocumentation() const override;
198 bool isDeleted() const override;
199 bool isBriefSectionVisible() const override;
200 bool isDetailedSectionVisible(MemberListContainer container) const override;
201 bool hasDetailedDescription() const override;
202 bool isFriendClass() const override;
203 bool isDocumentedFriendClass() const override;
204 const MemberDef *reimplements() const override;
205 const MemberVector &reimplementedBy() const override;
206 bool isReimplementedBy(const ClassDef *cd) const override;
207 ClassDef *relatedAlso() const override;
208 bool hasDocumentedEnumValues() const override;
209 const MemberDef *getAnonymousEnumType() const override;
210 bool isDocsForDefinition() const override;
211 const MemberDef *getEnumScope() const override;
212 const MemberVector &enumFieldList() const override;
213 void setEnumBaseType(const QCString &type) override;
214 QCString enumBaseType() const override;
215 bool hasExamples() const override;
216 const ExampleList &getExamples() const override;
217 bool isPrototype() const override;
218 const ArgumentList &argumentList() const override;
219 const ArgumentList &declArgumentList() const override;
220 const ArgumentList &templateArguments() const override;
221 const ArgumentLists &definitionTemplateParameterLists() const override;
222 std::optional<ArgumentList> formalTemplateArguments() const override;
223 int getMemberGroupId() const override;
224 MemberGroup *getMemberGroup() const override;
225 bool fromAnonymousScope() const override;
226 MemberDef *fromAnonymousMember() const override;
227 MemberDef *toAnonymousMember() const override;
228 bool hasCallGraph() const override;
229 bool hasCallerGraph() const override;
230 bool hasReferencesRelation() const override;
231 bool hasReferencedByRelation() const override;
232 bool hasEnumValues() const override;
233 bool hasInlineSource() const override;
234 bool isDocTransferDone() const override;
235 QCString sourceRefName() const override;
236 const MemberDef *templateMaster() const override;
237 QCString getScopeString() const override;
238 ClassDef *getClassDefOfAnonymousType() const override;
239 bool isTypedefValCached() const override;
240 const ClassDef *getCachedTypedefVal() const override;
241 QCString getCachedTypedefTemplSpec() const override;
242 QCString getCachedResolvedTypedef() const override;
243 MemberDef *memberDefinition() const override;
244 MemberDef *memberDeclaration() const override;
245 const MemberDef *inheritsDocsFrom() const override;
246 const MemberDef *getGroupAlias() const override;
247 ClassDef *category() const override;
248 const MemberDef *categoryRelation() const override;
249 QCString displayName(bool=TRUE) const override;
250 QCString getDeclType() const override;
251 StringVector getLabels(const Definition *container) const override;
252 const ArgumentList &typeConstraints() const override;
253 QCString requiresClause() const override;
254 QCString documentation() const override;
255 QCString briefDescription(bool abbr=FALSE) const override;
256 QCString fieldType() const override;
257 bool isReference() const override;
258 QCString getDeclFileName() const override;
259 int getDeclLine() const override;
260 int getDeclColumn() const override;
261 QCString anonymousMemberPrefix() const override;
262 void setMemberType(MemberType t) override;
263 void setDefinition(const QCString &d) override;
264 void setFileDef(FileDef *fd) override;
265 void setAnchor() override;
266 void setProtection(Protection p) override;
267 void setMemberSpecifiers(TypeSpecifier s) override;
268 void setVhdlSpecifiers(VhdlSpecifier s) override;
269 void mergeMemberSpecifiers(TypeSpecifier s) override;
270 void setInitializer(const QCString &i) override;
271 void setBitfields(const QCString &s) override;
272 void setMaxInitLines(int lines) override;
273 void setMemberClass(ClassDef *cd) override;
274 void setSectionList(const Definition *container,const MemberList *sl) override;
276 const QCString &fileName,int startLine,bool hasDocs,
277 MemberDef *member=nullptr) override;
278 void setReadAccessor(const QCString &r) override;
279 void setWriteAccessor(const QCString &w) override;
280 void setTemplateSpecialization(bool b) override;
281 void makeRelated() override;
282 void makeForeign() override;
283 void setInheritsDocsFrom(const MemberDef *md) override;
284 void setTagInfo(const TagInfo *i) override;
285 void setArgsString(const QCString &as) override;
286 void setReimplements(MemberDef *md) override;
287 void insertReimplementedBy(MemberDef *md) override;
288 void setRelatedAlso(ClassDef *cd) override;
289 void insertEnumField(MemberDef *md) override;
290 void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE) override;
291 void setEnumClassScope(ClassDef *cd) override;
292 void setDocumentedEnumValues(bool value) override;
293 void setAnonymousEnumType(const MemberDef *md) override;
294 bool addExample(const QCString &anchor,const QCString &name,const QCString &file) override;
295 void setPrototype(bool p,const QCString &df,int line, int column) override;
296 void setExplicitExternal(bool b,const QCString &df,int line,int column) override;
297 void setDeclFile(const QCString &df,int line,int column) override;
298 void moveArgumentList(std::unique_ptr<ArgumentList> al) override;
299 void moveDeclArgumentList(std::unique_ptr<ArgumentList> al) override;
300 void setDefinitionTemplateParameterLists(const ArgumentLists &lists) override;
301 void setTypeConstraints(const ArgumentList &al) override;
302 void setType(const QCString &t) override;
303 void setAccessorType(ClassDef *cd,const QCString &t) override;
304 void setNamespace(NamespaceDef *nd) override;
305 void setMemberGroup(MemberGroup *grp) override;
306 void setMemberGroupId(int id) override;
307 void makeImplementationDetail() override;
308 void setFromAnonymousScope(bool b) override;
309 void setFromAnonymousMember(MemberDef *m) override;
310 void setToAnonymousMember(MemberDef *m) override;
311 void overrideCallGraph(bool e) override;
312 void overrideCallerGraph(bool e) override;
313 void overrideReferencedByRelation(bool e) override;
314 void overrideReferencesRelation(bool e) override;
315 void overrideEnumValues(bool e) override;
316 void overrideInlineSource(bool e) override;
317 void setTemplateMaster(const MemberDef *mt) override;
318 void setFormalTemplateArguments(const ArgumentList &al) override;
319 void addListReference(const Definition *) override;
320 void addRequirementReferences(const Definition *) override;
321 void setDocsForDefinition(bool b) override;
322 void setGroupAlias(const MemberDef *md) override;
323 void cacheTypedefVal(const ClassDef *val,const QCString &templSpec,const QCString &resolvedType) override;
324 void invalidateTypedefValCache() override;
325 void invalidateCachedArgumentTypes() override;
326 void setMemberDefinition(MemberDef *md) override;
327 void setMemberDeclaration(MemberDef *md) override;
328 void copyArgumentNames(const MemberDef *bmd) override;
329 void setCategory(ClassDef *) override;
330 void setCategoryRelation(const MemberDef *) override;
331 void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE) override;
332 void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine) override;
333 void setInbodyDocumentation(const QCString &d,const QCString &inbodyFile,int inbodyLine) override;
334 void setHidden(bool b) override;
335 void setDocTransferDone() override;
336 void setRequiresClause(const QCString &req) override;
337 void incrementFlowKeyWordCount() override;
339 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
340 bool inGroup, int indentLevel,const ClassDef *inheritFrom=nullptr,const QCString &inheritId=QCString()) const override;
341 void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol,
342 const QCString &scopeName,const Definition *container,
343 bool inGroup,bool showEnumValues=FALSE,bool
344 showInline=FALSE) const override;
345 void writeMemberDocSimple(OutputList &ol,const Definition *container) const override;
346 void writeEnumDeclaration(OutputList &typeDecl,
347 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const override;
348 void writeTagFile(TextStream &,bool useQualifiedName,bool showNamespaceMembers) const override;
349 void warnIfUndocumented() const override;
350 void warnIfUndocumentedParams() const override;
351 bool visibleInIndex() const override;
352 void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const override;
353 std::unique_ptr<MemberDef> createTemplateInstanceMember(const ArgumentList &formalArgs,
354 const std::unique_ptr<ArgumentList> &actualArgs) const override;
355 void findSectionsInDocumentation() override;
356 void writeLink(OutputList &ol,
357 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
358 bool onlyText=FALSE) const override;
359 void resolveUnnamedParameters(const MemberDef *md) override;
360 void addQualifiers(const StringVector &qualifiers) override;
361 StringVector getQualifiers() const override;
363 void setModuleDef(ModuleDef *mod) override;
364 int redefineCount() const override;
365 void setRedefineCount(int) override;
366 void determineScopeForAnonymousMembers() override;
367 void setAnonymousMemberPrefix(const QCString &prefix) override;
368
369 private:
373 void _writeGroupInclude(OutputList &ol,bool inGroup) const;
374 void _writeMultiLineInitializer(OutputList &ol,const QCString &scopeName) const;
375 void _writeCallGraph(OutputList &ol) const;
376 void _writeCallerGraph(OutputList &ol) const;
377 void _writeReimplements(OutputList &ol) const;
378 bool _isReimplements() const;
379 void _writeReimplementedBy(OutputList &ol) const;
380 size_t _countReimplementedBy() const;
381 void _writeExamples(OutputList &ol) const;
382 void _writeTypeConstraints(OutputList &ol) const;
383 void _writeEnumValues(OutputList &ol,const Definition *container,
384 const QCString &cfname,const QCString &ciname,
385 const QCString &cname) const;
386 void _writeCategoryRelation(OutputList &ol) const;
387 void _writeTagData(const DefType) const;
388 void _writeTemplatePrefix(OutputList &ol, const Definition *def,
389 const ArgumentList &al, bool writeReqClause=true) const;
390 bool _hasVisibleCallGraph() const;
391 bool _hasVisibleCallerGraph() const;
392 bool _isAnonymousBitField() const;
393
394
395 void init(Definition *def,const QCString &t,const QCString &a,const QCString &e,
396 Protection p,Specifier v,bool s,Relationship r,
397 MemberType mt,const ArgumentList &tal,
398 const ArgumentList &al,const QCString &meta
399 );
400
401 uint8_t m_isLinkableCached; // 0 = not cached, 1=FALSE, 2=TRUE
402 uint8_t m_isConstructorCached; // 0 = not cached, 1=FALSE, 2=TRUE
403 uint8_t m_isDestructorCached; // 1 = not cached, 1=FALSE, 2=TRUE
404
405 ClassDef *m_classDef = nullptr; // member of or related to
406 FileDef *m_fileDef = nullptr; // member of file definition
407 NamespaceDef *m_nspace = nullptr; // the namespace this member is in.
409
410 const MemberDef *m_enumScope = nullptr; // the enclosing scope, if this is an enum field
411 bool m_livesInsideEnum = false;
412 const MemberDef *m_annEnumType = nullptr; // the anonymous enum that is the type of this member
413 MemberVector m_enumFields; // enumeration fields
414
415 MemberDef *m_redefines = nullptr; // the members that this member redefines
416 MemberVector m_redefinedBy; // the list of members that redefine this one
417
418 MemberDef *m_memDef = nullptr; // member definition for this declaration
419 MemberDef *m_memDec = nullptr; // member declaration for this definition
420 ClassDef *m_relatedAlso = nullptr; // points to class marked by relatedAlso
421
422 ExampleList m_examples; // a dictionary of all examples for quick access
423
424 QCString m_type; // return actual type
425 QCString m_accessorType; // return type that tell how to get to this member
426 ClassDef *m_accessorClass = nullptr; // class that this member accesses (for anonymous types)
427 QCString m_args; // function arguments/variable array specifiers
428 QCString m_def; // member definition in code (fully qualified name)
429 QCString m_anc; // HTML anchor name
430 Specifier m_virt = Specifier::Normal; // normal/virtual/pure virtual
431 Protection m_prot = Protection::Public; // protection type [Public/Protected/Private]
432 QCString m_decl; // member declaration in class
433
434 QCString m_bitfields; // struct member bitfields
435 QCString m_read; // property read accessor
436 QCString m_write; // property write accessor
437 QCString m_exception; // exceptions that can be thrown
438 QCString m_initializer; // initializer
439 QCString m_extraTypeChars; // extra type info found after the argument list
440 QCString m_enumBaseType; // base type of the enum (C++11)
441 QCString m_requiresClause; // requires clause (C++20)
442 int m_initLines = 0; // number of lines in the initializer
443 bool m_docTransferDone = false;
444
445 TypeSpecifier m_memSpec; // The specifiers present for this member
447 MemberType m_mtype = MemberType::Define; // returns the kind of member
448 int m_maxInitLines = 0; // when the initializer will be displayed
449 int m_userInitLines = 0; // result of explicit \hideinitializer or \showinitializer
452
453 ArgumentList m_defArgList; // argument list of this member definition
454 ArgumentList m_declArgList; // argument list of this member declaration
455
456 ArgumentList m_tArgList; // template argument list of function template
457 ArgumentList m_typeConstraints; // type constraints for template parameters
458 const MemberDef *m_templateMaster = nullptr;
459 std::optional<ArgumentList> m_formalTemplateArguments;
460 ArgumentLists m_defTmpArgLists; // lists of template argument lists
461 // (for template functions in nested template classes)
462
463 QCString m_metaData; // Slice metadata.
464
465 mutable ClassDef *m_cachedAnonymousType = nullptr; // if the member has an anonymous compound
466 // as its type then this is computed by
467 // getClassDefOfAnonymousType() and
468 // cached here.
469 std::map<const Definition *,const MemberList *> m_sectionMap;
470
471 const MemberDef *m_groupAlias = nullptr; // Member containing the definition
472 int m_grpId = 0; // group id
473 MemberGroup *m_memberGroup = nullptr; // group's member definition
474 GroupDef *m_group = nullptr; // group in which this member is in
476 QCString m_groupFileName; // file where this grouping was defined
477 int m_groupStartLine = 0; // line " " " " "
479
484
485 // documentation inheritance
486 const MemberDef *m_docProvider = nullptr;
487
488 // to store the output file base from tag files
490
491 // to store extra qualifiers
493
494 // objective-c
495 bool m_implOnly = false; // function found in implementation but not
496 // in the interface
497 mutable bool m_hasDocumentedParams = false; // guard to show only the first warning, acts as cache
498 mutable bool m_hasDocumentedReturnType = false; // guard to show only the first warning, acts as cache
499 bool m_isDMember = false;
500 Relationship m_related = Relationship::Member; // relationship of this to the class
501 bool m_stat = false; // is it a static function?
502 bool m_proto = false; // is it a prototype?
503 bool m_docEnumValues = false; // is an enum with documented enum values.
504
505 bool m_annScope = false; // member is part of an anonymous scope
507 mutable bool m_hasDetailedDescriptionCached = false;
509 // const member.
510 bool m_hasCallGraph = false;
511 bool m_hasCallerGraph = false;
514 bool m_hasInlineSource = false;
515 bool m_hasEnumValues = false;
516 bool m_explExt = false; // member was explicitly declared external
517 bool m_tspec = false; // member is a template specialization
518 bool m_groupHasDocs = false; // true if the entry that caused the grouping was documented
519 bool m_docsForDefinition = false; // TRUE => documentation block is put before
520 // definition.
521 // FALSE => block is put before declaration.
525 int m_declLine = -1;
526 int m_declColumn = -1;
529};
530
531std::unique_ptr<MemberDef> createMemberDef(const QCString &defFileName,int defLine,int defColumn,
532 const QCString &type,const QCString &name,const QCString &args,
533 const QCString &excp,Protection prot,Specifier virt,bool stat,
534 Relationship related,MemberType t,const ArgumentList &tal,
535 const ArgumentList &al,const QCString &metaData)
536{
537 return std::make_unique<MemberDefImpl>(defFileName,defLine,defColumn,type,name,args,excp,prot,virt,
538 stat,related,t,tal,al,metaData);
539}
540
541//-----------------------------------------------------------------------------
542
543class MemberDefAliasImpl final : public DefinitionAliasMixin<MemberDef>
544{
545 public:
546 MemberDefAliasImpl(const Definition *newScope,const MemberDef *md)
547 : DefinitionAliasMixin(newScope,md), m_memberGroup(nullptr) { init(); }
548 ~MemberDefAliasImpl() override { deinit(); }
550
551 DefType definitionType() const override { return TypeMember; }
552
553 const MemberDef *getMdAlias() const { return toMemberDef(getAlias()); }
554 MemberDef *getMdAlias() { return toMemberDef(const_cast<Definition*>(getAlias())); }
555 MemberDef *resolveAlias() override { return const_cast<MemberDef*>(getMdAlias()); }
556 const MemberDef *resolveAlias() const override { return getMdAlias(); }
557
558 std::unique_ptr<MemberDef> deepCopy() const override {
560 }
561 void moveTo(Definition *) override {}
562
563 const QCString &name() const override
564 { return getMdAlias()->name(); }
566 { return getMdAlias()->codeSymbolType(); }
568 { return getMdAlias()->getOutputFileBase(); }
569 QCString getReference() const override
570 { return getMdAlias()->getReference(); }
571 QCString anchor() const override
572 { return getMdAlias()->anchor(); }
573 QCString declaration() const override
574 { return getMdAlias()->declaration(); }
575 QCString definition() const override
576 { return getMdAlias()->definition(); }
577 QCString typeString() const override
578 { return getMdAlias()->typeString(); }
579 QCString argsString() const override
580 { return getMdAlias()->argsString(); }
581 QCString excpString() const override
582 { return getMdAlias()->excpString(); }
583 QCString bitfieldString() const override
584 { return getMdAlias()->bitfieldString(); }
585 QCString extraTypeChars() const override
586 { return getMdAlias()->extraTypeChars(); }
587 const QCString &initializer() const override
588 { return getMdAlias()->initializer(); }
589 int initializerLines() const override
590 { return getMdAlias()->initializerLines(); }
594 { return getMdAlias()->getVhdlSpecifiers(); }
595 const MemberList *getSectionList(const Definition *container) const override
596 { return getMdAlias()->getSectionList(container); }
598 { return getMdAlias()->displayDefinition(); }
599
600 const ClassDef *getClassDef() const override
601 { return getMdAlias()->getClassDef(); }
603 { return getMdAlias()->getClassDef(); }
604
605 const FileDef *getFileDef() const override
606 { return getMdAlias()->getFileDef(); }
607 FileDef *getFileDef() override
608 { return getMdAlias()->getFileDef(); }
609
610 const ModuleDef *getModuleDef() const override
611 { return getMdAlias()->getModuleDef(); }
612
613 const NamespaceDef* getNamespaceDef() const override
614 { return getMdAlias()->getNamespaceDef(); }
616 { return getMdAlias()->getNamespaceDef(); }
617
618 const ClassDef *accessorClass() const override
619 { return getMdAlias()->accessorClass(); }
620 QCString getReadAccessor() const override
621 { return getMdAlias()->getReadAccessor(); }
622 QCString getWriteAccessor() const override
623 { return getMdAlias()->getWriteAccessor(); }
624 const GroupDef *getGroupDef() const override
625 { return getMdAlias()->getGroupDef(); }
627 { return getMdAlias()->getGroupDef(); }
629 { return getMdAlias()->getGroupPri(); }
630 QCString getGroupFileName() const override
631 { return getMdAlias()->getGroupFileName(); }
632 int getGroupStartLine() const override
633 { return getMdAlias()->getGroupStartLine(); }
634 bool getGroupHasDocs() const override
635 { return getMdAlias()->getGroupHasDocs(); }
636 QCString qualifiedName() const override
637 { return getMdAlias()->qualifiedName(); }
638 QCString objCMethodName(bool localLink,bool showStatic) const override
639 { return getMdAlias()->objCMethodName(localLink,showStatic); }
640 Protection protection() const override
641 { return getMdAlias()->protection(); }
642 Specifier virtualness(int /* count */) const override
643 { return getMdAlias()->virtualness(); }
644 MemberType memberType() const override
645 { return getMdAlias()->memberType(); }
646 QCString memberTypeName() const override
647 { return getMdAlias()->memberTypeName(); }
648 bool isSignal() const override
649 { return getMdAlias()->isSignal(); }
650 bool isSlot() const override
651 { return getMdAlias()->isSlot(); }
652 bool isVariable() const override
653 { return getMdAlias()->isVariable(); }
654 bool isEnumerate() const override
655 { return getMdAlias()->isEnumerate(); }
656 bool isEnumValue() const override
657 { return getMdAlias()->isEnumValue(); }
658 bool isTypedef() const override
659 { return getMdAlias()->isTypedef(); }
660 bool isSequence() const override
661 { return getMdAlias()->isSequence(); }
662 bool isDictionary() const override
663 { return getMdAlias()->isDictionary(); }
664 bool isFunction() const override
665 { return getMdAlias()->isFunction(); }
666 bool isFunctionPtr() const override
667 { return getMdAlias()->isFunctionPtr(); }
668 bool isDefine() const override
669 { return getMdAlias()->isDefine(); }
670 bool isFriend() const override
671 { return getMdAlias()->isFriend(); }
672 bool isDCOP() const override
673 { return getMdAlias()->isDCOP(); }
674 bool isProperty() const override
675 { return getMdAlias()->isProperty(); }
676 bool isEvent() const override
677 { return getMdAlias()->isEvent(); }
678 bool isRelated() const override
679 { return getMdAlias()->isRelated(); }
680 bool isForeign() const override
681 { return getMdAlias()->isForeign(); }
682 bool isStatic() const override
683 { return getMdAlias()->isStatic(); }
684 bool isInline() const override
685 { return getMdAlias()->isInline(); }
686 bool isExplicit() const override
687 { return getMdAlias()->isExplicit(); }
688 bool isMutable() const override
689 { return getMdAlias()->isMutable(); }
690 bool isThreadLocal() const override
691 { return getMdAlias()->isThreadLocal(); }
692 bool isGettable() const override
693 { return getMdAlias()->isGettable(); }
694 bool isPrivateGettable() const override
695 { return getMdAlias()->isPrivateGettable(); }
696 bool isProtectedGettable() const override
697 { return getMdAlias()->isProtectedGettable(); }
698 bool isSettable() const override
699 { return getMdAlias()->isSettable(); }
700 bool isPrivateSettable() const override
701 { return getMdAlias()->isPrivateSettable(); }
702 bool isProtectedSettable() const override
703 { return getMdAlias()->isProtectedSettable(); }
704 bool isReadable() const override
705 { return getMdAlias()->isReadable(); }
706 bool isWritable() const override
707 { return getMdAlias()->isWritable(); }
708 bool isAddable() const override
709 { return getMdAlias()->isAddable(); }
710 bool isRemovable() const override
711 { return getMdAlias()->isRemovable(); }
712 bool isRaisable() const override
713 { return getMdAlias()->isRaisable(); }
714 bool isFinal() const override
715 { return getMdAlias()->isFinal(); }
716 bool isAbstract() const override
717 { return getMdAlias()->isAbstract(); }
718 bool isOverride() const override
719 { return getMdAlias()->isOverride(); }
720 bool isInitonly() const override
721 { return getMdAlias()->isInitonly(); }
722 bool isOptional() const override
723 { return getMdAlias()->isOptional(); }
724 bool isRequired() const override
725 { return getMdAlias()->isRequired(); }
726 bool isNonAtomic() const override
727 { return getMdAlias()->isNonAtomic(); }
728 bool isCopy() const override
729 { return getMdAlias()->isCopy(); }
730 bool isAssign() const override
731 { return getMdAlias()->isAssign(); }
732 bool isRetain() const override
733 { return getMdAlias()->isRetain(); }
734 bool isWeak() const override
735 { return getMdAlias()->isWeak(); }
736 bool isStrong() const override
737 { return getMdAlias()->isStrong(); }
738 bool isEnumStruct() const override
739 { return getMdAlias()->isEnumStruct(); }
740 bool isUnretained() const override
741 { return getMdAlias()->isUnretained(); }
742 bool isNew() const override
743 { return getMdAlias()->isNew(); }
744 bool isSealed() const override
745 { return getMdAlias()->isSealed(); }
746 bool isImplementation() const override
747 { return getMdAlias()->isImplementation(); }
748 bool isExternal() const override
749 { return getMdAlias()->isExternal(); }
750 bool isTypeAlias() const override
751 { return getMdAlias()->isTypeAlias(); }
752 bool isDefault() const override
753 { return getMdAlias()->isDefault(); }
754 bool isDelete() const override
755 { return getMdAlias()->isDelete(); }
756 bool isNoExcept() const override
757 { return getMdAlias()->isNoExcept(); }
758 bool isAttribute() const override
759 { return getMdAlias()->isAttribute(); }
760 bool isUNOProperty() const override
761 { return getMdAlias()->isUNOProperty(); }
762 bool isReadonly() const override
763 { return getMdAlias()->isReadable(); }
764 bool isBound() const override
765 { return getMdAlias()->isBound(); }
766 bool isConstrained() const override
767 { return getMdAlias()->isConstrained(); }
768 bool isTransient() const override
769 { return getMdAlias()->isTransient(); }
770 bool isMaybeVoid() const override
771 { return getMdAlias()->isMaybeVoid(); }
772 bool isMaybeDefault() const override
773 { return getMdAlias()->isMaybeDefault(); }
774 bool isMaybeAmbiguous() const override
775 { return getMdAlias()->isMaybeAmbiguous(); }
776 bool isPublished() const override
777 { return getMdAlias()->isPublished(); }
778 bool isTemplateSpecialization() const override
779 { return getMdAlias()->isTemplateSpecialization(); }
780 bool isObjCMethod() const override
781 { return getMdAlias()->isObjCMethod(); }
782 bool isObjCProperty() const override
783 { return getMdAlias()->isObjCProperty(); }
784 bool isCSharpProperty() const override
785 { return getMdAlias()->isCSharpProperty(); }
786 bool isConstructor() const override
787 { return getMdAlias()->isConstructor(); }
788 bool isDestructor() const override
789 { return getMdAlias()->isDestructor(); }
790 bool hasOneLineInitializer() const override
791 { return getMdAlias()->hasOneLineInitializer(); }
792 bool hasMultiLineInitializer() const override
793 { return getMdAlias()->hasMultiLineInitializer(); }
794 bool isCallable() const override
795 { return getMdAlias()->isCallable(); }
796 bool isStrongEnumValue() const override
797 { return getMdAlias()->isStrongEnumValue(); }
798 bool livesInsideEnum() const override
799 { return getMdAlias()->livesInsideEnum(); }
800 bool isSliceLocal() const override
801 { return getMdAlias()->isSliceLocal(); }
802 bool isNoDiscard() const override
803 { return getMdAlias()->isNoDiscard(); }
804 bool isConstExpr() const override
805 { return getMdAlias()->isConstExpr(); }
806 bool isConstEval() const override
807 { return getMdAlias()->isConstEval(); }
808 bool isConstInit() const override
809 { return getMdAlias()->isConstInit(); }
810 int numberOfFlowKeyWords() const override
811 { return getMdAlias()->numberOfFlowKeyWords(); }
812 bool isFriendToHide() const override
813 { return getMdAlias()->isFriendToHide(); }
814 bool isNotFriend() const override
815 { return getMdAlias()->isNotFriend(); }
816 bool isFunctionOrSignalSlot() const override
817 { return getMdAlias()->isFunctionOrSignalSlot(); }
818 bool isRelatedOrFriend() const override
819 { return getMdAlias()->isRelatedOrFriend(); }
820 bool isLinkableInProject() const override
821 { return getMdAlias()->isLinkableInProject(); }
822 bool isLinkable() const override
823 { return getMdAlias()->isLinkable(); }
824 bool hasDocumentation() const override
825 { return getMdAlias()->hasDocumentation(); }
826 bool hasUserDocumentation() const override
827 { return getMdAlias()->hasUserDocumentation(); }
828 bool isDeleted() const override
829 { return getMdAlias()->isDeleted(); }
830 bool isBriefSectionVisible() const override
831 { return getMdAlias()->isBriefSectionVisible(); }
832 bool isDetailedSectionVisible(MemberListContainer container) const override
833 { return getMdAlias()->isDetailedSectionVisible(container); }
834 bool hasDetailedDescription() const override
835 { return getMdAlias()->hasDetailedDescription(); }
836 bool isFriendClass() const override
837 { return getMdAlias()->isFriendClass(); }
838 bool isDocumentedFriendClass() const override
839 { return getMdAlias()->isDocumentedFriendClass(); }
840 const MemberDef *reimplements() const override
841 { return getMdAlias()->reimplements(); }
842 const MemberVector &reimplementedBy() const override
843 { return getMdAlias()->reimplementedBy(); }
844 bool isReimplementedBy(const ClassDef *cd) const override
845 { return getMdAlias()->isReimplementedBy(cd); }
846 ClassDef *relatedAlso() const override
847 { return getMdAlias()->relatedAlso(); }
848 bool hasDocumentedEnumValues() const override
849 { return getMdAlias()->hasDocumentedEnumValues(); }
850 const MemberDef *getAnonymousEnumType() const override
851 { return getMdAlias()->getAnonymousEnumType(); }
852 bool isDocsForDefinition() const override
853 { return getMdAlias()->isDocsForDefinition(); }
854 const MemberDef *getEnumScope() const override
855 { return getMdAlias()->getEnumScope(); }
856 const MemberVector &enumFieldList() const override
857 { return getMdAlias()->enumFieldList(); }
858 QCString enumBaseType() const override
859 { return getMdAlias()->enumBaseType(); }
860 bool hasExamples() const override
861 { return getMdAlias()->hasExamples(); }
862 const ExampleList &getExamples() const override
863 { return getMdAlias()->getExamples(); }
864 bool isPrototype() const override
865 { return getMdAlias()->isPrototype(); }
866 const ArgumentList &argumentList() const override
867 { return getMdAlias()->argumentList(); }
868 const ArgumentList &declArgumentList() const override
869 { return getMdAlias()->declArgumentList(); }
870 const ArgumentList &templateArguments() const override
871 { return getMdAlias()->templateArguments(); }
874 std::optional<ArgumentList> formalTemplateArguments() const override
875 { return getMdAlias()->formalTemplateArguments(); }
876 int getMemberGroupId() const override
877 { return getMdAlias()->getMemberGroupId(); }
878 MemberGroup *getMemberGroup() const override
879 { return m_memberGroup; }
880 bool fromAnonymousScope() const override
881 { return getMdAlias()->fromAnonymousScope(); }
883 { return getMdAlias()->fromAnonymousMember(); }
884 MemberDef *toAnonymousMember() const override
885 { return getMdAlias()->toAnonymousMember(); }
886 bool hasCallGraph() const override
887 { return getMdAlias()->hasCallGraph(); }
888 bool hasCallerGraph() const override
889 { return getMdAlias()->hasCallerGraph(); }
890 bool hasReferencesRelation() const override
891 { return getMdAlias()->hasReferencesRelation(); }
892 bool hasReferencedByRelation() const override
893 { return getMdAlias()->hasReferencedByRelation(); }
894 bool hasInlineSource() const override
895 { return getMdAlias()->hasInlineSource(); }
896 bool isDocTransferDone() const override
897 { return getMdAlias()->isDocTransferDone(); }
898 QCString sourceRefName() const override
899 { return getMdAlias()->sourceRefName(); }
900 bool hasEnumValues() const override
901 { return getMdAlias()->hasEnumValues(); }
903 { return getMdAlias()->getQualifiers(); }
904 const MemberDef *templateMaster() const override
905 { return getMdAlias()->templateMaster(); }
906 QCString getScopeString() const override
907 { return getMdAlias()->getScopeString(); }
910 bool isTypedefValCached() const override
911 { return getMdAlias()->isTypedefValCached(); }
912 const ClassDef *getCachedTypedefVal() const override
913 { return getMdAlias()->getCachedTypedefVal(); }
918 MemberDef *memberDefinition() const override
919 { return getMdAlias()->memberDefinition(); }
920 MemberDef *memberDeclaration() const override
921 { return getMdAlias()->memberDeclaration(); }
922 const MemberDef *inheritsDocsFrom() const override
923 { return getMdAlias()->inheritsDocsFrom(); }
924 const MemberDef *getGroupAlias() const override
925 { return getMdAlias()->getGroupAlias(); }
926 ClassDef *category() const override
927 { return getMdAlias()->category(); }
928 const MemberDef *categoryRelation() const override
929 { return getMdAlias()->categoryRelation(); }
930 QCString displayName(bool b=TRUE) const override
931 { return getMdAlias()->displayName(b); }
932 QCString getDeclType() const override
933 { return getMdAlias()->getDeclType(); }
934 StringVector getLabels(const Definition *container) const override
935 { return getMdAlias()->getLabels(container); }
936 const ArgumentList &typeConstraints() const override
937 { return getMdAlias()->typeConstraints(); }
938 QCString documentation() const override
939 { return getMdAlias()->documentation(); }
940 QCString briefDescription(bool /* abbr=FALSE */) const override
941 { return getMdAlias()->briefDescription(); }
942 QCString fieldType() const override
943 { return getMdAlias()->fieldType(); }
944 bool isReference() const override
945 { return getMdAlias()->isReference(); }
946 QCString getDeclFileName() const override
947 { return getMdAlias()->getDeclFileName(); }
948 int getDeclLine() const override
949 { return getMdAlias()->getDeclLine(); }
950 int getDeclColumn() const override
951 { return getMdAlias()->getDeclColumn(); }
952 QCString requiresClause() const override
953 { return getMdAlias()->requiresClause(); }
954 bool visibleInIndex() const override
955 { return getMdAlias()->visibleInIndex(); }
956 int redefineCount() const override
957 { return getMdAlias()->redefineCount(); }
959 { return getMdAlias()->anonymousMemberPrefix(); }
960
961 void warnIfUndocumented() const override {}
962 void warnIfUndocumentedParams() const override {}
963 void detectUndocumentedParams(bool /* hasParamCommand */,bool /* hasReturnCommand */) const override {}
964 void setMemberGroup(MemberGroup *grp) override { m_memberGroup = grp; }
965 std::unique_ptr<MemberDef> createTemplateInstanceMember(const ArgumentList &formalArgs,
966 const std::unique_ptr<ArgumentList> &actualArgs) const override
967 { return getMdAlias()->createTemplateInstanceMember(formalArgs,actualArgs); }
968
970 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
971 bool inGroup, int indentLevel, const ClassDef *inheritFrom=nullptr,const QCString &inheritId=QCString()) const override
972 {
973 getMdAlias()->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritFrom,inheritId);
974 }
976 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const override
977 {
978 getMdAlias()->writeEnumDeclaration(typeDecl,cd,nd,fd,gd,mod);
979 }
981 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
982 bool onlyText=FALSE) const override
983 {
984 getMdAlias()->writeLink(ol,cd,nd,fd,gd,mod,onlyText);
985 }
986 private:
987 MemberGroup *m_memberGroup; // group's member definition
988};
989
990
991std::unique_ptr<MemberDef> createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd)
992{
993 auto amd = std::make_unique<MemberDefAliasImpl>(newScope,aliasMd);
994 //printf("amd: name=%s displayName=%s\n",qPrint(amd->name()),qPrint(amd->displayName()));
995 return amd;
996}
997
998//-----------------------------------------------------------------------------
999
1000static QCString addTemplateNames(const QCString &s,const QCString &n,const QCString &t)
1001{
1002 QCString result;
1003 QCString clRealName=n;
1004 int p=0,i=0;
1005 if ((i=clRealName.find('<'))!=-1)
1006 {
1007 clRealName=clRealName.left(i); // strip template specialization
1008 }
1009 if ((i=clRealName.findRev("::"))!=-1)
1010 {
1011 clRealName=clRealName.right(clRealName.length()-i-2);
1012 }
1013 while ((i=s.find(clRealName,p))!=-1)
1014 {
1015 result+=s.mid(p,i-p);
1016 size_t j=clRealName.length()+i;
1017 if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j))))
1018 { // add template names
1019 //printf("Adding %s+%s\n",qPrint(clRealName),qPrint(t));
1020 result+=clRealName+t;
1021 }
1022 else
1023 { // template names already present
1024 //printf("Adding %s\n",qPrint(clRealName));
1025 result+=clRealName;
1026 }
1027 p=i+static_cast<int>(clRealName.length());
1028 }
1029 result+=s.right(s.length()-p);
1030 //printf("addTemplateNames(%s,%s,%s)=%s\n",qPrint(s),qPrint(n),qPrint(t),qPrint(result));
1031 return result;
1032}
1033
1034// ol.startMemberDocName has already been done before this is called.
1035// when this function returns TRUE, ol.endParameterList will be called.
1036//
1037// typical sequence:
1038// ol.startMemberDoc
1039// ol.startMemberDocName
1040// --- enter writeDefArgumentList
1041// ol.endMemberDocName
1042// ol.startParameterList
1043// ...
1044// ol.startParameterType(first=TRUE)
1045// ol.endParameterType
1046// ol.startParameterName
1047// ol.endParameterName
1048// ol.startParameterExtra
1049// ol.startParameterDefVal [optional]
1050// ol.endParameterDefVal [optional]
1051// ol.endParameterExtra(last==FALSE)
1052// ...
1053// ol.startParameterType(first=FALSE)
1054// ol.endParameterType
1055// ol.startParameterName
1056// ol.endParameterName
1057// ol.startParameterExtra
1058// ol.endParameterExtra(last==TRUE)
1059// ...
1060// --- leave writeDefArgumentList with return value TRUE
1061// ol.endParameterList
1062// ol.endMemberDoc(hasArgs=TRUE)
1063//
1064// For an empty list the function should return FALSE, the sequence is
1065// ol.startMemberDoc
1066// ol.startMemberDocName
1067// --- enter writeDefArgumentList
1068// --- leave writeDefArgumentList with return value FALSE
1069// ol.endMemberDocName
1070// ol.endMemberDoc(hasArgs=FALSE);
1071//
1072
1073static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const MemberDef *md)
1074{
1075 const ArgumentList &defArgList=(md->isDocsForDefinition()) ?
1076 md->argumentList() : md->declArgumentList();
1077 //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d hasParameters()=%d (%s)\n",
1078 // qPrint(md->name()),md->isDocsForDefinition(),defArgList.hasParameters(),qPrint(argListToString(defArgList)));
1079 if (!defArgList.hasParameters() || md->isProperty() || md->isTypedef())
1080 {
1081 return FALSE; // member has no function like argument list
1082 }
1083
1084 bool isDefine = md->isDefine();
1085 if (!isDefine) ol.docify(" ");
1086
1087 //printf("writeDefArgList(%d)\n",defArgList->count());
1088 ol.endMemberDocName();
1090 //printf("===> name=%s isDefine=%d\n",qPrint(md->name()),md->isDefine());
1091
1092 QCString cName;
1093 if (scope)
1094 {
1095 cName=scope->name();
1096 int il=cName.find('<');
1097 int ir=cName.findRev('>');
1098 if (il!=-1 && ir!=-1 && ir>il)
1099 {
1100 cName=cName.mid(il,ir-il+1);
1101 //printf("1. cName=%s\n",qPrint(cName));
1102 }
1103 else if (scope->definitionType()==Definition::TypeClass)
1104 {
1105 cName=tempArgListToString((toClassDef(scope))->templateArguments(),
1106 scope->getLanguage());
1107 //printf("2. cName=%s\n",qPrint(cName));
1108 }
1109 else // no template specifier
1110 {
1111 cName.clear();
1112 }
1113 }
1114 //printf("~~~ %s cName=%s\n",qPrint(md->name()),qPrint(cName));
1115
1117
1118 LinkifyTextOptions options;
1119 options.setScope(scope).setFileScope(md->getBodyDef()).setSelf(md);
1120
1121 bool first=TRUE;
1122 bool paramTypeStarted=FALSE;
1123 auto alIt = defArgList.begin();
1124 while (alIt!=defArgList.end())
1125 {
1126 Argument a = *alIt;
1127 if (isDefine || first)
1128 {
1129 ol.startParameterType(first,QCString());
1130 paramTypeStarted=true;
1131 if (isDefine)
1132 {
1133 ol.endParameterType();
1135 }
1136 }
1137
1138 if (!a.attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
1139 {
1140 ol.docify(a.attrib+" ");
1141 }
1142
1143 QCString atype = a.type;
1144 if (sep!="::") { atype=substitute(atype,"::",sep); }
1145
1146 int funcPtrPos=-1;
1147 {
1148 if (md->isObjCMethod()) { atype.prepend("("); atype.append(")"); }
1149 if (atype!="...")
1150 {
1151 if (!cName.isEmpty() && scope && scope!=Doxygen::globalScope)
1152 {
1153 atype=addTemplateNames(atype,scope->name(),cName);
1154 }
1155 // 1. split ...*)(... -> '*' + name + ')(...'
1156 // 2. split ...*[some thing])(... -> '*' + name + '[some thing])(...'
1157 int starPos = atype.find('*'); // find pointer
1158 if (starPos==-1) starPos = atype.find('&'); // can also be reference
1159 funcPtrPos = atype.find(")(");
1160 if (starPos!=-1 && funcPtrPos>starPos)
1161 {
1162 funcPtrPos=starPos+1;
1163 }
1164 else
1165 {
1166 funcPtrPos=-1;
1167 }
1169 funcPtrPos==-1 ? atype : atype.left(funcPtrPos),
1170 options);
1171 }
1172 }
1173
1174 if (!isDefine)
1175 {
1176 if (paramTypeStarted)
1177 {
1178 ol.endParameterType();
1179 paramTypeStarted=FALSE;
1180 }
1181 ol.startParameterName(defArgList.size()<2);
1182 }
1183 else
1184 {
1185 ol.endParameterName();
1186 }
1187
1188 if (atype=="...")
1189 {
1190 ol.docify(atype);
1191 }
1192 else if (!a.name.isEmpty()) // argument has a name
1193 {
1194 ol.docify(a.name);
1195 }
1196 if (!isDefine)
1197 {
1198 if (funcPtrPos!=-1)
1199 {
1201 }
1202 ol.endParameterName();
1203 }
1205 if (funcPtrPos!=-1)
1206 {
1207 linkifyText(TextGeneratorOLImpl(ol),atype.mid(funcPtrPos),options);
1208 }
1209 if (!a.array.isEmpty())
1210 {
1211 ol.docify(a.array);
1212 }
1213 if (!a.defval.isEmpty()) // write the default value
1214 {
1215 QCString n=a.defval;
1216 if (scope && scope!=Doxygen::globalScope && !cName.isEmpty())
1217 {
1218 n=addTemplateNames(n,scope->name(),cName);
1219 }
1220 ol.startParameterDefVal(" = ");
1221 linkifyText(TextGeneratorOLImpl(ol),n,LinkifyTextOptions(options).setKeepSpaces(true));
1222 ol.endParameterDefVal();
1223 }
1224 ++alIt;
1225 if (alIt!=defArgList.end())
1226 {
1227 a = *alIt;
1228 if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
1229 if (!isDefine)
1230 {
1231 QCString key;
1232 if (md->isObjCMethod() && a.attrib.length()>=2)
1233 {
1234 //printf("Found parameter keyword %s\n",a.qPrint(attrib));
1235 // strip [ and ]
1236 key=a.attrib.mid(1,a.attrib.length()-2);
1237 if (key!=",") key+=":"; // for normal keywords add colon
1238 }
1239 ol.endParameterExtra(false,false,!md->isObjCMethod());
1240 ol.startParameterType(FALSE,key);
1241 paramTypeStarted=TRUE;
1242 }
1243 else // isDefine
1244 {
1245 ol.endParameterExtra(false,false,true);
1246 }
1247 }
1248 first=FALSE;
1249 }
1250 if (first)
1251 {
1252 ol.startParameterName(defArgList.size()<2);
1253 ol.endParameterName();
1255 }
1256 ol.endParameterExtra(TRUE,defArgList.size()<2,!md->isObjCMethod());
1257 if (!md->extraTypeChars().isEmpty())
1258 {
1259 ol.docify(md->extraTypeChars());
1260 }
1261 if (defArgList.constSpecifier())
1262 {
1263 ol.docify(" const");
1264 }
1265 if (defArgList.volatileSpecifier())
1266 {
1267 ol.docify(" volatile");
1268 }
1269 if (defArgList.refQualifier()==RefQualifierType::LValue)
1270 {
1271 ol.docify(" &");
1272 }
1273 else if (defArgList.refQualifier()==RefQualifierType::RValue)
1274 {
1275 ol.docify(" &&");
1276 }
1277 if (!defArgList.trailingReturnType().isEmpty())
1278 {
1279 linkifyText(TextGeneratorOLImpl(ol), defArgList.trailingReturnType(), options);
1280 }
1281 return TRUE;
1282}
1283
1285 OutputList &ol, const ClassDef *cd, const MemberDef *md, QCString const& exception)
1286{
1287 // this is ordinary exception spec - there must be a '('
1288 //printf("exception='%s'\n",qPrint(exception));
1289 int index = exception.find('(');
1290 LinkifyTextOptions options;
1291 options.setScope(cd).setFileScope(md->getBodyDef()).setSelf(md);
1292 if (index!=-1)
1293 {
1294 ol.exceptionEntry(exception.left(index),false);
1295 ++index; // paren in second column so skip it here
1296 for (int comma = exception.find(',', index); comma!=-1; )
1297 {
1298 ++comma; // include comma
1299 linkifyText(TextGeneratorOLImpl(ol),exception.mid(index,comma-index),options);
1300 ol.exceptionEntry(QCString(),false);
1301 index=comma;
1302 comma = exception.find(',', index);
1303 }
1304 int close = exception.find(')', index);
1305 if (close!=-1)
1306 {
1307 QCString type=removeRedundantWhiteSpace(exception.mid(index,close-index));
1308 linkifyText(TextGeneratorOLImpl(ol),type,options);
1309 ol.exceptionEntry(QCString(),true);
1310 }
1311 else
1312 {
1313 warn(md->getDefFileName(),md->getDefLine(),
1314 "missing ) in exception list on member {}",md->name());
1315 }
1316 }
1317 else // Java Exception
1318 {
1319 ol.docify(" ");
1320 linkifyText(TextGeneratorOLImpl(ol),exception,options);
1321 }
1322}
1323
1324static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberDef *md)
1325{
1326 QCString exception = md->excpString().stripWhiteSpace();
1327 if ('{'==exception.at(0))
1328 {
1329 // this is an UNO IDL attribute - need special handling
1330 int index = exception.find(';');
1331 int oldIndex = 1;
1332 while (-1 != index) // there should be no more than 2 (set / get)
1333 {
1334 // omit '{' and ';' -> "set raises (...)"
1335 writeExceptionListImpl(ol,cd,md,exception.mid(oldIndex,index-oldIndex));
1336 oldIndex=index+1;
1337 index = exception.find(';',oldIndex);
1338 }
1339 // the rest is now just '}' - omit that
1340 }
1341 else
1342 {
1343 writeExceptionListImpl(ol,cd,md,exception);
1344 }
1345}
1346
1347//-----------------------------------------------------------------------------
1348//-----------------------------------------------------------------------------
1349//-----------------------------------------------------------------------------
1350
1352 const QCString &t,const QCString &a,const QCString &e,
1353 Protection p,Specifier v,bool s,Relationship r,
1354 MemberType mt,const ArgumentList &tal,
1355 const ArgumentList &al,const QCString &meta
1356 )
1357{
1358 m_classDef=nullptr;
1359 m_fileDef=nullptr;
1360 m_moduleDef=nullptr;
1361 m_redefines=nullptr;
1362 m_relatedAlso=nullptr;
1363 m_accessorClass=nullptr;
1364 m_nspace=nullptr;
1365 m_memDef=nullptr;
1366 m_memDec=nullptr;
1367 m_group=nullptr;
1368 m_grpId=-1;
1369 m_enumScope=nullptr;
1371 m_hasCallGraph = Config_getBool(CALL_GRAPH);
1372 m_hasCallerGraph = Config_getBool(CALLER_GRAPH);
1373 m_hasReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION);
1374 m_hasReferencesRelation = Config_getBool(REFERENCES_RELATION);
1375 m_hasEnumValues = Config_getBool(SHOW_ENUM_VALUES);
1376 m_hasInlineSource = Config_getBool(INLINE_SOURCES);
1377 m_initLines=0;
1378 m_type=t;
1379 if (mt==MemberType::Typedef) m_type.stripPrefix("typedef ");
1380 // type.stripPrefix("struct ");
1381 // type.stripPrefix("class " );
1382 // type.stripPrefix("union " );
1384 m_args=a;
1386 if (m_type.isEmpty()) m_decl=d->name()+m_args; else m_decl=m_type+" "+d->name()+m_args;
1387
1388 m_memberGroup=nullptr;
1389 m_virt=v;
1390 m_prot=p;
1391 m_related=r;
1392 m_stat=s;
1393 m_mtype=mt;
1394 m_exception=e;
1395 m_proto=FALSE;
1399 m_fromAnnMemb=nullptr;
1400 m_toAnnMemb=nullptr;
1401 m_annEnumType=nullptr;
1402 m_groupAlias=nullptr;
1404 m_tspec=FALSE;
1405 m_cachedAnonymousType=nullptr;
1406 m_maxInitLines=Config_getInt(MAX_INITIALIZER_LINES);
1407 m_userInitLines=-1;
1409 // copy function template arguments (if any)
1410 m_tArgList = tal;
1411 //printf("new member al=%p\n",al);
1412 // copy function definition arguments (if any)
1413 m_defArgList = al;
1414 // convert function declaration arguments (if any)
1415 if (!m_args.isEmpty())
1416 {
1418 //printf("setDeclArgList %s to %s const=%d\n",qPrint(args),
1419 // qPrint(argListToString(declArgList)),declArgList->constSpecifier);
1420 }
1421 m_metaData = meta;
1422 m_templateMaster = nullptr;
1425 m_cachedTypedefValue = nullptr;
1427 m_groupMember = nullptr;
1430 m_docProvider = nullptr;
1432}
1433
1434
1435//-----------------------------------------------------------------------------
1436//-----------------------------------------------------------------------------
1437//-----------------------------------------------------------------------------
1438
1439/*! Creates a new member definition.
1440 *
1441 * \param df File containing the definition of this member.
1442 * \param dl Line at which the member definition was found.
1443 * \param dc Column at which the member definition was found.
1444 * \param t A string representing the type of the member.
1445 * \param na A string representing the name of the member.
1446 * \param a A string representing the arguments of the member.
1447 * \param e A string representing the throw clause of the members.
1448 * \param p The protection context of the member, possible values are:
1449 * \c Public, \c Protected, \c Private.
1450 * \param v The degree of 'virtualness' of the member, possible values are:
1451 * \c Normal, \c Virtual, \c Pure.
1452 * \param s A boolean that is true iff the member is static.
1453 * \param r The relationship between the class and the member.
1454 * \param mt The kind of member. See #MemberType for a list of
1455 * all types.
1456 * \param tal The template arguments of this member.
1457 * \param al The arguments of this member. This is a structured form of
1458 * the string past as argument \a a.
1459 * \param meta Slice metadata.
1460 */
1461
1463 const QCString &t,const QCString &na,const QCString &a,const QCString &e,
1465 const ArgumentList &tal,const ArgumentList &al,const QCString &meta
1467{
1468 //printf("MemberDefImpl::MemberDef(%s)\n",qPrint(na));
1469 init(this,t,a,e,p,v,s,r,mt,tal,al,meta);
1473}
1474
1475std::unique_ptr<MemberDef> MemberDefImpl::deepCopy() const
1476{
1477 std::unique_ptr<MemberDefImpl> result(new MemberDefImpl(
1480 // first copy base members
1481 result->DefinitionMixin<MemberDefMutable>::operator=(*this);
1482 // then copy other members
1483 result->m_typeConstraints = m_typeConstraints ;
1484 result->m_declArgList = m_declArgList ;
1485 result->m_classDef = m_classDef ;
1486 result->m_fileDef = m_fileDef ;
1487 result->m_moduleDef = m_moduleDef ;
1488 result->m_nspace = m_nspace ;
1489 result->m_enumScope = m_enumScope ;
1490 result->m_livesInsideEnum = m_livesInsideEnum ;
1491 result->m_annEnumType = m_annEnumType ;
1492 result->m_enumFields = m_enumFields ;
1493 result->m_redefines = m_redefines ;
1494 result->m_redefinedBy = m_redefinedBy ;
1495 result->m_memDef = m_memDef ;
1496 result->m_memDec = m_memDec ;
1497 result->m_relatedAlso = m_relatedAlso ;
1498 result->m_examples = m_examples ;
1499 result->m_accessorType = m_accessorType ;
1500 result->m_accessorClass = m_accessorClass ;
1501 result->m_def = m_def ;
1502 result->m_anc = m_anc ;
1503 result->m_decl = m_decl ;
1504 result->m_bitfields = m_bitfields ;
1505 result->m_read = m_read ;
1506 result->m_write = m_write ;
1507 result->m_exception = m_exception ;
1508 result->m_initializer = m_initializer ;
1509 result->m_extraTypeChars = m_extraTypeChars ;
1510 result->m_enumBaseType = m_enumBaseType ;
1511 result->m_requiresClause = m_requiresClause ;
1512 result->m_initLines = m_initLines ;
1513 result->m_memSpec = m_memSpec ;
1514 result->m_vhdlSpec = m_vhdlSpec ;
1515 result->m_maxInitLines = m_maxInitLines ;
1516 result->m_userInitLines = m_userInitLines ;
1517 result->m_fromAnnMemb = m_fromAnnMemb ;
1518 result->m_toAnnMemb = m_toAnnMemb ;
1519 result->m_defArgList = m_defArgList ;
1520 result->m_declArgList = m_declArgList ;
1521 result->m_tArgList = m_tArgList ;
1522 result->m_typeConstraints = m_typeConstraints ;
1523 result->m_templateMaster = m_templateMaster ;
1524 result->m_formalTemplateArguments = m_formalTemplateArguments ;
1525 result->m_defTmpArgLists = m_defTmpArgLists ;
1526 result->m_cachedAnonymousType = m_cachedAnonymousType ;
1527 result->m_sectionMap = m_sectionMap ;
1528 result->m_groupAlias = m_groupAlias ;
1529 result->m_grpId = m_grpId ;
1530 result->m_memberGroup = m_memberGroup ;
1531 result->m_group = m_group ;
1532 result->m_grouppri = m_grouppri ;
1533 result->m_groupFileName = m_groupFileName ;
1534 result->m_groupStartLine = m_groupStartLine ;
1535 result->m_groupMember = m_groupMember ;
1536 result->m_isTypedefValCached = m_isTypedefValCached ;
1537 result->m_cachedTypedefValue = m_cachedTypedefValue ;
1538 result->m_cachedTypedefTemplSpec = m_cachedTypedefTemplSpec ;
1539 result->m_cachedResolvedType = m_cachedResolvedType ;
1540 result->m_docProvider = m_docProvider ;
1541 result->m_explicitOutputFileBase = m_explicitOutputFileBase ;
1542 result->m_qualifiers = m_qualifiers ;
1543 result->m_implOnly = m_implOnly ;
1544 result->m_hasDocumentedParams = m_hasDocumentedParams ;
1545 result->m_hasDocumentedReturnType = m_hasDocumentedReturnType ;
1546 result->m_isDMember = m_isDMember ;
1547 result->m_proto = m_proto ;
1548 result->m_docEnumValues = m_docEnumValues ;
1549 result->m_annScope = m_annScope ;
1550 result->m_anonymousPrefix = m_anonymousPrefix ;
1551 result->m_hasDetailedDescriptionCached = m_hasDetailedDescriptionCached ;
1552 result->m_detailedDescriptionCachedValue = m_detailedDescriptionCachedValue ;
1553 result->m_hasCallGraph = m_hasCallGraph ;
1554 result->m_hasCallerGraph = m_hasCallerGraph ;
1555 result->m_hasReferencedByRelation = m_hasReferencedByRelation ;
1556 result->m_hasReferencesRelation = m_hasReferencesRelation ;
1557 result->m_hasEnumValues = m_hasEnumValues ;
1558 result->m_hasInlineSource = m_hasInlineSource ;
1559 result->m_explExt = m_explExt ;
1560 result->m_tspec = m_tspec ;
1561 result->m_groupHasDocs = m_groupHasDocs ;
1562 result->m_docsForDefinition = m_docsForDefinition ;
1563 result->m_category = m_category ;
1564 result->m_categoryRelation = m_categoryRelation ;
1565 result->m_declFileName = m_declFileName ;
1566 result->m_declLine = m_declLine ;
1567 result->m_declColumn = m_declColumn ;
1568 result->m_numberOfFlowKW = m_numberOfFlowKW ;
1569 result->setDefinitionTemplateParameterLists(m_defTmpArgLists);
1570
1571 result->m_isLinkableCached = 0;
1572 result->m_isConstructorCached = 0;
1573 result->m_isDestructorCached = 0;
1574 return result;
1575}
1576
1578{
1579 setOuterScope(scope);
1581 {
1582 m_classDef = toClassDef(scope);
1583 }
1584 else if (scope->definitionType()==Definition::TypeFile)
1585 {
1586 m_fileDef = toFileDef(scope);
1587 }
1588 else if (scope->definitionType()==Definition::TypeModule)
1589 {
1590 m_moduleDef = toModuleDef(scope);
1591 }
1592 else if (scope->definitionType()==Definition::TypeNamespace)
1593 {
1594 m_nspace = toNamespaceDef(scope);
1595 }
1598}
1599
1600
1605
1607{
1608 if (m_templateMaster)
1609 {
1611 if (mdm)
1612 {
1613 mdm->insertReimplementedBy(md);
1614 }
1615 }
1616 if (!m_redefinedBy.contains(md))
1617 {
1618 m_redefinedBy.inSort(md);
1619 }
1620}
1621
1623{
1624 return m_redefines;
1625}
1626
1628{
1629 return m_redefinedBy;
1630}
1631
1633{
1634 if (cd)
1635 {
1636 for (const auto &md : m_redefinedBy)
1637 {
1638 const ClassDef *mcd = md->getClassDef();
1639 if (mcd)
1640 {
1641 if (cd==mcd || cd->isBaseClass(mcd,TRUE))
1642 {
1643 return TRUE;
1644 }
1645 }
1646 }
1647 }
1648 return FALSE;
1649}
1650
1652{
1653 m_enumFields.push_back(md);
1654}
1655
1656bool MemberDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
1657{
1658 //printf("%s::addExample(%s,%s,%s)\n",qPrint(name()),anchor,nameStr,file);
1659 return m_examples.inSort(Example(anchor,nameStr,file));
1660}
1661
1663{
1664 return !m_examples.empty();
1665}
1666
1668{
1669 QCString n = name();
1671
1672 if (!s.isEmpty())
1673 {
1674 n.prepend(s+"::");
1675 }
1676 else if (isStatic() && getFileDef())
1677 {
1678 n.prepend(getFileDef()->name()+":");
1679 }
1680 if (isCallable())
1681 {
1682 n.append(argsString());
1683 }
1684 return n;
1685}
1686
1688{
1689 bool separateMemberPages = Config_getBool(SEPARATE_MEMBER_PAGES);
1690 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
1691 QCString baseName;
1692
1693 //printf("Member: %s: templateMaster=%p group=%p classDef=%p nspace=%p fileDef=%p\n",
1694 // qPrint(name()),m_templateMaster,m_group,m_classDef,
1695 // m_nspace,m_fileDef);
1696 const NamespaceDef *nspace = getNamespaceDef();
1697 const FileDef *fileDef = getFileDef();
1698 const ClassDef *classDef = getClassDef();
1699 const ModuleDef *moduleDef = getModuleDef();
1700 const GroupDef *groupDef = getGroupDef();
1701 if (!m_explicitOutputFileBase.isEmpty())
1702 {
1704 }
1705 else if (templateMaster())
1706 {
1708 }
1709 else if (groupDef)
1710 {
1711 baseName=groupDef->getOutputFileBase();
1712 }
1713 else if (classDef)
1714 {
1715 baseName=classDef->getOutputFileBase();
1716 if (inlineSimpleClasses && classDef->isSimple())
1717 {
1718 return baseName;
1719 }
1720 }
1721 else if (nspace && (nspace->isLinkable() || nspace->isAnonymous()))
1722 {
1723 baseName=nspace->getOutputFileBase();
1724 }
1725 else if (fileDef)
1726 {
1727 baseName=fileDef->getOutputFileBase();
1728 }
1729 else if (moduleDef)
1730 {
1731 baseName=moduleDef->getOutputFileBase();
1732 }
1733
1734 if (baseName.isEmpty())
1735 {
1737 "Internal inconsistency: member {} does not belong to any container!",name()
1738 );
1739 return "dummy";
1740 }
1741 else if (separateMemberPages && hasDetailedDescription())
1742 {
1743 if (getEnumScope()) // enum value, which is part of enum's documentation
1744 {
1745 baseName+="_"+getEnumScope()->anchor();
1746 }
1747 else
1748 {
1749 baseName+="_"+anchor();
1750 }
1751 }
1752 return baseName;
1753}
1754
1756{
1758 if (!ref.isEmpty())
1759 {
1760 return ref;
1761 }
1762 const NamespaceDef *nspace = getNamespaceDef();
1763 const FileDef *fileDef = getFileDef();
1764 const ClassDef *classDef = getClassDef();
1765 const ModuleDef *moduleDef = getModuleDef();
1766 const GroupDef *groupDef = getGroupDef();
1767 if (templateMaster())
1768 {
1769 return templateMaster()->getReference();
1770 }
1771 else if (groupDef)
1772 {
1773 return groupDef->getReference();
1774 }
1775 else if (classDef)
1776 {
1777 return classDef->getReference();
1778 }
1779 else if (nspace)
1780 {
1781 return nspace->getReference();
1782 }
1783 else if (moduleDef)
1784 {
1785 return moduleDef->getReference();
1786 }
1787 else if (fileDef)
1788 {
1789 return fileDef->getReference();
1790 }
1791 return "";
1792}
1793
1795{
1796 QCString result=m_anc;
1797 if (m_groupAlias) return m_groupAlias->anchor();
1798 if (m_templateMaster) return m_templateMaster->anchor();
1799 if (m_enumScope && m_enumScope!=this) // avoid recursion for C#'s public enum E { E, F }
1800 {
1801 result.prepend(m_enumScope->anchor());
1802 }
1803 if (getGroupDef())
1804 {
1805 if (m_groupMember)
1806 {
1807 result=m_groupMember->anchor();
1808 }
1809 else if (getReference().isEmpty())
1810 {
1811 result.prepend("g");
1812 }
1813 }
1814 return result;
1815}
1816
1818{
1819 AUTO_TRACE("name={}",qualifiedName());
1820 bool extractStatic = Config_getBool(EXTRACT_STATIC);
1821 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
1822 m_isLinkableCached = 2; // linkable
1823 //printf("MemberDefImpl::isLinkableInProject(name=%s)\n",qPrint(name()));
1824 if (isHidden())
1825 {
1826 AUTO_TRACE_ADD("is hidden");
1828 return;
1829 }
1830 if (templateMaster())
1831 {
1832 AUTO_TRACE_ADD("has master template");
1834 return;
1835 }
1836 if (isAnonymous())
1837 {
1838 AUTO_TRACE_ADD("name invalid");
1839 m_isLinkableCached = 1; // not a valid or a dummy name
1840 return;
1841 }
1842 if (!hasDocumentation() || isReference())
1843 {
1844 AUTO_TRACE_ADD("no docs or reference");
1845 m_isLinkableCached = 1; // no documentation
1846 return;
1847 }
1848 const GroupDef *groupDef = getGroupDef();
1849 const ClassDef *classDef = getClassDef();
1850 if (groupDef && !groupDef->isLinkableInProject())
1851 {
1852 AUTO_TRACE_ADD("in not linkable group");
1853 m_isLinkableCached = 1; // group but group not linkable
1854 return;
1855 }
1856 if (!groupDef && classDef && !classDef->isLinkableInProject())
1857 {
1858 AUTO_TRACE_ADD("in not linkable class");
1859 m_isLinkableCached = 1; // in class but class not linkable
1860 return;
1861 }
1862 const NamespaceDef *nspace = getNamespaceDef();
1863 const FileDef *fileDef = getFileDef();
1864 if (!groupDef && nspace /*&& m_related==Relationship::Member*/ && !nspace->isLinkableInProject()
1865 && (fileDef==nullptr || !fileDef->isLinkableInProject()))
1866 {
1867 AUTO_TRACE_ADD("in not linkable namespace");
1868 m_isLinkableCached = 1; // in namespace but namespace not linkable
1869 return;
1870 }
1871 if (!groupDef && !nspace &&
1872 /*m_related==Relationship::Member &&*/ !classDef &&
1873 fileDef && !fileDef->isLinkableInProject())
1874 {
1875 AUTO_TRACE_ADD("in not linkable file");
1876 m_isLinkableCached = 1; // in file (and not in namespace) but file not linkable
1877 return;
1878 }
1879 if ((!protectionLevelVisible(m_prot) && m_mtype!=MemberType::Friend) &&
1880 !(m_prot==Protection::Private && (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual))
1881 {
1882 AUTO_TRACE_ADD("private and invisible");
1883 m_isLinkableCached = 1; // hidden due to protection
1884 return;
1885 }
1886 if (m_stat && classDef==nullptr && !extractStatic)
1887 {
1888 AUTO_TRACE_ADD("static and invisible");
1889 m_isLinkableCached = 1; // hidden due to staticness
1890 return;
1891 }
1892 AUTO_TRACE_ADD("linkable");
1893 return; // linkable!
1894}
1895
1901
1907
1912
1918
1924
1926{
1927 if (m_isLinkableCached==0)
1928 {
1929 MemberDefImpl *that = const_cast<MemberDefImpl*>(this);
1931 }
1933 return m_isLinkableCached==2;
1934}
1935
1937{
1938 if (m_templateMaster)
1939 {
1940 return m_templateMaster->isLinkable();
1941 }
1942 else
1943 {
1944 return isLinkableInProject() || isReference();
1945 }
1946}
1947
1948
1953
1955 const ClassDef *,const NamespaceDef *,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
1956 bool onlyText) const
1957{
1958 SrcLangExt lang = getLanguage();
1959 bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
1961 QCString n = name();
1962 const ClassDef *classDef = getClassDef();
1963 const NamespaceDef *nspace = getNamespaceDef();
1964 if (!hideScopeNames)
1965 {
1966 if (m_enumScope && m_livesInsideEnum && getGroupDef()!=nullptr)
1967 {
1968 n.prepend(m_enumScope->displayName()+sep);
1969 }
1970 if (classDef && (gd || mod) && !isRelated())
1971 {
1972 n.prepend(classDef->displayName()+sep);
1973 }
1974 else if (nspace && (gd || fd || mod))
1975 {
1976 n.prepend(nspace->displayName()+sep);
1977 }
1978 }
1979
1980 if (isObjCMethod())
1981 {
1982 if (isStatic()) ol.docify("+ "); else ol.docify("- ");
1983 }
1984 if (!onlyText && (isLinkable() || hasDetailedDescription())) // write link
1985 {
1986 if (m_mtype==MemberType::EnumValue && getGroupDef()==nullptr && // enum value is not grouped
1987 getEnumScope() && getEnumScope()->getGroupDef()) // but its container is
1988 {
1989 const GroupDef *enumValGroup = getEnumScope()->getGroupDef();
1990 ol.writeObjectLink(enumValGroup->getReference(),
1991 enumValGroup->getOutputFileBase(),
1992 anchor(),n);
1993 }
1994 else
1995 {
1997 }
1998 }
1999 else // write only text
2000 {
2001 ol.startBold();
2002 ol.docify(n);
2003 ol.endBold();
2004 }
2005}
2006
2008
2009/*! If this member has an anonymous class/struct/union as its type, then
2010 * this method will return the ClassDef that describes this return type.
2011 */
2013{
2014 std::lock_guard<std::mutex> lock(g_cachedAnonymousTypeMutex);
2015 //printf("%s:getClassDefOfAnonymousType() cache=%s\n",qPrint(name()),
2016 // m_cachedAnonymousType?qPrint(m_cachedAnonymousType->name()):"<empty>");
2018
2019 QCString cname;
2020 if (getClassDef()!=nullptr)
2021 {
2022 cname=getClassDef()->name();
2023 }
2024 else if (getNamespaceDef()!=nullptr)
2025 {
2026 cname=getNamespaceDef()->name();
2027 }
2028 QCString ltype(m_type);
2029 // strip 'friend' keyword from ltype
2030 ltype.stripPrefix("friend ");
2031
2032 // search for the last anonymous scope in the member type
2033 ClassDef *annoClassDef=nullptr;
2034
2035 // match expression if it contains at least one @1 marker, e.g.
2036 // 'struct A::@1::@2::B' matches 'A::@1::@2::B' but 'struct A::B' does not match.
2037 std::string stype = ltype.str();
2038 static const reg::Ex r(R"([\w@:]*@\d+[\w@:]*)");
2039 reg::Match match;
2040 if (reg::search(stype,match,r)) // found anonymous scope in type
2041 {
2042 QCString annName = match.str();
2043
2044 // if inside a class or namespace try to prepend the scope name
2045 if (!cname.isEmpty() && annName.left(cname.length()+2)!=cname+"::")
2046 {
2047 QCString ts=stripAnonymousNamespaceScope(cname+"::"+annName);
2048 annoClassDef=getClass(ts);
2049 }
2050 // if not found yet, try without scope name
2051 if (annoClassDef==nullptr)
2052 {
2054 annoClassDef=getClass(ts);
2055 }
2056 }
2057 m_cachedAnonymousType = annoClassDef;
2058 return annoClassDef;
2059}
2060
2062{
2065 if (cd && md==nullptr) // skip member of anonymous types that are themselves also anonymous
2066 // (e.g. y in struct { struct { int x; } y; } z;)
2067 {
2069 if (cdm)
2070 {
2071 //printf("class %s setAnonymousMemberPrefix(%s)\n",qPrint(cdm->name()),qPrint(name()));
2073 }
2074 }
2075}
2076
2078{
2079 //printf("> MemberDefImpl::setAnonymousMemberPrefix(%s) for %s\n",qPrint(prefix),qPrint(qualifiedName()));
2080 m_anonymousPrefix.prepend(prefix+".");
2081 for (const auto &md : m_enumFields)
2082 {
2084 if (mdm)
2085 {
2087 }
2088 }
2089
2092 if (acd && amd) // also add prefix to member of anonymous types that are themselves also anonymous
2093 // (e.g. prefix z.y. for x in struct { struct { int x; } y; } z;)
2094 {
2096 if (acdm)
2097 {
2099 }
2100 }
2101 //printf("< MemberDefImpl::setAnonymousMemberPrefix(%s) for %s\n",qPrint(prefix),qPrint(qualifiedName()));
2102}
2103
2108
2109
2110/*! This methods returns TRUE iff the brief section (also known as
2111 * declaration section) is visible in the documentation.
2112 */
2114{
2115 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2116 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2117 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2118 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
2119 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2120 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
2121
2122 //printf("Member %s grpId=%d docs=%s file=%s args=%s\n",
2123 // qPrint(name()),
2124 // 0,"", //grpId,grpId==-1?"<none>":Doxygen::memberDocDict[grpId]->data(),
2125 // "", //qPrint(getFileDef()->name()),
2126 // argsString());
2127
2128 bool hasDocs = hasDocumentation();
2129
2130 // only include static members with file/namespace scope if
2131 // explicitly enabled in the config file
2132 bool visibleIfStatic = !(getClassDef()==nullptr &&
2133 isStatic() &&
2134 !extractStatic
2135 );
2136
2137 // only include members is the are documented or
2138 // HIDE_UNDOC_MEMBERS is NO in the config file
2139 bool visibleIfDocumented = (!hideUndocMembers ||
2140 hasDocs ||
2142 );
2143
2144 // hide members with no detailed description and brief descriptions
2145 // explicitly disabled.
2146 bool visibleIfEnabled = !(hideUndocMembers &&
2147 documentation().isEmpty() &&
2148 !briefMemberDesc &&
2149 !repeatBrief
2150 );
2151
2152 // Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true
2153 bool visibleIfFriendCompound = !(hideFriendCompounds &&
2154 isFriend() /*&&
2155 (m_type=="friend class" ||
2156 m_type=="friend struct" ||
2157 m_type=="friend union"
2158 )*/
2159 );
2160
2161 // only include members that are non-private unless EXTRACT_PRIVATE is
2162 // set to YES or the member is part of a group. And as a special case,
2163 // private *documented* virtual members are shown if EXTRACT_PRIV_VIRTUAL
2164 // is set to YES
2165 bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
2166 m_mtype==MemberType::Friend ||
2167 (m_prot==Protection::Private &&
2168 (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual && hasDocs)
2169 );
2170
2171 // hide member if it overrides a member in a superclass and has no
2172 // documentation of its own
2173 //bool visibleIfDocVirtual = !reimplements() ||
2174 // !Config_getBool(INHERIT_DOCS) ||
2175 // hasDocs;
2176
2177 // true if this member is a constructor or destructor
2178 bool cOrDTor = isConstructor() || isDestructor();
2179
2180 // hide default constructors or destructors (no args) without
2181 // documentation
2182 bool visibleIfNotDefaultCDTor = !(cOrDTor &&
2183 (m_defArgList.empty() ||
2184 m_defArgList.front().type == "void"
2185 ) &&
2186 !hasDocs
2187 );
2188
2189
2190 //printf("visibleIfStatic=%d visibleIfDocumented=%d visibleIfEnabled=%d "
2191 // "visibleIfPrivate=%d visibleIfNotDefaultCDTor=%d "
2192 // "visibleIfFriendCompound=%d !annScope=%d\n",
2193 // visibleIfStatic,visibleIfDocumented,
2194 // visibleIfEnabled,visibleIfPrivate,visibleIfNotDefaultCDTor,
2195 // visibleIfFriendCompound,!m_annScope);
2196
2197 bool visible = visibleIfStatic && visibleIfDocumented &&
2198 visibleIfEnabled && visibleIfPrivate &&
2199 /*visibleIfDocVirtual &&*/ visibleIfNotDefaultCDTor &&
2200 visibleIfFriendCompound &&
2201 !m_annScope && !isHidden();
2202 //printf("MemberDefImpl::isBriefSectionVisible() %d\n",visible);
2203 return visible;
2204}
2205
2207{
2208 SrcLangExt lang = getLanguage();
2209 QCString ltype(m_type);
2210 if (lang==SrcLangExt::Cpp && isEnumerate() && isStrong())
2211 {
2212 if (isEnumStruct())
2213 {
2214 ltype+=" struct";
2215 }
2216 else
2217 {
2218 ltype+=" class";
2219 }
2220 }
2221 if (isTypedef() && getLanguage() != SrcLangExt::Slice)
2222 {
2223 ltype.prepend("typedef ");
2224 }
2225 if (isTypeAlias())
2226 {
2227 if (lang==SrcLangExt::Python)
2228 {
2229 ltype="type";
2230 }
2231 else
2232 {
2233 ltype="using";
2234 }
2235 }
2236 // strip 'friend' keyword from ltype
2237 ltype.stripPrefix("friend ");
2238 if (ltype=="@") // rename type from enum values
2239 {
2240 ltype="";
2241 }
2242 else
2243 {
2244 if (isObjCMethod())
2245 {
2246 ltype.prepend("(");
2247 ltype.append(")");
2248 }
2249 }
2250 return ltype;
2251}
2252
2254 const ArgumentList &al, bool writeReqClause) const
2255{
2256 ol.docify("template<");
2257 LinkifyTextOptions options;
2258 options.setScope(def).setFileScope(getFileDef()).setSelf(this);
2259 for (auto it = al.begin(); it!=al.end();)
2260 {
2261 Argument a = *it;
2262 linkifyText(TextGeneratorOLImpl(ol),a.type,options);
2263 if (!a.name.isEmpty())
2264 {
2265 ol.docify(" ");
2266 ol.docify(a.name);
2267 }
2268 if (!a.defval.isEmpty())
2269 {
2270 ol.docify(" = ");
2271 ol.docify(a.defval);
2272 }
2273 ++it;
2274 if (it!=al.end()) ol.docify(", ");
2275 }
2276 ol.docify("> ");
2277 if (writeReqClause && !m_requiresClause.isEmpty())
2278 {
2279 ol.lineBreak();
2280 ol.docify("requires ");
2282 m_requiresClause, // text
2283 LinkifyTextOptions(options).setAutoBreak(true).setBreakThreshold(120));
2284 }
2285}
2286
2288{
2289 if (exception.isEmpty()) return args; // no exception, nothing to combine args
2290 int pos = args.findRev(')');
2291 int eqPos = pos!=-1 ? args.find('=',pos) : -1; // look for '=' in '(args) = something'
2292 if (eqPos==-1) return args+" "+exception; // append exception at the end
2293 return args.left(eqPos)+" "+exception+" "+args.mid(eqPos); // insert exception before =
2294}
2295
2297{
2298 return !m_bitfields.isEmpty() && name().startsWith("__pad"); // anonymous bitfield
2299}
2300
2302 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
2303 bool inGroup, int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId) const
2304{
2305 //printf("> %s MemberDefImpl::writeDeclaration() inGroup=%d inheritId=%s\n",qPrint(qualifiedName()),inGroup,qPrint(inheritId));
2306
2307 // hide enum value, since they appear already as part of the enum, unless they
2308 // are explicitly grouped.
2309 if (!inGroup && m_mtype==MemberType::EnumValue) return;
2310
2311 const Definition *d=nullptr;
2312 ASSERT (cd!=nullptr || nd!=nullptr || fd!=nullptr || gd!=nullptr || mod!=nullptr); // member should belong to something
2313 if (cd) d=cd;
2314 else if (nd) d=nd;
2315 else if (fd) d=fd;
2316 else d=gd;
2317 if (d==gd || d==mod) // see bug 753608
2318 {
2319 if (getClassDef()) d = getClassDef();
2320 else if (getNamespaceDef()) d = getNamespaceDef();
2321 else if (getFileDef()) d = getFileDef();
2322 }
2323 else if (d==fd) // see issue #9850, namespace member can be shown in file scope as well
2324 {
2325 if (getNamespaceDef()) d = getNamespaceDef();
2326 }
2327 if (d==nullptr)
2328 {
2329 err("No context could be derived for member '{}'\n",name());
2330 return; // should not happen
2331 }
2332
2333 QCString cname = d->name();
2334 QCString cdname = d->displayName();
2335 QCString cfname = getOutputFileBase();
2336
2337 // search for the last anonymous scope in the member type
2338 ClassDef *annoClassDef=getClassDefOfAnonymousType();
2339
2341
2342 // start a new member declaration
2343 bool isAnonType = annoClassDef || m_fromAnnMemb || m_annEnumType;
2347 ol.startMemberItem(annoClassDef ? QCString() : anchor(), anonType, inheritId);
2348
2349
2350 // If there is no detailed description we need to write the anchor here.
2351 bool detailsVisible = hasDetailedDescription();
2352 bool writeAnchor = (inGroup || getGroupDef()==nullptr) && // only write anchors for member that have no details and are
2353 !detailsVisible && !m_fromAnnMemb && // rendered inside the group page or are not grouped at all
2354 inheritId.isEmpty();
2355
2356 if (writeAnchor)
2357 {
2358 QCString doxyArgs=argsString();
2359 QCString doxyName=name();
2360 if (!cname.isEmpty())
2361 {
2363 }
2364 ol.startDoxyAnchor(cfname,cname,anchor(),doxyName,doxyArgs);
2365 ol.addLabel(cfname,anchor());
2366 }
2367
2368 if (!detailsVisible)
2369 {
2370 ol.pushGeneratorState();
2374 ol.docify("\n");
2375 ol.popGeneratorState();
2376 }
2377
2378 if (annoClassDef || m_fromAnnMemb)
2379 {
2380 for (int j=0;j<indentLevel;j++)
2381 {
2383 }
2384 }
2385
2386 // *** write template lists
2387 if (m_tArgList.hasParameters() && getLanguage()==SrcLangExt::Cpp)
2388 {
2389 if (!isAnonType) ol.startMemberTemplateParams();
2391 if (!isAnonType) ol.endMemberTemplateParams(anchor(),inheritId);
2392 }
2393
2394
2395 // *** write type
2396 QCString ltype(m_type);
2397 auto lang = getLanguage();
2398 if (isTypedef() && lang != SrcLangExt::Slice)
2399 {
2400 ltype.prepend("typedef ");
2401 }
2402 if (isTypeAlias())
2403 {
2404 if (lang==SrcLangExt::Python)
2405 {
2406 ltype="type";
2407 }
2408 else
2409 {
2410 ltype="using";
2411 }
2412 }
2413 // strip 'friend' keyword from ltype
2414 ltype.stripPrefix("friend ");
2415 static const reg::Ex r(R"(@\d+)");
2416 reg::Match match;
2417 std::string stype = ltype.str();
2418 bool endAnonScopeNeeded=FALSE;
2419 LinkifyTextOptions options;
2420 options.setScope(d).setFileScope(getBodyDef()).setSelf(this);
2421 if (reg::search(stype,match,r)) // member has an anonymous type
2422 {
2423 int i = static_cast<int>(match.position());
2424 int l = static_cast<int>(match.length());
2425 //printf("annoClassDef=%p annMemb=%p scopeName='%s' anonymous='%s'\n",
2426 // annoClassDef,annMemb,qPrint(cname),qPrint(ltype.mid(i,l)));
2427
2428 if (annoClassDef) // type is an anonymous compound
2429 {
2430 int ir=i+l;
2431 //printf("<<<<<<<<<<<<<<\n");
2432 ol.startAnonTypeScope(indentLevel);
2433 annoClassDef->writeDeclaration(ol,m_fromAnnMemb,inGroup,indentLevel+1,inheritedFrom,inheritId);
2434 //printf(">>>>>>>>>>>>>> startMemberItem(2)\n");
2436 ol.startMemberItem(anchor(),anonType,inheritId);
2437 for (int j=0;j< indentLevel;j++)
2438 {
2440 }
2441 QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace();
2442 //printf(">>>>>> ltype='%s' varName='%s'\n",qPrint(ltype),qPrint(varName));
2443 ol.docify("}");
2444 if (varName.isEmpty() && isAnonymous())
2445 {
2446 ol.docify(";");
2447 }
2448 else if (!varName.isEmpty() && (varName.at(0)=='*' || varName.at(0)=='&'))
2449 {
2450 ol.docify(" ");
2451 ol.docify(varName);
2452 }
2453 endAnonScopeNeeded=TRUE;
2454 }
2455 else
2456 {
2457 if (getAnonymousEnumType()) // type is an anonymous enum
2458 {
2459 linkifyText(TextGeneratorOLImpl(ol),ltype.left(i),options);
2460 getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
2461 linkifyText(TextGeneratorOLImpl(ol),ltype.right(ltype.length()-i-l),LinkifyTextOptions(options).setAutoBreak(true));
2462 }
2463 else
2464 {
2465 ltype = ltype.left(i) + " { ... } " + removeAnonymousScopes(ltype.right(ltype.length()-i-l));
2466 linkifyText(TextGeneratorOLImpl(ol), ltype, options);
2467 }
2468 }
2469 }
2470 else if (ltype=="@") // rename type from enum values
2471 {
2472 ltype="";
2473 }
2474 else
2475 {
2476 if (isObjCMethod())
2477 {
2478 ltype.prepend("(");
2479 ltype.append(")");
2480 }
2481 linkifyText(TextGeneratorOLImpl(ol),ltype,options);
2482 }
2483 bool htmlOn = ol.isEnabled(OutputType::Html);
2484 if (htmlOn && !ltype.isEmpty())
2485 {
2487 }
2488 if (!ltype.isEmpty()) ol.docify(" ");
2489 if (htmlOn)
2490 {
2492 }
2493
2494 if (m_fromAnnMemb)
2495 {
2496 ol.pushGeneratorState();
2499 ol.popGeneratorState();
2500 }
2501 else
2502 {
2503 ol.insertMemberAlign(m_tArgList.hasParameters());
2504 }
2505
2506 // *** write name
2507 if (!isAnonymous() && !_isAnonymousBitField()) // hide anonymous stuff
2508 {
2509 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2510 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2512 bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
2513 m_mtype==MemberType::Friend ||
2514 (m_prot==Protection::Private &&
2515 (m_virt!=Specifier::Normal || isOverride() || isFinal()) &&
2516 extractPrivateVirtual && hasDocumentation()
2517 ));
2518 //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",qPrint(name()),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation());
2519 if (!name().isEmpty() && // name valid
2520 (hasDetailedDescription() || isReference()) && // has docs
2521 visibleIfPrivate &&
2522 !(isStatic() && getClassDef()==nullptr && !extractStatic) // hidden due to static-ness
2523 )
2524 {
2525 if (annMemb)
2526 {
2527 //printf("anchor=%s ann_anchor=%s\n",anchor(),annMemb->anchor());
2528 annMemb->writeLink(ol,
2529 annMemb->getClassDef(),
2530 annMemb->getNamespaceDef(),
2531 annMemb->getFileDef(),
2532 annMemb->getGroupDef(),
2533 annMemb->getModuleDef());
2534 }
2535 else
2536 {
2537 //printf("writeLink %s->%d\n",qPrint(name),hasDocumentation());
2538 const ClassDef *rcd = cd;
2539 if (isReference() && getClassDef()) rcd = getClassDef();
2540 writeLink(ol,rcd,nd,fd,gd,mod);
2541 }
2542 }
2543 else if (isDocumentedFriendClass())
2544 // if the member is an undocumented friend declaration for some class,
2545 // then maybe we can link to the class
2546 {
2547 writeLink(ol,getClass(name()),nullptr,nullptr,nullptr,nullptr);
2548 }
2549 else
2550 // there is a brief member description and brief member
2551 // descriptions are enabled or there is no detailed description.
2552 {
2553 const ClassDef *rcd = cd;
2554 if (isReference() && getClassDef()) rcd = getClassDef();
2555 writeLink(ol,rcd,nd,fd,gd,mod,TRUE);
2556 }
2557 }
2558
2559 // *** write arguments
2560 if (!argsString().isEmpty() && !isObjCMethod())
2561 {
2562 if (!isDefine() && !isTypedef()) ol.writeString(" ");
2564 isDefine() ?
2565 substitute(argsString(),",",", ") :
2566 isTypedef() ?
2567 substitute(argsString(),")(",") (") :
2569 LinkifyTextOptions(options)
2570 .setArgumentList(&m_defArgList)
2571 .setAutoBreak(m_fromAnnMemb!=nullptr)
2572 .setIndentLevel(indentLevel)
2573 );
2574 }
2575
2576 // *** write bitfields
2577 if (!m_bitfields.isEmpty()) // add bitfields
2578 {
2580 }
2581 else if (hasOneLineInitializer()
2582 //!init.isEmpty() && initLines==0 && // one line initializer
2583 //((maxInitLines>0 && userInitLines==-1) || userInitLines>0) // enabled by default or explicitly
2584 ) // add initializer
2585 {
2586 if (isTypeAlias()) // using statement
2587 {
2588 ol.writeString(" = ");
2589 linkifyText(TextGeneratorOLImpl(ol),m_initializer.simplifyWhiteSpace(),options);
2590 }
2591 else if (!isDefine())
2592 {
2593 //ol.writeString(" = ");
2594 ol.writeString(" ");
2595 linkifyText(TextGeneratorOLImpl(ol),m_initializer.simplifyWhiteSpace(),options);
2596 }
2597 else
2598 {
2601 }
2602 }
2603
2604
2606 {
2607 ol.startTypewriter();
2608 ol.docify(" [implementation]");
2609 ol.endTypewriter();
2610 }
2611
2612 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2613
2614 if (isProperty() && (isSettable() || isGettable() ||
2617 {
2618 ol.writeLatexSpacing();
2619 ol.startTypewriter();
2620 ol.docify(" [");
2621 StringVector sl;
2622
2623 if (isGettable()) sl.emplace_back("get");
2624 if (isProtectedGettable()) sl.emplace_back("protected get");
2625 if (isSettable()) sl.emplace_back("set");
2626 if (isProtectedSettable()) sl.emplace_back("protected set");
2627 if (extractPrivate)
2628 {
2629 if (isPrivateGettable()) sl.emplace_back("private get");
2630 if (isPrivateSettable()) sl.emplace_back("private set");
2631 }
2632 bool first=true;
2633 for (const auto &s : sl)
2634 {
2635 if (!first)
2636 {
2637 ol.docify(", ");
2638 }
2639 first=false;
2640 ol.docify(s);
2641 }
2642 ol.docify("]");
2643 ol.endTypewriter();
2644 }
2645
2646 if (isEvent() && (isAddable() || isRemovable() || isRaisable()))
2647 {
2648 ol.writeLatexSpacing();
2649 ol.startTypewriter();
2650 ol.docify(" [");
2651 StringVector sl;
2652 if (isAddable()) sl.emplace_back("add");
2653 if (isRemovable()) sl.emplace_back("remove");
2654 if (isRaisable()) sl.emplace_back("raise");
2655 bool first=true;
2656 for (const auto &s : sl)
2657 {
2658 if (!first)
2659 {
2660 ol.docify(", ");
2661 }
2662 first=false;
2663 ol.docify(s);
2664 }
2665 ol.docify("]");
2666 ol.endTypewriter();
2667 }
2668
2669 if (writeAnchor)
2670 {
2671 ol.endDoxyAnchor(cfname,anchor());
2672 }
2673
2674 //printf("endMember %s annoClassDef=%p annEnumType=%p\n",
2675 // qPrint(name()),annoClassDef,annEnumType);
2676 ol.endMemberItem(anonType);
2677 if (endAnonScopeNeeded)
2678 {
2679 ol.endAnonTypeScope(indentLevel);
2680 }
2681
2682 // write brief description
2683 if (!briefDescription().isEmpty() &&
2684 Config_getBool(BRIEF_MEMBER_DESC)
2685 )
2686 {
2687 auto parser { createDocParser() };
2688 auto ast { validatingParseDoc(*parser.get(),
2689 briefFile(),
2690 briefLine(),
2692 this,
2694 DocOptions()
2695 .setIndexWords(inheritedFrom==nullptr)
2696 .setSingleLine(true))
2697 };
2698 if (!ast->isEmpty())
2699 {
2700 ol.startMemberDescription(anchor(),inheritId);
2701 ol.writeDoc(ast.get(),getOuterScope()?getOuterScope():d,this);
2702 if (detailsVisible) // add More.. link only when both brief and details are visible
2703 {
2704 if (!isAnonymous()) // hide anonymous stuff
2705 {
2706 ol.pushGeneratorState();
2708 ol.docify(" ");
2710 if (annMemb)
2711 {
2712 ol.startTextLink(annMemb->getOutputFileBase(),annMemb->anchor());
2713 ol.parseText(theTranslator->trMore());
2714 ol.endTextLink();
2715 }
2716 ol.popGeneratorState();
2717 }
2718 }
2719 // for RTF we need to add an extra empty paragraph
2720 ol.pushGeneratorState();
2722 ol.startParagraph();
2723 ol.endParagraph();
2724 ol.popGeneratorState();
2726 }
2727 }
2728
2729 ol.endMemberDeclaration(anchor(),inheritId);
2730
2732 //printf("< %s MemberDefImpl::writeDeclaration() inGroup=%d\n",qPrint(qualifiedName()),inGroup);
2733}
2734
2736
2738{
2739 std::lock_guard<std::mutex> lock(g_hasDetailedDescriptionMutex);
2740 //printf(">hasDetailedDescription(cached=%d)\n",m_hasDetailedDescriptionCached);
2742 {
2743 bool extractAll = Config_getBool(EXTRACT_ALL);
2744 bool alwaysDetailedSec = Config_getBool(ALWAYS_DETAILED_SEC);
2745 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2746 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
2747 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2748 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2749 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2750 bool inlineSources = hasInlineSource();
2751
2752 // the member has detailed documentation because the user added some comments
2753 bool docFilter =
2754 // extract all is enabled
2755 extractAll ||
2756 // has detailed docs
2757 !documentation().isEmpty() ||
2758 // has inbody docs
2760 // is an enum with values that are documented
2762 // is documented enum value
2763 (m_mtype==MemberType::EnumValue && !briefDescription().isEmpty()) ||
2764 // has brief description that is part of the detailed description
2765 (!briefDescription().isEmpty() && // has brief docs
2766 (alwaysDetailedSec && // they are visible in
2767 (repeatBrief || // detailed section or
2768 !briefMemberDesc // they are explicitly not
2769 ) // shown in brief section
2770 )
2771 ) ||
2772 // has one or more documented arguments
2774 m_templateMaster->argumentList().hasDocumentation() :
2775 m_defArgList.hasDocumentation()) ||
2777 m_templateMaster->templateArguments().hasTemplateDocumentation() :
2778 m_tArgList.hasTemplateDocumentation()) ||
2779 // user-specified qualifiers
2780 !m_qualifiers.empty();
2781
2782 // generate function guard
2783 // ================== =======
2784 // _writeGroupInclude -> ignored in calculation
2785 // multiLineInitializer() -> hasMultiLineInitializer()
2786 // _writeReimplements -> _isReimplements()
2787 // _writeReimplementedBy -> _countReimplementedBy()>0
2788 // _writeExamples -> hasExamples()
2789 // _writeTypeConstraints -> m_typeConstraints.hasParameters()
2790 // writeSourceDef -> !getSourceFileBase().isEmpty();
2791 // writeInlineCode -> hasInlineSource() && hasSources()
2792 // writeSourceRefs -> hasReferencesRelation() && hasSourceRefs()
2793 // writeSourceReffedBy -> hasReferencedByRelation() && hasSourceReffedBy()
2794 // _writeCallGraph -> _hasVisibleCallGraph()
2795 // _writeCallerGraph -> _hasVisibleCallerGraph()
2796
2797 // the member has detailed documentation because there is some generated info
2798 bool docInfo =
2799 // has a multi-line initialization block
2801 // reimplements / reimplemented by
2803 // examples
2804 hasExamples() ||
2805 // type constraints
2806 m_typeConstraints.hasParameters() ||
2807 // has source definition
2809 // has inline sources
2810 (inlineSources && hasSources()) ||
2811 // has references
2814 // call graph
2816 // caller graph
2818 // requirement references
2820
2821 if (!hideUndocMembers) // if HIDE_UNDOC_MEMBERS is NO we also show the detailed section
2822 // if there is only some generated info
2823 {
2824 docFilter = docFilter || docInfo;
2825 }
2826
2827 // this is not a global static or global statics should be extracted
2828 bool staticFilter = getClassDef()!=nullptr || !isStatic() || extractStatic;
2829
2830 // a module does not contain details for members, so either the namespace or file should be linkable
2831 bool moduleFilter = getModuleDef()==nullptr || (getFileDef() && getFileDef()->isLinkable()) ||
2833
2834 // only include members that are non-private unless EXTRACT_PRIVATE is
2835 // set to YES or the member is part of a group
2836 bool privateFilter = protectionLevelVisible(protection()) || m_mtype==MemberType::Friend ||
2837 (m_prot==Protection::Private && (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual);
2838
2839 // hide friend (class|struct|union) member if HIDE_FRIEND_COMPOUNDS
2840 // is true
2841 bool friendCompoundFilter = !(Config_getBool(HIDE_FRIEND_COMPOUNDS) && isFriend());
2842
2844 (docFilter && staticFilter && moduleFilter && privateFilter && friendCompoundFilter && !isHidden());
2845 //printf("docFilter=%d docInfo=%d staticFilter=%d privateFilter=%d friendCompoundFilter=%d !isHidden()=%d",
2846 // docFilter,docInfo,staticFilter,privateFilter,friendCompoundFilter,!isHidden());
2848 }
2849 //printf("<hasDetailedDescription(cached=%d)\n",m_hasDetailedDescriptionCached);
2851}
2852
2854{
2855 bool separateMemPages = Config_getBool(SEPARATE_MEMBER_PAGES);
2856 bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
2857 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2858 bool groupFilter = getGroupDef()==nullptr || container==MemberListContainer::Group || separateMemPages;
2859 bool fileFilter = getNamespaceDef()==nullptr || !getNamespaceDef()->isLinkable() || container!=MemberListContainer::File;
2860 bool simpleFilter = (hasBriefDescription() || !hideUndocMembers) && inlineSimpleStructs &&
2861 getClassDef()!=nullptr && getClassDef()->isSimple();
2862
2863 bool visible = hasDetailedDescription() && groupFilter && fileFilter &&
2864 !isReference();
2865 bool result = visible || simpleFilter;
2866 //printf("%s::isDetailedSectionVisible: %d groupFilter=%d fileFilter=%d\n",
2867 // qPrint(name()),result,groupFilter,fileFilter);
2868 return result;
2869}
2870
2872{
2873 StringVector sl;
2874 bool inlineInfo = Config_getBool(INLINE_INFO);
2875
2876 Specifier lvirt=virtualness();
2877 if ((!isObjCMethod() || isOptional() || isRequired()) &&
2878 (protection()!=Protection::Public || lvirt!=Specifier::Normal ||
2879 isFriend() || isRelated() ||
2880 (isInline() && inlineInfo) ||
2881 isSignal() || isSlot() ||
2882 isStatic() || isExternal() ||
2883 isExported() ||
2884 (getClassDef() && getClassDef()!=container && container->definitionType()==TypeClass) ||
2885 TypeSpecifier(m_memSpec).setInline(false)!=TypeSpecifier()
2886 )
2887 )
2888 {
2889 // write the member specifier list
2890 //ol.writeLatexSpacing();
2891 //ol.startTypewriter();
2892 //ol.docify(" [");
2893 SrcLangExt lang = getLanguage();
2894 bool optVhdl = lang==SrcLangExt::VHDL;
2895 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2896 if (optVhdl)
2897 {
2898 sl.push_back(theTranslator->trVhdlType(getVhdlSpecifiers(),TRUE).str());
2899 }
2900 else
2901 {
2902 if (isFriend()) sl.emplace_back("friend");
2903 else if (isRelated()) sl.emplace_back("related");
2904 else
2905 {
2906 if (isExternal()) sl.emplace_back("extern");
2907 if (inlineInfo && isInline()) sl.emplace_back("inline");
2908 if (isExplicit()) sl.emplace_back("explicit");
2909 if (isMutable()) sl.emplace_back("mutable");
2910 if (isThreadLocal()) sl.emplace_back("thread_local");
2911 if (isStatic()) sl.emplace_back("static");
2912 if (isGettable()) sl.emplace_back("get");
2913 if (isProtectedGettable()) sl.emplace_back("protected get");
2914 if (isSettable()) sl.emplace_back("set");
2915 if (isProtectedSettable()) sl.emplace_back("protected set");
2916 if (extractPrivate)
2917 {
2918 if (isPrivateGettable()) sl.emplace_back("private get");
2919 if (isPrivateSettable()) sl.emplace_back("private set");
2920 }
2921 if (isNoDiscard()) sl.emplace_back("nodiscard");
2922 if (isConstExpr()) sl.emplace_back("constexpr");
2923 if (isConstEval()) sl.emplace_back("consteval");
2924 if (isConstInit()) sl.emplace_back("constinit");
2925 if (isAddable()) sl.emplace_back("add");
2926 if (!isUNOProperty() && isRemovable()) sl.emplace_back("remove");
2927 if (isRaisable()) sl.emplace_back("raise");
2928 if (isReadable()) sl.emplace_back("read");
2929 if (isWritable()) sl.emplace_back("write");
2930 if (isFinal()) sl.emplace_back("final");
2931 if (isAbstract()) sl.emplace_back("abstract");
2932 if (isOverride()) sl.emplace_back("override");
2933 if (isInitonly()) sl.emplace_back("initonly");
2934 if (isSealed()) sl.emplace_back("sealed");
2935 if (isNew()) sl.emplace_back("new");
2936 if (isOptional()) sl.emplace_back("optional");
2937 if (isRequired()) sl.emplace_back("required");
2938 if (isExported()) sl.emplace_back("export");
2939
2940 if (isNonAtomic()) sl.emplace_back("nonatomic");
2941 else if (isObjCProperty()) sl.emplace_back("atomic");
2942
2943 // mutual exclusive Objective 2.0 property attributes
2944 if (isAssign()) sl.emplace_back("assign");
2945 else if (isCopy()) sl.emplace_back("copy");
2946 else if (isRetain()) sl.emplace_back("retain");
2947 else if (isWeak()) sl.emplace_back("weak");
2948 else if (lang!=SrcLangExt::CSharp && isStrong()) sl.emplace_back("strong");
2949 else if (isUnretained()) sl.emplace_back("unsafe_unretained");
2950
2951 if (!isObjCMethod())
2952 {
2953 if (protection()==Protection::Protected) sl.emplace_back("protected");
2954 else if (protection()==Protection::Private) sl.emplace_back("private");
2955 else if (protection()==Protection::Package) sl.emplace_back("package");
2956
2957 if (lvirt==Specifier::Virtual) sl.emplace_back("virtual");
2958 else if (lvirt==Specifier::Pure) sl.emplace_back("pure virtual");
2959 if (isSignal()) sl.emplace_back("signal");
2960 if (isSlot()) sl.emplace_back("slot");
2961 if (isDefault()) sl.emplace_back("default");
2962 if (isDelete()) sl.emplace_back("delete");
2963 if (isNoExcept()) sl.emplace_back("noexcept");
2964 if (isAttribute()) sl.emplace_back("attribute");
2965 if (isUNOProperty()) sl.emplace_back("property");
2966 if (isReadonly()) sl.emplace_back("readonly");
2967 if (isBound()) sl.emplace_back("bound");
2968 if (isUNOProperty() && isRemovable()) sl.emplace_back("removable");
2969 if (isConstrained()) sl.emplace_back("constrained");
2970 if (isTransient()) sl.emplace_back("transient");
2971 if (isMaybeVoid()) sl.emplace_back("maybevoid");
2972 if (isMaybeDefault()) sl.emplace_back("maybedefault");
2973 if (isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
2974 if (isPublished()) sl.emplace_back("published"); // enum
2975 }
2977 {
2978 sl.emplace_back("implementation");
2979 }
2980 }
2981 if (getClassDef() &&
2982 container->definitionType()==TypeClass &&
2983 getClassDef()!=container &&
2984 !isRelated()
2985 )
2986 {
2987 sl.emplace_back("inherited");
2988 }
2989 }
2990 }
2991 else if (isObjCMethod() && isImplementation())
2992 {
2993 sl.emplace_back("implementation");
2994 }
2995
2996 for (const auto &sx : m_qualifiers)
2997 {
2998 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2999 if (!alreadyAdded)
3000 {
3001 sl.push_back(sx);
3002 }
3003 }
3004
3005 return sl;
3006}
3007
3009{
3010 // write call graph
3012 {
3013 DotCallGraph callGraph(this,FALSE);
3014 if (callGraph.isTooBig())
3015 {
3016 warn_uncond("Call graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
3017 qualifiedName(), callGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
3018 }
3019 else if (!callGraph.isTrivial())
3020 {
3021 msg("Generating call graph for function {}\n",qualifiedName());
3023 ol.startCallGraph();
3024 ol.parseText(theTranslator->trCallGraph());
3025 ol.endCallGraph(callGraph);
3026 ol.enableAll();
3027 }
3028 }
3029}
3030
3032{
3034 {
3035 DotCallGraph callerGraph(this, TRUE);
3036 if (callerGraph.isTooBig())
3037 {
3038 warn_uncond("Caller graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
3039 qualifiedName(), callerGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
3040 }
3041 else if (!callerGraph.isTrivial())
3042 {
3043 msg("Generating caller graph for function {}\n",qualifiedName());
3045 ol.startCallGraph();
3046 ol.parseText(theTranslator->trCallerGraph());
3047 ol.endCallGraph(callerGraph);
3048 ol.enableAll();
3049 }
3050 }
3051}
3052
3054{
3055 const MemberDef *bmd=reimplements();
3056 const ClassDef *bcd=nullptr;
3057 if (bmd && (bcd=bmd->getClassDef()))
3058 {
3059 // write class that contains a member that is reimplemented by this one
3060 if (bcd->isLinkable())
3061 {
3062 return true;
3063 }
3064 }
3065 return false;
3066}
3068{
3069 const MemberDef *bmd=reimplements();
3070 const ClassDef *bcd=nullptr;
3071 if (bmd && (bcd=bmd->getClassDef()))
3072 {
3073 // write class that contains a member that is reimplemented by this one
3074 if (bcd->isLinkable())
3075 {
3076 ol.startParagraph();
3077 QCString reimplFromLine;
3078 if (bmd->virtualness()!=Specifier::Pure && bcd->compoundType()!=ClassDef::Interface)
3079 {
3080 reimplFromLine = theTranslator->trReimplementedFromList(1);
3081 }
3082 else
3083 {
3084 reimplFromLine = theTranslator->trImplementedFromList(1);
3085 }
3086 int markerPos = reimplFromLine.find("@0");
3087 if (markerPos!=-1) // should always pass this.
3088 {
3089 ol.parseText(reimplFromLine.left(markerPos)); //text left from marker
3090 if (bmd->isLinkable()) // replace marker with link
3091 {
3092 //Definition *bd=bmd->group;
3093 //if (bd==0) bd=bcd;
3095 bmd->anchor(),bcd->displayName());
3096
3097 //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
3098 // bmd->anchor(),bcd->name());
3099 if ( bmd->isLinkableInProject() )
3100 {
3101 writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
3102 }
3103 }
3104 else
3105 {
3107 QCString(),bcd->displayName());
3108 if (bcd->isLinkableInProject()/* && !Config_getBool(PDF_HYPERLINKS)*/ )
3109 {
3110 writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor());
3111 }
3112 }
3113 ol.parseText(reimplFromLine.right(
3114 reimplFromLine.length()-markerPos-2)); // text right from marker
3115
3116 }
3117 else
3118 {
3119 err("translation error: no marker in trReimplementsFromList()\n");
3120 }
3121 ol.endParagraph();
3122 }
3123 }
3124}
3125
3127{
3128 const MemberVector &bml=reimplementedBy();
3129 size_t count=0;
3130 for (const auto &bmd : bml)
3131 {
3132 const ClassDef *bcd=bmd->getClassDef();
3133 // count the members that directly inherit from md and for
3134 // which the member and class are visible in the docs.
3135 if ( bcd && bmd->isLinkable() && bcd->isLinkable() )
3136 {
3137 count++;
3138 }
3139 }
3140 return count;
3141}
3142
3144{
3145 const MemberVector &bml=reimplementedBy();
3146 size_t count = _countReimplementedBy();
3147 if (count>0)
3148 {
3149 auto replaceFunc = [&bml,&ol](size_t entryIndex)
3150 {
3151 size_t cnt=0;
3152 auto it = bml.begin();
3153 // find the entryIndex-th documented entry in the inheritance list.
3154 const MemberDef *bmd = nullptr;
3155 const ClassDef *bcd = nullptr;
3156 while (it!=bml.end())
3157 {
3158 bmd = *it;
3159 bcd = bmd->getClassDef();
3160 if ( bmd->isLinkable() && bcd->isLinkable())
3161 {
3162 if (cnt==entryIndex) break;
3163 cnt++;
3164 }
3165 ++it;
3166 }
3167
3168 if (bcd && bmd) // write link for marker
3169 {
3170 //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
3171 // bmd->anchor(),bcd->name());
3173 bmd->anchor(),bcd->displayName());
3174
3175 if (bmd->isLinkableInProject() )
3176 {
3177 writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
3178 }
3179 }
3180 };
3181
3182 QCString reimplInLine;
3183 if (m_virt==Specifier::Pure || (getClassDef() && getClassDef()->compoundType()==ClassDef::Interface))
3184 {
3185 reimplInLine = theTranslator->trImplementedInList(static_cast<int>(count));
3186 }
3187 else
3188 {
3189 reimplInLine = theTranslator->trReimplementedInList(static_cast<int>(count));
3190 }
3191
3192 // write the list of classes that overwrite this member
3193 ol.startParagraph();
3194 writeMarkerList(ol,
3195 reimplInLine.str(),
3196 count,
3197 replaceFunc);
3198 ol.endParagraph();
3199 }
3200}
3201
3203{
3204 if (getClassDef()) // this should be a member of a class/category
3205 {
3206 //printf("%s: category %s relation %s class=%s categoryOf=%s\n",
3207 // qPrint(name()),
3208 // m_category ? qPrint(m_category->name()) : "<none>",
3209 // m_categoryRelation ? qPrint(m_categoryRelation->name()) : "<none>",
3210 // qPrint(m_classDef->name()),
3211 // m_classDef->categoryOf() ? qPrint(m_classDef->categoryOf()->name()) : "<none>"
3212 // );
3213 QCString text;
3214 QCString ref;
3215 QCString file;
3216 QCString anc;
3217 QCString name;
3218 int i=-1;
3219 if (m_categoryRelation && m_categoryRelation->isLinkable())
3220 {
3221 if (m_category)
3222 {
3223 // this member is in a normal class and implements method categoryRelation from category
3224 // so link to method 'categoryRelation' with 'provided by category 'category' text.
3225 text = theTranslator->trProvidedByCategory();
3226 name = m_category->displayName();
3227 }
3228 else if (getClassDef()->categoryOf())
3229 {
3230 // this member is part of a category so link to the corresponding class member of the class we extend
3231 // so link to method 'categoryRelation' with 'extends class 'classDef->categoryOf()'
3232 text = theTranslator->trExtendsClass();
3234 }
3235 i=text.find("@0");
3236 if (i!=-1)
3237 {
3238 const MemberDef *md = m_categoryRelation;
3239 ref = md->getReference();
3240 file = md->getOutputFileBase();
3241 anc = md->anchor();
3242 }
3243 }
3244 if (i!=-1 && !name.isEmpty())
3245 {
3246 ol.startParagraph();
3247 ol.parseText(text.left(i));
3248 ol.writeObjectLink(ref,file,anc,name);
3249 ol.parseText(text.mid(i+2));
3250 ol.endParagraph();
3251 }
3252 }
3253}
3254
3256{
3257 // write the list of examples that use this member
3258 if (hasExamples())
3259 {
3260 ol.startExamples();
3261 ol.startDescForItem();
3263 ol.endDescForItem();
3264 ol.endExamples();
3265 }
3266}
3267
3269{
3270 if (m_typeConstraints.hasParameters())
3271 {
3273 }
3274}
3275
3277 const QCString &cfname,const QCString &ciname,
3278 const QCString &cname) const
3279{
3280 // For enum, we also write the documented enum values
3281 if (isEnumerate())
3282 {
3283 bool first=true;
3284 //printf("** %s: enum values=%zu\n",qPrint(name()),enumFieldList().size());
3285 bool hasInits = false;
3286 if (hasEnumValues())
3287 {
3288 for (const auto &fmd : enumFieldList())
3289 {
3290 if (fmd->isLinkable())
3291 {
3292 if (!fmd->initializer().isEmpty())
3293 {
3294 hasInits = true;
3295 break;
3296 }
3297 }
3298 }
3299 }
3300 for (const auto &fmd : enumFieldList())
3301 {
3302 //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
3303 if (fmd->isLinkable())
3304 {
3305 if (first)
3306 {
3307 ol.startDescTable(theTranslator->trEnumerationValues(),hasInits);
3308 first=false;
3309 }
3310
3311 ol.startDescTableRow();
3312 ol.addIndexItem(fmd->name(),ciname);
3313 ol.addIndexItem(ciname,fmd->name());
3314
3316 ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString());
3317 ol.addLabel(cfname,fmd->anchor());
3318 ol.docify(fmd->name());
3320 ol.writeString(" ");
3321 ol.enableAll();
3322 ol.endDoxyAnchor(cfname,fmd->anchor());
3323 ol.endDescTableTitle();
3324 if (hasInits)
3325 {
3326 ol.startDescTableInit();
3327 if (!fmd->initializer().isEmpty())
3328 {
3329 QCString initStr = fmd->initializer().stripWhiteSpace();
3330 if (initStr.startsWith("=")) initStr = initStr.mid(1).stripWhiteSpace();
3332 ol.writeString("(");
3333 ol.enableAll();
3334 ol.docify(initStr);
3336 ol.writeString(")");
3337 ol.enableAll();
3338 }
3339 ol.endDescTableInit();
3340 }
3341 ol.startDescTableData();
3342
3343 bool hasBrief = !fmd->briefDescription().isEmpty();
3344 bool hasDetails = !fmd->documentation().isEmpty();
3345
3346 if (hasBrief)
3347 {
3348 ol.generateDoc(fmd->briefFile(),
3349 fmd->briefLine(),
3350 getOuterScope()?getOuterScope():container,
3351 fmd,
3352 fmd->briefDescription(),
3353 DocOptions()
3354 .setIndexWords(true));
3355 }
3356 if (hasDetails)
3357 {
3358 ol.generateDoc(fmd->docFile(),
3359 fmd->docLine(),
3360 getOuterScope()?getOuterScope():container,
3361 fmd,
3362 fmd->documentation()+"\n",
3363 DocOptions()
3364 .setIndexWords(true));
3365 }
3366 ol.endDescTableData();
3367 ol.endDescTableRow();
3368 }
3369 }
3370 if (!first)
3371 {
3372 ol.endDescTable();
3373 }
3374 }
3375}
3376
3377// match from the start of the scope until the last marker
3378static const reg::Ex reAnonymous(R"([\w:@]*@\d+)");
3379
3381{
3382 QCString ldef = definition();
3383 QCString title = name();
3384 if (isEnumerate())
3385 {
3386 if (isAnonymous())
3387 {
3388 ldef = title = "anonymous enum";
3389 if (!m_enumBaseType.isEmpty())
3390 {
3391 ldef+=" : "+m_enumBaseType;
3392 }
3393 }
3394 else
3395 {
3396 ldef.prepend("enum ");
3397 if (isSliceLocal())
3398 {
3399 ldef.prepend("local ");
3400 }
3401 }
3402 }
3403 else if (isEnumValue())
3404 {
3405 if (isAnonymous())
3406 {
3407 ldef=ldef.mid(2);
3408 }
3409 }
3410
3411 std::string sdef = ldef.str();
3412 reg::Match match;
3413 if (reg::search(sdef,match,reAnonymous))
3414 {
3415 ldef = match.prefix().str() + " { ... } " + removeAnonymousScopes(match.suffix().str());
3416 }
3417
3418 const ClassDef *cd=getClassDef();
3419 if (cd && cd->isObjectiveC())
3420 {
3421 // strip scope name
3422 int ep = ldef.find("::");
3423 if (ep!=-1)
3424 {
3425 int sp=ldef.findRev(' ',ep);
3426 if (sp!=-1)
3427 {
3428 ldef=ldef.left(sp+1)+ldef.mid(ep+2);
3429 }
3430 }
3431 // strip keywords
3432 int dp = ldef.find(':');
3433 if (dp!=-1)
3434 {
3435 ldef=ldef.left(dp+1);
3436 }
3437 int l=static_cast<int>(ldef.length());
3438 //printf("start >%s<\n",qPrint(ldef));
3439 int i=l-1;
3440 while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
3441 while (i>=0 && isspace(static_cast<uint8_t>(ldef.at(i)))) i--;
3442 if (i>0)
3443 {
3444 // insert branches around the type
3445 ldef = "("+ldef.left(i+1)+")"+ldef.mid(i+1);
3446 }
3447 //printf("end >%s< i=%d\n",qPrint(ldef),i);
3448 if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
3449 }
3450 SrcLangExt lang = getLanguage();
3452 return substitute(ldef,"::",sep);
3453}
3454
3456{
3457 // only write out the include file if this is not part of a class or file
3458 // definition
3459 bool showGroupedMembInc = Config_getBool(SHOW_GROUPED_MEMB_INC);
3460 bool forceLocalIncludes = Config_getBool(FORCE_LOCAL_INCLUDES);
3461 const FileDef *fd = getFileDef();
3462 QCString nm;
3463 if (inGroup && fd && showGroupedMembInc)
3464 {
3465 if (!Config_getList(STRIP_FROM_INC_PATH).empty())
3466 {
3468 }
3469 else
3470 {
3471 nm = fd->name();
3472 }
3473 }
3474 if (!nm.isEmpty())
3475 {
3476 ol.startParagraph();
3477 ol.startTypewriter();
3478 SrcLangExt lang = getLanguage();
3479 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
3480 if (isIDLorJava)
3481 {
3482 ol.docify("import ");
3483 }
3484 else
3485 {
3486 ol.docify("#include ");
3487 }
3488
3489 if (isIDLorJava || forceLocalIncludes) ol.docify("\""); else ol.docify("<");
3490
3491 if (fd->isLinkable())
3492 {
3493 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),fd->anchor(),nm);
3494 }
3495 else
3496 {
3497 ol.docify(nm);
3498 }
3499
3500 if (isIDLorJava || forceLocalIncludes) ol.docify("\""); else ol.docify(">");
3501
3502 ol.endTypewriter();
3503 ol.endParagraph();
3504 }
3505}
3506
3508{
3509 //printf("md=%s initLines=%d init='%s'\n",qPrint(name()),initLines,qPrint(init));
3510 ol.startBold();
3511 if (m_mtype==MemberType::Define)
3512 ol.parseText(theTranslator->trDefineValue());
3513 else
3514 ol.parseText(theTranslator->trInitialValue());
3515 ol.endBold();
3516 QCString langCorrected = getDefFileExtension();
3518 if (srcLangExt == SrcLangExt::Lex)
3519 {
3520 langCorrected = ".doxygen_lex_c";
3521 srcLangExt = SrcLangExt::Cpp;
3522 }
3523 auto intf = Doxygen::parserManager->getCodeParser(langCorrected);
3524 intf->resetCodeParserState();
3525 auto &codeOL = ol.codeGenerators();
3526 codeOL.startCodeFragment("DoxyCode");
3527 intf->parseCode(codeOL,scopeName,m_initializer,srcLangExt,Config_getBool(STRIP_CODE_COMMENTS),
3530 .setInlineFragment(true)
3531 .setMemberDef(this)
3532 .setShowLineNumbers(false)
3533 .setSearchCtx(this)
3534 );
3535 codeOL.endCodeFragment("DoxyCode");
3536}
3537
3538/*! Writes the "detailed documentation" section of this member to
3539 * all active output formats.
3540 */
3542 int memCount,int memTotal,
3543 OutputList &ol,
3544 const QCString &scName,
3545 const Definition *container,
3546 bool inGroup,
3547 bool /* showEnumValues */,
3548 bool showInline
3549 ) const
3550{
3551 // if this member is in a group find the real scope name.
3552 bool hasParameterList = FALSE;
3553
3554 //printf("MemberDefImpl::writeDocumentation(): name='%s' hasDocs='%d' containerType=%d inGroup=%d sectionLinkable=%d\n",
3555 // qPrint(name()),hasDocs,container->definitionType(),inGroup,hasDetailedDescription());
3556
3557 //if ( !hasDocs ) return;
3558 //if (isEnumValue() && !showEnumValues) return;
3559
3560 SrcLangExt lang = getLanguage();
3561 //printf("member=%s lang=%d\n",qPrint(name()),lang);
3562 bool optVhdl = lang==SrcLangExt::VHDL;
3564
3565 QCString scopeName = scName;
3566 QCString memAnchor = anchor();
3567 QCString ciname = container->displayName();
3568 const Definition *scopedContainer = container; // see bug 753608
3569 if (container->definitionType()==TypeGroup)
3570 {
3571 if (getClassDef()) { scopeName=getClassDef()->displayName(); scopedContainer=getClassDef(); }
3572 else if (getNamespaceDef()) { scopeName=getNamespaceDef()->displayName(); scopedContainer=getNamespaceDef(); }
3573 else if (getFileDef()) { scopeName=getFileDef()->displayName(); scopedContainer=getFileDef(); }
3574 ciname = (toGroupDef(container))->groupTitle();
3575 }
3576 else if (container->definitionType()==TypeFile && getNamespaceDef() && getNamespaceDef()->isLinkable())
3577 { // member is in a namespace, but is written as part of the file documentation
3578 // as well, so we need to make sure its anchor is unique (it is not really used).
3579 memAnchor.prepend("file_");
3580 }
3581
3582 QCString cname = container->name();
3583 QCString cfname = getOutputFileBase();
3584
3585 // get member name
3586 QCString doxyName=name();
3587 // prepend scope if there is any. TODO: make this optional for C only docs
3588 if (!scopeName.isEmpty())
3589 {
3590 doxyName.prepend(scopeName+sep);
3591 }
3592 QCString doxyArgs=argsString();
3593
3594 QCString ldef = definition();
3595 QCString title = name();
3596 if (m_toAnnMemb)
3597 {
3598 title.prepend(m_toAnnMemb->anonymousMemberPrefix());
3599 }
3600
3601 //printf("member '%s' def='%s'\n",qPrint(name()),qPrint(ldef));
3602 if (isEnumerate())
3603 {
3604 if (title.at(0)=='@')
3605 {
3606 ldef = title = "anonymous enum";
3607 if (!m_enumBaseType.isEmpty())
3608 {
3609 ldef+=" : "+m_enumBaseType;
3610 }
3611 }
3612 else
3613 {
3614 if (lang==SrcLangExt::Cpp)
3615 {
3616 if (isEnumStruct()) ldef.prepend("struct ");
3617 else if (isStrong()) ldef.prepend("class ");
3618 }
3619 ldef.prepend("enum ");
3620 if (isSliceLocal())
3621 {
3622 ldef.prepend("local ");
3623 }
3624 }
3625 }
3626 else if (isEnumValue())
3627 {
3628 if (ldef.at(0)=='@')
3629 {
3630 ldef=ldef.mid(2);
3631 }
3632 }
3633 else if (isFunction() && !isObjCMethod())
3634 {
3635 title += "()";
3636 }
3637 if (lang == SrcLangExt::Slice)
3638 {
3639 // Remove the container scope from the member name.
3640 QCString prefix = scName + sep;
3641 int pos = ldef.findRev(prefix.data());
3642 if(pos != -1)
3643 {
3644 ldef.remove(pos, prefix.length());
3645 }
3646 }
3647 ldef.stripPrefix("constexpr ");
3648 ldef.stripPrefix("consteval ");
3649 ldef.stripPrefix("constinit ");
3650 ldef.stripPrefix("static ");
3651
3652 //----------------------------------------
3653
3654 ol.pushGeneratorState();
3655
3656 bool htmlEndLabelTable=FALSE;
3657 StringVector sl = getLabels(scopedContainer);
3658
3659 static const reg::Ex r(R"(@\d+)");
3660 reg::Match match;
3661 std::string sdef = ldef.str();
3662 LinkifyTextOptions options;
3663 options.setScope(scopedContainer).setFileScope(getBodyDef()).setSelf(this);
3664 if ((isVariable() || isTypedef()) && reg::search(sdef,match,r))
3665 {
3666 // find enum type and insert it in the definition
3667 bool found=false;
3668 for (const auto &vmd : *ml)
3669 {
3670 if (vmd->isEnumerate() && match.str()==vmd->name())
3671 {
3672 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3673 ol.startMemberDoc(ciname,name(),memAnchor,name(),memCount,memTotal,showInline);
3674 ol.addLabel(cfname, memAnchor);
3675 QCString prefix = match.prefix().str();
3676 QCString suffix = match.suffix().str();
3678 vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef(),getModuleDef());
3679 linkifyText(TextGeneratorOLImpl(ol),suffix,options);
3680
3681 found=true;
3682 break;
3683 }
3684 }
3685 if (!found) // anonymous compound
3686 {
3687 ClassDef *annoClassDef=getClassDefOfAnonymousType();
3688 QCString typeName;
3689 if (annoClassDef) typeName=annoClassDef->compoundTypeString();
3690 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3691 ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline);
3692 ol.addLabel(cfname, memAnchor);
3693 // search for the last anonymous compound name in the definition
3694
3696 if (reg::search(sdef,match,reAnonymous))
3697 {
3698 QCString prefix = match.prefix().str();
3699 QCString suffix = match.suffix().str();
3700 ol.docify(prefix);
3701 ol.docify(" { ... } ");
3703 }
3704 else
3705 {
3706 linkifyText(TextGeneratorOLImpl(ol),ldef,options);
3707 }
3708 }
3709 }
3710 else // not an enum value or anonymous compound
3711 {
3712 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3713 ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline);
3714 ol.addLabel(cfname, memAnchor);
3715
3716 if (!m_metaData.isEmpty() && getLanguage()==SrcLangExt::Slice)
3717 {
3719 ol.docify(m_metaData);
3721 }
3722
3723 const ClassDef *cd=getClassDef();
3724 const NamespaceDef *nd=getNamespaceDef();
3725 if (!m_defTmpArgLists.empty() && lang==SrcLangExt::Cpp)
3726 // definition has explicit template parameter declarations
3727 {
3728 for (const ArgumentList &tal : m_defTmpArgLists)
3729 {
3730 if (!tal.empty())
3731 {
3733 _writeTemplatePrefix(ol,scopedContainer,tal);
3735 }
3736 }
3737 }
3738 else // definition gets it template parameters from its class
3739 // (since no definition was found)
3740 {
3741 if (cd && lang==SrcLangExt::Cpp && !isTemplateSpecialization())
3742 {
3743 for (const ArgumentList &tal : cd->getTemplateParameterLists())
3744 {
3745 if (!tal.empty())
3746 {
3748 _writeTemplatePrefix(ol,scopedContainer,tal,false);
3750 }
3751 }
3752 }
3753 if (m_tArgList.hasParameters() && lang==SrcLangExt::Cpp) // function template prefix
3754 {
3756 _writeTemplatePrefix(ol,scopedContainer,m_tArgList);
3758 }
3759 }
3760
3761 if (!sl.empty())
3762 {
3763 ol.pushGeneratorState();
3764 ol.disableAll();
3766 ol.writeString("<table class=\"mlabels\">\n");
3767 ol.writeString(" <tr>\n");
3768 ol.writeString(" <td class=\"mlabels-left\">\n");
3769 ol.popGeneratorState();
3770 htmlEndLabelTable=TRUE;
3771 }
3772
3774 if (cd && cd->isObjectiveC())
3775 {
3776 // strip scope name
3777 int ep = ldef.find("::");
3778 if (ep!=-1)
3779 {
3780 int sp=ldef.findRev(' ',ep);
3781 if (sp!=-1)
3782 {
3783 ldef=ldef.left(sp+1)+ldef.mid(ep+2);
3784 } else {
3785 ldef=ldef.mid(ep+2);
3786 }
3787 }
3788 // strip keywords
3789 int dp = ldef.find(':');
3790 if (dp!=-1)
3791 {
3792 ldef=ldef.left(dp+1);
3793 }
3794 int dl=static_cast<int>(ldef.length());
3795 //printf("start >%s<\n",qPrint(ldef));
3796 int i=dl-1;
3797 while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
3798 while (i>=0 && isspace(static_cast<uint8_t>(ldef.at(i)))) i--;
3799 if (i>0)
3800 {
3801 // insert branches around the type
3802 ldef="("+ldef.left(i+1)+")"+ldef.mid(i+1);
3803 }
3804 //printf("end >%s< i=%d\n",qPrint(ldef),i);
3805 if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
3806 }
3807
3808 if (optVhdl)
3809 {
3810 hasParameterList=VhdlDocGen::writeVHDLTypeDocumentation(this,scopedContainer,ol);
3811 }
3812 else if (lang==SrcLangExt::Slice)
3813 {
3814 // Eliminate the self-reference.
3815 int pos = ldef.findRev(' ');
3816 if (pos<0) pos=0;
3817 if (pos>0)
3818 {
3819 linkifyText(TextGeneratorOLImpl(ol),ldef.left(pos),options);
3820 }
3821 ol.docify(ldef.mid(pos));
3822 const Definition *scope = cd;
3823 if (scope==nullptr) scope = nd;
3824 hasParameterList=writeDefArgumentList(ol,scope,this);
3825 }
3826 else
3827 {
3828 linkifyText(TextGeneratorOLImpl(ol),substitute(ldef,"::",sep),options);
3829 const Definition *scope = cd;
3830 if (scope==nullptr) scope = nd;
3831 hasParameterList=writeDefArgumentList(ol,scope,this);
3832 }
3833
3834 if (hasOneLineInitializer()) // add initializer
3835 {
3836 if (isTypeAlias())
3837 {
3838 ol.docify(" = ");
3839 QCString init = m_initializer.simplifyWhiteSpace();
3841 }
3842 else if (!isDefine())
3843 {
3844 ol.docify(" ");
3845 QCString init = m_initializer.simplifyWhiteSpace();
3847 }
3848 else
3849 {
3852 }
3853 }
3854 if (!excpString().isEmpty()) // add exception list
3855 {
3856 writeExceptionList(ol,cd,this);
3857 hasParameterList=true; // call endParameterList below
3858 }
3859 }
3860
3861 ol.pushGeneratorState();
3863 if (!sl.empty())
3864 {
3865 ol.startLabels();
3866 size_t count=0;
3867 for (const auto &s : sl)
3868 {
3869 count++;
3870 ol.writeLabel(s,count==sl.size());
3871 }
3872 ol.endLabels();
3873 }
3874 ol.popGeneratorState();
3875
3876 if (hasParameterList)
3877 {
3878 ol.endParameterList();
3879 ol.endMemberDoc(TRUE);
3880 }
3881 else
3882 {
3883 ol.endMemberDocName();
3884 ol.endMemberDoc(FALSE);
3885 }
3886
3887 // for HTML write the labels here
3888 ol.pushGeneratorState();
3889 ol.disableAll();
3891 if (htmlEndLabelTable)
3892 {
3893 ol.writeString(" </td>\n");
3894 ol.writeString(" <td class=\"mlabels-right\">\n");
3895 ol.startLabels();
3896 size_t count=0;
3897 for (const auto &s : sl)
3898 {
3899 count++;
3900 ol.writeLabel(s,count==sl.size());
3901 }
3902 ol.endLabels();
3903 ol.writeString(" </td>\n");
3904 ol.writeString(" </tr>\n");
3905 ol.writeString("</table>\n");
3906 }
3907 ol.writeString("</div>");
3908 ol.popGeneratorState();
3909
3910
3911 ol.endDoxyAnchor(cfname,memAnchor);
3912 ol.startIndent();
3913
3914 _writeGroupInclude(ol,inGroup);
3915
3916 /* write multi-line initializer (if any) */
3918
3919 /* write brief description */
3920 QCString brief = briefDescription();
3921 if (!brief.isEmpty() &&
3922 (Config_getBool(REPEAT_BRIEF) ||
3923 !Config_getBool(BRIEF_MEMBER_DESC)
3924 )
3925 )
3926 {
3927 ol.startParagraph();
3929 briefLine(),
3930 scopedContainer,
3931 this,
3932 brief,
3933 DocOptions()
3934 .setSingleLine(true));
3935 ol.endParagraph();
3936 }
3937
3938 /* write detailed description */
3939 QCString detailed = documentation();
3940 if (!detailed.isEmpty() ||
3941 !inbodyDocumentation().isEmpty())
3942 {
3943 // write vhdl inline code with or without option INLINE_SOURCE
3944 if (optVhdl && VhdlDocGen::isMisc(this))
3945 {
3946 VhdlDocGen::writeSource(this,ol,cname);
3947 return;
3948 }
3949 else
3950 {
3951 ol.generateDoc(docFile(),
3952 docLine(),
3953 scopedContainer,
3954 this,
3955 detailed+"\n",
3956 DocOptions()
3957 .setIndexWords(true));
3958 }
3959
3960 if (!inbodyDocumentation().isEmpty())
3961 {
3963 inbodyLine(),
3964 scopedContainer,
3965 this,
3966 inbodyDocumentation()+"\n",
3967 DocOptions()
3968 .setIndexWords(true));
3969 }
3970 }
3971 else if (!brief.isEmpty() && (Config_getBool(REPEAT_BRIEF) || !Config_getBool(BRIEF_MEMBER_DESC)))
3972 {
3973 if (!inbodyDocumentation().isEmpty())
3974 {
3976 inbodyLine(),
3977 scopedContainer,
3978 this,
3979 inbodyDocumentation()+"\n",
3980 DocOptions()
3981 .setIndexWords(true));
3982 }
3983 }
3984
3985
3986 //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n",
3987 // defArgList,
3988 // defArgList?defArgList->hasDocumentation():-1);
3989 const ArgumentList &docArgList = m_templateMaster ?
3990 m_templateMaster->argumentList() :
3992 ol.generateDoc(docFile(),
3993 docLine(),
3994 scopedContainer,
3995 this, // memberDef
3996 inlineArgListToDoc(docArgList), // docStr
3997 DocOptions()
3998 .setIndexWords(true));
3999
4000 const ArgumentList &docTemplateArgList = m_templateMaster ?
4001 m_templateMaster->templateArguments() :
4002 m_tArgList;
4003 ol.generateDoc(docFile(),
4004 docLine(),
4005 scopedContainer,
4006 this, // memberDef
4007 inlineTemplateArgListToDoc(docTemplateArgList), // docStr
4008 DocOptions()
4009 .setIndexWords(true));
4010
4011 _writeEnumValues(ol,scopedContainer,cfname,ciname,cname);
4015 _writeExamples(ol);
4017 QCString scopeStr = getScopeString();
4018 writeSourceDef(ol);
4019 writeInlineCode(ol,scopeStr);
4020 if (hasReferencesRelation()) writeSourceRefs(ol,scopeStr);
4021 if (hasReferencedByRelation()) writeSourceReffedBy(ol,scopeStr);
4022 _writeCallGraph(ol);
4025
4026 ol.endIndent();
4027
4028 // enable LaTeX again
4029 //if (Config_getBool(EXTRACT_ALL) && !hasDocs) ol.enable(OutputType::Latex);
4030 ol.popGeneratorState();
4031
4033}
4034
4035// strip scope and field name from the type
4036// example: "struct N<K::J>::S.v.c" will become "struct v"
4038{
4040 if (ts.endsWith("::")) ts = ts.left(ts.length()-2);
4041 static const reg::Ex re1(R"(\a\w*::)"); // non-template version
4042 static const reg::Ex re2(R"(\a\w*<[^>]*>::)"); // template version
4043 reg::Match match;
4044 std::string t = ts.str();
4045 while (reg::search(t,match,re2) || reg::search(t,match,re1))
4046 {
4047 t = match.prefix().str() + match.suffix().str(); // remove the matched part
4048 }
4049 //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),qPrint(t));
4050 return t;
4051}
4052
4054{
4055 QCString type = m_accessorType;
4056 if (type.isEmpty())
4057 {
4058 type = m_type;
4059 }
4060
4061 if (isTypedef() && getLanguage() != SrcLangExt::Slice) type.prepend("typedef ");
4062 return simplifyTypeForTable(type);
4063}
4064
4066{
4067 Definition *scope = getOuterScope();
4068 QCString doxyName = name();
4069 QCString doxyArgs = argsString();
4070 QCString memAnchor = anchor();
4071 QCString cfname = getOutputFileBase();
4072 QCString cname;
4073 if (scope) cname = scope->name();
4074 if (doxyName.at(0)=='@')
4075 {
4076 doxyName="__unnamed__";
4077 }
4078
4080 //printf("===> %s::anonymous: %s\n",qPrint(name()),cd?qPrint(cd->name()):"<none>");
4081
4082 LinkifyTextOptions options;
4083 options.setScope(scope).setFileScope(getBodyDef()).setSelf(this);
4084
4085 if (container && container->definitionType()==Definition::TypeClass &&
4086 !(toClassDef(container))->isJavaEnum())
4087 {
4089 ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
4090 ol.addLabel(cfname,memAnchor);
4091
4092 QCString ts = fieldType();
4093
4094 if (isFunctionPtr())
4095 ts = m_type + m_args;
4096
4097 if (cd) // cd points to an anonymous struct pointed to by this member
4098 // so we add a link to it from the type column.
4099 {
4100 int i=0;
4101 const char *prefixes[] = { "struct ","union ","class ", nullptr };
4102 const char **p = prefixes;
4103 while (*p)
4104 {
4105 int l=qstrlen(*p);
4106 if (ts.left(l)==*p)
4107 {
4108 ol.writeString(*p);
4109 i=l;
4110 }
4111 p++;
4112 }
4114 cd->getOutputFileBase(),
4115 cd->anchor(),ts.mid(i));
4116 }
4117 else // use standard auto linking
4118 {
4119 linkifyText(TextGeneratorOLImpl(ol),ts,options);
4120 }
4121 ol.endDoxyAnchor(cfname,memAnchor);
4123 }
4124
4126 ol.docify(doxyName);
4127 if (isVariable() && !argsString().isEmpty() && !isObjCMethod() && !isFunctionPtr())
4128 {
4130 }
4131 if (!m_bitfields.isEmpty()) // add bitfields
4132 {
4134 }
4135 if (hasOneLineInitializer() && !isDefine())
4136 {
4137 ol.writeString(" ");
4138 linkifyText(TextGeneratorOLImpl(ol),m_initializer.simplifyWhiteSpace(),options);
4139 }
4141
4143
4144 QCString brief = briefDescription();
4145 QCString detailed = documentation();
4146
4147 /* write brief description */
4148 if (!brief.isEmpty())
4149 {
4151 briefLine(),
4152 getOuterScope()?getOuterScope():container,this,
4153 brief,
4154 DocOptions()
4155 .setSingleLine(true));
4156 }
4157
4158 /* write detailed description */
4159 if (!detailed.isEmpty())
4160 {
4161 if (!brief.isEmpty())
4162 {
4164 ol.lineBreak();
4166 }
4167 ol.generateDoc(docFile(),
4168 docLine(),
4169 getOuterScope()?getOuterScope():container,this,
4170 detailed+"\n",
4171 DocOptions());
4172 }
4173
4174 ol.endInlineMemberDoc();
4175}
4176
4178{
4179 if (m_mtype == MemberType::Define)
4180 {
4181 return "macro definition";
4182 }
4183 else if (m_mtype == MemberType::Enumeration)
4184 {
4185 return "enumeration";
4186 }
4187 return to_string_lower(m_mtype);
4188}
4189
4191{
4192 /*
4193 * Removed bug_303020:
4194 * if (m_memberGroup) return;
4195 */
4196 const ClassDef *cd = getClassDef();
4197 const NamespaceDef *nd = getNamespaceDef();
4198 const FileDef *fd = getFileDef();
4199 const GroupDef *gd = getGroupDef();
4200 const Definition *d=nullptr;
4201 QCString t;
4202 if (cd)
4203 {
4204 t=cd->compoundTypeString();
4205 d=cd;
4206 }
4207 else if (nd)
4208 {
4209 t=nd->compoundTypeString();
4210 d=nd;
4211 }
4212 else if (gd)
4213 {
4214 t="group";
4215 d=gd;
4216 }
4217 else
4218 {
4219 t="file";
4220 d=fd;
4221 }
4222 bool extractAll = Config_getBool(EXTRACT_ALL);
4223
4224 //printf("%s:warnIfUndoc: hasUserDocs=%d isFriendClass=%d protection=%d isRef=%d isDel=%d\n",
4225 // qPrint(name()),
4226 // hasUserDocumentation(),isFriendClass(),protectionLevelVisible(m_prot),isReference(),isDeleted());
4227 if ((!hasUserDocumentation() && !extractAll) &&
4228 !isFriendClass() &&
4229 name().find('@')==-1 && d && d->name().find('@')==-1 &&
4232 !isReference() && !isDeleted()
4233 )
4234 {
4235 SrcLangExt lang = getLanguage();
4237 warn_undoc(getDefFileName(),getDefLine(),"Member {}{} ({}) of {} {} is not documented.",
4239 substitute(d->name(),"::",sep));
4240 }
4241 else if (!hasDetailedDescription())
4242 {
4244 }
4245
4246 // if it is an enum, we check that its members are documented
4247 if (!extractAll && isEnumerate() && Config_getBool(WARN_IF_UNDOC_ENUM_VAL))
4248 {
4249 for (const auto &fmd : enumFieldList())
4250 {
4251 if (!fmd->isLinkableInProject())
4252 {
4253 SrcLangExt lang = getLanguage();
4255 warn(fmd->getDefFileName(),fmd->getDefLine(), "Documentation for enum member '{}{}{}' is missing.",
4256 qualifiedName(),sep,fmd->name());
4257 }
4258 }
4259 }
4260}
4261
4263{
4264 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
4265 bool extractStatic = Config_getBool(EXTRACT_STATIC);
4266 return (!isAnonymous() &&
4267 (!hideUndocMembers || hasDocumentation()) &&
4268 (!isStatic() || extractStatic) &&
4269 isLinkable()
4270 );
4271}
4272
4274{
4275 QCString ret = trailRet;
4276
4277 ret = ret.stripWhiteSpace();
4278 if (ret.startsWith("->"))
4279 {
4280 ret = ret.mid(2).stripWhiteSpace();
4281 return ret;
4282 }
4283 return trailRet;
4284}
4285
4287
4288void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const
4289{
4290 //printf("%s:detectUndocumentedParams(%d,%d)\n",qPrint(name()),hasParamCommand,hasReturnCommand);
4291 bool isPython = getLanguage()==SrcLangExt::Python;
4292
4293 // this function is called while parsing the documentation. A member can have multiple
4294 // documentation blocks, which could be handled by multiple threads, hence this guard.
4295 std::lock_guard<std::mutex> lock(g_detectUndocumentedParamsMutex);
4296
4297 if (!m_hasDocumentedParams && hasParamCommand)
4298 {
4299 //printf("%s:hasDocumentedParams=TRUE;\n",qPrint(name()));
4300 m_hasDocumentedParams = true;
4301 }
4302 else if (!m_hasDocumentedParams)
4303 {
4304 const ArgumentList &al = argumentList();
4305 const ArgumentList &declAl = declArgumentList();
4306 bool allDoc=TRUE; // no parameter => all parameters are documented
4307 if ( // member has parameters
4308 al.hasParameters() // with at least one parameter (that is not void)
4309 )
4310 {
4311 // see if all parameters have documentation
4312 for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
4313 {
4314 const Argument &a = *it;
4315 if (!a.name.isEmpty() && a.type!="void" && a.name!="..." &&
4316 !(isPython && (a.name=="self" || a.name=="cls"))
4317 )
4318 {
4319 allDoc = !a.docs.isEmpty();
4320 }
4321 //printf("a.type=%s a.name=%s doc=%s\n",
4322 // qPrint(a.type),qPrint(a.name),qPrint(a.docs));
4323 }
4324 if (!allDoc && declAl.empty()) // try declaration arguments as well
4325 {
4326 allDoc=true;
4327 for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
4328 {
4329 const Argument &a = *it;
4330 if (!a.name.isEmpty() && a.type!="void" && a.name!="..." &&
4331 !(isPython && (a.name=="self" || a.name=="cls"))
4332 )
4333 {
4334 allDoc = !a.docs.isEmpty();
4335 }
4336 //printf("a.name=%s doc=%s\n",qPrint(a.name),qPrint(a.docs));
4337 }
4338 }
4339 }
4340 if (allDoc)
4341 {
4342 //printf("%s:hasDocumentedParams=TRUE;\n",qPrint(name()));
4343 m_hasDocumentedParams = true;
4344 }
4345 }
4346
4347 //printf("Member %s hasDocumentedReturnType=%d hasReturnCommand=%d\n",
4348 // qPrint(name()),m_hasDocumentedReturnType,hasReturnCommand);
4350}
4351
4353{
4354 QCString returnType = typeString();
4355 bool isFortran = getLanguage()==SrcLangExt::Fortran;
4356 bool isFortranSubroutine = isFortran && returnType.find("subroutine")!=-1;
4357
4358 bool isVoidReturn = returnType=="void" || returnType.endsWith(" void");
4359 if (!isVoidReturn && (returnType=="auto" || returnType.endsWith(" auto")))
4360 {
4362 if (!defArgList.trailingReturnType().isEmpty())
4363 {
4364 QCString strippedTrailingReturn = stripTrailingReturn(defArgList.trailingReturnType());
4365 isVoidReturn = (strippedTrailingReturn=="void") || (strippedTrailingReturn.endsWith(" void"));
4366 }
4367 }
4368 if (!Config_getBool(EXTRACT_ALL) &&
4369 Config_getBool(WARN_IF_UNDOCUMENTED) &&
4370 Config_getBool(WARN_NO_PARAMDOC) &&
4371 isFunction() &&
4372 !isDeleted() &&
4373 !isReference() &&
4375 {
4377 {
4379 "parameters of member {} are not documented",
4380 qualifiedName());
4381 }
4383 hasDocumentation() && !returnType.isEmpty() &&
4384 !( // not one of the cases where nothing is returned
4385 isVoidReturn || // void return type
4386 isFortranSubroutine || // fortran subroutine
4387 isConstructor() || // a constructor
4388 isDestructor() || // or a destructor
4389 isFriend() // or a friend
4390 )
4391 )
4392 {
4394 "return type of member {} is not documented",
4395 qualifiedName());
4396 }
4397 }
4398 if (Config_getBool(WARN_IF_DOC_ERROR) &&
4400 (isVoidReturn || // void return type
4401 isFortranSubroutine || // fortran subroutine
4402 isConstructor() || // a constructor
4403 isDestructor())) // or destructor
4404 {
4405 warn_doc_error(docFile(),docLine(),"found documented return type for {} that does not return anything",
4406 qualifiedName());
4407 }
4408}
4409
4411{
4412 ClassDef *fcd=nullptr;
4413 QCString baseName=name();
4414 int i=baseName.find('<');
4415 if (i!=-1) baseName=baseName.left(i);
4416 return (isFriendClass() &&
4417 (fcd=getClass(baseName)) && fcd->isLinkable());
4418}
4419
4421{
4422 return m_defArgList.isDeleted();
4423}
4424
4426{
4428 (m_mtype==MemberType::Enumeration && m_docEnumValues) || // has enum values
4429 (m_defArgList.hasDocumentation()|| m_tArgList.hasTemplateDocumentation()); // has doc (template) arguments
4430}
4431
4432
4437
4439{
4440 QCString result;
4441 if (isStrong()) result=name();
4442 else if (getClassDef()) result=getClassDef()->displayName();
4443 else if (getNamespaceDef()) result=getNamespaceDef()->displayName();
4444 return result;
4445}
4446
4448{
4449 QCString memAnchor = name();
4450 if (!m_args.isEmpty()) memAnchor+=m_args;
4451 if (m_memSpec.isAlias()) // this is for backward compatibility
4452 {
4453 memAnchor.prepend(" = "+m_initializer);
4454 }
4455 memAnchor.prepend(definition()); // actually the method name is now included
4456 // twice, which is silly, but we keep it this way for backward
4457 // compatibility.
4458
4459 // include number of template arguments as well,
4460 // to distinguish between two template
4461 // specializations that only differ in the template parameters.
4462 if (m_tArgList.hasParameters())
4463 {
4464 char buf[20];
4465 qsnprintf(buf,20,"%d:",static_cast<int>(m_tArgList.size()));
4466 buf[19]='\0';
4467 memAnchor.prepend(buf);
4468 }
4469 if (!m_requiresClause.isEmpty())
4470 {
4471 memAnchor+=" "+m_requiresClause;
4472 }
4473 if (m_redefineCount>0)
4474 {
4475 char buf[20];
4476 qsnprintf(buf,20,":%d",m_redefineCount);
4477 buf[19]='\0';
4478 memAnchor.append(buf);
4479 }
4480
4481 // convert to md5 hash
4482 uint8_t md5_sig[16];
4483 char sigStr[33];
4484 MD5Buffer(memAnchor.data(),static_cast<unsigned int>(memAnchor.length()),md5_sig);
4485 MD5SigToString(md5_sig,sigStr);
4486 m_anc = QCString("a")+sigStr;
4487}
4488
4490 const QCString &fileName,int startLine,
4491 bool hasDocs,MemberDef *member)
4492{
4493 //printf("%s MemberDefImpl::setGroupDef(%s)\n",qPrint(name()),qPrint(gd->name()));
4494 m_group=gd;
4495 m_grouppri=pri;
4496 m_groupFileName=fileName;
4497 m_groupStartLine=startLine;
4498 m_groupHasDocs=hasDocs;
4499 m_groupMember=member;
4501}
4502
4517
4525
4527{
4528 m_nspace=nd;
4529 setOuterScope(nd);
4530}
4531
4533 const ArgumentList &formalArgs,const std::unique_ptr<ArgumentList> &actualArgs) const
4534{
4535 //printf(" Member %s %s %s\n",qPrint(typeString()),qPrint(name()),qPrint(argsString()));
4536 std::unique_ptr<ArgumentList> actualArgList = std::make_unique<ArgumentList>(m_defArgList);
4537 if (!m_defArgList.empty())
4538 {
4539 // replace formal arguments with actuals
4540 for (Argument &arg : *actualArgList)
4541 {
4542 arg.type = substituteTemplateArgumentsInString(arg.type,formalArgs,actualArgs.get());
4543 }
4544 actualArgList->setTrailingReturnType(
4545 substituteTemplateArgumentsInString(actualArgList->trailingReturnType(),formalArgs,actualArgs.get()));
4546 }
4547
4548 QCString methodName=name();
4549 if (methodName.startsWith("operator ")) // conversion operator
4550 {
4551 methodName=substituteTemplateArgumentsInString(methodName,formalArgs,actualArgs.get());
4552 }
4553
4554 auto imd = createMemberDef(
4556 substituteTemplateArgumentsInString(m_type,formalArgs,actualArgs.get()),
4557 methodName,
4558 substituteTemplateArgumentsInString(m_args,formalArgs,actualArgs.get()),
4561 ArgumentList(), ArgumentList(), ""
4562 );
4563 auto mmd = toMemberDefMutable(imd.get());
4564 mmd->moveArgumentList(std::move(actualArgList));
4565 mmd->setDefinition(substituteTemplateArgumentsInString(m_def,formalArgs,actualArgs.get()));
4566 mmd->setBodyDef(getBodyDef());
4567 mmd->setBodySegment(getDefLine(),getStartBodyLine(),getEndBodyLine());
4568 mmd->setFormalTemplateArguments(formalArgs);
4569
4570 // TODO: init other member variables (if needed).
4571 // TODO: reimplemented info
4572 return imd;
4573}
4574
4576{
4577 //printf("%s: init=%s, initLines=%d maxInitLines=%d userInitLines=%d\n",
4578 // qPrint(name()),qPrint(m_initializer),m_initLines,
4579 // m_maxInitLines,m_userInitLines);
4580 bool isFuncLikeMacro = m_mtype==MemberType::Define && m_defArgList.hasParameters();
4581 return !m_initializer.isEmpty() && m_initLines==0 && // one line initializer
4582 !isFuncLikeMacro &&
4583 ((m_maxInitLines>0 && m_userInitLines==-1) || m_userInitLines>0); // enabled by default or explicitly
4584}
4585
4587{
4588 //printf("initLines=%d userInitLines=%d maxInitLines=%d\n",
4589 // initLines,userInitLines,maxInitLines);
4590 bool isFuncLikeMacro = m_mtype==MemberType::Define && m_defArgList.hasParameters();
4591 return (m_initLines>0 || (!m_initializer.isEmpty() && isFuncLikeMacro)) &&
4592 ((m_initLines<m_maxInitLines && m_userInitLines==-1) // implicitly enabled
4593 || m_initLines<m_userInitLines // explicitly enabled
4594 );
4595}
4596
4598{
4599 size_t indent=0;
4601 int l=static_cast<int>(m_initializer.length());
4602 int p=l-1;
4603 while (p>=0 && isspace(static_cast<uint8_t>(m_initializer.at(p)))) p--;
4604 m_initializer=m_initializer.left(p+1);
4605 m_initLines=m_initializer.contains('\n');
4607
4608 //printf("%s::setInitializer(%s)\n",qPrint(name()),qPrint(m_initializer));
4609}
4610
4612{
4613 bool optimizeOutputForC = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
4614 SrcLangExt lang = getLanguage();
4615 if (!isLinkableInProject()) return;
4616 QCString memLabel;
4617 if (optimizeOutputForC)
4618 {
4619 memLabel=theTranslator->trGlobal(TRUE,TRUE);
4620 }
4621 else if (lang==SrcLangExt::Fortran)
4622 {
4623 memLabel=theTranslator->trSubprogram(TRUE,TRUE);
4624 }
4625 else
4626 {
4627 memLabel=theTranslator->trMember(TRUE,TRUE);
4628 }
4629 QCString memName = name();
4632 (toClassDef(pd))->displayName() : pd->name();
4634 QCString memArgs;
4635 if (!isRelated())
4636 {
4637 if (isObjCMethod())
4638 {
4639 memName = "[" + pd->name() + " " + name() + "]";
4640 }
4641 else
4642 {
4643 if (pd!=Doxygen::globalScope) memName.prepend(pdName+sep);
4644 memArgs = argsString();
4645 }
4646 }
4647 const RefItemVector &xrefItems = xrefListItems();
4648 if (sep!="::")
4649 {
4650 memName = substitute(memName,"::",sep);
4651 }
4652 addRefItem(xrefItems,
4653 qualifiedName()+argsString(), // argsString is needed for overloaded functions (see bug 609624)
4654 memLabel,
4655 getOutputFileBase()+"#"+anchor(),memName,memArgs,pd);
4656}
4657
4662
4664{
4665 auto it = m_sectionMap.find(container);
4666 return it!=m_sectionMap.end() ? it->second : nullptr;
4667}
4668
4670{
4671 //printf("MemberDefImpl::setSectionList(%s,%p) name=%s\n",qPrint(d->name()),sl,qPrint(name()));
4672 m_sectionMap.emplace(container,sl);
4673}
4674
4676{
4677 if (count>25)
4678 {
4680 "Internal inconsistency: recursion detected in overload relation for member {}!",name());
4681 return Specifier::Normal;
4682 }
4683 Specifier v = m_virt;
4684 const MemberDef *rmd = reimplements();
4685 while (rmd && v==Specifier::Normal)
4686 {
4687 v = rmd->virtualness(count+1)==Specifier::Normal ? Specifier::Normal : Specifier::Virtual;
4688 rmd = rmd->reimplements();
4689 }
4690 return v;
4691}
4692
4693void MemberDefImpl::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers) const
4694{
4695 if (!isLinkableInProject()) return;
4696 if (!showNamespaceMembers && getNamespaceDef()) return;
4697 tagFile << " <member kind=\"";
4698 if (m_mtype == MemberType::Enumeration)
4699 {
4700 tagFile << "enumeration";
4701 }
4702 else
4703 {
4704 tagFile << to_string_lower(m_mtype);
4705 }
4706 if (m_prot!=Protection::Public)
4707 {
4708 tagFile << "\" protection=\"";
4709 if (m_prot==Protection::Protected) tagFile << "protected";
4710 else if (m_prot==Protection::Package) tagFile << "package";
4711 else /* Private */ tagFile << "private";
4712 }
4713 if (m_virt!=Specifier::Normal)
4714 {
4715 tagFile << "\" virtualness=\"";
4716 if (m_virt==Specifier::Virtual) tagFile << "virtual";
4717 else /* Pure */ tagFile << "pure";
4718 }
4719 if (isStatic())
4720 {
4721 tagFile << "\" static=\"yes";
4722 }
4723 tagFile << "\">\n";
4724 if (typeString()!=QCString("@"))
4725 {
4726 tagFile << " <type>" << convertToXML(typeString()) << "</type>\n";
4727 }
4730 tagFile << " <name>" << convertToXML(useQualifiedName ? qualifiedName() : name()) << "</name>\n";
4731 tagFile << " <anchorfile>" << convertToXML(fn) << "</anchorfile>\n";
4732 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
4733 QCString idStr = id();
4734 if (!idStr.isEmpty())
4735 {
4736 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
4737 }
4738 tagFile << " <arglist>" << convertToXML(argsString()) << "</arglist>\n";
4739 if (isStrong())
4740 {
4741 for (const auto &fmd : m_enumFields)
4742 {
4743 if (!fmd->isReference())
4744 {
4745 tagFile << " <enumvalue file=\"" << convertToXML(fn);
4746 tagFile << "\" anchor=\"" << convertToXML(fmd->anchor());
4747 idStr = fmd->id();
4748 if (!idStr.isEmpty())
4749 {
4750 tagFile << "\" clangid=\"" << convertToXML(idStr);
4751 }
4752 tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>\n";
4753 }
4754 }
4755 }
4756 writeDocAnchorsToTagFile(tagFile);
4757 tagFile << " </member>\n";
4758}
4759
4761{
4762 m_isConstructorCached=1; // FALSE
4763 if (getClassDef())
4764 {
4765 if (m_isDMember) // for D
4766 {
4767 m_isConstructorCached = name()=="this" ? 2 : 1;
4768 return;
4769 }
4770 else if (getLanguage()==SrcLangExt::PHP) // for PHP
4771 {
4772 m_isConstructorCached = name()=="__construct" ? 2 : 1;
4773 return;
4774 }
4775 else if (name()=="__init__" &&
4776 getLanguage()==SrcLangExt::Python) // for Python
4777 {
4778 m_isConstructorCached = 2; // TRUE
4779 return;
4780 }
4781 else // for other languages
4782 {
4783 QCString locName = getClassDef()->localName();
4784 int i=locName.find('<');
4785 if (i==-1) // not a template class
4786 {
4787 m_isConstructorCached = name()==locName ? 2 : 1;
4788 }
4789 else
4790 {
4791 m_isConstructorCached = name()==locName.left(i) ? 2 : 1;
4792 }
4793 return;
4794 }
4795 }
4796}
4797
4799{
4800 if (m_isConstructorCached==0)
4801 {
4802 MemberDefImpl *that = const_cast<MemberDefImpl*>(this);
4803 that->_computeIsConstructor();
4804 }
4806 return m_isConstructorCached==2;
4807
4808}
4809
4811{
4812 bool isDestructor = false;
4813 if (m_isDMember) // for D
4814 {
4815 isDestructor = name()=="~this";
4816 }
4817 else if (getLanguage()==SrcLangExt::PHP) // for PHP
4818 {
4819 isDestructor = name()=="__destruct";
4820 }
4821 else if (name()=="__del__" &&
4822 getLanguage()==SrcLangExt::Python) // for Python
4823 {
4824 isDestructor = true;
4825 }
4826 else if (getLanguage()==SrcLangExt::Fortran) // for Fortran
4827 {
4828 isDestructor = typeString()=="final";
4829 }
4830 else // other languages
4831 {
4832 isDestructor =
4833 (name().find('~')!=-1 || name().find('!')!=-1) // The ! is for C++/CLI
4834 && name().find("operator")==-1;
4835 }
4837}
4838
4840{
4841 if (m_isDestructorCached==0)
4842 {
4843 MemberDefImpl *that=const_cast<MemberDefImpl*>(this);
4844 that->_computeIsDestructor();
4845 }
4847 return m_isDestructorCached==2;
4848}
4849
4851 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const
4852{
4853 int enumMemCount=0;
4854
4855 uint32_t numVisibleEnumValues=0;
4856 for (const auto &fmd : m_enumFields)
4857 {
4858 if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
4859 }
4860 if (numVisibleEnumValues==0 && !isBriefSectionVisible())
4861 {
4862 return;
4863 }
4864
4865 QCString n = name();
4866 int i=n.findRev("::");
4867 if (i!=-1) n=n.right(n.length()-i-2); // strip scope (TODO: is this needed?)
4868 if (n[0]!='@') // not an anonymous enum
4869 {
4871 {
4872 //_writeTagData(compoundType);
4873 writeLink(typeDecl,cd,nd,fd,gd,mod);
4874 }
4875 else
4876 {
4877 typeDecl.startBold();
4878 typeDecl.docify(n);
4879 typeDecl.endBold();
4880 }
4881 typeDecl.writeChar(' ');
4882 }
4883 if (!m_enumBaseType.isEmpty())
4884 {
4885 typeDecl.writeChar(':');
4886 typeDecl.writeChar(' ');
4887 typeDecl.docify(m_enumBaseType);
4888 typeDecl.writeChar(' ');
4889 }
4890
4891 uint32_t enumValuesPerLine = static_cast<uint32_t>(Config_getInt(ENUM_VALUES_PER_LINE));
4892 if (numVisibleEnumValues>0 && enumValuesPerLine>0)
4893 {
4894 typeDecl.docify("{ ");
4895
4896 auto it = m_enumFields.begin();
4897 if (it!=m_enumFields.end())
4898 {
4899 const MemberDef *fmd=*it;
4900 bool fmdVisible = fmd->isBriefSectionVisible();
4901 bool first=true;
4902 while (fmd)
4903 {
4904 if (fmdVisible)
4905 {
4906 if (!first)
4907 {
4908 typeDecl.writeString(", ");
4909 }
4910 /* in html we start a new line after a number of items */
4911 if (numVisibleEnumValues>enumValuesPerLine
4912 && (enumMemCount%enumValuesPerLine)==0
4913 )
4914 {
4915 typeDecl.pushGeneratorState();
4917 typeDecl.enable(OutputType::Latex);
4918 typeDecl.enable(OutputType::Docbook);
4919 typeDecl.lineBreak();
4920 typeDecl.disable(OutputType::Latex);
4921 typeDecl.disable(OutputType::Docbook);
4922 typeDecl.writeString("&#160;&#160;");
4923 typeDecl.popGeneratorState();
4924 }
4925
4926 if (fmd->hasDocumentation()) // enum value has docs
4927 {
4928 fmd->writeLink(typeDecl,cd,nd,fd,gd,mod);
4929 }
4930 else // no docs for this enum value
4931 {
4932 typeDecl.startBold();
4933 typeDecl.docify(fmd->name());
4934 typeDecl.endBold();
4935 }
4936 if (fmd->hasOneLineInitializer()) // enum value has initializer
4937 {
4938 //typeDecl.writeString(" = ");
4939 typeDecl.writeString(" ");
4940 typeDecl.parseText(fmd->initializer());
4941 }
4942 first=false;
4943 }
4944
4945 bool prevVisible = fmdVisible;
4946 ++it;
4947 if (it!=m_enumFields.end())
4948 {
4949 fmd=*it;
4950 }
4951 else
4952 {
4953 fmd=nullptr;
4954 }
4955 if (prevVisible)
4956 {
4957 typeDecl.disable(OutputType::Man);
4958 typeDecl.writeString("\n"); // to prevent too long lines in LaTeX
4959 typeDecl.enable(OutputType::Man);
4960 enumMemCount++;
4961 }
4962 }
4963 if (numVisibleEnumValues>enumValuesPerLine)
4964 {
4965 typeDecl.pushGeneratorState();
4967 typeDecl.lineBreak();
4968 typeDecl.popGeneratorState();
4969 }
4970 }
4971 typeDecl.docify(" }");
4972 }
4973}
4974
4975void MemberDefImpl::moveArgumentList(std::unique_ptr<ArgumentList> al)
4976{
4977 m_defArgList = *al;
4978}
4979
4980void MemberDefImpl::moveDeclArgumentList(std::unique_ptr<ArgumentList> al)
4981{
4982 m_declArgList = *al;
4983}
4984
4989
4991{
4992 m_type = t;
4993}
4994
4996{
4997 m_accessorClass = cd;
4998 m_accessorType = t;
4999}
5000
5005
5012
5018
5024
5030
5036
5041
5046
5048{
5049 if (getClassDef() && getClassDef()->isObjectiveC() && isFunction()) return TRUE;
5050 return FALSE;
5051}
5052
5054{
5055 if (getClassDef() && getClassDef()->isObjectiveC() && isProperty()) return TRUE;
5056 return FALSE;
5057}
5058
5060{
5061 if (getClassDef() && getClassDef()->isCSharp() && isProperty()) return TRUE;
5062 return FALSE;
5063}
5064
5066{
5067 if (isObjCMethod())
5068 {
5069 QCString qm;
5070 if (isStatic()) qm="+"; else qm="-";
5071 qm+="[";
5072 qm+=getClassDef()->name()+" ";
5073 qm+=name();
5074 qm+="]";
5075 return qm;
5076 }
5077 else if (m_enumScope && m_enumScope->isStrong())
5078 {
5079 return m_enumScope->qualifiedName()+
5081 localName();
5082 }
5083 else
5084 {
5086 }
5087}
5088
5090{
5091 if (ti)
5092 {
5093 //printf("%s: Setting tag name=%s anchor=%s\n",qPrint(name()),qPrint(ti->tagName),qPrint(ti->anchor));
5094 m_anc=ti->anchor;
5095 setReference(ti->tagName);
5097 }
5098}
5099
5100QCString MemberDefImpl::objCMethodName(bool localLink,bool showStatic) const
5101{
5102 QCString qm;
5103 if (showStatic)
5104 {
5105 if (isStatic()) qm="+ "; else qm="- ";
5106 }
5107 qm+=name();
5108 if (!localLink) // link to method of same class
5109 {
5110 qm+=" (";
5111 qm+=getClassDef()->name();
5112 qm+=")";
5113 }
5114 return qm;
5115}
5116
5118{
5119 return m_decl;
5120}
5121
5123{
5124 return m_def;
5125}
5126
5131
5133{
5134 return m_type;
5135}
5136
5138{
5139 return m_args;
5140}
5141
5143{
5144 return m_exception;
5145}
5146
5148{
5149 return m_bitfields;
5150}
5151
5153{
5154 return m_initializer;
5155}
5156
5158{
5159 return m_initLines;
5160}
5161
5163{
5164 return m_docTransferDone;
5165}
5166
5171
5176
5178{
5179 return m_classDef;
5180}
5181
5186
5191
5193{
5194 return m_fileDef;
5195}
5196
5198{
5199 return m_fileDef;
5200}
5201
5203{
5204 return m_nspace;
5205}
5206
5211
5213{
5214 return m_read;
5215}
5216
5218{
5219 return m_write;
5220}
5221
5223{
5224 return m_group;
5225}
5226
5228{
5229 return m_group;
5230}
5231
5233{
5234 return m_moduleDef;
5235}
5236
5241
5246
5248{
5249 return m_groupStartLine;
5250}
5251
5253{
5254 return m_groupHasDocs;
5255}
5256
5258{
5259 return m_prot;
5260}
5261
5263{
5264 return m_mtype;
5265}
5266
5268{
5269 return m_mtype==MemberType::Signal;
5270}
5271
5273{
5274 return m_mtype==MemberType::Slot;
5275}
5276
5278{
5279 return m_mtype==MemberType::Variable;
5280}
5281
5283{
5284 return m_mtype==MemberType::Enumeration;
5285}
5286
5288{
5289 return m_mtype==MemberType::EnumValue;
5290}
5291
5293{
5294 return m_mtype==MemberType::Typedef;
5295}
5296
5298{
5299 return m_mtype==MemberType::Sequence;
5300}
5301
5303{
5304 return m_mtype==MemberType::Dictionary;
5305}
5306
5308{
5309 return m_mtype==MemberType::Function;
5310}
5311
5313{
5314 return m_mtype==MemberType::Variable && QCString(argsString()).find(")(")!=-1;
5315}
5316
5318{
5319 return m_mtype==MemberType::Define;
5320}
5321
5323{
5324 return m_mtype==MemberType::Friend;
5325}
5326
5328{
5329 return m_mtype==MemberType::DCOP;
5330}
5331
5333{
5334 return m_mtype==MemberType::Property;
5335}
5336
5338{
5339 return m_mtype==MemberType::Event;
5340}
5341
5343{
5344 return m_related == Relationship::Related;
5345}
5346
5348{
5349 return m_related == Relationship::Foreign;
5350}
5351
5353{
5354 return m_stat;
5355}
5356
5358{
5359 return m_memSpec.isInline();
5360}
5361
5363{
5364 return m_memSpec.isExplicit();
5365}
5366
5368{
5369 return m_memSpec.isMutable();
5370}
5371
5373{
5374 return m_memSpec.isThreadLocal();
5375}
5376
5378{
5379 return m_memSpec.isGettable();
5380}
5381
5383{
5384 return m_memSpec.isPrivateGettable();
5385}
5386
5388{
5389 return m_memSpec.isProtectedGettable();
5390}
5391
5393{
5394 return m_memSpec.isSettable();
5395}
5396
5398{
5399 return m_memSpec.isPrivateSettable();
5400}
5401
5403{
5404 return m_memSpec.isProtectedSettable();
5405}
5406
5408{
5409 return m_memSpec.isAddable();
5410}
5411
5413{
5414 return m_memSpec.isRemovable();
5415}
5416
5418{
5419 return m_memSpec.isRaisable();
5420}
5421
5423{
5424 return m_memSpec.isReadable();
5425}
5426
5428{
5429 return m_memSpec.isWritable();
5430}
5431
5433{
5434 return m_memSpec.isFinal();
5435}
5436
5438{
5439 return m_memSpec.isNew();
5440}
5441
5443{
5444 return m_memSpec.isSealed();
5445}
5446
5448{
5449 return m_memSpec.isOverride();
5450}
5451
5453{
5454 return m_memSpec.isInitonly();
5455}
5456
5458{
5459 return m_memSpec.isAbstract();
5460}
5461
5463{
5464 return m_memSpec.isOptional();
5465}
5466
5468{
5469 return m_memSpec.isRequired();
5470}
5471
5473{
5474 return m_memSpec.isNonAtomic();
5475}
5476
5478{
5479 return m_memSpec.isCopy();
5480}
5481
5483{
5484 return m_memSpec.isAssign();
5485}
5486
5488{
5489 return m_memSpec.isRetain();
5490}
5491
5493{
5494 return m_memSpec.isWeak();
5495}
5496
5498{
5499 return m_memSpec.isStrong();
5500}
5501
5503{
5504 return m_memSpec.isEnumStruct();
5505}
5506
5508{
5509 return m_mtype==MemberType::EnumValue &&
5510 m_enumScope &&
5511 m_enumScope->isStrong();
5512}
5513
5515{
5516 return m_memSpec.isUnretained();
5517}
5518
5520{
5521 return m_memSpec.isAlias();
5522}
5523
5525{
5526 return m_memSpec.isDefault();
5527}
5528
5530{
5531 return m_memSpec.isDelete();
5532}
5533
5535{
5536 return m_memSpec.isNoExcept();
5537}
5538
5540{
5541 return m_memSpec.isAttribute();
5542}
5543
5545{
5546 return m_memSpec.isProperty();
5547}
5548
5550{
5551 return m_memSpec.isReadonly();
5552}
5553
5555{
5556 return m_memSpec.isBound();
5557}
5558
5560{
5561 return m_memSpec.isConstrained();
5562}
5563
5565{
5566 return m_memSpec.isTransient();
5567}
5568
5570{
5571 return m_memSpec.isMaybeVoid();
5572}
5573
5575{
5576 return m_memSpec.isMaybeDefault();
5577}
5578
5580{
5581 return m_memSpec.isMaybeAmbiguous();
5582}
5583
5585{
5586 return m_memSpec.isPublished();
5587}
5588
5589
5591{
5592 return m_implOnly;
5593}
5594
5596{
5597 return m_explExt;
5598}
5599
5601{
5602 return m_tspec;
5603}
5604
5606{
5607 return isFunction() ||
5608 isSlot() ||
5609 isSignal() ||
5610 isConstructor() ||
5611 isDestructor() ||
5612 isObjCMethod() ||
5613 isFriend();
5614}
5615
5617{
5618 return m_relatedAlso;
5619}
5620
5622{
5623 return m_docEnumValues;
5624}
5625
5627{
5628 return m_annEnumType;
5629}
5630
5632{
5633 return m_docsForDefinition;
5634}
5635
5637{
5638 return m_enumScope;
5639}
5640
5642{
5643 return m_livesInsideEnum;
5644}
5645
5647{
5648 return m_memSpec.isLocal();
5649}
5650
5652{
5653 return m_memSpec.isNoDiscard();
5654}
5655
5657{
5658 return m_memSpec.isConstExpr();
5659}
5660
5662{
5663 return m_memSpec.isConstEval();
5664}
5665
5667{
5668 return m_memSpec.isConstInit();
5669}
5670
5672{
5673 return m_enumFields;
5674}
5675
5677{
5678 return m_examples;
5679}
5680
5682{
5683 return m_proto;
5684}
5685
5687{
5688 return m_defArgList;
5689}
5690
5692{
5693 return m_declArgList;
5694}
5695
5697{
5698 ArgumentList &decAl = m_declArgList;
5699 ArgumentList &defAl = m_defArgList;
5700 const ArgumentList &decAlSrc = md->declArgumentList();
5701 const ArgumentList &defAlSrc = md->argumentList();
5702 auto decSrc = decAlSrc.begin(), defSrc = defAlSrc.begin();
5703 for (auto decIt = decAl.begin(), defIt = defAl.begin();
5704 decIt != decAl.end() && defIt != defAl.end() && decSrc != decAlSrc.end() && defSrc != defAlSrc.end();
5705 ++decIt, ++defIt, ++decSrc, ++defSrc++)
5706 {
5707 Argument &decA = *decIt;
5708 Argument &defA = *defIt;
5709 const Argument &decAS = *decSrc;
5710 const Argument &defAS = *defSrc;
5711 if (decA.name.isEmpty())
5712 {
5713 if (!defA.name.isEmpty())
5714 {
5715 decA.name = defA.name;
5716 }
5717 else if (!decAS.name.isEmpty())
5718 {
5719 decA.name = decAS.name;
5720 }
5721 else if (!defAS.name.isEmpty())
5722 {
5723 decA.name = defAS.name;
5724 }
5725 }
5726 if (defA.name.isEmpty())
5727 {
5728 if (!decA.name.isEmpty())
5729 {
5730 defA.name = decA.name;
5731 }
5732 else if (!decAS.name.isEmpty())
5733 {
5734 defA.name = decAS.name;
5735 }
5736 else if (!defAS.name.isEmpty())
5737 {
5738 defA.name = defAS.name;
5739 }
5740 }
5741 }
5742}
5743
5745{
5746 return m_tArgList;
5747}
5748
5753
5755{
5756 return m_grpId;
5757}
5758
5763
5765{
5766 return m_annScope;
5767}
5768
5770{
5771 return m_hasCallGraph;
5772}
5773
5775{
5776 bool enabled = m_hasCallGraph &&
5777 (isFunction() || isSlot() || isSignal()) &&
5778 Config_getBool(HAVE_DOT);
5779 if (enabled)
5780 {
5781 bool trivial = DotCallGraph::isTrivial(this,FALSE);
5782 return !trivial;
5783 }
5784 return FALSE;
5785}
5786
5788{
5789 return m_hasCallerGraph;
5790}
5791
5793{
5794 bool enabled = m_hasCallerGraph &&
5795 (isFunction() || isSlot() || isSignal()) &&
5796 Config_getBool(HAVE_DOT);
5797 if (enabled)
5798 {
5799 bool trivial = DotCallGraph::isTrivial(this,TRUE);
5800 return !trivial;
5801 }
5802 return FALSE;
5803}
5804
5809
5814
5816{
5817 return m_hasInlineSource;
5818}
5819
5821{
5822 return m_hasEnumValues;
5823}
5824
5826{
5827 return m_templateMaster;
5828}
5829
5830std::optional<ArgumentList> MemberDefImpl::formalTemplateArguments() const
5831{
5833}
5834
5836{
5837 return m_isTypedefValCached;
5838}
5839
5844
5849
5851{
5852 //printf("MemberDefImpl::getCachedResolvedTypedef()=%s\n",qPrint(m_cachedResolvedType));
5853 return m_cachedResolvedType;
5854}
5855
5857{
5858 return m_memDef;
5859}
5860
5862{
5863 return m_memDec;
5864}
5865
5867{
5868 return m_docProvider;
5869}
5870
5872{
5873 return m_groupAlias;
5874}
5875
5880
5882{
5883 return m_declLine;
5884}
5885
5887{
5888 return m_declColumn;
5889}
5890
5891
5892//----------------------------------------------
5893
5899
5901{
5902 m_def=d;
5903}
5904
5912
5914{
5915 m_moduleDef=mod;
5916}
5917
5923
5928
5933
5938
5943
5945{
5946 for (const auto &sx : qualifiers)
5947 {
5948 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5949 if (!alreadyAdded)
5950 {
5951 m_qualifiers.push_back(sx);
5952 }
5953 }
5954}
5955
5960
5962{
5963 if (lines!=-1)
5964 {
5965 m_userInitLines=lines;
5966 }
5967}
5968
5970{
5971 m_read=r;
5972}
5973
5975{
5976 m_write=w;
5977}
5978
5980{
5981 m_tspec=b;
5982}
5983
5985{
5986 m_related = Relationship::Related;
5988}
5989
5991{
5992 m_related = Relationship::Foreign;
5994}
5995
5997{
5998 m_docProvider = md;
5999}
6000
6002{
6003 m_args = as;
6004}
6005
6010
6017
6019{
6020 m_docEnumValues=value;
6021}
6022
6024{
6025 m_annEnumType = md;
6026}
6027
6028void MemberDefImpl::setPrototype(bool p,const QCString &df,int line,int column)
6029{
6030 m_proto=p;
6031 if (p)
6032 {
6033 setDeclFile(df,line,column);
6034 }
6035 else
6036 {
6037 setDefFile(df,line,column);
6038 }
6039}
6040
6041void MemberDefImpl::setExplicitExternal(bool b,const QCString &df,int line,int column)
6042{
6043 m_explExt=b;
6044 if (b)
6045 {
6046 setDeclFile(df,line,column);
6047 }
6048 else
6049 {
6050 setDefFile(df,line,column);
6051 }
6052}
6053
6054void MemberDefImpl::setDeclFile(const QCString &df,int line,int column)
6055{
6056 m_declFileName = df;
6057 m_declLine = line;
6058 m_declColumn = column;
6059}
6060
6062{
6063 m_grpId=id;
6064}
6065
6070
6072{
6073 m_annScope=b;
6074}
6075
6080
6085
6090
6095
6101
6106
6111
6113{
6114 m_groupAlias = md;
6115}
6116
6121
6126
6131
6133{
6134 return m_category;
6135}
6136
6138{
6139 m_category = def;
6140}
6141
6143{
6144 return m_categoryRelation;
6145}
6146
6151
6153{
6154 m_enumBaseType = type;
6155}
6156
6158{
6159 return m_enumBaseType;
6160}
6161
6163{
6164 m_requiresClause = req;
6165}
6166
6171
6172void MemberDefImpl::cacheTypedefVal(const ClassDef*val, const QCString & templSpec, const QCString &resolvedType)
6173{
6176 m_cachedTypedefTemplSpec=templSpec;
6177 m_cachedResolvedType=resolvedType;
6178 //printf("MemberDefImpl::cacheTypedefVal=%s m_impl=%p\n",qPrint(m_cachedResolvedType),m_impl);
6179}
6180
6182{
6183 {
6184 const ArgumentList &srcAl = bmd->argumentList();
6185 ArgumentList &dstAl = m_defArgList;
6186 auto srcIt = srcAl.begin();
6187 auto dstIt = dstAl.begin();
6188 while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
6189 {
6190 Argument &argDst = *dstIt;
6191 const Argument &argSrc = *srcIt;
6192 if (!argSrc.name.isEmpty())
6193 {
6194 argDst.name = argSrc.name;
6195 }
6196 argDst.docs = argSrc.docs;
6197 ++srcIt;
6198 ++dstIt;
6199 }
6200 }
6201
6202 {
6203 const ArgumentList &srcAl = bmd->declArgumentList();
6204 ArgumentList &dstAl = m_declArgList;
6205 auto srcIt = srcAl.begin();
6206 auto dstIt = dstAl.begin();
6207
6208 while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
6209 {
6210 Argument &argDst = *dstIt;
6211 const Argument &argSrc = *srcIt;
6212 if (!argSrc.name.isEmpty())
6213 {
6214 argDst.name = argSrc.name;
6215 }
6216 argDst.docs = argSrc.docs;
6217 ++srcIt;
6218 ++dstIt;
6219 }
6220 }
6221}
6222
6224{
6225 for (Argument &a : al)
6226 {
6227 a.canType.clear();
6228 }
6229}
6230
6236
6241
6243{
6244 return m_numberOfFlowKW;
6245}
6246
6247//----------------
6248
6250{
6251 return DefinitionMixin::name();
6252}
6253
6254//----------------
6255
6257{
6258 for (auto decIt = decAl.begin(), defIt = defAl.begin();
6259 decIt!= decAl.end() && defIt!= defAl.end();
6260 ++decIt, ++defIt)
6261 {
6262 Argument &decA = *decIt;
6263 Argument &defA = *defIt;
6264 if (decA.docs.isEmpty() && !defA.docs.isEmpty())
6265 {
6266 decA.docs = defA.docs;
6267 }
6268 else if (defA.docs.isEmpty() && !decA.docs.isEmpty())
6269 {
6270 defA.docs = decA.docs;
6271 }
6272 //printf("transferArgumentDocumentation(%s<->%s)\n",qPrint(decA.name),qPrint(defA.name));
6273 if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
6274 {
6275 if (decA.name.isEmpty() && !defA.name.isEmpty())
6276 {
6277 decA.name = defA.name;
6278 }
6279 else if (defA.name.isEmpty() && !decA.name.isEmpty())
6280 {
6281 defA.name = decA.name;
6282 }
6283 }
6284 }
6285}
6286
6288{
6289 AUTO_TRACE("mdec='{}' mdef='{}' mdec.isPrototype={} mdef.isPrototype={}",
6290 mdec->name(), mdef->name(), mdec->isPrototype(), mdef->isPrototype());
6291 if (
6292 (!mdef->isDocTransferDone() || !mdec->isDocTransferDone()) &&
6293 (
6294 (mdef->isFunction() && !mdef->isStatic() && !mdef->isPrototype()) ||
6295 (mdef->isVariable() && !mdef->isExternal() && !mdef->isStatic())
6296 )
6297 )
6298 {
6299 bool sameNumTemplateArgs = mdef->templateArguments().size()==mdec->templateArguments().size();
6300
6301 ArgumentList &mdefAl = const_cast<ArgumentList&>(mdef->argumentList());
6302 ArgumentList &mdecAl = const_cast<ArgumentList&>(mdec->argumentList());
6303 if (sameNumTemplateArgs &&
6304 matchArguments2(mdef->getOuterScope(),mdef->getFileDef(),mdef->typeString(),&mdefAl,
6305 mdec->getOuterScope(),mdec->getFileDef(),mdec->typeString(),&mdecAl,
6306 TRUE,mdef->getLanguage()
6307 )
6308 ) /* match found */
6309 {
6310 AUTO_TRACE_ADD("combining definition and declaration");
6311
6312 if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
6313 {
6314 mdec->resolveUnnamedParameters(mdef);
6315 }
6316
6317 // first merge argument documentation
6318 transferArgumentDocumentation(mdecAl,mdefAl);
6319
6320 // copy brief description between definition and declaration
6321 QCString mdefBrief = mdef->briefDescription();
6322 QCString mdecBrief = mdec->briefDescription();
6323 QCString mdefBriefFile = mdef->briefFile();
6324 QCString mdecBriefFile = mdec->briefFile();
6325 int mdefBriefLine = mdef->briefLine();
6326 int mdecBriefLine = mdec->briefLine();
6327 if (!mdef->isDocTransferDone() && !mdecBrief.isEmpty())
6328 {
6329 mdef->setBriefDescription(mdecBrief,mdecBriefFile,mdecBriefLine);
6330 }
6331 if (!mdec->isDocTransferDone() && !mdefBrief.isEmpty())
6332 {
6333 mdec->setBriefDescription(mdefBrief,mdefBriefFile,mdefBriefLine);
6334 }
6335
6336 // copy detailed description between definition and declaration
6337 QCString mdefDocs = mdef->documentation();
6338 QCString mdecDocs = mdec->documentation();
6339 QCString mdefFile = mdef->docFile();
6340 QCString mdecFile = mdec->docFile();
6341 int mdefLine = mdef->docLine();
6342 int mdecLine = mdec->docLine();
6343 bool mdefDocsForDef = mdef->isDocsForDefinition();
6344 bool mdecDocsForDef = mdec->isDocsForDefinition();
6345 if (!mdec->isDocTransferDone() && !mdefDocs.isEmpty())
6346 {
6347 //printf("transferring docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
6348 mdec->setDocumentation(mdefDocs,mdefFile,mdefLine);
6349 mdec->setDocsForDefinition(mdefDocsForDef);
6350 if (mdefAl.hasParameters())
6351 {
6352 auto mdefAlComb = stringToArgumentList(mdef->getLanguage(),mdef->argsString());
6353 transferArgumentDocumentation(mdefAl,*mdefAlComb);
6354 mdec->moveArgumentList(std::move(mdefAlComb));
6355 }
6356 }
6357 if (!mdef->isDocTransferDone() && !mdecDocs.isEmpty())
6358 {
6359 //printf("transferring docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
6360 mdef->setDocumentation(mdecDocs,mdecFile,mdecLine);
6361 mdef->setDocsForDefinition(mdecDocsForDef);
6362 if (mdecAl.hasParameters())
6363 {
6364 auto mdecAlComb = stringToArgumentList(mdec->getLanguage(),mdec->argsString());
6365 transferArgumentDocumentation(mdecAl,*mdecAlComb);
6366 mdef->moveDeclArgumentList(std::move(mdecAlComb));
6367 }
6368 }
6369
6370 // copy inbody documentation between definition and declaration
6371 QCString mdefInbodyDocs = mdef->inbodyDocumentation();
6372 QCString mdecInbodyDocs = mdec->inbodyDocumentation();
6373 QCString mdefInbodyFile = mdef->inbodyFile();
6374 QCString mdecInbodyFile = mdec->inbodyFile();
6375 int mdefInbodyLine = mdef->inbodyLine();
6376 int mdecInbodyLine = mdec->inbodyLine();
6377 if (!mdec->isDocTransferDone() && !mdefInbodyDocs.isEmpty())
6378 {
6379 mdec->setInbodyDocumentation(mdefInbodyDocs,mdefInbodyFile,mdefInbodyLine);
6380 }
6381 if (!mdef->isDocTransferDone() && !mdecInbodyDocs.isEmpty())
6382 {
6383 mdef->setInbodyDocumentation(mdecInbodyDocs,mdecInbodyFile,mdecInbodyLine);
6384 }
6385
6386 if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
6387 {
6388 //printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
6389 mdef->setBodySegment(mdec->getDefLine(),mdec->getStartBodyLine(),mdec->getEndBodyLine());
6390 mdef->setBodyDef(mdec->getBodyDef());
6391 //mdef->setBodyMember(mdec);
6392 }
6393 else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
6394 {
6395 //printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
6396 mdec->setBodySegment(mdef->getDefLine(),mdef->getStartBodyLine(),mdef->getEndBodyLine());
6397 mdec->setBodyDef(mdef->getBodyDef());
6398 //mdec->setBodyMember(mdef);
6399 }
6402
6403 // copy group info.
6404 if (mdec->getGroupDef()==nullptr && mdef->getGroupDef()!=nullptr)
6405 {
6406 mdec->setGroupDef(mdef->getGroupDef(),
6407 mdef->getGroupPri(),
6408 mdef->docFile(),
6409 mdef->docLine(),
6410 mdef->hasDocumentation(),
6411 mdef
6412 );
6413 }
6414 else if (mdef->getGroupDef()==nullptr && mdec->getGroupDef()!=nullptr)
6415 {
6416 mdef->setGroupDef(mdec->getGroupDef(),
6417 mdec->getGroupPri(),
6418 mdec->docFile(),
6419 mdec->docLine(),
6420 mdec->hasDocumentation(),
6421 mdec
6422 );
6423 }
6424
6425
6426 mdec->mergeRefItems(mdef);
6427 mdef->mergeRefItems(mdec);
6428
6429 mdef->setMemberDeclaration(mdec);
6430 mdec->setMemberDefinition(mdef);
6431
6432 mergeMemberOverrideOptions(mdec,mdef);
6433
6434 mdef->addQualifiers(mdec->getQualifiers());
6435 mdec->addQualifiers(mdef->getQualifiers());
6436
6437 mdef->setDocTransferDone();
6438 mdec->setDocTransferDone();
6439 }
6440 }
6441}
6442
6444{
6445 if (m_templateMaster)
6446 {
6447 return m_templateMaster->briefDescription(abbr);
6448 }
6449 else
6450 {
6452 }
6453}
6454
6456{
6457 if (m_templateMaster)
6458 {
6459 return m_templateMaster->documentation();
6460 }
6461 else
6462 {
6464 }
6465}
6466
6468{
6469 if (m_templateMaster)
6470 {
6471 return m_templateMaster->hasUserDocumentation();
6472 }
6473 else
6474 {
6476 }
6477}
6478
6480{
6481 return m_typeConstraints;
6482}
6483
6485{
6486 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
6487 bool isFriendToHide = hideFriendCompounds &&
6488 (m_type=="friend class" ||
6489 m_type=="friend struct" ||
6490 m_type=="friend union");
6491 return isFriendToHide;
6492}
6493
6495{
6496 return (isFriend() &&
6497 (m_type=="friend class" || m_type=="friend struct" ||
6498 m_type=="friend union"));
6499}
6500
6501
6503{
6504 return !(isFriend() && isFriendToHide());
6505}
6506
6508{
6509 return isFunction() || isSlot() || isSignal();
6510}
6511
6513{
6514 return isRelated() || isForeign() || (isFriend() && !isFriendToHide());
6515}
6516
6518{
6520 (m_templateMaster && m_templateMaster->isReference());
6521}
6522
6524{
6525 switch (memberType())
6526 {
6527 case MemberType::Define: return CodeSymbolType::Define;
6528 case MemberType::Function: return CodeSymbolType::Function;
6529 case MemberType::Variable: return CodeSymbolType::Variable;
6530 case MemberType::Typedef: return CodeSymbolType::Typedef;
6531 case MemberType::Enumeration: return CodeSymbolType::Enumeration;
6532 case MemberType::EnumValue: return CodeSymbolType::EnumValue;
6533 case MemberType::Signal: return CodeSymbolType::Signal;
6534 case MemberType::Slot: return CodeSymbolType::Slot;
6535 case MemberType::Friend: return CodeSymbolType::Friend;
6536 case MemberType::DCOP: return CodeSymbolType::DCOP;
6537 case MemberType::Property: return CodeSymbolType::Property;
6538 case MemberType::Event: return CodeSymbolType::Event;
6539 case MemberType::Interface: return CodeSymbolType::Interface;
6540 case MemberType::Service: return CodeSymbolType::Service;
6541 case MemberType::Sequence: return CodeSymbolType::Sequence;
6542 case MemberType::Dictionary: return CodeSymbolType::Dictionary;
6543 }
6545}
6546
6548{
6549 return m_redefineCount;
6550}
6551
6553{
6554 m_redefineCount=count;
6555}
6556
6557//-------------------------------------------------------------------------------
6558// Helpers
6559
6561
6563{
6564 MemberDefMutable *src = toMemberDefMutable(const_cast<MemberDef*>(s));
6565 MemberDefMutable *dst = toMemberDefMutable(const_cast<MemberDef*>(d));
6566 if (src==nullptr || dst==nullptr) return;
6567 //printf("--> addDocCrossReference src=%s,dst=%s\n",qPrint(src->name()),qPrint(dst->name()));
6568 if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
6569 if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
6570 src->isCallable()
6571 )
6572 {
6573 QCString sourceRefName = src->sourceRefName();
6576
6577 // ---- critical section
6578 std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
6579 dst->addSourceReferencedBy(src,sourceRefName);
6580 if (mdDef)
6581 {
6582 mdDef->addSourceReferencedBy(src,sourceRefName);
6583 }
6584 if (mdDecl)
6585 {
6586 mdDecl->addSourceReferencedBy(src,sourceRefName);
6587 }
6588 // ---- end critical section
6589 }
6590 if ((src->hasReferencesRelation() || src->hasCallGraph()) &&
6591 src->isCallable()
6592 )
6593 {
6594 QCString sourceRefName = dst->sourceRefName();
6597
6598 // ---- critical section
6599 std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
6600 src->addSourceReferences(dst,sourceRefName);
6601 if (mdDef)
6602 {
6603 mdDef->addSourceReferences(dst,sourceRefName);
6604 }
6605 if (mdDecl)
6606 {
6607 mdDecl->addSourceReferences(dst,sourceRefName);
6608 }
6609 // ---- end critical section
6610 }
6611}
6612
6613// --- Cast functions
6614//
6616{
6617 if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6618 {
6619 return static_cast<MemberDef*>(d);
6620 }
6621 else
6622 {
6623 return nullptr;
6624 }
6625}
6626
6628{
6629 Definition *d = toDefinition(md);
6630 if (d && typeid(*d)==typeid(MemberDefImpl))
6631 {
6632 return static_cast<MemberDef*>(d);
6633 }
6634 else
6635 {
6636 return nullptr;
6637 }
6638}
6639
6641{
6642 if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6643 {
6644 return static_cast<const MemberDef*>(d);
6645 }
6646 else
6647 {
6648 return nullptr;
6649 }
6650}
6651
6653{
6654 if (d && typeid(*d)==typeid(MemberDefImpl))
6655 {
6656 return static_cast<MemberDefMutable*>(d);
6657 }
6658 else
6659 {
6660 return nullptr;
6661 }
6662}
6663
6664
constexpr auto prefix
Definition anchor.cpp:44
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:147
This class represents an function or template argument list.
Definition arguments.h:65
RefQualifierType refQualifier() const
Definition arguments.h:116
iterator end()
Definition arguments.h:94
bool hasParameters() const
Definition arguments.h:76
QCString trailingReturnType() const
Definition arguments.h:114
size_t size() const
Definition arguments.h:100
bool constSpecifier() const
Definition arguments.h:111
bool empty() const
Definition arguments.h:99
iterator begin()
Definition arguments.h:93
bool volatileSpecifier() const
Definition arguments.h:112
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. class/struct/union/...
virtual void setAnonymousMemberPrefix(const QCString &prefix)=0
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:77
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
bool hasRequirementRefs() 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
void writeRequirementRefs(OutputList &ol) const 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:130
static bool parseSourcesNeeded
Definition doxygen.h:123
static ParserManager * parserManager
Definition doxygen.h:129
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
A model of a file symbol.
Definition filedef.h:99
virtual QCString absFilePath() 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
MemberDef * toAnonymousMember() const 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
int redefineCount() 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 isThreadLocal() 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 isDocTransferDone() 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 anonymousMemberPrefix() 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 QCString anonymousMemberPrefix() 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 isThreadLocal() 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 isDocTransferDone() 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 MemberDef * toAnonymousMember() 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 int redefineCount() 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 setToAnonymousMember(MemberDef *m) 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 setRedefineCount(int) override
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 m_docTransferDone
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
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
MemberDef * toAnonymousMember() const override
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 anonymousMemberPrefix() const 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
MemberDef * m_toAnnMemb
bool isRequired() const override
const MemberVector & reimplementedBy() const override
void determineScopeForAnonymousMembers() 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
QCString m_anonymousPrefix
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
int redefineCount() const override
bool isDictionary() const override
bool isSlot() const override
bool hasInlineSource() const 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 isDocTransferDone() const 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 setDocTransferDone() 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
void addRequirementReferences(const Definition *) override
bool hasExamples() const override
void resolveUnnamedParameters(const MemberDef *md) override
void setMemberDefinition(MemberDef *md) override
bool isThreadLocal() const 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
void setAnonymousMemberPrefix(const QCString &prefix) 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
MemberDef * m_fromAnnMemb
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 addListReference(const Definition *) override
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 setDocTransferDone()=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 setAnonymousMemberPrefix(const QCString &prefix)=0
virtual void insertReimplementedBy(MemberDef *md)=0
A class representing a group of members.
Definition membergroup.h:44
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:125
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:279
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:315
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:383
bool isEnabled(OutputType o)
void endIndent()
Definition outputlist.h:584
void writeString(const QCString &text)
Definition outputlist.h:411
void startMemberDeclaration()
Definition outputlist.h:569
void startMemberDoc(const QCString &clName, const QCString &memName, const QCString &anchor, const QCString &title, int memCount, int memTotal, bool showInline)
Definition outputlist.h:531
void endDescTableRow()
Definition outputlist.h:634
void startMemberDocName(bool align)
Definition outputlist.h:680
void endParameterExtra(bool last, bool one, bool bracket)
Definition outputlist.h:694
void writeChar(char c)
Definition outputlist.h:529
void disable(OutputType o)
void endMemberTemplateParams(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:499
void endMemberDocName()
Definition outputlist.h:682
void endMemberDoc(bool hasArgs)
Definition outputlist.h:535
void startDescTableInit()
Definition outputlist.h:640
void startCallGraph()
Definition outputlist.h:656
void endDescTable()
Definition outputlist.h:630
void startParameterExtra()
Definition outputlist.h:692
const OutputCodeList & codeGenerators() const
Definition outputlist.h:358
void startParameterList(bool openBracket)
Definition outputlist.h:700
void writeLatexSpacing()
Definition outputlist.h:545
void enable(OutputType o)
void endInlineMemberType()
Definition outputlist.h:728
void endMemberDescription()
Definition outputlist.h:567
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:439
void startInlineMemberType()
Definition outputlist.h:726
void startInlineMemberDoc()
Definition outputlist.h:734
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:565
void endDescTableTitle()
Definition outputlist.h:638
void endDoxyAnchor(const QCString &fn, const QCString &anchor)
Definition outputlist.h:541
void docify(const QCString &s)
Definition outputlist.h:437
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, const DocOptions &options)
void startIndent()
Definition outputlist.h:582
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:407
void endDescForItem()
Definition outputlist.h:549
void endExamples()
Definition outputlist.h:580
void exceptionEntry(const QCString &prefix, bool closeBracket)
Definition outputlist.h:704
void endParagraph()
Definition outputlist.h:409
void endDescTableData()
Definition outputlist.h:646
void addIndexItem(const QCString &s1, const QCString &s2)
Definition outputlist.h:590
void disableAll()
void startDescTableTitle()
Definition outputlist.h:636
void startExamples()
Definition outputlist.h:578
void endInlineMemberDoc()
Definition outputlist.h:736
void endMemberDocPrefixItem()
Definition outputlist.h:678
void startParameterDefVal(const char *separator)
Definition outputlist.h:696
void startAnonTypeScope(int i1)
Definition outputlist.h:489
void endTextLink()
Definition outputlist.h:444
void startBold()
Definition outputlist.h:561
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:495
void startDescTable(const QCString &title, const bool hasInits)
Definition outputlist.h:628
void startTypewriter()
Definition outputlist.h:449
void addLabel(const QCString &fName, const QCString &anchor)
Definition outputlist.h:543
void startDescTableData()
Definition outputlist.h:644
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:517
void startDescForItem()
Definition outputlist.h:547
void endParameterDefVal()
Definition outputlist.h:698
void startParameterType(bool first, const QCString &key)
Definition outputlist.h:684
void disableAllBut(OutputType o)
void endParameterName()
Definition outputlist.h:690
void popGeneratorState()
void endBold()
Definition outputlist.h:563
void startDoxyAnchor(const QCString &fName, const QCString &manName, const QCString &anchor, const QCString &name, const QCString &args)
Definition outputlist.h:537
void endLabels()
Definition outputlist.h:742
void endParameterList()
Definition outputlist.h:702
void endCallGraph(DotCallGraph &g)
Definition outputlist.h:658
void startInlineMemberName()
Definition outputlist.h:730
void writeLabel(const QCString &l, bool isLast)
Definition outputlist.h:740
void startLabels()
Definition outputlist.h:738
void endParameterType()
Definition outputlist.h:686
void startMemberDocPrefixItem()
Definition outputlist.h:676
void endAnonTypeScope(int i1)
Definition outputlist.h:491
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:571
void startParameterName(bool one)
Definition outputlist.h:688
void enableAll()
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:493
void endTypewriter()
Definition outputlist.h:451
void endInlineMemberName()
Definition outputlist.h:732
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:559
void parseText(const QCString &textStr)
void writeNonBreakableSpace(int num)
Definition outputlist.h:626
void endDescTableInit()
Definition outputlist.h:642
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:442
void startDescTableRow()
Definition outputlist.h:632
void startMemberTemplateParams()
Definition outputlist.h:497
This is an alternative implementation of QCString.
Definition qcstring.h:103
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:426
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:170
bool startsWith(const char *s) const
Definition qcstring.h:511
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:245
QCString lower() const
Definition qcstring.h:253
bool endsWith(const char *s) const
Definition qcstring.h:528
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:597
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:167
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:264
QCString & remove(size_t index, size_t len)
Definition qcstring.h:446
const std::string & str() const
Definition qcstring.h:556
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition qcstring.cpp:190
QCString & append(char c)
Definition qcstring.h:400
QCString right(size_t len) const
Definition qcstring.h:238
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
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:176
QCString left(size_t len) const
Definition qcstring.h:233
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:217
void clear()
Definition qcstring.h:186
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)
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:694
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:151
#define Config_getInt(name)
Definition config.h:34
#define Config_getList(name)
Definition config.h:38
#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:826
Definition * toDefinition(DefinitionMutable *dm)
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:49
#define AUTO_TRACE(...)
Definition docnode.cpp:48
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
static void setAnonymousEnumType()
Definition doxygen.cpp:8920
static void writeTagFile()
static void addRequirementReferences()
Definition doxygen.cpp:5409
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1966
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:844
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:571
#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:42
QCString name
Definition arguments.h:44
QCString defval
Definition arguments.h:46
QCString docs
Definition arguments.h:47
QCString array
Definition arguments.h:45
QCString attrib
Definition arguments.h:41
Options to configure the code parser.
Definition parserintf.h:78
Data associated with an example.
Definition example.h:29
GroupPri_t
Grouping priority.
Definition types.h:230
@ GROUPING_AUTO_DEF
membership in group was defined via @defgroup
Definition types.h:234
LinkifyTextOptions & setScope(const Definition *scope)
Definition util.h:111
LinkifyTextOptions & setSelf(const Definition *self)
Definition util.h:117
LinkifyTextOptions & setFileScope(const FileDef *fileScope)
Definition util.h:114
This struct is used to capture the tag file information for an Entry.
Definition entry.h:104
QCString anchor
Definition entry.h:107
QCString fileName
Definition entry.h:106
QCString tagName
Definition entry.h:105
CodeSymbolType
Definition types.h:481
MemberType
Definition types.h:569
MemberListContainer
Definition types.h:472
Protection
Definition types.h:32
SrcLangExt
Definition types.h:207
Relationship
Definition types.h:167
Specifier
Definition types.h:80
static constexpr const char * to_string_lower(Protection prot) noexcept
Definition types.h:50
VhdlSpecifier
Definition types.h:770
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const QCString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const QCString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:2031
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:567
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5235
bool protectionLevelVisible(Protection prot)
Definition util.cpp:5959
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
Definition util.cpp:4390
void stripIndentationVerbatim(QCString &doc, const int indentationLevel, bool skipFirstLine)
Definition util.cpp:6060
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:5483
QCString stripAnonymousNamespaceScope(const QCString &s)
Definition util.cpp:230
QCString stripFromIncludePath(const QCString &path)
Definition util.cpp:329
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1299
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:4849
void writePageRef(OutputList &ol, const QCString &cn, const QCString &mn)
Definition util.cpp:259
QCString removeAnonymousScopes(const QCString &str)
Definition util.cpp:161
QCString inlineTemplateArgListToDoc(const ArgumentList &al)
Definition util.cpp:1227
QCString stripExtension(const QCString &fName)
Definition util.cpp:4968
QCString convertToXML(const QCString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3933
QCString detab(const QCString &s, size_t &refIndent)
Definition util.cpp:6742
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5919
void mergeMemberOverrideOptions(MemberDefMutable *md1, MemberDefMutable *md2)
Definition util.cpp:6883
void linkifyText(const TextGeneratorIntf &out, const QCString &text, const LinkifyTextOptions &options)
Definition util.cpp:893
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:1124
QCString inlineArgListToDoc(const ArgumentList &al)
Definition util.cpp:1204
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:1175
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:4946
A bunch of utility functions.
bool isId(int c)
Definition util.h:257