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