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 "md5hash.h"
22#include "memberdef.h"
23#include "membername.h"
24#include "doxygen.h"
25#include "util.h"
26#include "code.h"
27#include "message.h"
28#include "htmlhelp.h"
29#include "language.h"
30#include "outputlist.h"
31#include "example.h"
32#include "membergroup.h"
33#include "groupdef.h"
34#include "defargs.h"
35#include "docparser.h"
36#include "dot.h"
37#include "dotcallgraph.h"
38#include "searchindex.h"
39#include "parserintf.h"
40#include "vhdldocgen.h"
41#include "arguments.h"
42#include "memberlist.h"
43#include "namespacedef.h"
44#include "moduledef.h"
45#include "filedef.h"
46#include "config.h"
47#include "definitionimpl.h"
48#include "regex.h"
49#include "trace.h"
50
51//-----------------------------------------------------------------------------
52
53class MemberDefImpl final : public DefinitionMixin<MemberDefMutable>
54{
55 public:
56 MemberDefImpl(const DString &defFileName,int defLine,int defColumn,
57 const DString &type,const DString &name,const DString &args,
58 const DString &excp,Protection prot,Specifier virt,bool stat,
59 Relationship related,MemberType t,const ArgumentList &tal,
60 const ArgumentList &al,const DString &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 DString getOutputFileBase() const override;
71 DString getReference() const override;
72 DString anchor() const override;
73 DString declaration() const override;
74 DString definition() const override;
75 DString typeString() const override;
76 DString argsString() const override;
77 DString excpString() const override;
78 DString bitfieldString() const override;
79 DString extraTypeChars() const override;
80 const DString &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 DString 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 DString getReadAccessor() const override;
96 DString getWriteAccessor() const override;
97 Grouping::GroupPri_t getGroupPri() const override;
98 DString getGroupFileName() const override;
99 int getGroupStartLine() const override;
100 bool getGroupHasDocs() const override;
101 DString qualifiedName() const override;
102 DString objCMethodName(bool localLink,bool showStatic) const override;
103 Protection protection() const override;
104 Specifier virtualness(int count=0) const override;
105 MemberType memberType() const override;
106 DString memberTypeName() const override;
107 bool isSignal() const override;
108 bool isSlot() const override;
109 bool isVariable() const override;
110 bool isEnumerate() const override;
111 bool isEnumValue() const override;
112 bool isTypedef() const override;
113 bool isSequence() const override;
114 bool isDictionary() const override;
115 bool isFunction() const override;
116 bool isFunctionPtr() const override;
117 bool isDefine() const override;
118 bool isFriend() const override;
119 bool isDCOP() const override;
120 bool isProperty() const override;
121 bool isEvent() const override;
122 bool isRelated() const override;
123 bool isForeign() const override;
124 bool isStatic() const override;
125 bool isInline() const override;
126 bool isExplicit() const override;
127 bool isMutable() const override;
128 bool isThreadLocal() 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 DString &type) override;
213 DString 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 hasCallGraph() const override;
225 bool hasCallerGraph() const override;
226 bool hasReferencesRelation() const override;
227 bool hasReferencedByRelation() const override;
228 bool hasEnumValues() const override;
229 bool hasInlineSource() const override;
230 bool isDocTransferDone() const override;
231 DString sourceRefName() const override;
232 const MemberDef *templateMaster() const override;
233 DString getScopeString() const override;
234 const ClassDef *getClassDefOfAnonymousType() const override;
235 bool isTypedefValCached() const override;
236 const ClassDef *getCachedTypedefVal() const override;
237 DString getCachedTypedefTemplSpec() const override;
238 DString getCachedResolvedTypedef() const override;
239 MemberDef *memberDefinition() const override;
240 MemberDef *memberDeclaration() const override;
241 const MemberDef *inheritsDocsFrom() const override;
242 const MemberDef *getGroupAlias() const override;
243 ClassDef *category() const override;
244 const MemberDef *categoryRelation() const override;
245 DString displayName(bool=true) const override;
246 DString getDeclType() const override;
247 StringVector getLabels(const Definition *container) const override;
248 const ArgumentList &typeConstraints() const override;
249 DString requiresClause() const override;
250 DString documentation() const override;
251 DString briefDescription(bool abbr=false) const override;
252 DString fieldType() const override;
253 bool isReference() const override;
254 DString getDeclFileName() const override;
255 int getDeclLine() const override;
256 int getDeclColumn() const override;
257 void setMemberType(MemberType t) override;
258 void setDefinition(const DString &d) override;
259 void setFileDef(FileDef *fd) override;
260 void setAnchor() override;
261 void setProtection(Protection p) override;
262 void setMemberSpecifiers(TypeSpecifier s) override;
263 void setVhdlSpecifiers(VhdlSpecifier s) override;
264 void mergeMemberSpecifiers(TypeSpecifier s) override;
265 void setInitializer(const DString &i) override;
266 void setBitfields(const DString &s) override;
267 void setMaxInitLines(int lines) override;
268 void setMemberClass(ClassDef *cd) override;
269 void setSectionList(const Definition *container,const MemberList *sl) override;
271 const DString &fileName,int startLine,bool hasDocs,
272 MemberDef *member=nullptr) override;
273 void setReadAccessor(const DString &r) override;
274 void setWriteAccessor(const DString &w) override;
275 void setTemplateSpecialization(bool b) override;
276 void makeRelated() override;
277 void makeForeign() override;
278 void setInheritsDocsFrom(const MemberDef *md) override;
279 void setTagInfo(const TagInfo *i) override;
280 void setArgsString(const DString &as) override;
281 void setReimplements(MemberDef *md) override;
282 void insertReimplementedBy(MemberDef *md) override;
283 void setRelatedAlso(ClassDef *cd) override;
284 void insertEnumField(MemberDef *md) override;
285 void setEnumScope(MemberDef *md,bool livesInsideEnum=false) override;
286 void setEnumClassScope(ClassDef *cd) override;
287 void setDocumentedEnumValues(bool value) override;
288 void setAnonymousEnumType(const MemberDef *md) override;
289 bool addExample(const DString &anchor,const DString &name,const DString &file) override;
290 void setPrototype(bool p,const DString &df,int line, int column) override;
291 void setExplicitExternal(bool b,const DString &df,int line,int column) override;
292 void setDeclFile(const DString &df,int line,int column) override;
293 void moveArgumentList(std::unique_ptr<ArgumentList> al) override;
294 void moveDeclArgumentList(std::unique_ptr<ArgumentList> al) override;
295 void setDefinitionTemplateParameterLists(const ArgumentLists &lists) override;
296 void setTypeConstraints(const ArgumentList &al) override;
297 void setType(const DString &t) override;
298 void setNamespace(NamespaceDef *nd) override;
299 void setMemberGroup(MemberGroup *grp) override;
300 void setMemberGroupId(int id) override;
301 void makeImplementationDetail() override;
302 void overrideCallGraph(bool e) override;
303 void overrideCallerGraph(bool e) override;
304 void overrideReferencedByRelation(bool e) override;
305 void overrideReferencesRelation(bool e) override;
306 void overrideEnumValues(bool e) override;
307 void overrideInlineSource(bool e) override;
308 void setTemplateMaster(const MemberDef *mt) override;
309 void setFormalTemplateArguments(const ArgumentList &al) override;
310 void addListReference(const Definition *) override;
311 void addRequirementReferences(const Definition *) override;
312 void setDocsForDefinition(bool b) override;
313 void setGroupAlias(const MemberDef *md) override;
314 void cacheTypedefVal(const ClassDef *val,const DString &templSpec,const DString &resolvedType) override;
315 void invalidateTypedefValCache() override;
316 void invalidateCachedArgumentTypes() override;
317 void setMemberDefinition(MemberDef *md) override;
318 void setMemberDeclaration(MemberDef *md) override;
319 void copyArgumentNames(const MemberDef *bmd) override;
320 void setCategory(ClassDef *) override;
321 void setCategoryRelation(const MemberDef *) override;
322 void setDocumentation(const DString &d,const DString &docFile,int docLine,bool stripWhiteSpace=true) override;
323 void setBriefDescription(const DString &b,const DString &briefFile,int briefLine) override;
324 void setInbodyDocumentation(const DString &d,const DString &inbodyFile,int inbodyLine) override;
325 void setHidden(bool b) override;
326 void setDocTransferDone() override;
327 void setExplicitInherited(bool b) override;
328 void setRequiresClause(const DString &req) override;
329 void incrementFlowKeyWordCount() override;
331 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
332 bool inGroup, int indentLevel,const ClassDef *inheritFrom=nullptr,const DString &inheritId=DString()) const override;
333 void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol,
334 const DString &scopeName,const Definition *container,
335 bool inGroup,bool showEnumValues=false,bool
336 showInline=false) const override;
337 void writeMemberDocSimple(OutputList &ol,const Definition *container) const override;
338 void writeEnumDeclaration(OutputList &typeDecl,
339 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const override;
340 void writeTagFile(TextStream &,bool useQualifiedName,bool showNamespaceMembers) const override;
341 void warnIfUndocumented() const override;
342 void warnIfUndocumentedParams() const override;
343 bool visibleInIndex() const override;
344 void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const override;
345 std::unique_ptr<MemberDef> createTemplateInstanceMember(const ArgumentList &formalArgs,
346 const std::unique_ptr<ArgumentList> &actualArgs) const override;
347 void findSectionsInDocumentation() override;
348 void writeLink(OutputList &ol,
349 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
350 bool onlyText=false) const override;
351 void resolveUnnamedParameters(const MemberDef *md) override;
352 void addQualifiers(const StringVector &qualifiers) override;
353 StringVector getQualifiers() const override;
355 void setModuleDef(ModuleDef *mod) override;
356 int redefineCount() const override;
357 void setRedefineCount(int) override;
358 void setClassDefOfAnonymousType(const ClassDef *cd) override;
359
360 private:
364 void _writeGroupInclude(OutputList &ol,bool inGroup) const;
365 void _writeMultiLineInitializer(OutputList &ol,const DString &scopeName) const;
366 void _writeCallGraph(OutputList &ol) const;
367 void _writeCallerGraph(OutputList &ol) const;
368 void _writeReimplements(OutputList &ol) const;
369 bool _isReimplements() const;
370 void _writeReimplementedBy(OutputList &ol) const;
371 size_t _countReimplementedBy() const;
372 void _writeExamples(OutputList &ol) const;
373 void _writeTypeConstraints(OutputList &ol) const;
374 void _writeEnumValues(OutputList &ol,const Definition *container,
375 const DString &cfname,const DString &ciname,
376 const DString &cname) const;
377 void _writeCategoryRelation(OutputList &ol) const;
378 void _writeTagData(const DefType) const;
379 void _writeTemplatePrefix(OutputList &ol, const Definition *def,
380 const ArgumentList &al, bool writeReqClause=true) const;
381 bool _hasVisibleCallGraph() const;
382 bool _hasVisibleCallerGraph() const;
383 bool _isAnonymousBitField() const;
384
385
386 void init(Definition *def,const DString &t,const DString &a,const DString &e,
387 Protection p,Specifier v,bool s,Relationship r,
388 MemberType mt,const ArgumentList &tal,
389 const ArgumentList &al,const DString &meta
390 );
391
392 uint8_t m_isLinkableCached; // 0 = not cached, 1=false, 2=true
393 uint8_t m_isConstructorCached; // 0 = not cached, 1=false, 2=true
394 uint8_t m_isDestructorCached; // 1 = not cached, 1=false, 2=true
395
396 ClassDef *m_classDef = nullptr; // member of or related to
397 FileDef *m_fileDef = nullptr; // member of file definition
398 NamespaceDef *m_nspace = nullptr; // the namespace this member is in.
400
401 const MemberDef *m_enumScope = nullptr; // the enclosing scope, if this is an enum field
402 bool m_livesInsideEnum = false;
403 const MemberDef *m_annEnumType = nullptr; // the anonymous enum that is the type of this member
404 MemberVector m_enumFields; // enumeration fields
405
406 MemberDef *m_redefines = nullptr; // the members that this member redefines
407 MemberVector m_redefinedBy; // the list of members that redefine this one
408
409 MemberDef *m_memDef = nullptr; // member definition for this declaration
410 MemberDef *m_memDec = nullptr; // member declaration for this definition
411 ClassDef *m_relatedAlso = nullptr; // points to class marked by relatedAlso
412
413 ExampleList m_examples; // a dictionary of all examples for quick access
414
415 DString m_type; // return actual type
416 DString m_args; // function arguments/variable array specifiers
417 DString m_def; // member definition in code (fully qualified name)
418 DString 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 DString m_decl; // member declaration in class
422
423 DString m_bitfields; // struct member bitfields
424 DString m_read; // property read accessor
425 DString m_write; // property write accessor
426 DString m_exception; // exceptions that can be thrown
427 DString m_initializer; // initializer
428 DString m_extraTypeChars; // extra type info found after the argument list
429 DString m_enumBaseType; // base type of the enum (C++11)
430 DString m_requiresClause; // requires clause (C++20)
431 int m_initLines = 0; // number of lines in the initializer
432 bool m_docTransferDone = false;
433
434 TypeSpecifier m_memSpec; // The specifiers present for this member
436 MemberType m_mtype = MemberType::Define; // returns the kind of member
437 int m_maxInitLines = 0; // when the initializer will be displayed
438 int m_userInitLines = 0; // result of explicit \hideinitializer or \showinitializer
439
440 ArgumentList m_defArgList; // argument list of this member definition
441 ArgumentList m_declArgList; // argument list of this member declaration
442
443 ArgumentList m_tArgList; // template argument list of function template
444 ArgumentList m_typeConstraints; // type constraints for template parameters
445 const MemberDef *m_templateMaster = nullptr;
446 std::optional<ArgumentList> m_formalTemplateArguments;
447 ArgumentLists m_defTmpArgLists; // lists of template argument lists
448 // (for template functions in nested template classes)
449
450 DString m_metaData; // Slice metadata.
451
452 const ClassDef *m_anonymousType = 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 DString 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
478
479 // to store extra qualifiers
481
482 // objective-c
483 bool m_implOnly = false; // function found in implementation but not
484 // in the interface
485 mutable bool m_hasDocumentedParams = false; // guard to show only the first warning, acts as cache
486 mutable bool m_hasDocumentedReturnType = false; // guard to show only the first warning, acts as cache
487 bool m_isDMember = false;
488 Relationship m_related = Relationship::Member; // relationship of this to the class
489 bool m_stat = false; // is it a static function?
490 bool m_proto = false; // is it a prototype?
491 bool m_docEnumValues = false; // is an enum with documented enum values.
492
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;
515};
516
517std::unique_ptr<MemberDef> createMemberDef(const DString &defFileName,int defLine,int defColumn,
518 const DString &type,const DString &name,const DString &args,
519 const DString &excp,Protection prot,Specifier virt,bool stat,
520 Relationship related,MemberType t,const ArgumentList &tal,
521 const ArgumentList &al,const DString &metaData)
522{
523 return std::make_unique<MemberDefImpl>(defFileName,defLine,defColumn,type,name,args,excp,prot,virt,
524 stat,related,t,tal,al,metaData);
525}
526
527//-----------------------------------------------------------------------------
528
529class MemberDefAliasImpl final : public DefinitionAliasMixin<MemberDef>
530{
531 public:
532 MemberDefAliasImpl(const Definition *newScope,const MemberDef *md)
533 : DefinitionAliasMixin(newScope,md), m_memberGroup(nullptr) { init(); }
534 ~MemberDefAliasImpl() override { deinit(); }
536
537 DefType definitionType() const override { return TypeMember; }
538
539 const MemberDef *getMdAlias() const { return toMemberDef(getAlias()); }
540 MemberDef *getMdAlias() { return toMemberDef(const_cast<Definition*>(getAlias())); }
541 MemberDef *resolveAlias() override { return const_cast<MemberDef*>(getMdAlias()); }
542 const MemberDef *resolveAlias() const override { return getMdAlias(); }
543
544 std::unique_ptr<MemberDef> deepCopy() const override {
546 }
547 void moveTo(Definition *) override {}
548
549 const DString &name() const override
550 { return getMdAlias()->name(); }
552 { return getMdAlias()->codeSymbolType(); }
553 DString getOutputFileBase() const override
554 { return getMdAlias()->getOutputFileBase(); }
555 DString getReference() const override
556 { return getMdAlias()->getReference(); }
557 DString anchor() const override
558 { return getMdAlias()->anchor(); }
559 DString declaration() const override
560 { return getMdAlias()->declaration(); }
561 DString definition() const override
562 { return getMdAlias()->definition(); }
563 DString typeString() const override
564 { return getMdAlias()->typeString(); }
565 DString argsString() const override
566 { return getMdAlias()->argsString(); }
567 DString excpString() const override
568 { return getMdAlias()->excpString(); }
569 DString bitfieldString() const override
570 { return getMdAlias()->bitfieldString(); }
571 DString extraTypeChars() const override
572 { return getMdAlias()->extraTypeChars(); }
573 const DString &initializer() const override
574 { return getMdAlias()->initializer(); }
575 int initializerLines() const override
576 { return getMdAlias()->initializerLines(); }
580 { return getMdAlias()->getVhdlSpecifiers(); }
581 const MemberList *getSectionList(const Definition *container) const override
582 { return getMdAlias()->getSectionList(container); }
583 DString displayDefinition() const override
584 { return getMdAlias()->displayDefinition(); }
585
586 const ClassDef *getClassDef() const override
587 { return getMdAlias()->getClassDef(); }
589 { return getMdAlias()->getClassDef(); }
590
591 const FileDef *getFileDef() const override
592 { return getMdAlias()->getFileDef(); }
593 FileDef *getFileDef() override
594 { return getMdAlias()->getFileDef(); }
595
596 const ModuleDef *getModuleDef() const override
597 { return getMdAlias()->getModuleDef(); }
598
599 const NamespaceDef* getNamespaceDef() const override
600 { return getMdAlias()->getNamespaceDef(); }
602 { return getMdAlias()->getNamespaceDef(); }
603
604 DString getReadAccessor() const override
605 { return getMdAlias()->getReadAccessor(); }
606 DString getWriteAccessor() const override
607 { return getMdAlias()->getWriteAccessor(); }
608 const GroupDef *getGroupDef() const override
609 { return getMdAlias()->getGroupDef(); }
611 { return getMdAlias()->getGroupDef(); }
613 { return getMdAlias()->getGroupPri(); }
614 DString getGroupFileName() const override
615 { return getMdAlias()->getGroupFileName(); }
616 int getGroupStartLine() const override
617 { return getMdAlias()->getGroupStartLine(); }
618 bool getGroupHasDocs() const override
619 { return getMdAlias()->getGroupHasDocs(); }
620 DString qualifiedName() const override
621 { return getMdAlias()->qualifiedName(); }
622 DString objCMethodName(bool localLink,bool showStatic) const override
623 { return getMdAlias()->objCMethodName(localLink,showStatic); }
624 Protection protection() const override
625 { return getMdAlias()->protection(); }
626 Specifier virtualness(int /* count */) const override
627 { return getMdAlias()->virtualness(); }
628 MemberType memberType() const override
629 { return getMdAlias()->memberType(); }
630 DString memberTypeName() const override
631 { return getMdAlias()->memberTypeName(); }
632 bool isSignal() const override
633 { return getMdAlias()->isSignal(); }
634 bool isSlot() const override
635 { return getMdAlias()->isSlot(); }
636 bool isVariable() const override
637 { return getMdAlias()->isVariable(); }
638 bool isEnumerate() const override
639 { return getMdAlias()->isEnumerate(); }
640 bool isEnumValue() const override
641 { return getMdAlias()->isEnumValue(); }
642 bool isTypedef() const override
643 { return getMdAlias()->isTypedef(); }
644 bool isSequence() const override
645 { return getMdAlias()->isSequence(); }
646 bool isDictionary() const override
647 { return getMdAlias()->isDictionary(); }
648 bool isFunction() const override
649 { return getMdAlias()->isFunction(); }
650 bool isFunctionPtr() const override
651 { return getMdAlias()->isFunctionPtr(); }
652 bool isDefine() const override
653 { return getMdAlias()->isDefine(); }
654 bool isFriend() const override
655 { return getMdAlias()->isFriend(); }
656 bool isDCOP() const override
657 { return getMdAlias()->isDCOP(); }
658 bool isProperty() const override
659 { return getMdAlias()->isProperty(); }
660 bool isEvent() const override
661 { return getMdAlias()->isEvent(); }
662 bool isRelated() const override
663 { return getMdAlias()->isRelated(); }
664 bool isForeign() const override
665 { return getMdAlias()->isForeign(); }
666 bool isStatic() const override
667 { return getMdAlias()->isStatic(); }
668 bool isInline() const override
669 { return getMdAlias()->isInline(); }
670 bool isExplicit() const override
671 { return getMdAlias()->isExplicit(); }
672 bool isMutable() const override
673 { return getMdAlias()->isMutable(); }
674 bool isThreadLocal() const override
675 { return getMdAlias()->isThreadLocal(); }
676 bool isGettable() const override
677 { return getMdAlias()->isGettable(); }
678 bool isPrivateGettable() const override
679 { return getMdAlias()->isPrivateGettable(); }
680 bool isProtectedGettable() const override
681 { return getMdAlias()->isProtectedGettable(); }
682 bool isSettable() const override
683 { return getMdAlias()->isSettable(); }
684 bool isPrivateSettable() const override
685 { return getMdAlias()->isPrivateSettable(); }
686 bool isProtectedSettable() const override
687 { return getMdAlias()->isProtectedSettable(); }
688 bool isReadable() const override
689 { return getMdAlias()->isReadable(); }
690 bool isWritable() const override
691 { return getMdAlias()->isWritable(); }
692 bool isAddable() const override
693 { return getMdAlias()->isAddable(); }
694 bool isRemovable() const override
695 { return getMdAlias()->isRemovable(); }
696 bool isRaisable() const override
697 { return getMdAlias()->isRaisable(); }
698 bool isFinal() const override
699 { return getMdAlias()->isFinal(); }
700 bool isAbstract() const override
701 { return getMdAlias()->isAbstract(); }
702 bool isOverride() const override
703 { return getMdAlias()->isOverride(); }
704 bool isInitonly() const override
705 { return getMdAlias()->isInitonly(); }
706 bool isOptional() const override
707 { return getMdAlias()->isOptional(); }
708 bool isRequired() const override
709 { return getMdAlias()->isRequired(); }
710 bool isNonAtomic() const override
711 { return getMdAlias()->isNonAtomic(); }
712 bool isCopy() const override
713 { return getMdAlias()->isCopy(); }
714 bool isAssign() const override
715 { return getMdAlias()->isAssign(); }
716 bool isRetain() const override
717 { return getMdAlias()->isRetain(); }
718 bool isWeak() const override
719 { return getMdAlias()->isWeak(); }
720 bool isStrong() const override
721 { return getMdAlias()->isStrong(); }
722 bool isEnumStruct() const override
723 { return getMdAlias()->isEnumStruct(); }
724 bool isUnretained() const override
725 { return getMdAlias()->isUnretained(); }
726 bool isNew() const override
727 { return getMdAlias()->isNew(); }
728 bool isSealed() const override
729 { return getMdAlias()->isSealed(); }
730 bool isImplementation() const override
731 { return getMdAlias()->isImplementation(); }
732 bool isExternal() const override
733 { return getMdAlias()->isExternal(); }
734 bool isTypeAlias() const override
735 { return getMdAlias()->isTypeAlias(); }
736 bool isDefault() const override
737 { return getMdAlias()->isDefault(); }
738 bool isDelete() const override
739 { return getMdAlias()->isDelete(); }
740 bool isNoExcept() const override
741 { return getMdAlias()->isNoExcept(); }
742 bool isAttribute() const override
743 { return getMdAlias()->isAttribute(); }
744 bool isUNOProperty() const override
745 { return getMdAlias()->isUNOProperty(); }
746 bool isReadonly() const override
747 { return getMdAlias()->isReadable(); }
748 bool isBound() const override
749 { return getMdAlias()->isBound(); }
750 bool isConstrained() const override
751 { return getMdAlias()->isConstrained(); }
752 bool isTransient() const override
753 { return getMdAlias()->isTransient(); }
754 bool isMaybeVoid() const override
755 { return getMdAlias()->isMaybeVoid(); }
756 bool isMaybeDefault() const override
757 { return getMdAlias()->isMaybeDefault(); }
758 bool isMaybeAmbiguous() const override
759 { return getMdAlias()->isMaybeAmbiguous(); }
760 bool isPublished() const override
761 { return getMdAlias()->isPublished(); }
762 bool isTemplateSpecialization() const override
763 { return getMdAlias()->isTemplateSpecialization(); }
764 bool isObjCMethod() const override
765 { return getMdAlias()->isObjCMethod(); }
766 bool isObjCProperty() const override
767 { return getMdAlias()->isObjCProperty(); }
768 bool isCSharpProperty() const override
769 { return getMdAlias()->isCSharpProperty(); }
770 bool isConstructor() const override
771 { return getMdAlias()->isConstructor(); }
772 bool isDestructor() const override
773 { return getMdAlias()->isDestructor(); }
774 bool hasOneLineInitializer() const override
775 { return getMdAlias()->hasOneLineInitializer(); }
776 bool hasMultiLineInitializer() const override
777 { return getMdAlias()->hasMultiLineInitializer(); }
778 bool isCallable() const override
779 { return getMdAlias()->isCallable(); }
780 bool isStrongEnumValue() const override
781 { return getMdAlias()->isStrongEnumValue(); }
782 bool livesInsideEnum() const override
783 { return getMdAlias()->livesInsideEnum(); }
784 bool isSliceLocal() const override
785 { return getMdAlias()->isSliceLocal(); }
786 bool isNoDiscard() const override
787 { return getMdAlias()->isNoDiscard(); }
788 bool isConstExpr() const override
789 { return getMdAlias()->isConstExpr(); }
790 bool isConstEval() const override
791 { return getMdAlias()->isConstEval(); }
792 bool isConstInit() const override
793 { return getMdAlias()->isConstInit(); }
794 int numberOfFlowKeyWords() const override
795 { return getMdAlias()->numberOfFlowKeyWords(); }
796 bool isFriendToHide() const override
797 { return getMdAlias()->isFriendToHide(); }
798 bool isNotFriend() const override
799 { return getMdAlias()->isNotFriend(); }
800 bool isFunctionOrSignalSlot() const override
801 { return getMdAlias()->isFunctionOrSignalSlot(); }
802 bool isRelatedOrFriend() const override
803 { return getMdAlias()->isRelatedOrFriend(); }
804 bool isLinkableInProject() const override
805 { return getMdAlias()->isLinkableInProject(); }
806 bool isLinkable() const override
807 { return getMdAlias()->isLinkable(); }
808 bool hasDocumentation() const override
809 { return getMdAlias()->hasDocumentation(); }
810 bool hasUserDocumentation() const override
811 { return getMdAlias()->hasUserDocumentation(); }
812 bool isDeleted() const override
813 { return getMdAlias()->isDeleted(); }
814 bool isBriefSectionVisible() const override
815 { return getMdAlias()->isBriefSectionVisible(); }
816 bool isDetailedSectionVisible(MemberListContainer container) const override
817 { return getMdAlias()->isDetailedSectionVisible(container); }
818 bool hasDetailedDescription() const override
819 { return getMdAlias()->hasDetailedDescription(); }
820 bool isFriendClass() const override
821 { return getMdAlias()->isFriendClass(); }
822 bool isDocumentedFriendClass() const override
823 { return getMdAlias()->isDocumentedFriendClass(); }
824 const MemberDef *reimplements() const override
825 { return getMdAlias()->reimplements(); }
826 const MemberVector &reimplementedBy() const override
827 { return getMdAlias()->reimplementedBy(); }
828 bool isReimplementedBy(const ClassDef *cd) const override
829 { return getMdAlias()->isReimplementedBy(cd); }
830 ClassDef *relatedAlso() const override
831 { return getMdAlias()->relatedAlso(); }
832 bool hasDocumentedEnumValues() const override
833 { return getMdAlias()->hasDocumentedEnumValues(); }
834 const MemberDef *getAnonymousEnumType() const override
835 { return getMdAlias()->getAnonymousEnumType(); }
836 bool isDocsForDefinition() const override
837 { return getMdAlias()->isDocsForDefinition(); }
838 const MemberDef *getEnumScope() const override
839 { return getMdAlias()->getEnumScope(); }
840 const MemberVector &enumFieldList() const override
841 { return getMdAlias()->enumFieldList(); }
842 DString enumBaseType() const override
843 { return getMdAlias()->enumBaseType(); }
844 bool hasExamples() const override
845 { return getMdAlias()->hasExamples(); }
846 const ExampleList &getExamples() const override
847 { return getMdAlias()->getExamples(); }
848 bool isPrototype() const override
849 { return getMdAlias()->isPrototype(); }
850 const ArgumentList &argumentList() const override
851 { return getMdAlias()->argumentList(); }
852 const ArgumentList &declArgumentList() const override
853 { return getMdAlias()->declArgumentList(); }
854 const ArgumentList &templateArguments() const override
855 { return getMdAlias()->templateArguments(); }
858 std::optional<ArgumentList> formalTemplateArguments() const override
859 { return getMdAlias()->formalTemplateArguments(); }
860 int getMemberGroupId() const override
861 { return getMdAlias()->getMemberGroupId(); }
862 MemberGroup *getMemberGroup() const override
863 { return m_memberGroup; }
864 bool hasCallGraph() const override
865 { return getMdAlias()->hasCallGraph(); }
866 bool hasCallerGraph() const override
867 { return getMdAlias()->hasCallerGraph(); }
868 bool hasReferencesRelation() const override
869 { return getMdAlias()->hasReferencesRelation(); }
870 bool hasReferencedByRelation() const override
871 { return getMdAlias()->hasReferencedByRelation(); }
872 bool hasInlineSource() const override
873 { return getMdAlias()->hasInlineSource(); }
874 bool isDocTransferDone() const override
875 { return getMdAlias()->isDocTransferDone(); }
876 DString sourceRefName() const override
877 { return getMdAlias()->sourceRefName(); }
878 bool hasEnumValues() const override
879 { return getMdAlias()->hasEnumValues(); }
881 { return getMdAlias()->getQualifiers(); }
882 const MemberDef *templateMaster() const override
883 { return getMdAlias()->templateMaster(); }
884 DString getScopeString() const override
885 { return getMdAlias()->getScopeString(); }
886 const ClassDef *getClassDefOfAnonymousType() const override
888 bool isTypedefValCached() const override
889 { return getMdAlias()->isTypedefValCached(); }
890 const ClassDef *getCachedTypedefVal() const override
891 { return getMdAlias()->getCachedTypedefVal(); }
896 MemberDef *memberDefinition() const override
897 { return getMdAlias()->memberDefinition(); }
898 MemberDef *memberDeclaration() const override
899 { return getMdAlias()->memberDeclaration(); }
900 const MemberDef *inheritsDocsFrom() const override
901 { return getMdAlias()->inheritsDocsFrom(); }
902 const MemberDef *getGroupAlias() const override
903 { return getMdAlias()->getGroupAlias(); }
904 ClassDef *category() const override
905 { return getMdAlias()->category(); }
906 const MemberDef *categoryRelation() const override
907 { return getMdAlias()->categoryRelation(); }
908 DString displayName(bool b=true) const override
909 { return getMdAlias()->displayName(b); }
910 DString getDeclType() const override
911 { return getMdAlias()->getDeclType(); }
912 StringVector getLabels(const Definition *container) const override
913 { return getMdAlias()->getLabels(container); }
914 const ArgumentList &typeConstraints() const override
915 { return getMdAlias()->typeConstraints(); }
916 DString documentation() const override
917 { return getMdAlias()->documentation(); }
918 DString briefDescription(bool /* abbr=false */) const override
919 { return getMdAlias()->briefDescription(); }
920 DString fieldType() const override
921 { return getMdAlias()->fieldType(); }
922 bool isReference() const override
923 { return getMdAlias()->isReference(); }
924 DString getDeclFileName() const override
925 { return getMdAlias()->getDeclFileName(); }
926 int getDeclLine() const override
927 { return getMdAlias()->getDeclLine(); }
928 int getDeclColumn() const override
929 { return getMdAlias()->getDeclColumn(); }
930 DString requiresClause() const override
931 { return getMdAlias()->requiresClause(); }
932 bool visibleInIndex() const override
933 { return getMdAlias()->visibleInIndex(); }
934 int redefineCount() const override
935 { return getMdAlias()->redefineCount(); }
936
937 void warnIfUndocumented() const override {}
938 void warnIfUndocumentedParams() const override {}
939 void detectUndocumentedParams(bool /* hasParamCommand */,bool /* hasReturnCommand */) const override {}
940 void setMemberGroup(MemberGroup *grp) override { m_memberGroup = grp; }
941 std::unique_ptr<MemberDef> createTemplateInstanceMember(const ArgumentList &formalArgs,
942 const std::unique_ptr<ArgumentList> &actualArgs) const override
943 { return getMdAlias()->createTemplateInstanceMember(formalArgs,actualArgs); }
944
946 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
947 bool inGroup, int indentLevel, const ClassDef *inheritFrom=nullptr,const DString &inheritId=DString()) const override
948 {
949 getMdAlias()->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritFrom,inheritId);
950 }
952 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const override
953 {
954 getMdAlias()->writeEnumDeclaration(typeDecl,cd,nd,fd,gd,mod);
955 }
957 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
958 bool onlyText=false) const override
959 {
960 getMdAlias()->writeLink(ol,cd,nd,fd,gd,mod,onlyText);
961 }
962 private:
963 MemberGroup *m_memberGroup; // group's member definition
964};
965
966
967std::unique_ptr<MemberDef> createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd)
968{
969 auto amd = std::make_unique<MemberDefAliasImpl>(newScope,aliasMd);
970 //printf("amd: name=%s displayName=%s\n",qPrint(amd->name()),qPrint(amd->displayName()));
971 return amd;
972}
973
974//-----------------------------------------------------------------------------
975
976static DString addTemplateNames(const DString &s,const DString &n,const DString &t)
977{
978 DString result;
979 DString clRealName=n;
980 size_t p=0,i=0;
981 if ((i=clRealName.find('<'))!=DString::npos)
982 {
983 clRealName=clRealName.left(i); // strip template specialization
984 }
985 if ((i=clRealName.rfind("::"))!=DString::npos)
986 {
987 clRealName=clRealName.mid(i+2);
988 }
989 while ((i=s.find(clRealName,p))!=DString::npos)
990 {
991 result+=s.mid(p,i-p);
992 size_t j=clRealName.length()+i;
993 if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j))))
994 { // add template names
995 //printf("Adding %s+%s\n",qPrint(clRealName),qPrint(t));
996 result+=clRealName+t;
997 }
998 else
999 { // template names already present
1000 //printf("Adding %s\n",qPrint(clRealName));
1001 result+=clRealName;
1002 }
1003 p=i+clRealName.length();
1004 }
1005 result+=s.mid(p);
1006 //printf("addTemplateNames(%s,%s,%s)=%s\n",qPrint(s),qPrint(n),qPrint(t),qPrint(result));
1007 return result;
1008}
1009
1010// ol.startMemberDocName has already been done before this is called.
1011// when this function returns true, ol.endParameterList will be called.
1012//
1013// typical sequence:
1014// ol.startMemberDoc
1015// ol.startMemberDocName
1016// --- enter writeDefArgumentList
1017// ol.endMemberDocName
1018// ol.startParameterList
1019// ...
1020// ol.startParameterType(first=true)
1021// ol.endParameterType
1022// ol.startParameterName
1023// ol.endParameterName
1024// ol.startParameterExtra
1025// ol.startParameterDefVal [optional]
1026// ol.endParameterDefVal [optional]
1027// ol.endParameterExtra(last==false)
1028// ...
1029// ol.startParameterType(first=false)
1030// ol.endParameterType
1031// ol.startParameterName
1032// ol.endParameterName
1033// ol.startParameterExtra
1034// ol.endParameterExtra(last==true)
1035// ...
1036// --- leave writeDefArgumentList with return value true
1037// ol.endParameterList
1038// ol.endMemberDoc(hasArgs=true)
1039//
1040// For an empty list the function should return false, the sequence is
1041// ol.startMemberDoc
1042// ol.startMemberDocName
1043// --- enter writeDefArgumentList
1044// --- leave writeDefArgumentList with return value false
1045// ol.endMemberDocName
1046// ol.endMemberDoc(hasArgs=false);
1047//
1048
1049static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const MemberDef *md)
1050{
1051 const ArgumentList &defArgList=(md->isDocsForDefinition()) ?
1052 md->argumentList() : md->declArgumentList();
1053 //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d hasParameters()=%d (%s)\n",
1054 // qPrint(md->name()),md->isDocsForDefinition(),defArgList.hasParameters(),qPrint(argListToString(defArgList)));
1055 if (!defArgList.hasParameters() || md->isProperty() || md->isTypedef())
1056 {
1057 return false; // member has no function like argument list
1058 }
1059
1060 bool isDefine = md->isDefine();
1061 if (!isDefine) ol.docify(" ");
1062
1063 //printf("writeDefArgList(%d)\n",defArgList->count());
1064 ol.endMemberDocName();
1066 //printf("===> name=%s isDefine=%d\n",qPrint(md->name()),md->isDefine());
1067
1068 DString cName;
1069 if (scope)
1070 {
1071 cName=scope->name();
1072 size_t il=cName.find('<');
1073 size_t ir=cName.rfind('>');
1074 if (il!=DString::npos && ir!=DString::npos && ir>il)
1075 {
1076 cName=cName.mid(il,ir-il+1);
1077 //printf("1. cName=%s\n",qPrint(cName));
1078 }
1079 else if (scope->definitionType()==Definition::TypeClass)
1080 {
1081 cName=tempArgListToString((toClassDef(scope))->templateArguments(),
1082 scope->getLanguage());
1083 //printf("2. cName=%s\n",qPrint(cName));
1084 }
1085 else // no template specifier
1086 {
1087 cName.clear();
1088 }
1089 }
1090 //printf("~~~ %s cName=%s\n",qPrint(md->name()),qPrint(cName));
1091
1093
1094 LinkifyTextOptions options;
1095 options.setScope(scope).setFileScope(md->getBodyDef()).setSelf(md);
1096
1097 bool first=true;
1098 bool paramTypeStarted=false;
1099 auto alIt = defArgList.begin();
1100 while (alIt!=defArgList.end())
1101 {
1102 Argument a = *alIt;
1103 if (isDefine || first)
1104 {
1105 ol.startParameterType(first,DString());
1106 paramTypeStarted=true;
1107 if (isDefine)
1108 {
1109 ol.endParameterType();
1110 ol.startParameterName(true);
1111 }
1112 }
1113
1114 if (!a.attrib.empty() && !md->isObjCMethod()) // argument has an IDL attribute
1115 {
1116 ol.docify(a.attrib+" ");
1117 }
1118
1119 DString atype = a.type;
1120 if (sep!="::") { atype=substitute(atype,"::",sep); }
1121
1122 size_t funcPtrPos=DString::npos;
1123 {
1124 if (md->isObjCMethod()) { atype.prepend("("); atype.append(")"); }
1125 if (atype!="...")
1126 {
1127 if (!cName.empty() && scope && scope!=Doxygen::globalScope)
1128 {
1129 atype=addTemplateNames(atype,scope->name(),cName);
1130 }
1131 // 1. split ...*)(... -> '*' + name + ')(...'
1132 // 2. split ...*[some thing])(... -> '*' + name + '[some thing])(...'
1133 size_t starPos = atype.find('*'); // find pointer
1134 if (starPos==DString::npos) starPos = atype.find('&'); // can also be reference
1135 funcPtrPos = atype.find(")(");
1136 if (starPos!=DString::npos && funcPtrPos!=DString::npos && funcPtrPos>starPos)
1137 {
1138 funcPtrPos=starPos+1;
1139 }
1140 else
1141 {
1142 funcPtrPos=DString::npos;
1143 }
1145 funcPtrPos==DString::npos ? atype : atype.left(funcPtrPos),
1146 options);
1147 }
1148 }
1149
1150 if (!isDefine)
1151 {
1152 if (paramTypeStarted)
1153 {
1154 ol.endParameterType();
1155 paramTypeStarted=false;
1156 }
1157 ol.startParameterName(defArgList.size()<2);
1158 }
1159 else
1160 {
1161 ol.endParameterName();
1162 }
1163
1164 if (atype=="...")
1165 {
1166 ol.docify(atype);
1167 }
1168 else if (!a.name.empty()) // argument has a name
1169 {
1170 ol.docify(a.name);
1171 }
1172 if (!isDefine)
1173 {
1174 if (funcPtrPos!=DString::npos)
1175 {
1177 }
1178 ol.endParameterName();
1179 }
1181 if (funcPtrPos!=DString::npos)
1182 {
1183 linkifyText(TextGeneratorOLImpl(ol),atype.mid(funcPtrPos),options);
1184 }
1185 if (!a.array.empty())
1186 {
1187 ol.docify(a.array);
1188 }
1189 if (!a.defval.empty()) // write the default value
1190 {
1191 DString n=a.defval;
1192 if (scope && scope!=Doxygen::globalScope && !cName.empty())
1193 {
1194 n=addTemplateNames(n,scope->name(),cName);
1195 }
1196 ol.startParameterDefVal(" = ");
1197 linkifyText(TextGeneratorOLImpl(ol),n,LinkifyTextOptions(options).setKeepSpaces(true));
1198 ol.endParameterDefVal();
1199 }
1200 ++alIt;
1201 if (alIt!=defArgList.end())
1202 {
1203 a = *alIt;
1204 if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
1205 if (!isDefine)
1206 {
1207 DString key;
1208 if (md->isObjCMethod() && a.attrib.length()>=2)
1209 {
1210 //printf("Found parameter keyword %s\n",a.qPrint(attrib));
1211 // strip [ and ]
1212 key=a.attrib.mid(1,a.attrib.length()-2);
1213 if (key!=",") key+=":"; // for normal keywords add colon
1214 }
1215 ol.endParameterExtra(false,false,!md->isObjCMethod());
1216 ol.startParameterType(false,key);
1217 paramTypeStarted=true;
1218 }
1219 else // isDefine
1220 {
1221 ol.endParameterExtra(false,false,true);
1222 }
1223 }
1224 first=false;
1225 }
1226 if (first)
1227 {
1228 ol.startParameterName(defArgList.size()<2);
1229 ol.endParameterName();
1231 }
1232 ol.endParameterExtra(true,defArgList.size()<2,!md->isObjCMethod());
1233 if (!md->extraTypeChars().empty())
1234 {
1235 ol.docify(md->extraTypeChars());
1236 }
1237 if (defArgList.constSpecifier())
1238 {
1239 ol.docify(" const");
1240 }
1241 if (defArgList.volatileSpecifier())
1242 {
1243 ol.docify(" volatile");
1244 }
1245 if (defArgList.refQualifier()==RefQualifierType::LValue)
1246 {
1247 ol.docify(" &");
1248 }
1249 else if (defArgList.refQualifier()==RefQualifierType::RValue)
1250 {
1251 ol.docify(" &&");
1252 }
1253 if (!defArgList.trailingReturnType().empty())
1254 {
1255 linkifyText(TextGeneratorOLImpl(ol), defArgList.trailingReturnType(), options);
1256 }
1257 return true;
1258}
1259
1261 OutputList &ol, const ClassDef *cd, const MemberDef *md, DString const& exception)
1262{
1263 // this is ordinary exception spec - there must be a '('
1264 //printf("exception='%s'\n",qPrint(exception));
1265 size_t index = exception.find('(');
1266 LinkifyTextOptions options;
1267 options.setScope(cd).setFileScope(md->getBodyDef()).setSelf(md);
1268 if (index!=DString::npos)
1269 {
1270 ol.exceptionEntry(exception.left(index),false);
1271 ++index; // paren in second column so skip it here
1272 for (size_t comma = exception.find(',', index); comma!=DString::npos; )
1273 {
1274 ++comma; // include comma
1275 linkifyText(TextGeneratorOLImpl(ol),exception.mid(index,comma-index),options);
1276 ol.exceptionEntry(DString(),false);
1277 index=comma;
1278 comma = exception.find(',', index);
1279 }
1280 if (size_t close = exception.find(')', index); close!=DString::npos)
1281 {
1282 DString type=removeRedundantWhiteSpace(exception.mid(index,close-index));
1283 linkifyText(TextGeneratorOLImpl(ol),type,options);
1284 ol.exceptionEntry(DString(),true);
1285 }
1286 else
1287 {
1288 warn(md->getDefFileName(),md->getDefLine(),
1289 "missing ) in exception list on member {}",md->name());
1290 }
1291 }
1292 else // Java Exception
1293 {
1294 ol.docify(" ");
1295 linkifyText(TextGeneratorOLImpl(ol),exception,options);
1296 }
1297}
1298
1299static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberDef *md)
1300{
1301 DString exception = md->excpString().stripWhiteSpace();
1302 if (exception.at(0)=='{')
1303 {
1304 // this is an UNO IDL attribute - need special handling
1305 size_t index = exception.find(';');
1306 size_t oldIndex = 1;
1307 while (index!=DString::npos) // there should be no more than 2 (set / get)
1308 {
1309 // omit '{' and ';' -> "set raises (...)"
1310 writeExceptionListImpl(ol,cd,md,exception.mid(oldIndex,index-oldIndex));
1311 oldIndex = index+1;
1312 index = exception.find(';',oldIndex);
1313 }
1314 // the rest is now just '}' - omit that
1315 }
1316 else
1317 {
1318 writeExceptionListImpl(ol,cd,md,exception);
1319 }
1320}
1321
1322//-----------------------------------------------------------------------------
1323//-----------------------------------------------------------------------------
1324//-----------------------------------------------------------------------------
1325
1327 const DString &t,const DString &a,const DString &e,
1328 Protection p,Specifier v,bool s,Relationship r,
1329 MemberType mt,const ArgumentList &tal,
1330 const ArgumentList &al,const DString &meta
1331 )
1332{
1333 m_classDef=nullptr;
1334 m_fileDef=nullptr;
1335 m_moduleDef=nullptr;
1336 m_redefines=nullptr;
1337 m_relatedAlso=nullptr;
1338 m_nspace=nullptr;
1339 m_memDef=nullptr;
1340 m_memDec=nullptr;
1341 m_group=nullptr;
1342 m_grpId=-1;
1343 m_enumScope=nullptr;
1344 m_livesInsideEnum=false;
1345 m_hasCallGraph = Config_getBool(CALL_GRAPH);
1346 m_hasCallerGraph = Config_getBool(CALLER_GRAPH);
1347 m_hasReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION);
1348 m_hasReferencesRelation = Config_getBool(REFERENCES_RELATION);
1349 m_hasEnumValues = Config_getBool(SHOW_ENUM_VALUES);
1350 m_hasInlineSource = Config_getBool(INLINE_SOURCES);
1351 m_initLines=0;
1352 m_type=t;
1353 if (mt==MemberType::Typedef) m_type.stripPrefix("typedef ");
1354 // type.stripPrefix("struct ");
1355 // type.stripPrefix("class " );
1356 // type.stripPrefix("union " );
1358 m_args=a;
1360 if (m_type.empty()) m_decl=d->name()+m_args; else m_decl=m_type+" "+d->name()+m_args;
1361
1362 m_memberGroup=nullptr;
1363 m_virt=v;
1364 m_prot=p;
1365 m_related=r;
1366 m_stat=s;
1367 m_mtype=mt;
1368 m_exception=e;
1369 m_proto=false;
1372 m_annEnumType=nullptr;
1373 m_groupAlias=nullptr;
1374 m_explExt=false;
1375 m_tspec=false;
1376 m_anonymousType=nullptr;
1377 m_maxInitLines=Config_getInt(MAX_INITIALIZER_LINES);
1378 m_userInitLines=-1;
1379 m_docEnumValues=false;
1380 // copy function template arguments (if any)
1381 m_tArgList = tal;
1382 //printf("new member al=%p\n",al);
1383 // copy function definition arguments (if any)
1384 m_defArgList = al;
1385 // convert function declaration arguments (if any)
1386 if (!m_args.empty())
1387 {
1389 //printf("setDeclArgList %s to %s const=%d\n",qPrint(args),
1390 // qPrint(argListToString(declArgList)),declArgList->constSpecifier);
1391 }
1392 m_metaData = meta;
1393 m_templateMaster = nullptr;
1394 m_docsForDefinition = true;
1395 m_isTypedefValCached = false;
1396 m_cachedTypedefValue = nullptr;
1397 m_implOnly=false;
1398 m_groupMember = nullptr;
1399 m_hasDocumentedParams = false;
1401 m_docProvider = nullptr;
1403}
1404
1405
1406//-----------------------------------------------------------------------------
1407//-----------------------------------------------------------------------------
1408//-----------------------------------------------------------------------------
1409
1410/*! Creates a new member definition.
1411 *
1412 * \param df File containing the definition of this member.
1413 * \param dl Line at which the member definition was found.
1414 * \param dc Column at which the member definition was found.
1415 * \param t A string representing the type of the member.
1416 * \param na A string representing the name of the member.
1417 * \param a A string representing the arguments of the member.
1418 * \param e A string representing the throw clause of the members.
1419 * \param p The protection context of the member, possible values are:
1420 * \c Public, \c Protected, \c Private.
1421 * \param v The degree of 'virtualness' of the member, possible values are:
1422 * \c Normal, \c Virtual, \c Pure.
1423 * \param s A boolean that is true iff the member is static.
1424 * \param r The relationship between the class and the member.
1425 * \param mt The kind of member. See #MemberType for a list of
1426 * all types.
1427 * \param tal The template arguments of this member.
1428 * \param al The arguments of this member. This is a structured form of
1429 * the string past as argument \a a.
1430 * \param meta Slice metadata.
1431 */
1432
1434 const DString &t,const DString &na,const DString &a,const DString &e,
1436 const ArgumentList &tal,const ArgumentList &al,const DString &meta
1438{
1439 //printf("MemberDefImpl::MemberDef(%s)\n",qPrint(na));
1440 init(this,t,a,e,p,v,s,r,mt,tal,al,meta);
1444}
1445
1446std::unique_ptr<MemberDef> MemberDefImpl::deepCopy() const
1447{
1448 std::unique_ptr<MemberDefImpl> result(new MemberDefImpl(
1451 // first copy base members
1452 result->DefinitionMixin<MemberDefMutable>::operator=(*this);
1453 // then copy other members
1454 result->m_typeConstraints = m_typeConstraints ;
1455 result->m_declArgList = m_declArgList ;
1456 result->m_classDef = m_classDef ;
1457 result->m_fileDef = m_fileDef ;
1458 result->m_moduleDef = m_moduleDef ;
1459 result->m_nspace = m_nspace ;
1460 result->m_enumScope = m_enumScope ;
1461 result->m_livesInsideEnum = m_livesInsideEnum ;
1462 result->m_annEnumType = m_annEnumType ;
1463 result->m_enumFields = m_enumFields ;
1464 result->m_redefines = m_redefines ;
1465 result->m_redefinedBy = m_redefinedBy ;
1466 result->m_memDef = m_memDef ;
1467 result->m_memDec = m_memDec ;
1468 result->m_relatedAlso = m_relatedAlso ;
1469 result->m_examples = m_examples ;
1470 result->m_def = m_def ;
1471 result->m_anc = m_anc ;
1472 result->m_decl = m_decl ;
1473 result->m_bitfields = m_bitfields ;
1474 result->m_read = m_read ;
1475 result->m_write = m_write ;
1476 result->m_exception = m_exception ;
1477 result->m_initializer = m_initializer ;
1478 result->m_extraTypeChars = m_extraTypeChars ;
1479 result->m_enumBaseType = m_enumBaseType ;
1480 result->m_requiresClause = m_requiresClause ;
1481 result->m_initLines = m_initLines ;
1482 result->m_memSpec = m_memSpec ;
1483 result->m_vhdlSpec = m_vhdlSpec ;
1484 result->m_maxInitLines = m_maxInitLines ;
1485 result->m_userInitLines = m_userInitLines ;
1486 result->m_defArgList = m_defArgList ;
1487 result->m_declArgList = m_declArgList ;
1488 result->m_tArgList = m_tArgList ;
1489 result->m_typeConstraints = m_typeConstraints ;
1490 result->m_templateMaster = m_templateMaster ;
1491 result->m_formalTemplateArguments = m_formalTemplateArguments ;
1492 result->m_defTmpArgLists = m_defTmpArgLists ;
1493 result->m_anonymousType = m_anonymousType ;
1494 result->m_sectionMap = m_sectionMap ;
1495 result->m_groupAlias = m_groupAlias ;
1496 result->m_grpId = m_grpId ;
1497 result->m_memberGroup = m_memberGroup ;
1498 result->m_group = m_group ;
1499 result->m_grouppri = m_grouppri ;
1500 result->m_groupFileName = m_groupFileName ;
1501 result->m_groupStartLine = m_groupStartLine ;
1502 result->m_groupMember = m_groupMember ;
1503 result->m_isTypedefValCached = m_isTypedefValCached ;
1504 result->m_cachedTypedefValue = m_cachedTypedefValue ;
1505 result->m_cachedTypedefTemplSpec = m_cachedTypedefTemplSpec ;
1506 result->m_cachedResolvedType = m_cachedResolvedType ;
1507 result->m_docProvider = m_docProvider ;
1508 result->m_explicitOutputFileBase = m_explicitOutputFileBase ;
1509 result->m_qualifiers = m_qualifiers ;
1510 result->m_implOnly = m_implOnly ;
1511 result->m_hasDocumentedParams = m_hasDocumentedParams ;
1512 result->m_hasDocumentedReturnType = m_hasDocumentedReturnType ;
1513 result->m_isDMember = m_isDMember ;
1514 result->m_proto = m_proto ;
1515 result->m_docEnumValues = m_docEnumValues ;
1516 result->m_hasDetailedDescriptionCached = m_hasDetailedDescriptionCached ;
1517 result->m_detailedDescriptionCachedValue = m_detailedDescriptionCachedValue ;
1518 result->m_hasCallGraph = m_hasCallGraph ;
1519 result->m_hasCallerGraph = m_hasCallerGraph ;
1520 result->m_hasReferencedByRelation = m_hasReferencedByRelation ;
1521 result->m_hasReferencesRelation = m_hasReferencesRelation ;
1522 result->m_hasEnumValues = m_hasEnumValues ;
1523 result->m_hasInlineSource = m_hasInlineSource ;
1524 result->m_explExt = m_explExt ;
1525 result->m_tspec = m_tspec ;
1526 result->m_groupHasDocs = m_groupHasDocs ;
1527 result->m_docsForDefinition = m_docsForDefinition ;
1528 result->m_category = m_category ;
1529 result->m_categoryRelation = m_categoryRelation ;
1530 result->m_declFileName = m_declFileName ;
1531 result->m_declLine = m_declLine ;
1532 result->m_declColumn = m_declColumn ;
1533 result->m_numberOfFlowKW = m_numberOfFlowKW ;
1534 result->setDefinitionTemplateParameterLists(m_defTmpArgLists);
1535
1536 result->m_isLinkableCached = 0;
1537 result->m_isConstructorCached = 0;
1538 result->m_isDestructorCached = 0;
1539 return result;
1540}
1541
1543{
1544 setOuterScope(scope);
1546 {
1547 m_classDef = toClassDef(scope);
1548 }
1549 else if (scope->definitionType()==Definition::TypeFile)
1550 {
1551 m_fileDef = toFileDef(scope);
1552 }
1553 else if (scope->definitionType()==Definition::TypeModule)
1554 {
1555 m_moduleDef = toModuleDef(scope);
1556 }
1557 else if (scope->definitionType()==Definition::TypeNamespace)
1558 {
1559 m_nspace = toNamespaceDef(scope);
1560 }
1563}
1564
1565
1570
1572{
1573 if (m_templateMaster)
1574 {
1576 if (mdm)
1577 {
1578 mdm->insertReimplementedBy(md);
1579 }
1580 }
1581 if (!m_redefinedBy.contains(md))
1582 {
1584 }
1585}
1586
1588{
1589 return m_redefines;
1590}
1591
1593{
1594 return m_redefinedBy;
1595}
1596
1598{
1599 if (cd)
1600 {
1601 for (const auto &md : m_redefinedBy)
1602 {
1603 const ClassDef *mcd = md->getClassDef();
1604 if (mcd)
1605 {
1606 if (cd==mcd || cd->isBaseClass(mcd,true))
1607 {
1608 return true;
1609 }
1610 }
1611 }
1612 }
1613 return false;
1614}
1615
1620
1621bool MemberDefImpl::addExample(const DString &anchor,const DString &nameStr, const DString &file)
1622{
1623 //printf("%s::addExample(%s,%s,%s)\n",qPrint(name()),anchor,nameStr,file);
1624 return m_examples.inSort(Example(anchor,nameStr,file));
1625}
1626
1628{
1629 return !m_examples.empty();
1630}
1631
1633{
1634 DString n = name();
1635 DString s = getScopeString();
1636
1637 if (!s.empty())
1638 {
1639 n.prepend(s+"::");
1640 }
1641 else if (isStatic() && getFileDef())
1642 {
1643 n.prepend(getFileDef()->name()+":");
1644 }
1645 if (isCallable())
1646 {
1647 n.append(argsString());
1648 }
1649 return n;
1650}
1651
1653{
1654 bool separateMemberPages = Config_getBool(SEPARATE_MEMBER_PAGES);
1655 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
1656 DString baseName;
1657
1658 //printf("Member: %s: templateMaster=%p group=%p classDef=%p nspace=%p fileDef=%p\n",
1659 // qPrint(name()),m_templateMaster,m_group,m_classDef,
1660 // m_nspace,m_fileDef);
1661 const NamespaceDef *nspace = getNamespaceDef();
1662 const FileDef *fileDef = getFileDef();
1663 const ClassDef *classDef = getClassDef();
1664 const ModuleDef *moduleDef = getModuleDef();
1665 const GroupDef *groupDef = getGroupDef();
1667 {
1669 }
1670 else if (templateMaster())
1671 {
1673 }
1674 else if (groupDef)
1675 {
1676 baseName=groupDef->getOutputFileBase();
1677 }
1678 else if (classDef)
1679 {
1680 baseName=classDef->getOutputFileBase();
1681 if (inlineSimpleClasses && classDef->isSimple())
1682 {
1683 return baseName;
1684 }
1685 }
1686 else if (nspace && (nspace->isLinkable() || nspace->isAnonymous()))
1687 {
1688 baseName=nspace->getOutputFileBase();
1689 }
1690 else if (fileDef)
1691 {
1692 baseName=fileDef->getOutputFileBase();
1693 }
1694 else if (moduleDef)
1695 {
1696 baseName=moduleDef->getOutputFileBase();
1697 }
1698
1699 if (baseName.empty())
1700 {
1702 "Internal inconsistency: member {} does not belong to any container!",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.empty())
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 DString result=m_anc;
1762 if (m_groupAlias) return m_groupAlias->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().empty())
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 ClassDef *classDef = getClassDef();
1815 if (groupDef && !groupDef->isLinkableInProject())
1816 {
1817 AUTO_TRACE_ADD("in not linkable group");
1818 m_isLinkableCached = 1; // group but group not linkable
1819 return;
1820 }
1821 if (!groupDef && classDef && !classDef->isLinkableInProject())
1822 {
1823 AUTO_TRACE_ADD("in not linkable class");
1824 m_isLinkableCached = 1; // in class but class not linkable
1825 return;
1826 }
1827 const NamespaceDef *nspace = getNamespaceDef();
1828 const FileDef *fileDef = getFileDef();
1829 if (!groupDef && nspace /*&& m_related==Relationship::Member*/ && !nspace->isLinkableInProject()
1830 && (fileDef==nullptr || !fileDef->isLinkableInProject()))
1831 {
1832 AUTO_TRACE_ADD("in not linkable namespace");
1833 m_isLinkableCached = 1; // in namespace but namespace not linkable
1834 return;
1835 }
1836 if (!groupDef && !nspace &&
1837 /*m_related==Relationship::Member &&*/ !classDef &&
1838 fileDef && !fileDef->isLinkableInProject())
1839 {
1840 AUTO_TRACE_ADD("in not linkable file");
1841 m_isLinkableCached = 1; // in file (and not in namespace) but file not linkable
1842 return;
1843 }
1844 if ((!protectionLevelVisible(m_prot) && m_mtype!=MemberType::Friend) &&
1845 !(m_prot==Protection::Private && (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual))
1846 {
1847 AUTO_TRACE_ADD("private and invisible");
1848 m_isLinkableCached = 1; // hidden due to protection
1849 return;
1850 }
1851 if (m_stat && classDef==nullptr && !extractStatic)
1852 {
1853 AUTO_TRACE_ADD("static and invisible");
1854 m_isLinkableCached = 1; // hidden due to staticness
1855 return;
1856 }
1857 AUTO_TRACE_ADD("linkable");
1858 return; // linkable!
1859}
1860
1866
1872
1877
1882
1888
1894
1896{
1897 if (m_isLinkableCached==0)
1898 {
1899 MemberDefImpl *that = const_cast<MemberDefImpl*>(this);
1901 }
1903 return m_isLinkableCached==2;
1904}
1905
1907{
1908 if (m_templateMaster)
1909 {
1910 return m_templateMaster->isLinkable();
1911 }
1912 else
1913 {
1914 return isLinkableInProject() || isReference();
1915 }
1916}
1917
1918
1923
1925 const ClassDef *,const NamespaceDef *,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
1926 bool onlyText) const
1927{
1928 SrcLangExt lang = getLanguage();
1929 bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
1930 DString sep = getLanguageSpecificSeparator(lang,true);
1931 DString n = name();
1932 const ClassDef *classDef = getClassDef();
1933 const NamespaceDef *nspace = getNamespaceDef();
1934 if (!hideScopeNames)
1935 {
1936 if (m_enumScope && m_livesInsideEnum && getGroupDef()!=nullptr)
1937 {
1939 }
1940 if (classDef && (gd || mod) && !isRelated())
1941 {
1942 n.prepend(classDef->displayName()+sep);
1943 }
1944 else if (nspace && (gd || fd || mod))
1945 {
1946 n.prepend(nspace->displayName()+sep);
1947 }
1948 }
1949
1950 if (isObjCMethod())
1951 {
1952 if (isStatic()) ol.docify("+ "); else ol.docify("- ");
1953 }
1954 if (!onlyText && (isLinkable() || hasDetailedDescription())) // write link
1955 {
1956 if (m_mtype==MemberType::EnumValue && getGroupDef()==nullptr && // enum value is not grouped
1957 getEnumScope() && getEnumScope()->getGroupDef()) // but its container is
1958 {
1959 const GroupDef *enumValGroup = getEnumScope()->getGroupDef();
1960 ol.writeObjectLink(enumValGroup->getReference(),
1961 enumValGroup->getOutputFileBase(),
1962 anchor(),n);
1963 }
1964 else
1965 {
1967 }
1968 }
1969 else // write only text
1970 {
1971 ol.startBold();
1972 ol.docify(n);
1973 ol.endBold();
1974 }
1975}
1976
1978
1983
1984/*! If this member has an anonymous class/struct/union as its type, then
1985 * this method will return the ClassDef that describes this return type.
1986 */
1991
1992/*! This methods returns true iff the brief section (also known as
1993 * declaration section) is visible in the documentation.
1994 */
1996{
1997 bool extractStatic = Config_getBool(EXTRACT_STATIC);
1998 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
1999 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2000 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
2001 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2002 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
2003
2004 //printf("Member %s grpId=%d docs=%s file=%s args=%s\n",
2005 // qPrint(name()),
2006 // 0,"", //grpId,grpId==-1?"<none>":Doxygen::memberDocDict[grpId]->data(),
2007 // "", //qPrint(getFileDef()->name()),
2008 // argsString());
2009
2010 bool hasDocs = hasDocumentation();
2011
2012 // only include static members with file/namespace scope if
2013 // explicitly enabled in the config file
2014 bool visibleIfStatic = !(getClassDef()==nullptr &&
2015 isStatic() &&
2016 !extractStatic
2017 );
2018
2019 // only include members is the are documented or
2020 // HIDE_UNDOC_MEMBERS is NO in the config file
2021 bool visibleIfDocumented = (!hideUndocMembers ||
2022 hasDocs ||
2024 );
2025
2026 // hide members with no detailed description and brief descriptions
2027 // explicitly disabled.
2028 bool visibleIfEnabled = !(hideUndocMembers &&
2029 documentation().empty() &&
2030 !briefMemberDesc &&
2031 !repeatBrief
2032 );
2033
2034 // Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true
2035 bool visibleIfFriendCompound = !(hideFriendCompounds &&
2036 isFriend() /*&&
2037 (m_type=="friend class" ||
2038 m_type=="friend struct" ||
2039 m_type=="friend union"
2040 )*/
2041 );
2042
2043 // only include members that are non-private unless EXTRACT_PRIVATE is
2044 // set to YES or the member is part of a group. And as a special case,
2045 // private *documented* virtual members are shown if EXTRACT_PRIV_VIRTUAL
2046 // is set to YES
2047 bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
2048 m_mtype==MemberType::Friend ||
2049 (m_prot==Protection::Private &&
2050 (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual && hasDocs)
2051 );
2052
2053 // hide member if it overrides a member in a superclass and has no
2054 // documentation of its own
2055 //bool visibleIfDocVirtual = !reimplements() ||
2056 // !Config_getBool(INHERIT_DOCS) ||
2057 // hasDocs;
2058
2059 // true if this member is a constructor or destructor
2060 bool cOrDTor = isConstructor() || isDestructor();
2061
2062 // hide default constructors or destructors (no args) without
2063 // documentation
2064 bool visibleIfNotDefaultCDTor = !(cOrDTor &&
2065 (m_defArgList.empty() ||
2066 m_defArgList.front().type == "void"
2067 ) &&
2068 !hasDocs
2069 );
2070
2071
2072 //printf("visibleIfStatic=%d visibleIfDocumented=%d visibleIfEnabled=%d "
2073 // "visibleIfPrivate=%d visibleIfNotDefaultCDTor=%d "
2074 // "visibleIfFriendCompound=%d\n",
2075 // visibleIfStatic,visibleIfDocumented,
2076 // visibleIfEnabled,visibleIfPrivate,visibleIfNotDefaultCDTor,
2077 // visibleIfFriendCompound);
2078
2079 bool visible = visibleIfStatic && visibleIfDocumented &&
2080 visibleIfEnabled && visibleIfPrivate &&
2081 /*visibleIfDocVirtual &&*/ visibleIfNotDefaultCDTor &&
2082 visibleIfFriendCompound &&
2083 !isHidden();
2084 //printf("MemberDefImpl::isBriefSectionVisible() %d\n",visible);
2085 return visible;
2086}
2087
2089{
2090 SrcLangExt lang = getLanguage();
2091 DString ltype(m_type);
2092 if (lang==SrcLangExt::Cpp && isEnumerate() && isStrong())
2093 {
2094 if (isEnumStruct())
2095 {
2096 ltype+=" struct";
2097 }
2098 else
2099 {
2100 ltype+=" class";
2101 }
2102 }
2103 if (isTypedef() && getLanguage() != SrcLangExt::Slice)
2104 {
2105 ltype.prepend("typedef ");
2106 }
2107 if (isTypeAlias())
2108 {
2109 if (lang==SrcLangExt::Python)
2110 {
2111 ltype="type";
2112 }
2113 else
2114 {
2115 ltype="using";
2116 }
2117 }
2118 // strip 'friend' keyword from ltype
2119 ltype.stripPrefix("friend ");
2120 if (ltype=="@") // rename type from enum values
2121 {
2122 ltype="";
2123 }
2124 else
2125 {
2126 if (isObjCMethod())
2127 {
2128 ltype.prepend("(");
2129 ltype.append(")");
2130 }
2131 }
2132 return ltype;
2133}
2134
2136 const ArgumentList &al, bool writeReqClause) const
2137{
2138 ol.docify("template<");
2139 LinkifyTextOptions options;
2140 options.setScope(def).setFileScope(getFileDef()).setSelf(this);
2141 for (auto it = al.begin(); it!=al.end();)
2142 {
2143 Argument a = *it;
2144 linkifyText(TextGeneratorOLImpl(ol),a.type,options);
2145 if (!a.name.empty())
2146 {
2147 ol.docify(" ");
2148 ol.docify(a.name);
2149 }
2150 if (!a.defval.empty())
2151 {
2152 ol.docify(" = ");
2153 ol.docify(a.defval);
2154 }
2155 ++it;
2156 if (it!=al.end()) ol.docify(", ");
2157 }
2158 ol.docify("> ");
2159 if (writeReqClause && !m_requiresClause.empty())
2160 {
2161 ol.lineBreak();
2162 ol.docify("requires ");
2164 m_requiresClause, // text
2165 LinkifyTextOptions(options).setAutoBreak(true).setBreakThreshold(120));
2166 }
2167}
2168
2170{
2171 if (exception.empty()) return args; // no exception, nothing to combine args
2172 size_t pos = args.rfind(')');
2173 size_t eqPos = pos!=DString::npos ? args.find('=',pos) : DString::npos; // look for '=' in '(args) = something'
2174 if (eqPos==DString::npos) return args+" "+exception; // append exception at the end
2175 return args.left(eqPos)+" "+exception+" "+args.mid(eqPos); // insert exception before =
2176}
2177
2179{
2180 return !m_bitfields.empty() && name().startsWith("__pad"); // anonymous bitfield
2181}
2182
2184 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
2185 bool inGroup, int indentLevel, const ClassDef *inheritedFrom,const DString &inheritId) const
2186{
2187 //printf("> %s MemberDefImpl::writeDeclaration() inGroup=%d inheritId=%s\n",qPrint(qualifiedName()),inGroup,qPrint(inheritId));
2188
2189 // hide enum value, since they appear already as part of the enum, unless they
2190 // are explicitly grouped.
2191 if (!inGroup && m_mtype==MemberType::EnumValue) return;
2192
2193 const Definition *d=nullptr;
2194 ASSERT (cd!=nullptr || nd!=nullptr || fd!=nullptr || gd!=nullptr || mod!=nullptr); // member should belong to something
2195 if (cd) d=cd;
2196 else if (nd) d=nd;
2197 else if (fd) d=fd;
2198 else d=gd;
2199 if (d==gd || d==mod) // see bug 753608
2200 {
2201 if (getClassDef()) d = getClassDef();
2202 else if (getNamespaceDef()) d = getNamespaceDef();
2203 else if (getFileDef()) d = getFileDef();
2204 }
2205 else if (d==fd) // see issue #9850, namespace member can be shown in file scope as well
2206 {
2207 if (getNamespaceDef()) d = getNamespaceDef();
2208 }
2209 if (d==nullptr)
2210 {
2211 err("No context could be derived for member '{}'\n",name());
2212 return; // should not happen
2213 }
2214
2215 DString cname = d->name();
2216 DString cdname = d->displayName();
2217 DString cfname = getOutputFileBase();
2218
2219 // search for the last anonymous scope in the member type
2220 const ClassDef *annoClassDef=getClassDefOfAnonymousType();
2221
2223
2224 // start a new member declaration
2227 ol.startMemberItem(annoClassDef ? DString() : anchor(), anonType, inheritId);
2228
2229
2230 // If there is no detailed description we need to write the anchor here.
2231 bool detailsVisible = hasDetailedDescription();
2232 bool writeAnchor = (inGroup || getGroupDef()==nullptr) && // only write anchors for member that have no details and are
2233 !detailsVisible && // rendered inside the group page or are not grouped at all
2234 inheritId.empty();
2235
2236 if (writeAnchor)
2237 {
2238 DString doxyArgs=argsString();
2239 DString doxyName=name();
2240 if (!cname.empty())
2241 {
2243 }
2244 ol.startDoxyAnchor(cfname,cname,anchor(),doxyName,doxyArgs);
2245 ol.addLabel(cfname,anchor());
2246 }
2247
2248 if (!detailsVisible)
2249 {
2250 ol.pushGeneratorState();
2254 ol.docify("\n");
2255 ol.popGeneratorState();
2256 }
2257
2258 if (annoClassDef)
2259 {
2260 for (int j=0;j<indentLevel;j++)
2261 {
2263 }
2264 }
2265
2266 // *** write template lists
2267 if (m_tArgList.hasParameters() && getLanguage()==SrcLangExt::Cpp)
2268 {
2271 ol.endMemberTemplateParams(anchor(),inheritId);
2272 }
2273
2274
2275 // *** write type
2276 DString ltype(m_type);
2277 auto lang = getLanguage();
2278 if (isTypedef() && lang != SrcLangExt::Slice)
2279 {
2280 ltype.prepend("typedef ");
2281 }
2282 if (isTypeAlias())
2283 {
2284 if (lang==SrcLangExt::Python)
2285 {
2286 ltype="type";
2287 }
2288 else
2289 {
2290 ltype="using";
2291 }
2292 }
2293 // strip 'friend' keyword from ltype
2294 ltype.stripPrefix("friend ");
2295 static const reg::Ex r(R"(@\d+)"); // anonymous type marker
2296 reg::Match match;
2297 std::string stype = ltype.str();
2298 bool endAnonScopeNeeded=false;
2299 LinkifyTextOptions options;
2300 options.setScope(d).setFileScope(getBodyDef()).setSelf(this);
2301 if (reg::search(stype,match,r)) // member has an anonymous type marker
2302 {
2303 //printf("name=%s annoClassDef=%p stype='%s' scopeName='%s'\n",
2304 // qPrint(name()),(void*)annoClassDef,qPrint(stype),qPrint(cname));
2305
2306 static const reg::Ex ar(R"([\w@:]*@\d+[\w@:]*)"); // anonymous type marker(s) including scope
2307 reg::Match amatch;
2308 reg::search(stype,amatch,ar);
2309 size_t ai = amatch.position();
2310 size_t al = amatch.length();
2311 const MemberDef *amd = getAnonymousEnumType();
2312 if (annoClassDef && amd==nullptr) // type is an anonymous compound
2313 {
2314 ol.writeObjectLink(annoClassDef->getReference(),annoClassDef->getOutputFileBase(),
2315 annoClassDef->anchor(),ltype.left(ai)+ltype.mid(ai+al));
2316 }
2317 else if (amd) // type is an anonymous enum
2318 {
2319 DString typePlaceholder = " { ... } ";
2320 if (lang==SrcLangExt::Cpp)
2321 {
2322 if (amd->isEnumStruct()) typePlaceholder.prepend(" struct");
2323 else if (amd->isStrong()) typePlaceholder.prepend(" class");
2324 }
2326 amd->anchor(),ltype.left(ai)+typePlaceholder+ltype.mid(ai+al));
2327 }
2328 else // fallback if anonymous type is not found
2329 {
2330 size_t i = match.position();
2331 size_t l = match.length();
2332 ltype = ltype.left(i) + " { ... } " + removeAnonymousScopes(ltype.mid(i+l));
2333 linkifyText(TextGeneratorOLImpl(ol), ltype, options);
2334 }
2335 }
2336 else if (ltype=="@") // rename type from enum values
2337 {
2338 ltype="";
2339 }
2340 else
2341 {
2342 if (isObjCMethod())
2343 {
2344 ltype.prepend("(");
2345 ltype.append(")");
2346 }
2347 linkifyText(TextGeneratorOLImpl(ol),ltype,options);
2348 }
2349
2350 if (!ltype.empty())
2351 {
2352 ol.pushGeneratorState();
2354 ol.docify(" ");
2355 ol.popGeneratorState();
2356 }
2357
2359
2360 // *** write name
2361 if (!isAnonymous() && !_isAnonymousBitField()) // hide anonymous stuff
2362 {
2363 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2364 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2365 bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
2366 m_mtype==MemberType::Friend ||
2367 (m_prot==Protection::Private &&
2368 (m_virt!=Specifier::Normal || isOverride() || isFinal()) &&
2369 extractPrivateVirtual && hasDocumentation()
2370 ));
2371 //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",qPrint(name()),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation());
2372 if (!name().empty() && // name valid
2373 (hasDetailedDescription() || isReference()) && // has docs
2374 visibleIfPrivate &&
2375 !(isStatic() && getClassDef()==nullptr && !extractStatic) // hidden due to static-ness
2376 )
2377 {
2378 //printf("writeLink %s->%d\n",qPrint(name),hasDocumentation());
2379 const ClassDef *rcd = cd;
2380 if (isReference() && getClassDef()) rcd = getClassDef();
2381 writeLink(ol,rcd,nd,fd,gd,mod);
2382 }
2383 else if (isDocumentedFriendClass())
2384 // if the member is an undocumented friend declaration for some class,
2385 // then maybe we can link to the class
2386 {
2387 writeLink(ol,getClass(name()),nullptr,nullptr,nullptr,nullptr);
2388 }
2389 else
2390 // there is a brief member description and brief member
2391 // descriptions are enabled or there is no detailed description.
2392 {
2393 const ClassDef *rcd = cd;
2394 if (isReference() && getClassDef()) rcd = getClassDef();
2395 writeLink(ol,rcd,nd,fd,gd,mod,true);
2396 }
2397 }
2398
2399 // *** write arguments
2400 if (!argsString().empty() && !isObjCMethod())
2401 {
2402 if (!isDefine() && !isTypedef()) ol.writeString(" ");
2404 isDefine() ?
2405 substitute(argsString(),",",", ") :
2406 isTypedef() ?
2407 substitute(argsString(),")(",") (") :
2409 LinkifyTextOptions(options)
2410 .setArgumentList(&m_defArgList)
2411 .setAutoBreak(false)
2412 .setIndentLevel(indentLevel)
2413 );
2414 }
2415
2416 // *** write bitfields
2417 if (!m_bitfields.empty()) // add bitfields
2418 {
2420 }
2421 else if (hasOneLineInitializer()
2422 //!init.empty() && initLines==0 && // one line initializer
2423 //((maxInitLines>0 && userInitLines==-1) || userInitLines>0) // enabled by default or explicitly
2424 ) // add initializer
2425 {
2426 if (isTypeAlias()) // using statement
2427 {
2428 ol.writeString(" = ");
2430 }
2431 else if (!isDefine())
2432 {
2433 //ol.writeString(" = ");
2434 ol.writeString(" ");
2436 }
2437 else
2438 {
2441 }
2442 }
2443
2444
2446 {
2447 ol.startTypewriter();
2448 ol.docify(" [implementation]");
2449 ol.endTypewriter();
2450 }
2451
2452 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2453
2454 if (isProperty() && (isSettable() || isGettable() ||
2457 {
2458 ol.writeLatexSpacing();
2459 ol.startTypewriter();
2460 ol.docify(" [");
2461 StringVector sl;
2462
2463 if (isGettable()) sl.emplace_back("get");
2464 if (isProtectedGettable()) sl.emplace_back("protected get");
2465 if (isSettable()) sl.emplace_back("set");
2466 if (isProtectedSettable()) sl.emplace_back("protected set");
2467 if (extractPrivate)
2468 {
2469 if (isPrivateGettable()) sl.emplace_back("private get");
2470 if (isPrivateSettable()) sl.emplace_back("private set");
2471 }
2472 bool first=true;
2473 for (const auto &s : sl)
2474 {
2475 if (!first)
2476 {
2477 ol.docify(", ");
2478 }
2479 first=false;
2480 ol.docify(s);
2481 }
2482 ol.docify("]");
2483 ol.endTypewriter();
2484 }
2485
2486 if (isEvent() && (isAddable() || isRemovable() || isRaisable()))
2487 {
2488 ol.writeLatexSpacing();
2489 ol.startTypewriter();
2490 ol.docify(" [");
2491 StringVector sl;
2492 if (isAddable()) sl.emplace_back("add");
2493 if (isRemovable()) sl.emplace_back("remove");
2494 if (isRaisable()) sl.emplace_back("raise");
2495 bool first=true;
2496 for (const auto &s : sl)
2497 {
2498 if (!first)
2499 {
2500 ol.docify(", ");
2501 }
2502 first=false;
2503 ol.docify(s);
2504 }
2505 ol.docify("]");
2506 ol.endTypewriter();
2507 }
2508
2509 if (writeAnchor)
2510 {
2511 ol.endDoxyAnchor(cfname,anchor());
2512 }
2513
2514 //printf("endMember %s annoClassDef=%p annEnumType=%p\n",
2515 // qPrint(name()),annoClassDef,annEnumType);
2516 ol.endMemberItem(anonType);
2517 if (endAnonScopeNeeded)
2518 {
2519 ol.endAnonTypeScope(indentLevel);
2520 }
2521
2522 // write brief description
2523 if (!briefDescription().empty() &&
2524 Config_getBool(BRIEF_MEMBER_DESC)
2525 )
2526 {
2527 auto parser { createDocParser() };
2528 auto ast { validatingParseDoc(*parser.get(),
2529 briefFile(),
2530 briefLine(),
2532 this,
2534 DocOptions()
2535 .setIndexWords(inheritedFrom==nullptr)
2536 .setSingleLine(true))
2537 };
2538 if (!ast->empty())
2539 {
2540 ol.startMemberDescription(anchor(),inheritId);
2541 ol.writeDoc(ast.get(),getOuterScope()?getOuterScope():d,this);
2542 if (detailsVisible) // add More.. link only when both brief and details are visible
2543 {
2544 if (!isAnonymous()) // hide anonymous stuff
2545 {
2546 ol.pushGeneratorState();
2548 ol.docify(" ");
2549 ol.popGeneratorState();
2550 }
2551 }
2552 // for RTF we need to add an extra empty paragraph
2553 ol.pushGeneratorState();
2555 ol.startParagraph();
2556 ol.endParagraph();
2557 ol.popGeneratorState();
2559 }
2560 }
2561
2562 ol.endMemberDeclaration(anchor(),inheritId);
2563
2565 //printf("< %s MemberDefImpl::writeDeclaration() inGroup=%d\n",qPrint(qualifiedName()),inGroup);
2566}
2567
2569
2571{
2572 std::lock_guard<std::mutex> lock(g_hasDetailedDescriptionMutex);
2573 //printf(">hasDetailedDescription(cached=%d)\n",m_hasDetailedDescriptionCached);
2575 {
2576 bool extractAll = Config_getBool(EXTRACT_ALL);
2577 bool alwaysDetailedSec = Config_getBool(ALWAYS_DETAILED_SEC);
2578 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2579 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
2580 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2581 bool extractStatic = Config_getBool(EXTRACT_STATIC);
2582 bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
2583 bool inlineSources = hasInlineSource();
2584
2585 // the member has detailed documentation because the user added some comments
2586 bool docFilter =
2587 // extract all is enabled
2588 extractAll ||
2589 // has detailed docs
2590 !documentation().empty() ||
2591 // has inbody docs
2593 // is an enum with values that are documented
2595 // is documented enum value
2596 (m_mtype==MemberType::EnumValue && !briefDescription().empty()) ||
2597 // has brief description that is part of the detailed description
2598 (!briefDescription().empty() && // has brief docs
2599 (alwaysDetailedSec && // they are visible in
2600 (repeatBrief || // detailed section or
2601 !briefMemberDesc // they are explicitly not
2602 ) // shown in brief section
2603 )
2604 ) ||
2605 // has one or more documented arguments
2610 m_templateMaster->templateArguments().hasTemplateDocumentation() :
2612 // user-specified qualifiers
2613 !m_qualifiers.empty();
2614
2615 // generate function guard
2616 // ================== =======
2617 // _writeGroupInclude -> ignored in calculation
2618 // multiLineInitializer() -> hasMultiLineInitializer()
2619 // _writeReimplements -> _isReimplements()
2620 // _writeReimplementedBy -> _countReimplementedBy()>0
2621 // _writeExamples -> hasExamples()
2622 // _writeTypeConstraints -> m_typeConstraints.hasParameters()
2623 // writeSourceDef -> !getSourceFileBase().empty();
2624 // writeInlineCode -> hasInlineSource() && hasSources()
2625 // writeSourceRefs -> hasReferencesRelation() && hasSourceRefs()
2626 // writeSourceReffedBy -> hasReferencedByRelation() && hasSourceReffedBy()
2627 // _writeCallGraph -> _hasVisibleCallGraph()
2628 // _writeCallerGraph -> _hasVisibleCallerGraph()
2629
2630 // the member has detailed documentation because there is some generated info
2631 bool docInfo =
2632 // has a multi-line initialization block
2634 // reimplements / reimplemented by
2636 // examples
2637 hasExamples() ||
2638 // type constraints
2640 // has source definition
2641 !getSourceFileBase().empty() ||
2642 // has inline sources
2643 (inlineSources && hasSources()) ||
2644 // has references
2647 // call graph
2649 // caller graph
2651 // requirement references
2653
2654 if (!hideUndocMembers) // if HIDE_UNDOC_MEMBERS is NO we also show the detailed section
2655 // if there is only some generated info
2656 {
2657 docFilter = docFilter || docInfo;
2658 }
2659
2660 // this is not a global static or global statics should be extracted
2661 bool staticFilter = getClassDef()!=nullptr || !isStatic() || extractStatic;
2662
2663 // a module does not contain details for members, so either the namespace or file should be linkable
2664 bool moduleFilter = getModuleDef()==nullptr || (getFileDef() && getFileDef()->isLinkable()) ||
2666
2667 // only include members that are non-private unless EXTRACT_PRIVATE is
2668 // set to YES or the member is part of a group
2669 bool privateFilter = protectionLevelVisible(protection()) || m_mtype==MemberType::Friend ||
2670 (m_prot==Protection::Private && (m_virt!=Specifier::Normal || isOverride() || isFinal()) && extractPrivateVirtual);
2671
2672 // hide friend (class|struct|union) member if HIDE_FRIEND_COMPOUNDS
2673 // is true
2674 bool friendCompoundFilter = !(Config_getBool(HIDE_FRIEND_COMPOUNDS) && isFriend());
2675
2677 (docFilter && staticFilter && moduleFilter && privateFilter && friendCompoundFilter && !isHidden());
2678 //printf("docFilter=%d docInfo=%d staticFilter=%d privateFilter=%d friendCompoundFilter=%d !isHidden()=%d",
2679 // docFilter,docInfo,staticFilter,privateFilter,friendCompoundFilter,!isHidden());
2681 }
2682 //printf("<hasDetailedDescription(cached=%d)\n",m_hasDetailedDescriptionCached);
2684}
2685
2687{
2688 bool separateMemPages = Config_getBool(SEPARATE_MEMBER_PAGES);
2689 bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
2690 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
2691 bool groupFilter = getGroupDef()==nullptr || container==MemberListContainer::Group || separateMemPages;
2692 bool fileFilter = getNamespaceDef()==nullptr || !getNamespaceDef()->isLinkable() || container!=MemberListContainer::File;
2693 bool simpleFilter = (hasBriefDescription() || !hideUndocMembers) && inlineSimpleStructs &&
2694 getClassDef()!=nullptr && getClassDef()->isSimple();
2695
2696 bool visible = hasDetailedDescription() && groupFilter && fileFilter &&
2697 !isReference();
2698 bool result = visible || simpleFilter;
2699 //printf("%s::isDetailedSectionVisible: %d groupFilter=%d fileFilter=%d\n",
2700 // qPrint(name()),result,groupFilter,fileFilter);
2701 return result;
2702}
2703
2705{
2706 StringVector sl;
2707 bool inlineInfo = Config_getBool(INLINE_INFO);
2708 bool inherited = getClassDef() &&
2709 (getClassDef()!=container || m_explicitInherited) &&
2710 container->definitionType()==TypeClass &&
2711 !isRelated();
2712 Specifier lvirt=virtualness();
2713 if ((!isObjCMethod() || isOptional() || isRequired()) &&
2714 (protection()!=Protection::Public || lvirt!=Specifier::Normal ||
2715 isFriend() || isRelated() ||
2716 (isInline() && inlineInfo) ||
2717 isSignal() || isSlot() ||
2718 isStatic() || isExternal() ||
2719 isExported() ||
2720 inherited ||
2721 TypeSpecifier(m_memSpec).setInline(false)!=TypeSpecifier()
2722 )
2723 )
2724 {
2725 // write the member specifier list
2726 //ol.writeLatexSpacing();
2727 //ol.startTypewriter();
2728 //ol.docify(" [");
2729 SrcLangExt lang = getLanguage();
2730 bool optVhdl = lang==SrcLangExt::VHDL;
2731 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2732 if (optVhdl)
2733 {
2734 sl.push_back(theTranslator->trVhdlType(getVhdlSpecifiers(),true).str());
2735 }
2736 else
2737 {
2738 if (isFriend()) sl.emplace_back("friend");
2739 else if (isRelated()) sl.emplace_back("related");
2740 else
2741 {
2742 if (isExternal()) sl.emplace_back("extern");
2743 if (inlineInfo && isInline()) sl.emplace_back("inline");
2744 if (isExplicit()) sl.emplace_back("explicit");
2745 if (isMutable()) sl.emplace_back("mutable");
2746 if (isThreadLocal()) sl.emplace_back("thread_local");
2747 if (isStatic()) sl.emplace_back("static");
2748 if (isGettable()) sl.emplace_back("get");
2749 if (isProtectedGettable()) sl.emplace_back("protected get");
2750 if (isSettable()) sl.emplace_back("set");
2751 if (isProtectedSettable()) sl.emplace_back("protected set");
2752 if (extractPrivate)
2753 {
2754 if (isPrivateGettable()) sl.emplace_back("private get");
2755 if (isPrivateSettable()) sl.emplace_back("private set");
2756 }
2757 if (isNoDiscard()) sl.emplace_back("nodiscard");
2758 if (isConstExpr()) sl.emplace_back("constexpr");
2759 if (isConstEval()) sl.emplace_back("consteval");
2760 if (isConstInit()) sl.emplace_back("constinit");
2761 if (isAddable()) sl.emplace_back("add");
2762 if (!isUNOProperty() && isRemovable()) sl.emplace_back("remove");
2763 if (isRaisable()) sl.emplace_back("raise");
2764 if (isReadable()) sl.emplace_back("read");
2765 if (isWritable()) sl.emplace_back("write");
2766 if (isFinal()) sl.emplace_back("final");
2767 if (isAbstract()) sl.emplace_back("abstract");
2768 if (isOverride()) sl.emplace_back("override");
2769 if (isInitonly()) sl.emplace_back("initonly");
2770 if (isSealed()) sl.emplace_back("sealed");
2771 if (isNew()) sl.emplace_back("new");
2772 if (isOptional()) sl.emplace_back("optional");
2773 if (isRequired()) sl.emplace_back("required");
2774 if (isExported()) sl.emplace_back("export");
2775
2776 if (isNonAtomic()) sl.emplace_back("nonatomic");
2777 else if (isObjCProperty()) sl.emplace_back("atomic");
2778
2779 // mutual exclusive Objective 2.0 property attributes
2780 if (isAssign()) sl.emplace_back("assign");
2781 else if (isCopy()) sl.emplace_back("copy");
2782 else if (isRetain()) sl.emplace_back("retain");
2783 else if (isWeak()) sl.emplace_back("weak");
2784 else if (lang!=SrcLangExt::CSharp && isStrong()) sl.emplace_back("strong");
2785 else if (isUnretained()) sl.emplace_back("unsafe_unretained");
2786
2787 if (!isObjCMethod())
2788 {
2789 if (protection()==Protection::Protected) sl.emplace_back("protected");
2790 else if (protection()==Protection::Private) sl.emplace_back("private");
2791 else if (protection()==Protection::Package) sl.emplace_back("package");
2792
2793 if (lvirt==Specifier::Virtual) sl.emplace_back("virtual");
2794 else if (lvirt==Specifier::Pure) sl.emplace_back("pure virtual");
2795 if (isSignal()) sl.emplace_back("signal");
2796 if (isSlot()) sl.emplace_back("slot");
2797 if (isDefault()) sl.emplace_back("default");
2798 if (isDelete()) sl.emplace_back("delete");
2799 if (isNoExcept()) sl.emplace_back("noexcept");
2800 if (isAttribute()) sl.emplace_back("attribute");
2801 if (isUNOProperty()) sl.emplace_back("property");
2802 if (isReadonly()) sl.emplace_back("readonly");
2803 if (isBound()) sl.emplace_back("bound");
2804 if (isUNOProperty() && isRemovable()) sl.emplace_back("removable");
2805 if (isConstrained()) sl.emplace_back("constrained");
2806 if (isTransient()) sl.emplace_back("transient");
2807 if (isMaybeVoid()) sl.emplace_back("maybevoid");
2808 if (isMaybeDefault()) sl.emplace_back("maybedefault");
2809 if (isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
2810 if (isPublished()) sl.emplace_back("published"); // enum
2811 }
2813 {
2814 sl.emplace_back("implementation");
2815 }
2816 }
2817 if (inherited)
2818 {
2819 sl.emplace_back("inherited");
2820 }
2821 }
2822 }
2823 else if (isObjCMethod() && isImplementation())
2824 {
2825 sl.emplace_back("implementation");
2826 }
2827
2828 for (const auto &sx : m_qualifiers)
2829 {
2830 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2831 if (!alreadyAdded)
2832 {
2833 sl.push_back(sx);
2834 }
2835 }
2836
2837 return sl;
2838}
2839
2841{
2842 // write call graph
2844 {
2845 DotCallGraph callGraph(this,false);
2846 if (callGraph.isTooBig())
2847 {
2848 warn_uncond("Call graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
2849 qualifiedName(), callGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
2850 }
2851 else if (!callGraph.isTrivial())
2852 {
2853 msg("Generating call graph for function {}\n",qualifiedName());
2855 ol.startCallGraph();
2857 ol.endCallGraph(callGraph);
2858 ol.enableAll();
2859 }
2860 }
2861}
2862
2864{
2866 {
2867 DotCallGraph callerGraph(this, true);
2868 if (callerGraph.isTooBig())
2869 {
2870 warn_uncond("Caller graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
2871 qualifiedName(), callerGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
2872 }
2873 else if (!callerGraph.isTrivial())
2874 {
2875 msg("Generating caller graph for function {}\n",qualifiedName());
2877 ol.startCallGraph();
2879 ol.endCallGraph(callerGraph);
2880 ol.enableAll();
2881 }
2882 }
2883}
2884
2886{
2887 const MemberDef *bmd=reimplements();
2888 const ClassDef *bcd=nullptr;
2889 if (bmd && (bcd=bmd->getClassDef()))
2890 {
2891 // write class that contains a member that is reimplemented by this one
2892 if (bcd->isLinkable())
2893 {
2894 return true;
2895 }
2896 }
2897 return false;
2898}
2900{
2901 const MemberDef *bmd=reimplements();
2902 const ClassDef *bcd=nullptr;
2903 if (bmd && (bcd=bmd->getClassDef()))
2904 {
2905 // write class that contains a member that is reimplemented by this one
2906 if (bcd->isLinkable())
2907 {
2908 ol.startParagraph();
2909 DString reimplFromLine;
2910 if (bmd->virtualness()!=Specifier::Pure && bcd->compoundType()!=ClassDef::Interface)
2911 {
2912 reimplFromLine = theTranslator->trReimplementedFromList(1);
2913 }
2914 else
2915 {
2916 reimplFromLine = theTranslator->trImplementedFromList(1);
2917 }
2918 if (size_t markerPos = reimplFromLine.find("@0"); markerPos!=DString::npos) // should always pass this.
2919 {
2920 ol.parseText(reimplFromLine.left(markerPos)); //text left from marker
2921 if (bmd->isLinkable()) // replace marker with link
2922 {
2923 //Definition *bd=bmd->group;
2924 //if (bd==0) bd=bcd;
2926 bmd->anchor(),bcd->displayName());
2927
2928 //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
2929 // bmd->anchor(),bcd->name());
2930 if ( bmd->isLinkableInProject() )
2931 {
2932 writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
2933 }
2934 }
2935 else
2936 {
2938 DString(),bcd->displayName());
2939 if (bcd->isLinkableInProject()/* && !Config_getBool(PDF_HYPERLINKS)*/ )
2940 {
2941 writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor());
2942 }
2943 }
2944 ol.parseText(reimplFromLine.right(
2945 reimplFromLine.length()-markerPos-2)); // text right from marker
2946
2947 }
2948 else
2949 {
2950 err("translation error: no marker in trReimplementsFromList()\n");
2951 }
2952 ol.endParagraph();
2953 }
2954 }
2955}
2956
2958{
2959 const MemberVector &bml=reimplementedBy();
2960 size_t count=0;
2961 for (const auto &bmd : bml)
2962 {
2963 const ClassDef *bcd=bmd->getClassDef();
2964 // count the members that directly inherit from md and for
2965 // which the member and class are visible in the docs.
2966 if ( bcd && bmd->isLinkable() && bcd->isLinkable() )
2967 {
2968 count++;
2969 }
2970 }
2971 return count;
2972}
2973
2975{
2976 const MemberVector &bml=reimplementedBy();
2977 size_t count = _countReimplementedBy();
2978 if (count>0)
2979 {
2980 auto replaceFunc = [&bml,&ol](size_t entryIndex)
2981 {
2982 size_t cnt=0;
2983 auto it = bml.begin();
2984 // find the entryIndex-th documented entry in the inheritance list.
2985 const MemberDef *bmd = nullptr;
2986 const ClassDef *bcd = nullptr;
2987 while (it!=bml.end())
2988 {
2989 bmd = *it;
2990 bcd = bmd->getClassDef();
2991 if ( bmd->isLinkable() && bcd->isLinkable())
2992 {
2993 if (cnt==entryIndex) break;
2994 cnt++;
2995 }
2996 ++it;
2997 }
2998
2999 if (bcd && bmd) // write link for marker
3000 {
3001 //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
3002 // bmd->anchor(),bcd->name());
3004 bmd->anchor(),bcd->displayName());
3005
3006 if (bmd->isLinkableInProject() )
3007 {
3008 writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
3009 }
3010 }
3011 };
3012
3013 DString reimplInLine;
3014 if (m_virt==Specifier::Pure || (getClassDef() && getClassDef()->compoundType()==ClassDef::Interface))
3015 {
3016 reimplInLine = theTranslator->trImplementedInList(static_cast<int>(count));
3017 }
3018 else
3019 {
3020 reimplInLine = theTranslator->trReimplementedInList(static_cast<int>(count));
3021 }
3022
3023 // write the list of classes that overwrite this member
3024 ol.startParagraph();
3025 writeMarkerList(ol,
3026 reimplInLine.str(),
3027 count,
3028 replaceFunc);
3029 ol.endParagraph();
3030 }
3031}
3032
3034{
3035 if (getClassDef()) // this should be a member of a class/category
3036 {
3037 //printf("%s: category %s relation %s class=%s categoryOf=%s\n",
3038 // qPrint(name()),
3039 // m_category ? qPrint(m_category->name()) : "<none>",
3040 // m_categoryRelation ? qPrint(m_categoryRelation->name()) : "<none>",
3041 // qPrint(m_classDef->name()),
3042 // m_classDef->categoryOf() ? qPrint(m_classDef->categoryOf()->name()) : "<none>"
3043 // );
3044 DString text;
3045 DString ref;
3046 DString file;
3047 DString anc;
3048 DString name;
3049 size_t i=DString::npos;
3051 {
3052 if (m_category)
3053 {
3054 // this member is in a normal class and implements method categoryRelation from category
3055 // so link to method 'categoryRelation' with 'provided by category 'category' text.
3058 }
3059 else if (getClassDef()->categoryOf())
3060 {
3061 // this member is part of a category so link to the corresponding class member of the class we extend
3062 // so link to method 'categoryRelation' with 'extends class 'classDef->categoryOf()'
3063 text = theTranslator->trExtendsClass();
3065 }
3066 i=text.find("@0");
3067 if (i!=DString::npos)
3068 {
3069 const MemberDef *md = m_categoryRelation;
3070 ref = md->getReference();
3071 file = md->getOutputFileBase();
3072 anc = md->anchor();
3073 }
3074 }
3075 if (i!=DString::npos && !name.empty())
3076 {
3077 ol.startParagraph();
3078 ol.parseText(text.left(i));
3079 ol.writeObjectLink(ref,file,anc,name);
3080 ol.parseText(text.mid(i+2));
3081 ol.endParagraph();
3082 }
3083 }
3084}
3085
3087{
3088 // write the list of examples that use this member
3089 if (hasExamples())
3090 {
3091 ol.startExamples();
3092 ol.startDescForItem();
3094 ol.endDescForItem();
3095 ol.endExamples();
3096 }
3097}
3098
3106
3108 const DString &cfname,const DString &ciname,
3109 const DString &cname) const
3110{
3111 // For enum, we also write the documented enum values
3112 if (isEnumerate())
3113 {
3114 bool first=true;
3115 //printf("** %s: enum values=%zu\n",qPrint(name()),enumFieldList().size());
3116 bool hasInits = false;
3117 if (hasEnumValues())
3118 {
3119 for (const auto &fmd : enumFieldList())
3120 {
3121 if (fmd->isLinkable())
3122 {
3123 if (!fmd->initializer().empty())
3124 {
3125 hasInits = true;
3126 break;
3127 }
3128 }
3129 }
3130 }
3131 for (const auto &fmd : enumFieldList())
3132 {
3133 //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
3134 if (fmd->isLinkable())
3135 {
3136 if (first)
3137 {
3139 first=false;
3140 }
3141
3142 ol.startDescTableRow();
3143 ol.addIndexItem(fmd->name(),ciname);
3144 ol.addIndexItem(ciname,fmd->name());
3145
3147 ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString());
3148 ol.addLabel(cfname,fmd->anchor());
3149 ol.docify(fmd->name());
3151 ol.writeString(" ");
3152 ol.enableAll();
3153 ol.endDoxyAnchor(cfname,fmd->anchor());
3154 ol.endDescTableTitle();
3155 if (hasInits)
3156 {
3157 ol.startDescTableInit();
3158 if (!fmd->initializer().empty())
3159 {
3160 DString initStr = fmd->initializer().stripWhiteSpace();
3161 if (initStr.startsWith("=")) initStr = initStr.mid(1).stripWhiteSpace();
3163 ol.writeString("(");
3164 ol.enableAll();
3165 ol.docify(initStr);
3167 ol.writeString(")");
3168 ol.enableAll();
3169 }
3170 ol.endDescTableInit();
3171 }
3172 ol.startDescTableData();
3173
3174 bool hasBrief = !fmd->briefDescription().empty();
3175 bool hasDetails = !fmd->documentation().empty();
3176
3177 if (hasBrief)
3178 {
3179 ol.generateDoc(fmd->briefFile(),
3180 fmd->briefLine(),
3181 getOuterScope()?getOuterScope():container,
3182 fmd,
3183 fmd->briefDescription(),
3184 DocOptions()
3185 .setIndexWords(true));
3186 }
3187 if (hasDetails)
3188 {
3189 ol.generateDoc(fmd->docFile(),
3190 fmd->docLine(),
3191 getOuterScope()?getOuterScope():container,
3192 fmd,
3193 fmd->documentation()+"\n",
3194 DocOptions()
3195 .setIndexWords(true));
3196 }
3197 ol.endDescTableData();
3198 ol.endDescTableRow();
3199 }
3200 }
3201 if (!first)
3202 {
3203 ol.endDescTable();
3204 }
3205 }
3206}
3207
3208// match from the start of the scope until the last marker
3209static const reg::Ex reAnonymous(R"([\w:@]*@\d+)");
3210
3212{
3213 DString ldef = definition();
3214 DString title = name();
3215 if (isEnumerate())
3216 {
3217 if (isAnonymous())
3218 {
3219 ldef = title = "anonymous enum";
3220 if (!m_enumBaseType.empty())
3221 {
3222 ldef+=" : "+m_enumBaseType;
3223 }
3224 }
3225 else
3226 {
3227 ldef.prepend("enum ");
3228 if (isSliceLocal())
3229 {
3230 ldef.prepend("local ");
3231 }
3232 }
3233 }
3234 else if (isEnumValue())
3235 {
3236 if (isAnonymous())
3237 {
3238 ldef=ldef.mid(2);
3239 }
3240 }
3241
3242 std::string sdef = ldef.str();
3243 reg::Match match;
3244 if (reg::search(sdef,match,reAnonymous))
3245 {
3246 const ClassDef *annoClassDef=getClassDefOfAnonymousType();
3247 if (annoClassDef)
3248 {
3249 static const reg::Ex ar(R"([\w@:]*@\d+[\w@:]*)");
3250 reg::Match amatch;
3251 reg::search(sdef,amatch,ar);
3252 ldef = amatch.prefix().str() + annoClassDef->displayName() + amatch.suffix().str();
3253 }
3254 else
3255 {
3256 ldef = match.prefix().str() + " { ... } " + removeAnonymousScopes(match.suffix().str());
3257 }
3258 }
3259
3260 const ClassDef *cd=getClassDef();
3261 if (cd && cd->isObjectiveC())
3262 {
3263 // strip scope name
3264 if (size_t ep = ldef.find("::"); ep!=DString::npos)
3265 {
3266 if (size_t sp=ldef.rfind(' ',ep); sp!=DString::npos)
3267 {
3268 ldef=ldef.left(sp+1)+ldef.mid(ep+2);
3269 }
3270 }
3271 // strip keywords
3272 if (size_t dp = ldef.find(':'); dp!=DString::npos)
3273 {
3274 ldef=ldef.left(dp+1);
3275 }
3276 int l=static_cast<int>(ldef.length());
3277 //printf("start >%s<\n",qPrint(ldef));
3278 int i=l-1;
3279 while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
3280 while (i>=0 && isspace(static_cast<uint8_t>(ldef.at(i)))) i--;
3281 if (i>0)
3282 {
3283 // insert branches around the type
3284 ldef = "("+ldef.left(i+1)+")"+ldef.mid(i+1);
3285 }
3286 //printf("end >%s< i=%d\n",qPrint(ldef),i);
3287 if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
3288 }
3289 SrcLangExt lang = getLanguage();
3290 DString sep = getLanguageSpecificSeparator(lang,true);
3291 return substitute(ldef,"::",sep);
3292}
3293
3295{
3296 // only write out the include file if this is not part of a class or file
3297 // definition
3298 bool showGroupedMembInc = Config_getBool(SHOW_GROUPED_MEMB_INC);
3299 bool forceLocalIncludes = Config_getBool(FORCE_LOCAL_INCLUDES);
3300 const FileDef *fd = getFileDef();
3301 DString nm;
3302 if (inGroup && fd && showGroupedMembInc)
3303 {
3304 if (!Config_getList(STRIP_FROM_INC_PATH).empty())
3305 {
3307 }
3308 else
3309 {
3310 nm = fd->name();
3311 }
3312 }
3313 if (!nm.empty())
3314 {
3315 ol.startParagraph();
3316 ol.startTypewriter();
3317 SrcLangExt lang = getLanguage();
3318 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
3319 if (isIDLorJava)
3320 {
3321 ol.docify("import ");
3322 }
3323 else
3324 {
3325 ol.docify("#include ");
3326 }
3327
3328 if (isIDLorJava || forceLocalIncludes) ol.docify("\""); else ol.docify("<");
3329
3330 if (fd && fd->isLinkable())
3331 {
3332 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),fd->anchor(),nm);
3333 }
3334 else
3335 {
3336 ol.docify(nm);
3337 }
3338
3339 if (isIDLorJava || forceLocalIncludes) ol.docify("\""); else ol.docify(">");
3340
3341 ol.endTypewriter();
3342 ol.endParagraph();
3343 }
3344}
3345
3347{
3348 //printf("md=%s initLines=%d init='%s'\n",qPrint(name()),initLines,qPrint(init));
3349 ol.startBold();
3350 if (m_mtype==MemberType::Define)
3352 else
3354 ol.endBold();
3355 DString langCorrected = getDefFileExtension();
3357 if (srcLangExt == SrcLangExt::Lex)
3358 {
3359 langCorrected = ".doxygen_lex_c";
3360 srcLangExt = SrcLangExt::Cpp;
3361 }
3362 auto intf = Doxygen::parserManager->getCodeParser(langCorrected);
3363 intf->resetCodeParserState();
3364 auto &codeOL = ol.codeGenerators();
3365 codeOL.startCodeFragment("DoxyCode");
3366 intf->parseCode(codeOL,scopeName,m_initializer,srcLangExt,Config_getBool(STRIP_CODE_COMMENTS),
3369 .setInlineFragment(true)
3370 .setMemberDef(this)
3371 .setShowLineNumbers(false)
3372 .setSearchCtx(this)
3373 );
3374 codeOL.endCodeFragment("DoxyCode");
3375}
3376
3377/*! Writes the "detailed documentation" section of this member to
3378 * all active output formats.
3379 */
3381 int memCount,int memTotal,
3382 OutputList &ol,
3383 const DString &scName,
3384 const Definition *container,
3385 bool inGroup,
3386 bool /* showEnumValues */,
3387 bool showInline
3388 ) const
3389{
3390 // if this member is in a group find the real scope name.
3391 bool hasParameterList = false;
3392
3393 //printf("MemberDefImpl::writeDocumentation(): name='%s' hasDocs='%d' containerType=%d inGroup=%d sectionLinkable=%d\n",
3394 // qPrint(name()),hasDocs,container->definitionType(),inGroup,hasDetailedDescription());
3395
3396 //if ( !hasDocs ) return;
3397 //if (isEnumValue() && !showEnumValues) return;
3398
3399 SrcLangExt lang = getLanguage();
3400 //printf("member=%s lang=%d\n",qPrint(name()),lang);
3401 bool optVhdl = lang==SrcLangExt::VHDL;
3402 DString sep = getLanguageSpecificSeparator(lang,true);
3403
3404 DString scopeName = scName;
3405 DString memAnchor = anchor();
3406 DString ciname = container->displayName();
3407 const Definition *scopedContainer = container; // see bug 753608
3408 if (container->definitionType()==TypeGroup)
3409 {
3410 if (getClassDef()) { scopeName=getClassDef()->displayName(); scopedContainer=getClassDef(); }
3411 else if (getNamespaceDef()) { scopeName=getNamespaceDef()->displayName(); scopedContainer=getNamespaceDef(); }
3412 else if (getFileDef()) { scopeName=getFileDef()->displayName(); scopedContainer=getFileDef(); }
3413 ciname = (toGroupDef(container))->groupTitle();
3414 }
3415 else if (container->definitionType()==TypeFile && getNamespaceDef() && getNamespaceDef()->isLinkable())
3416 { // member is in a namespace, but is written as part of the file documentation
3417 // as well, so we need to make sure its anchor is unique (it is not really used).
3418 memAnchor.prepend("file_");
3419 }
3420
3421 DString cname = container->name();
3422 DString cfname = getOutputFileBase();
3423
3424 // get member name
3425 DString doxyName=name();
3426 // prepend scope if there is any. TODO: make this optional for C only docs
3427 if (!scopeName.empty())
3428 {
3429 doxyName.prepend(scopeName+sep);
3430 }
3431 DString doxyArgs=argsString();
3432
3433 DString ldef = definition();
3434 DString title = name();
3435
3436 //printf("member '%s' def='%s'\n",qPrint(name()),qPrint(ldef));
3437 if (isEnumerate())
3438 {
3439 if (title.at(0)=='@')
3440 {
3441 ldef = title = "anonymous enum";
3442 if (isSliceLocal())
3443 {
3444 ldef.prepend("local ");
3445 }
3446 if (lang==SrcLangExt::Cpp)
3447 {
3448 if (isEnumStruct()) ldef.append(" struct");
3449 else if (isStrong()) ldef.append(" class");
3450 }
3451 if (!m_enumBaseType.empty())
3452 {
3453 ldef+=" : "+m_enumBaseType;
3454 }
3455 }
3456 else
3457 {
3458 if (lang==SrcLangExt::Cpp)
3459 {
3460 if (isEnumStruct()) ldef.prepend("struct ");
3461 else if (isStrong()) ldef.prepend("class ");
3462 }
3463 ldef.prepend("enum ");
3464 if (isSliceLocal())
3465 {
3466 ldef.prepend("local ");
3467 }
3468 }
3469 }
3470 else if (isEnumValue())
3471 {
3472 if (ldef.at(0)=='@')
3473 {
3474 ldef=ldef.mid(2);
3475 }
3476 }
3477 else if (isFunction() && !isObjCMethod())
3478 {
3479 title += "()";
3480 }
3481 if (lang == SrcLangExt::Slice)
3482 {
3483 // Remove the container scope from the member name.
3484 DString prefix = scName + sep;
3485 if (size_t pos = ldef.rfind(prefix); pos != DString::npos)
3486 {
3487 ldef.remove(pos, prefix.length());
3488 }
3489 }
3490 ldef.stripPrefix("constexpr ");
3491 ldef.stripPrefix("consteval ");
3492 ldef.stripPrefix("constinit ");
3493 ldef.stripPrefix("static ");
3494
3495 //----------------------------------------
3496
3497 ol.pushGeneratorState();
3498
3499 bool htmlEndLabelTable=false;
3500 StringVector sl = getLabels(scopedContainer);
3501
3502 static const reg::Ex r(R"(@\d+)");
3503 reg::Match match;
3504 std::string sdef = ldef.str();
3505 LinkifyTextOptions options;
3506 options.setScope(scopedContainer).setFileScope(getBodyDef()).setSelf(this);
3507 if ((isVariable() || isTypedef()) && reg::search(sdef,match,r))
3508 {
3509 // find enum type and insert it in the definition
3510 bool found=false;
3511 for (const auto &vmd : *ml)
3512 {
3513 if (vmd->isEnumerate() && match.str()==vmd->name())
3514 {
3515 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3516 ol.startMemberDoc(ciname,name(),memAnchor,name(),memCount,memTotal,showInline);
3517 ol.addLabel(cfname, memAnchor);
3518 DString prefix = match.prefix().str();
3519 DString suffix = match.suffix().str();
3521 vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef(),getModuleDef());
3522 linkifyText(TextGeneratorOLImpl(ol),suffix,options);
3523
3524 found=true;
3525 break;
3526 }
3527 }
3528 if (!found) // anonymous compound
3529 {
3530 const ClassDef *annoClassDef=getClassDefOfAnonymousType();
3531 DString typeName;
3532 if (annoClassDef) typeName=annoClassDef->compoundTypeString();
3533 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3534 ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline);
3535 ol.addLabel(cfname, memAnchor);
3536 // search for the last anonymous compound name in the definition
3537
3539 if (reg::search(sdef,match,reAnonymous))
3540 {
3541 static const reg::Ex ar(R"([\w@:]*@\d+[\w@:]*)");
3542 reg::Match amatch;
3543 reg::search(sdef,amatch,ar);
3544 DString prefix = amatch.prefix().str();
3545 DString suffix = removeAnonymousScopes(amatch.suffix().str());
3546 //printf("writeDocumentation(): anonymous compound in definition: sdef='%s' prefix='%s' suffix='%s' annoClassDef=%p\n",
3547 // qPrint(sdef), qPrint(prefix),qPrint(suffix),(void*)annoClassDef);
3548 const MemberDef *amd = getAnonymousEnumType();
3549 if (annoClassDef && amd==nullptr)
3550 {
3551 ol.docify(prefix);
3552 DString annTypeName = annoClassDef->displayName(true);
3553 if (suffix.empty())
3554 {
3555 suffix=" "+localName();
3556 }
3557 ol.writeObjectLink(annoClassDef->getReference(),annoClassDef->getOutputFileBase(),
3558 annoClassDef->anchor(),annTypeName);
3559 linkifyText(TextGeneratorOLImpl(ol),suffix,options);
3560 }
3561 else if (amd) // type is an anonymous enum
3562 {
3563 DString typePlaceholder = " { ... } ";
3564 if (lang==SrcLangExt::Cpp)
3565 {
3566 if (amd->isEnumStruct()) typePlaceholder.prepend(" struct");
3567 else if (amd->isStrong()) typePlaceholder.prepend(" class");
3568 }
3569 ol.writeObjectLink(amd->getReference(),amd->getOutputFileBase(),amd->anchor(),prefix+typePlaceholder+suffix);
3570 }
3571 else
3572 {
3573 prefix = match.prefix().str();
3574 suffix = removeAnonymousScopes(match.suffix().str());
3575 ol.docify(prefix);
3576 ol.docify(" { ... } ");
3577 linkifyText(TextGeneratorOLImpl(ol),suffix,options);
3578 }
3579 }
3580 else
3581 {
3582 linkifyText(TextGeneratorOLImpl(ol),ldef,options);
3583 }
3584 }
3585 }
3586 else // not an enum value or anonymous compound
3587 {
3588 ol.startDoxyAnchor(cfname, cname, memAnchor, doxyName, doxyArgs);
3589 ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline);
3590 ol.addLabel(cfname, memAnchor);
3591
3592 if (!m_metaData.empty() && getLanguage()==SrcLangExt::Slice)
3593 {
3595 ol.docify(m_metaData);
3597 }
3598
3599 const ClassDef *cd=getClassDef();
3600 const NamespaceDef *nd=getNamespaceDef();
3601 if (!m_defTmpArgLists.empty() && lang==SrcLangExt::Cpp)
3602 // definition has explicit template parameter declarations
3603 {
3604 for (const ArgumentList &tal : m_defTmpArgLists)
3605 {
3606 if (!tal.empty())
3607 {
3609 _writeTemplatePrefix(ol,scopedContainer,tal);
3611 }
3612 }
3613 }
3614 else // definition gets it template parameters from its class
3615 // (since no definition was found)
3616 {
3617 if (cd && lang==SrcLangExt::Cpp && !isTemplateSpecialization())
3618 {
3619 for (const ArgumentList &tal : cd->getTemplateParameterLists())
3620 {
3621 if (!tal.empty())
3622 {
3624 _writeTemplatePrefix(ol,scopedContainer,tal,false);
3626 }
3627 }
3628 }
3629 if (m_tArgList.hasParameters() && lang==SrcLangExt::Cpp) // function template prefix
3630 {
3632 _writeTemplatePrefix(ol,scopedContainer,m_tArgList);
3634 }
3635 }
3636
3637 if (!sl.empty())
3638 {
3639 ol.pushGeneratorState();
3640 ol.disableAll();
3642 ol.writeString("<table class=\"mlabels\">\n");
3643 ol.writeString(" <tr>\n");
3644 ol.writeString(" <td class=\"mlabels-left\">\n");
3645 ol.popGeneratorState();
3646 htmlEndLabelTable=true;
3647 }
3648
3650 if (cd && cd->isObjectiveC())
3651 {
3652 // strip scope name
3653 if (size_t ep = ldef.find("::"); ep!=DString::npos)
3654 {
3655 if (size_t sp=ldef.rfind(' ',ep); sp!=DString::npos)
3656 {
3657 ldef=ldef.left(sp+1)+ldef.mid(ep+2);
3658 } else {
3659 ldef=ldef.mid(ep+2);
3660 }
3661 }
3662 // strip keywords
3663 if (size_t dp = ldef.find(':'); dp!=DString::npos)
3664 {
3665 ldef=ldef.left(dp+1);
3666 }
3667 int dl=static_cast<int>(ldef.length());
3668 //printf("start >%s<\n",qPrint(ldef));
3669 int i=dl-1;
3670 while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
3671 while (i>=0 && isspace(static_cast<uint8_t>(ldef.at(i)))) i--;
3672 if (i>0)
3673 {
3674 // insert branches around the type
3675 ldef="("+ldef.left(i+1)+")"+ldef.mid(i+1);
3676 }
3677 //printf("end >%s< i=%d\n",qPrint(ldef),i);
3678 if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
3679 }
3680
3681 if (optVhdl)
3682 {
3683 hasParameterList=VhdlDocGen::writeVHDLTypeDocumentation(this,scopedContainer,ol);
3684 }
3685 else if (lang==SrcLangExt::Slice)
3686 {
3687 // Eliminate the self-reference.
3688 size_t pos = ldef.rfind(' ');
3689 if (pos==DString::npos) pos=0;
3690 if (pos>0)
3691 {
3692 linkifyText(TextGeneratorOLImpl(ol),ldef.left(pos),options);
3693 }
3694 ol.docify(ldef.mid(pos));
3695 const Definition *scope = cd;
3696 if (scope==nullptr) scope = nd;
3697 hasParameterList=writeDefArgumentList(ol,scope,this);
3698 }
3699 else
3700 {
3701 linkifyText(TextGeneratorOLImpl(ol),substitute(ldef,"::",sep),options);
3702 const Definition *scope = cd;
3703 if (scope==nullptr) scope = nd;
3704 hasParameterList=writeDefArgumentList(ol,scope,this);
3705 }
3706
3707 if (hasOneLineInitializer()) // add initializer
3708 {
3709 if (isTypeAlias())
3710 {
3711 ol.docify(" = ");
3714 }
3715 else if (!isDefine())
3716 {
3717 ol.docify(" ");
3720 }
3721 else
3722 {
3725 }
3726 }
3727 if (!excpString().empty()) // add exception list
3728 {
3729 writeExceptionList(ol,cd,this);
3730 hasParameterList=true; // call endParameterList below
3731 }
3732 }
3733
3734 ol.pushGeneratorState();
3736 if (!sl.empty())
3737 {
3738 ol.startLabels();
3739 size_t count=0;
3740 for (const auto &s : sl)
3741 {
3742 count++;
3743 ol.writeLabel(s,count==sl.size());
3744 }
3745 ol.endLabels();
3746 }
3747 ol.popGeneratorState();
3748
3749 if (hasParameterList)
3750 {
3751 ol.endParameterList();
3752 ol.endMemberDoc(true);
3753 }
3754 else
3755 {
3756 ol.endMemberDocName();
3757 ol.endMemberDoc(false);
3758 }
3759
3760 // for HTML write the labels here
3761 ol.pushGeneratorState();
3762 ol.disableAll();
3764 if (htmlEndLabelTable)
3765 {
3766 ol.writeString(" </td>\n");
3767 ol.writeString(" <td class=\"mlabels-right\">\n");
3768 ol.startLabels();
3769 size_t count=0;
3770 for (const auto &s : sl)
3771 {
3772 count++;
3773 ol.writeLabel(s,count==sl.size());
3774 }
3775 ol.endLabels();
3776 ol.writeString(" </td>\n");
3777 ol.writeString(" </tr>\n");
3778 ol.writeString("</table>\n");
3779 }
3780 ol.writeString("</div>");
3781 ol.popGeneratorState();
3782
3783
3784 ol.endDoxyAnchor(cfname,memAnchor);
3785 ol.startIndent();
3786
3787 _writeGroupInclude(ol,inGroup);
3788
3789 /* write multi-line initializer (if any) */
3791
3792 /* write brief description */
3793 DString brief = briefDescription();
3794 if (!brief.empty() &&
3795 (Config_getBool(REPEAT_BRIEF) ||
3796 !Config_getBool(BRIEF_MEMBER_DESC)
3797 )
3798 )
3799 {
3800 ol.startParagraph();
3802 briefLine(),
3803 scopedContainer,
3804 this,
3805 brief,
3806 DocOptions()
3807 .setSingleLine(true));
3808 ol.endParagraph();
3809 }
3810
3811 /* write detailed description */
3812 DString detailed = documentation();
3813 if (!detailed.empty() ||
3814 !inbodyDocumentation().empty())
3815 {
3816 // write vhdl inline code with or without option INLINE_SOURCE
3817 if (optVhdl && VhdlDocGen::isMisc(this))
3818 {
3819 VhdlDocGen::writeSource(this,ol,cname);
3820 return;
3821 }
3822 else
3823 {
3824 ol.generateDoc(docFile(),
3825 docLine(),
3826 scopedContainer,
3827 this,
3828 detailed+"\n",
3829 DocOptions()
3830 .setIndexWords(true));
3831 }
3832
3833 if (!inbodyDocumentation().empty())
3834 {
3836 inbodyLine(),
3837 scopedContainer,
3838 this,
3839 inbodyDocumentation()+"\n",
3840 DocOptions()
3841 .setIndexWords(true));
3842 }
3843 }
3844 else if (!brief.empty() && (Config_getBool(REPEAT_BRIEF) || !Config_getBool(BRIEF_MEMBER_DESC)))
3845 {
3846 if (!inbodyDocumentation().empty())
3847 {
3849 inbodyLine(),
3850 scopedContainer,
3851 this,
3852 inbodyDocumentation()+"\n",
3853 DocOptions()
3854 .setIndexWords(true));
3855 }
3856 }
3857
3858
3859 //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n",
3860 // defArgList,
3861 // defArgList?defArgList->hasDocumentation():-1);
3862 const ArgumentList &docArgList = m_templateMaster ?
3865 ol.generateDoc(docFile(),
3866 docLine(),
3867 scopedContainer,
3868 this, // memberDef
3869 inlineArgListToDoc(docArgList), // docStr
3870 DocOptions()
3871 .setIndexWords(true));
3872
3873 const ArgumentList &docTemplateArgList = m_templateMaster ?
3875 m_tArgList;
3876 ol.generateDoc(docFile(),
3877 docLine(),
3878 scopedContainer,
3879 this, // memberDef
3880 inlineTemplateArgListToDoc(docTemplateArgList), // docStr
3881 DocOptions()
3882 .setIndexWords(true));
3883
3884 _writeEnumValues(ol,scopedContainer,cfname,ciname,cname);
3888 _writeExamples(ol);
3890 DString scopeStr = getScopeString();
3891 writeSourceDef(ol);
3892 writeInlineCode(ol,scopeStr);
3893 if (hasReferencesRelation()) writeSourceRefs(ol,scopeStr);
3894 if (hasReferencedByRelation()) writeSourceReffedBy(ol,scopeStr);
3895 _writeCallGraph(ol);
3898
3899 ol.endIndent();
3900
3901 // enable LaTeX again
3902 //if (Config_getBool(EXTRACT_ALL) && !hasDocs) ol.enable(OutputType::Latex);
3903 ol.popGeneratorState();
3904
3906}
3907
3908// strip scope and field name from the type
3909// example: "struct N<K::J>::S.v.c" will become "struct v"
3911{
3913 if (ts.endsWith("::")) ts = ts.left(ts.length()-2);
3914 static const reg::Ex re1(R"(\a\w*::)"); // non-template version
3915 static const reg::Ex re2(R"(\a\w*<[^>]*>::)"); // template version
3916 reg::Match match;
3917 std::string t = ts.str();
3918 while (reg::search(t,match,re2) || reg::search(t,match,re1))
3919 {
3920 t = match.prefix().str() + match.suffix().str(); // remove the matched part
3921 }
3922 //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),qPrint(t));
3923 return t;
3924}
3925
3927{
3928 DString type = m_type;
3929 if (isTypedef() && getLanguage() != SrcLangExt::Slice) type.prepend("typedef ");
3930 return simplifyTypeForTable(type);
3931}
3932
3934{
3935 Definition *scope = getOuterScope();
3936 DString doxyName = name();
3937 DString doxyArgs = argsString();
3938 DString memAnchor = anchor();
3939 DString cfname = getOutputFileBase();
3940 DString cname;
3941 if (scope) cname = scope->name();
3942 if (doxyName.at(0)=='@')
3943 {
3944 doxyName="__unnamed__";
3945 }
3946
3947 LinkifyTextOptions options;
3948 options.setScope(scope).setFileScope(getBodyDef()).setSelf(this);
3949
3950 if (container && container->definitionType()==Definition::TypeClass &&
3951 !(toClassDef(container))->isJavaEnum())
3952 {
3954 ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
3955 ol.addLabel(cfname,memAnchor);
3956
3957 bool written=false;
3958 const ClassDef *annoClassDef=getClassDefOfAnonymousType();
3959 if (annoClassDef)
3960 {
3961 static const reg::Ex ar(R"([\w@:]*@\d+[\w@:]*)"); // anonymous type marker(s) including scope
3962 reg::Match amatch;
3963 std::string stype = m_type.str();
3964 if (reg::search(stype,amatch,ar))
3965 {
3966 size_t ai = amatch.position();
3967 size_t al = amatch.length();
3968 ol.writeObjectLink(annoClassDef->getReference(),annoClassDef->getOutputFileBase(),
3969 annoClassDef->anchor(),m_type.left(ai)+m_type.mid(ai+al));
3970 written=true;
3971 }
3972 }
3973 if (!written)
3974 {
3975 DString ts;
3976 if (isFunctionPtr())
3977 {
3978 ts = m_type + m_args;
3979 }
3980 else
3981 {
3982 ts = fieldType();
3983 }
3984 linkifyText(TextGeneratorOLImpl(ol),ts,options);
3985 }
3986 ol.endDoxyAnchor(cfname,memAnchor);
3988 }
3989
3991 ol.docify(doxyName);
3992 if (isVariable() && !argsString().empty() && !isObjCMethod() && !isFunctionPtr())
3993 {
3995 }
3996 if (!m_bitfields.empty()) // add bitfields
3997 {
3999 }
4000 if (hasOneLineInitializer() && !isDefine())
4001 {
4002 ol.writeString(" ");
4004 }
4006
4008
4009 DString brief = briefDescription();
4010 DString detailed = documentation();
4011
4012 /* write brief description */
4013 if (!brief.empty())
4014 {
4016 briefLine(),
4017 getOuterScope()?getOuterScope():container,this,
4018 brief,
4019 DocOptions()
4020 .setSingleLine(true));
4021 }
4022
4023 /* write detailed description */
4024 if (!detailed.empty())
4025 {
4026 if (!brief.empty())
4027 {
4029 ol.lineBreak();
4031 }
4032 ol.generateDoc(docFile(),
4033 docLine(),
4034 getOuterScope()?getOuterScope():container,this,
4035 detailed+"\n",
4036 DocOptions());
4037 }
4038
4039 ol.endInlineMemberDoc();
4040}
4041
4043{
4044 if (m_mtype == MemberType::Define)
4045 {
4046 return "macro definition";
4047 }
4048 else if (m_mtype == MemberType::Enumeration)
4049 {
4050 return "enumeration";
4051 }
4052 return to_string_lower(m_mtype);
4053}
4054
4056{
4057 /*
4058 * Removed bug_303020:
4059 * if (m_memberGroup) return;
4060 */
4061 const ClassDef *cd = getClassDef();
4062 const NamespaceDef *nd = getNamespaceDef();
4063 const FileDef *fd = getFileDef();
4064 const GroupDef *gd = getGroupDef();
4065 const Definition *d=nullptr;
4066 DString t;
4067 if (cd)
4068 {
4069 t=cd->compoundTypeString();
4070 d=cd;
4071 }
4072 else if (nd)
4073 {
4074 t=nd->compoundTypeString();
4075 d=nd;
4076 }
4077 else if (gd)
4078 {
4079 t="group";
4080 d=gd;
4081 }
4082 else
4083 {
4084 t="file";
4085 d=fd;
4086 }
4087 bool extractAll = Config_getBool(EXTRACT_ALL);
4088
4089 //printf("%s:warnIfUndoc: hasUserDocs=%d isFriendClass=%d protection=%d isRef=%d isDel=%d\n",
4090 // qPrint(name()),
4091 // hasUserDocumentation(),isFriendClass(),protectionLevelVisible(m_prot),isReference(),isDeleted());
4092 if ((!hasUserDocumentation() && !extractAll) &&
4093 !isFriendClass() &&
4094 name().find('@')==DString::npos && d && d->name().find('@')==DString::npos &&
4097 !isReference() && !isDeleted()
4098 )
4099 {
4100 SrcLangExt lang = getLanguage();
4101 DString sep = getLanguageSpecificSeparator(lang,true);
4102 warn_undoc(getDefFileName(),getDefLine(),"Member {}{} ({}) of {} {} is not documented.",
4104 substitute(d->name(),"::",sep));
4105 }
4106 else if (!hasDetailedDescription())
4107 {
4109 }
4110
4111 // if it is an enum, we check that its members are documented
4112 if (!extractAll && isEnumerate() && Config_getBool(WARN_IF_UNDOC_ENUM_VAL))
4113 {
4114 for (const auto &fmd : enumFieldList())
4115 {
4116 if (!fmd->isLinkableInProject())
4117 {
4118 SrcLangExt lang = getLanguage();
4119 DString sep = getLanguageSpecificSeparator(lang,true);
4120 warn(fmd->getDefFileName(),fmd->getDefLine(), "Documentation for enum member '{}{}{}' is missing.",
4121 qualifiedName(),sep,fmd->name());
4122 }
4123 }
4124 }
4125}
4126
4128{
4129 bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
4130 bool extractStatic = Config_getBool(EXTRACT_STATIC);
4131 return (!isAnonymous() &&
4132 (!hideUndocMembers || hasDocumentation()) &&
4133 (!isStatic() || extractStatic) &&
4134 isLinkable()
4135 );
4136}
4137
4138static DString stripTrailingReturn(const DString &trailRet)
4139{
4140 DString ret = trailRet;
4141
4142 ret = ret.stripWhiteSpace();
4143 if (ret.startsWith("->"))
4144 {
4145 ret = ret.mid(2).stripWhiteSpace();
4146 return ret;
4147 }
4148 return trailRet;
4149}
4150
4152
4153void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const
4154{
4155 //printf("%s:detectUndocumentedParams(%d,%d)\n",qPrint(name()),hasParamCommand,hasReturnCommand);
4156 bool isPython = getLanguage()==SrcLangExt::Python;
4157
4158 // this function is called while parsing the documentation. A member can have multiple
4159 // documentation blocks, which could be handled by multiple threads, hence this guard.
4160 std::lock_guard<std::mutex> lock(g_detectUndocumentedParamsMutex);
4161
4162 if (!m_hasDocumentedParams && hasParamCommand)
4163 {
4164 //printf("%s:hasDocumentedParams=true;\n",qPrint(name()));
4165 m_hasDocumentedParams = true;
4166 }
4167 else if (!m_hasDocumentedParams)
4168 {
4169 const ArgumentList &al = argumentList();
4170 const ArgumentList &declAl = declArgumentList();
4171 bool allDoc=true; // no parameter => all parameters are documented
4172 if ( // member has parameters
4173 al.hasParameters() // with at least one parameter (that is not void)
4174 )
4175 {
4176 // see if all parameters have documentation
4177 for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
4178 {
4179 const Argument &a = *it;
4180 if (!a.name.empty() && a.type!="void" && a.name!="..." &&
4181 !(isPython && (a.name=="self" || a.name=="cls"))
4182 )
4183 {
4184 allDoc = !a.docs.empty();
4185 }
4186 //printf("a.type=%s a.name=%s doc=%s\n",
4187 // qPrint(a.type),qPrint(a.name),qPrint(a.docs));
4188 }
4189 if (!allDoc && declAl.empty()) // try declaration arguments as well
4190 {
4191 allDoc=true;
4192 for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
4193 {
4194 const Argument &a = *it;
4195 if (!a.name.empty() && a.type!="void" && a.name!="..." &&
4196 !(isPython && (a.name=="self" || a.name=="cls"))
4197 )
4198 {
4199 allDoc = !a.docs.empty();
4200 }
4201 //printf("a.name=%s doc=%s\n",qPrint(a.name),qPrint(a.docs));
4202 }
4203 }
4204 }
4205 if (allDoc)
4206 {
4207 //printf("%s:hasDocumentedParams=true;\n",qPrint(name()));
4208 m_hasDocumentedParams = true;
4209 }
4210 }
4211
4212 //printf("Member %s hasDocumentedReturnType=%d hasReturnCommand=%d\n",
4213 // qPrint(name()),m_hasDocumentedReturnType,hasReturnCommand);
4215}
4216
4218{
4219 DString returnType = typeString();
4220 bool isFortran = getLanguage()==SrcLangExt::Fortran;
4221 bool isFortranSubroutine = isFortran && returnType.find("subroutine")!=DString::npos;
4222
4223 bool isVoidReturn = returnType=="void" || returnType.endsWith(" void");
4224 if (!isVoidReturn && (returnType=="auto" || returnType.endsWith(" auto")))
4225 {
4227 if (!defArgList.trailingReturnType().empty())
4228 {
4229 DString strippedTrailingReturn = stripTrailingReturn(defArgList.trailingReturnType());
4230 isVoidReturn = (strippedTrailingReturn=="void") || (strippedTrailingReturn.endsWith(" void"));
4231 }
4232 }
4233 if (!Config_getBool(EXTRACT_ALL) &&
4234 Config_getBool(WARN_IF_UNDOCUMENTED) &&
4235 Config_getBool(WARN_NO_PARAMDOC) &&
4236 isFunction() &&
4237 !isDeleted() &&
4238 !isReference() &&
4240 {
4242 {
4244 "parameters of member {} are not documented",
4245 qualifiedName());
4246 }
4248 hasDocumentation() && !returnType.empty() &&
4249 !( // not one of the cases where nothing is returned
4250 isVoidReturn || // void return type
4251 isFortranSubroutine || // fortran subroutine
4252 isConstructor() || // a constructor
4253 isDestructor() || // or a destructor
4254 isFriend() // or a friend
4255 )
4256 )
4257 {
4259 "return type of member {} is not documented",
4260 qualifiedName());
4261 }
4262 }
4263 if (Config_getBool(WARN_IF_DOC_ERROR) &&
4265 (isVoidReturn || // void return type
4266 isFortranSubroutine || // fortran subroutine
4267 isConstructor() || // a constructor
4268 isDestructor())) // or destructor
4269 {
4270 warn_doc_error(docFile(),docLine(),"found documented return type for {} that does not return anything",
4271 qualifiedName());
4272 }
4273}
4274
4276{
4277 ClassDef *fcd=nullptr;
4278 DString baseName=name();
4279 if (size_t i=baseName.find('<'); i!=DString::npos) baseName=baseName.left(i);
4280 return (isFriendClass() &&
4281 (fcd=getClass(baseName)) && fcd->isLinkable());
4282}
4283
4285{
4286 return m_defArgList.isDeleted();
4287}
4288
4290{
4292 (m_mtype==MemberType::Enumeration && m_docEnumValues) || // has enum values
4293 (m_defArgList.hasDocumentation()|| m_tArgList.hasTemplateDocumentation()); // has doc (template) arguments
4294}
4295
4296
4301
4303{
4304 DString result;
4305 if (isStrong()) result=name();
4306 else if (getClassDef()) result=getClassDef()->displayName();
4307 else if (getNamespaceDef()) result=getNamespaceDef()->displayName();
4308 return result;
4309}
4310
4312{
4313 DString memAnchor = name();
4314 if (!m_args.empty()) memAnchor+=m_args;
4315 if (m_memSpec.isAlias()) // this is for backward compatibility
4316 {
4317 memAnchor.prepend(" = "+m_initializer);
4318 }
4319 memAnchor.prepend(definition()); // actually the method name is now included
4320 // twice, which is silly, but we keep it this way for backward
4321 // compatibility.
4322
4323 // include number of template arguments as well,
4324 // to distinguish between two template
4325 // specializations that only differ in the template parameters.
4327 {
4328 char buf[20];
4329 snprintf(buf,20,"%d:",static_cast<int>(m_tArgList.size()));
4330 buf[19]='\0';
4331 memAnchor.prepend(buf);
4332 }
4333 if (!m_requiresClause.empty())
4334 {
4335 memAnchor+=" "+m_requiresClause;
4336 }
4337 if (m_redefineCount>0)
4338 {
4339 char buf[20];
4340 snprintf(buf,20,":%d",m_redefineCount);
4341 buf[19]='\0';
4342 memAnchor.append(buf);
4343 }
4344
4345 // convert to md5 hash
4346 m_anc = "a"+md5str(memAnchor.view());
4347}
4348
4350 const DString &fileName,int startLine,
4351 bool hasDocs,MemberDef *member)
4352{
4353 //printf("%s MemberDefImpl::setGroupDef(%s)\n",qPrint(name()),qPrint(gd->name()));
4354 m_group=gd;
4355 m_grouppri=pri;
4356 m_groupFileName=fileName;
4357 m_groupStartLine=startLine;
4358 m_groupHasDocs=hasDocs;
4359 m_groupMember=member;
4361}
4362
4377
4385
4387{
4388 m_nspace=nd;
4389 setOuterScope(nd);
4390}
4391
4393 const ArgumentList &formalArgs,const std::unique_ptr<ArgumentList> &actualArgs) const
4394{
4395 //printf(" Member %s %s %s\n",qPrint(typeString()),qPrint(name()),qPrint(argsString()));
4396 std::unique_ptr<ArgumentList> actualArgList = std::make_unique<ArgumentList>(m_defArgList);
4397 if (!m_defArgList.empty())
4398 {
4399 // replace formal arguments with actuals
4400 for (Argument &arg : *actualArgList)
4401 {
4402 arg.type = substituteTemplateArgumentsInString(arg.type,formalArgs,actualArgs.get());
4403 }
4404 actualArgList->setTrailingReturnType(
4405 substituteTemplateArgumentsInString(actualArgList->trailingReturnType(),formalArgs,actualArgs.get()));
4406 }
4407
4408 DString methodName=name();
4409 if (methodName.startsWith("operator ")) // conversion operator
4410 {
4411 methodName=substituteTemplateArgumentsInString(methodName,formalArgs,actualArgs.get());
4412 }
4413
4414 auto imd = createMemberDef(
4416 substituteTemplateArgumentsInString(m_type,formalArgs,actualArgs.get()),
4417 methodName,
4418 substituteTemplateArgumentsInString(m_args,formalArgs,actualArgs.get()),
4421 ArgumentList(), ArgumentList(), ""
4422 );
4423 auto mmd = toMemberDefMutable(imd.get());
4424 mmd->moveArgumentList(std::move(actualArgList));
4425 mmd->setDefinition(substituteTemplateArgumentsInString(m_def,formalArgs,actualArgs.get()));
4426 mmd->setBodyDef(getBodyDef());
4427 mmd->setBodySegment(getDefLine(),getStartBodyLine(),getEndBodyLine());
4428 mmd->setFormalTemplateArguments(formalArgs);
4429
4430 // TODO: init other member variables (if needed).
4431 // TODO: reimplemented info
4432 return imd;
4433}
4434
4436{
4437 //printf("%s: init=%s, initLines=%d maxInitLines=%d userInitLines=%d\n",
4438 // qPrint(name()),qPrint(m_initializer),m_initLines,
4439 // m_maxInitLines,m_userInitLines);
4440 bool isFuncLikeMacro = m_mtype==MemberType::Define && m_defArgList.hasParameters();
4441 return !m_initializer.empty() && m_initLines==0 && // one line initializer
4442 !isFuncLikeMacro &&
4443 ((m_maxInitLines>0 && m_userInitLines==-1) || m_userInitLines>0); // enabled by default or explicitly
4444}
4445
4447{
4448 //printf("initLines=%d userInitLines=%d maxInitLines=%d\n",
4449 // initLines,userInitLines,maxInitLines);
4450 bool isFuncLikeMacro = m_mtype==MemberType::Define && m_defArgList.hasParameters();
4451 return (m_initLines>0 || (!m_initializer.empty() && isFuncLikeMacro)) &&
4452 ((m_initLines<m_maxInitLines && m_userInitLines==-1) // implicitly enabled
4453 || m_initLines<m_userInitLines // explicitly enabled
4454 );
4455}
4456
4458{
4459 size_t indent=0;
4461 int l=static_cast<int>(m_initializer.length());
4462 int p=l-1;
4463 while (p>=0 && isspace(static_cast<uint8_t>(m_initializer.at(p)))) p--;
4467
4468 //printf("%s::setInitializer(%s)\n",qPrint(name()),qPrint(m_initializer));
4469}
4470
4472{
4473 bool optimizeOutputForC = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
4474 SrcLangExt lang = getLanguage();
4475 if (!isLinkableInProject()) return;
4476 DString memLabel;
4477 if (optimizeOutputForC)
4478 {
4479 memLabel=theTranslator->trGlobal(true,true);
4480 }
4481 else if (lang==SrcLangExt::Fortran)
4482 {
4483 memLabel=theTranslator->trSubprogram(true,true);
4484 }
4485 else
4486 {
4487 memLabel=theTranslator->trMember(true,true);
4488 }
4489 DString memName = name();
4492 (toClassDef(pd))->displayName() : pd->name();
4493 DString sep = getLanguageSpecificSeparator(lang,true);
4494 DString memArgs;
4495 if (!isRelated())
4496 {
4497 if (isObjCMethod())
4498 {
4499 memName = "[" + pd->name() + " " + name() + "]";
4500 }
4501 else
4502 {
4503 if (pd!=Doxygen::globalScope) memName.prepend(pdName+sep);
4504 memArgs = argsString();
4505 }
4506 }
4507 const RefItemVector &xrefItems = xrefListItems();
4508 if (sep!="::")
4509 {
4510 memName = substitute(memName,"::",sep);
4511 }
4512 addRefItem(xrefItems,
4513 qualifiedName()+argsString(), // argsString is needed for overloaded functions (see bug 609624)
4514 memLabel,
4515 getOutputFileBase()+"#"+anchor(),memName,memArgs,pd);
4516}
4517
4522
4524{
4525 auto it = m_sectionMap.find(container);
4526 return it!=m_sectionMap.end() ? it->second : nullptr;
4527}
4528
4530{
4531 //printf("MemberDefImpl::setSectionList(%s,%p) name=%s\n",qPrint(d->name()),sl,qPrint(name()));
4532 m_sectionMap.emplace(container,sl);
4533}
4534
4536{
4537 if (count>25)
4538 {
4540 "Internal inconsistency: recursion detected in overload relation for member {}!",name());
4541 return Specifier::Normal;
4542 }
4543 Specifier v = m_virt;
4544 const MemberDef *rmd = reimplements();
4545 while (rmd && v==Specifier::Normal)
4546 {
4547 v = rmd->virtualness(count+1)==Specifier::Normal ? Specifier::Normal : Specifier::Virtual;
4548 rmd = rmd->reimplements();
4549 }
4550 return v;
4551}
4552
4553void MemberDefImpl::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers) const
4554{
4555 if (!isLinkableInProject()) return;
4556 if (!showNamespaceMembers && getNamespaceDef()) return;
4557 tagFile << " <member kind=\"";
4558 if (m_mtype == MemberType::Enumeration)
4559 {
4560 tagFile << "enumeration";
4561 }
4562 else
4563 {
4564 tagFile << to_string_lower(m_mtype);
4565 }
4566 if (m_prot!=Protection::Public)
4567 {
4568 tagFile << "\" protection=\"";
4569 if (m_prot==Protection::Protected) tagFile << "protected";
4570 else if (m_prot==Protection::Package) tagFile << "package";
4571 else /* Private */ tagFile << "private";
4572 }
4573 if (m_virt!=Specifier::Normal)
4574 {
4575 tagFile << "\" virtualness=\"";
4576 if (m_virt==Specifier::Virtual) tagFile << "virtual";
4577 else /* Pure */ tagFile << "pure";
4578 }
4579 if (isStatic())
4580 {
4581 tagFile << "\" static=\"yes";
4582 }
4583 tagFile << "\">\n";
4584 if (typeString()!=DString("@"))
4585 {
4586 tagFile << " <type>" << convertToXML(typeString()) << "</type>\n";
4587 }
4590 tagFile << " <name>" << convertToXML(useQualifiedName ? qualifiedName() : name()) << "</name>\n";
4591 tagFile << " <anchorfile>" << convertToXML(fn) << "</anchorfile>\n";
4592 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
4593 DString idStr = id();
4594 if (!idStr.empty())
4595 {
4596 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
4597 }
4598 tagFile << " <arglist>" << convertToXML(argsString()) << "</arglist>\n";
4599 if (isStrong())
4600 {
4601 for (const auto &fmd : m_enumFields)
4602 {
4603 if (!fmd->isReference())
4604 {
4605 tagFile << " <enumvalue file=\"" << convertToXML(fn);
4606 tagFile << "\" anchor=\"" << convertToXML(fmd->anchor());
4607 idStr = fmd->id();
4608 if (!idStr.empty())
4609 {
4610 tagFile << "\" clangid=\"" << convertToXML(idStr);
4611 }
4612 tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>\n";
4613 }
4614 }
4615 }
4616 writeDocAnchorsToTagFile(tagFile);
4617 tagFile << " </member>\n";
4618}
4619
4621{
4622 m_isConstructorCached=1; // false
4623 if (getClassDef())
4624 {
4625 if (m_isDMember) // for D
4626 {
4627 m_isConstructorCached = name()=="this" ? 2 : 1;
4628 return;
4629 }
4630 else if (getLanguage()==SrcLangExt::PHP) // for PHP
4631 {
4632 m_isConstructorCached = name()=="__construct" ? 2 : 1;
4633 return;
4634 }
4635 else if (name()=="__init__" &&
4636 getLanguage()==SrcLangExt::Python) // for Python
4637 {
4638 m_isConstructorCached = 2; // true
4639 return;
4640 }
4641 else // for other languages
4642 {
4643 DString locName = getClassDef()->localName();
4644 size_t i=locName.find('<');
4645 if (i==DString::npos) // not a template class
4646 {
4647 m_isConstructorCached = name()==locName ? 2 : 1;
4648 }
4649 else
4650 {
4651 m_isConstructorCached = name()==locName.left(i) ? 2 : 1;
4652 }
4653 return;
4654 }
4655 }
4656}
4657
4659{
4660 if (m_isConstructorCached==0)
4661 {
4662 MemberDefImpl *that = const_cast<MemberDefImpl*>(this);
4663 that->_computeIsConstructor();
4664 }
4666 return m_isConstructorCached==2;
4667
4668}
4669
4671{
4672 bool isDestructor = false;
4673 if (m_isDMember) // for D
4674 {
4675 isDestructor = name()=="~this";
4676 }
4677 else if (getLanguage()==SrcLangExt::PHP) // for PHP
4678 {
4679 isDestructor = name()=="__destruct";
4680 }
4681 else if (name()=="__del__" &&
4682 getLanguage()==SrcLangExt::Python) // for Python
4683 {
4684 isDestructor = true;
4685 }
4686 else if (getLanguage()==SrcLangExt::Fortran) // for Fortran
4687 {
4688 isDestructor = typeString()=="final";
4689 }
4690 else // other languages
4691 {
4692 isDestructor =
4693 (name().find('~')!=DString::npos || name().find('!')!=DString::npos) // The ! is for C++/CLI
4694 && name().find("operator")==DString::npos;
4695 }
4697}
4698
4700{
4701 if (m_isDestructorCached==0)
4702 {
4703 MemberDefImpl *that=const_cast<MemberDefImpl*>(this);
4704 that->_computeIsDestructor();
4705 }
4707 return m_isDestructorCached==2;
4708}
4709
4711 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod) const
4712{
4713 int enumMemCount=0;
4714
4715 uint32_t numVisibleEnumValues=0;
4716 for (const auto &fmd : m_enumFields)
4717 {
4718 if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
4719 }
4720 if (numVisibleEnumValues==0 && !isBriefSectionVisible())
4721 {
4722 return;
4723 }
4724
4725 DString n = name();
4726 if (size_t i=n.rfind("::"); i!=DString::npos) n=n.mid(i+2); // strip scope (TODO: is this needed?)
4727 if (n[0]!='@') // not an anonymous enum
4728 {
4730 {
4731 //_writeTagData(compoundType);
4732 writeLink(typeDecl,cd,nd,fd,gd,mod);
4733 }
4734 else
4735 {
4736 typeDecl.startBold();
4737 typeDecl.docify(n);
4738 typeDecl.endBold();
4739 }
4740 typeDecl.writeChar(' ');
4741 }
4742 if (!m_enumBaseType.empty())
4743 {
4744 typeDecl.writeChar(':');
4745 typeDecl.writeChar(' ');
4746 typeDecl.docify(m_enumBaseType);
4747 typeDecl.writeChar(' ');
4748 }
4749
4750 uint32_t enumValuesPerLine = static_cast<uint32_t>(Config_getInt(ENUM_VALUES_PER_LINE));
4751 if (numVisibleEnumValues>0 && enumValuesPerLine>0)
4752 {
4753 typeDecl.docify("{ ");
4754
4755 auto it = m_enumFields.begin();
4756 if (it!=m_enumFields.end())
4757 {
4758 const MemberDef *fmd=*it;
4759 bool fmdVisible = fmd->isBriefSectionVisible();
4760 bool first=true;
4761 while (fmd)
4762 {
4763 if (fmdVisible)
4764 {
4765 if (!first)
4766 {
4767 typeDecl.writeString(", ");
4768 }
4769 /* in html we start a new line after a number of items */
4770 if (numVisibleEnumValues>enumValuesPerLine
4771 && (enumMemCount%enumValuesPerLine)==0
4772 )
4773 {
4774 typeDecl.pushGeneratorState();
4776 typeDecl.enable(OutputType::Latex);
4777 typeDecl.enable(OutputType::Docbook);
4778 typeDecl.lineBreak();
4779 typeDecl.disable(OutputType::Latex);
4780 typeDecl.disable(OutputType::Docbook);
4781 typeDecl.writeString("&#160;&#160;");
4782 typeDecl.popGeneratorState();
4783 }
4784
4785 if (fmd->hasDocumentation()) // enum value has docs
4786 {
4787 fmd->writeLink(typeDecl,cd,nd,fd,gd,mod);
4788 }
4789 else // no docs for this enum value
4790 {
4791 typeDecl.startBold();
4792 typeDecl.docify(fmd->name());
4793 typeDecl.endBold();
4794 }
4795 if (fmd->hasOneLineInitializer()) // enum value has initializer
4796 {
4797 //typeDecl.writeString(" = ");
4798 typeDecl.writeString(" ");
4799 typeDecl.parseText(fmd->initializer());
4800 }
4801 first=false;
4802 }
4803
4804 bool prevVisible = fmdVisible;
4805 ++it;
4806 if (it!=m_enumFields.end())
4807 {
4808 fmd=*it;
4809 }
4810 else
4811 {
4812 fmd=nullptr;
4813 }
4814 if (prevVisible)
4815 {
4816 typeDecl.disable(OutputType::Man);
4817 typeDecl.writeString("\n"); // to prevent too long lines in LaTeX
4818 typeDecl.enable(OutputType::Man);
4819 enumMemCount++;
4820 }
4821 }
4822 if (numVisibleEnumValues>enumValuesPerLine)
4823 {
4824 typeDecl.pushGeneratorState();
4826 typeDecl.lineBreak();
4827 typeDecl.popGeneratorState();
4828 }
4829 }
4830 typeDecl.docify(" }");
4831 }
4832}
4833
4834void MemberDefImpl::moveArgumentList(std::unique_ptr<ArgumentList> al)
4835{
4836 m_defArgList = *al;
4837}
4838
4839void MemberDefImpl::moveDeclArgumentList(std::unique_ptr<ArgumentList> al)
4840{
4841 m_declArgList = *al;
4842}
4843
4848
4850{
4851 m_type = t;
4852}
4853
4860
4862{
4864 if (e) Doxygen::parseSourcesNeeded = true;
4865}
4866
4868{
4870 if (e) Doxygen::parseSourcesNeeded = true;
4871}
4872
4878
4884
4889
4894
4896{
4897 if (getClassDef() && getClassDef()->isObjectiveC() && isFunction()) return true;
4898 return false;
4899}
4900
4902{
4903 if (getClassDef() && getClassDef()->isObjectiveC() && isProperty()) return true;
4904 return false;
4905}
4906
4908{
4909 if (getClassDef() && getClassDef()->isCSharp() && isProperty()) return true;
4910 return false;
4911}
4912
4914{
4915 if (isObjCMethod())
4916 {
4917 DString qm;
4918 if (isStatic()) qm="+"; else qm="-";
4919 qm+="[";
4920 qm+=getClassDef()->name()+" ";
4921 qm+=name();
4922 qm+="]";
4923 return qm;
4924 }
4925 else if (m_enumScope && m_enumScope->isStrong())
4926 {
4927 return m_enumScope->qualifiedName()+
4929 localName();
4930 }
4931 else
4932 {
4934 }
4935}
4936
4938{
4939 if (ti)
4940 {
4941 //printf("%s: Setting tag name=%s anchor=%s\n",qPrint(name()),qPrint(ti->tagName),qPrint(ti->anchor));
4942 m_anc=ti->anchor;
4943 setReference(ti->tagName);
4945 }
4946}
4947
4948DString MemberDefImpl::objCMethodName(bool localLink,bool showStatic) const
4949{
4950 DString qm;
4951 if (showStatic)
4952 {
4953 if (isStatic()) qm="+ "; else qm="- ";
4954 }
4955 qm+=name();
4956 if (!localLink) // link to method of same class
4957 {
4958 qm+=" (";
4959 qm+=getClassDef()->name();
4960 qm+=")";
4961 }
4962 return qm;
4963}
4964
4966{
4967 return m_decl;
4968}
4969
4971{
4972 return m_def;
4973}
4974
4979
4981{
4982 return m_type;
4983}
4984
4986{
4987 return m_args;
4988}
4989
4991{
4992 return m_exception;
4993}
4994
4996{
4997 return m_bitfields;
4998}
4999
5001{
5002 return m_initializer;
5003}
5004
5006{
5007 return m_initLines;
5008}
5009
5011{
5012 return m_docTransferDone;
5013}
5014
5019
5024
5026{
5027 return m_classDef;
5028}
5029
5034
5039
5041{
5042 return m_fileDef;
5043}
5044
5046{
5047 return m_fileDef;
5048}
5049
5051{
5052 return m_nspace;
5053}
5054
5059
5061{
5062 return m_read;
5063}
5064
5066{
5067 return m_write;
5068}
5069
5071{
5072 return m_group;
5073}
5074
5076{
5077 return m_group;
5078}
5079
5081{
5082 return m_moduleDef;
5083}
5084
5089
5094
5096{
5097 return m_groupStartLine;
5098}
5099
5101{
5102 return m_groupHasDocs;
5103}
5104
5106{
5107 return m_prot;
5108}
5109
5111{
5112 return m_mtype;
5113}
5114
5116{
5117 return m_mtype==MemberType::Signal;
5118}
5119
5121{
5122 return m_mtype==MemberType::Slot;
5123}
5124
5126{
5127 return m_mtype==MemberType::Variable;
5128}
5129
5131{
5132 return m_mtype==MemberType::Enumeration;
5133}
5134
5136{
5137 return m_mtype==MemberType::EnumValue;
5138}
5139
5141{
5142 return m_mtype==MemberType::Typedef;
5143}
5144
5146{
5147 return m_mtype==MemberType::Sequence;
5148}
5149
5151{
5152 return m_mtype==MemberType::Dictionary;
5153}
5154
5156{
5157 return m_mtype==MemberType::Function;
5158}
5159
5161{
5162 return m_mtype==MemberType::Variable &&
5163 DString(argsString()).find(")(")!=DString::npos;
5164}
5165
5167{
5168 return m_mtype==MemberType::Define;
5169}
5170
5172{
5173 return m_mtype==MemberType::Friend;
5174}
5175
5177{
5178 return m_mtype==MemberType::DCOP;
5179}
5180
5182{
5183 return m_mtype==MemberType::Property;
5184}
5185
5187{
5188 return m_mtype==MemberType::Event;
5189}
5190
5192{
5193 return m_related == Relationship::Related;
5194}
5195
5197{
5198 return m_related == Relationship::Foreign;
5199}
5200
5202{
5203 return m_stat;
5204}
5205
5207{
5208 return m_memSpec.isInline();
5209}
5210
5212{
5213 return m_memSpec.isExplicit();
5214}
5215
5217{
5218 return m_memSpec.isMutable();
5219}
5220
5222{
5223 return m_memSpec.isThreadLocal();
5224}
5225
5227{
5228 return m_memSpec.isGettable();
5229}
5230
5232{
5233 return m_memSpec.isPrivateGettable();
5234}
5235
5237{
5238 return m_memSpec.isProtectedGettable();
5239}
5240
5242{
5243 return m_memSpec.isSettable();
5244}
5245
5247{
5248 return m_memSpec.isPrivateSettable();
5249}
5250
5252{
5253 return m_memSpec.isProtectedSettable();
5254}
5255
5257{
5258 return m_memSpec.isAddable();
5259}
5260
5262{
5263 return m_memSpec.isRemovable();
5264}
5265
5267{
5268 return m_memSpec.isRaisable();
5269}
5270
5272{
5273 return m_memSpec.isReadable();
5274}
5275
5277{
5278 return m_memSpec.isWritable();
5279}
5280
5282{
5283 return m_memSpec.isFinal();
5284}
5285
5287{
5288 return m_memSpec.isNew();
5289}
5290
5292{
5293 return m_memSpec.isSealed();
5294}
5295
5297{
5298 return m_memSpec.isOverride();
5299}
5300
5302{
5303 return m_memSpec.isInitonly();
5304}
5305
5307{
5308 return m_memSpec.isAbstract();
5309}
5310
5312{
5313 return m_memSpec.isOptional();
5314}
5315
5317{
5318 return m_memSpec.isRequired();
5319}
5320
5322{
5323 return m_memSpec.isNonAtomic();
5324}
5325
5327{
5328 return m_memSpec.isCopy();
5329}
5330
5332{
5333 return m_memSpec.isAssign();
5334}
5335
5337{
5338 return m_memSpec.isRetain();
5339}
5340
5342{
5343 return m_memSpec.isWeak();
5344}
5345
5347{
5348 return m_memSpec.isStrong();
5349}
5350
5352{
5353 return m_memSpec.isEnumStruct();
5354}
5355
5357{
5358 return m_mtype==MemberType::EnumValue &&
5359 m_enumScope &&
5361}
5362
5364{
5365 return m_memSpec.isUnretained();
5366}
5367
5369{
5370 return m_memSpec.isAlias();
5371}
5372
5374{
5375 return m_memSpec.isDefault();
5376}
5377
5379{
5380 return m_memSpec.isDelete();
5381}
5382
5384{
5385 return m_memSpec.isNoExcept();
5386}
5387
5389{
5390 return m_memSpec.isAttribute();
5391}
5392
5394{
5395 return m_memSpec.isProperty();
5396}
5397
5399{
5400 return m_memSpec.isReadonly();
5401}
5402
5404{
5405 return m_memSpec.isBound();
5406}
5407
5409{
5410 return m_memSpec.isConstrained();
5411}
5412
5414{
5415 return m_memSpec.isTransient();
5416}
5417
5419{
5420 return m_memSpec.isMaybeVoid();
5421}
5422
5424{
5425 return m_memSpec.isMaybeDefault();
5426}
5427
5429{
5430 return m_memSpec.isMaybeAmbiguous();
5431}
5432
5434{
5435 return m_memSpec.isPublished();
5436}
5437
5438
5440{
5441 return m_implOnly;
5442}
5443
5445{
5446 return m_explExt;
5447}
5448
5450{
5451 return m_tspec;
5452}
5453
5455{
5456 return isFunction() ||
5457 isSlot() ||
5458 isSignal() ||
5459 isConstructor() ||
5460 isDestructor() ||
5461 isObjCMethod() ||
5462 isFriend();
5463}
5464
5466{
5467 return m_relatedAlso;
5468}
5469
5471{
5472 return m_docEnumValues;
5473}
5474
5476{
5477 return m_annEnumType;
5478}
5479
5481{
5482 return m_docsForDefinition;
5483}
5484
5486{
5487 return m_enumScope;
5488}
5489
5491{
5492 return m_livesInsideEnum;
5493}
5494
5496{
5497 return m_memSpec.isLocal();
5498}
5499
5501{
5502 return m_memSpec.isNoDiscard();
5503}
5504
5506{
5507 return m_memSpec.isConstExpr();
5508}
5509
5511{
5512 return m_memSpec.isConstEval();
5513}
5514
5516{
5517 return m_memSpec.isConstInit();
5518}
5519
5521{
5522 return m_enumFields;
5523}
5524
5526{
5527 return m_examples;
5528}
5529
5531{
5532 return m_proto;
5533}
5534
5536{
5537 return m_defArgList;
5538}
5539
5541{
5542 return m_declArgList;
5543}
5544
5546{
5547 ArgumentList &decAl = m_declArgList;
5548 ArgumentList &defAl = m_defArgList;
5549 const ArgumentList &decAlSrc = md->declArgumentList();
5550 const ArgumentList &defAlSrc = md->argumentList();
5551 auto decSrc = decAlSrc.begin(), defSrc = defAlSrc.begin();
5552 for (auto decIt = decAl.begin(), defIt = defAl.begin();
5553 decIt != decAl.end() && defIt != defAl.end() && decSrc != decAlSrc.end() && defSrc != defAlSrc.end();
5554 ++decIt, ++defIt, ++decSrc, ++defSrc++)
5555 {
5556 Argument &decA = *decIt;
5557 Argument &defA = *defIt;
5558 const Argument &decAS = *decSrc;
5559 const Argument &defAS = *defSrc;
5560 if (decA.name.empty())
5561 {
5562 if (!defA.name.empty())
5563 {
5564 decA.name = defA.name;
5565 }
5566 else if (!decAS.name.empty())
5567 {
5568 decA.name = decAS.name;
5569 }
5570 else if (!defAS.name.empty())
5571 {
5572 decA.name = defAS.name;
5573 }
5574 }
5575 if (defA.name.empty())
5576 {
5577 if (!decA.name.empty())
5578 {
5579 defA.name = decA.name;
5580 }
5581 else if (!decAS.name.empty())
5582 {
5583 defA.name = decAS.name;
5584 }
5585 else if (!defAS.name.empty())
5586 {
5587 defA.name = defAS.name;
5588 }
5589 }
5590 }
5591}
5592
5594{
5595 return m_tArgList;
5596}
5597
5602
5604{
5605 return m_grpId;
5606}
5607
5612
5614{
5615 return m_hasCallGraph;
5616}
5617
5619{
5620 bool enabled = m_hasCallGraph &&
5621 (isFunction() || isSlot() || isSignal()) &&
5622 Config_getBool(HAVE_DOT);
5623 if (enabled)
5624 {
5625 bool trivial = DotCallGraph::isTrivial(this,false);
5626 return !trivial;
5627 }
5628 return false;
5629}
5630
5632{
5633 return m_hasCallerGraph;
5634}
5635
5637{
5638 bool enabled = m_hasCallerGraph &&
5639 (isFunction() || isSlot() || isSignal()) &&
5640 Config_getBool(HAVE_DOT);
5641 if (enabled)
5642 {
5643 bool trivial = DotCallGraph::isTrivial(this,true);
5644 return !trivial;
5645 }
5646 return false;
5647}
5648
5653
5658
5660{
5661 return m_hasInlineSource;
5662}
5663
5665{
5666 return m_hasEnumValues;
5667}
5668
5670{
5671 return m_templateMaster;
5672}
5673
5674std::optional<ArgumentList> MemberDefImpl::formalTemplateArguments() const
5675{
5677}
5678
5680{
5681 return m_isTypedefValCached;
5682}
5683
5688
5693
5695{
5696 //printf("MemberDefImpl::getCachedResolvedTypedef()=%s\n",qPrint(m_cachedResolvedType));
5697 return m_cachedResolvedType;
5698}
5699
5701{
5702 return m_memDef;
5703}
5704
5706{
5707 return m_memDec;
5708}
5709
5711{
5712 return m_docProvider;
5713}
5714
5716{
5717 return m_groupAlias;
5718}
5719
5724
5726{
5727 return m_declLine;
5728}
5729
5731{
5732 return m_declColumn;
5733}
5734
5735
5736//----------------------------------------------
5737
5743
5745{
5746 m_def=d;
5747}
5748
5756
5758{
5759 m_moduleDef=mod;
5760}
5761
5767
5772
5777
5782
5787
5789{
5790 for (const auto &sx : qualifiers)
5791 {
5792 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5793 if (!alreadyAdded)
5794 {
5795 m_qualifiers.push_back(sx);
5796 }
5797 }
5798}
5799
5804
5806{
5807 if (lines!=-1)
5808 {
5809 m_userInitLines=lines;
5810 }
5811}
5812
5814{
5815 m_read=r;
5816}
5817
5819{
5820 m_write=w;
5821}
5822
5824{
5825 m_tspec=b;
5826}
5827
5829{
5830 m_related = Relationship::Related;
5832}
5833
5835{
5836 m_related = Relationship::Foreign;
5838}
5839
5841{
5842 m_docProvider = md;
5843}
5844
5846{
5847 m_args = as;
5848}
5849
5854
5861
5863{
5864 m_docEnumValues=value;
5865}
5866
5868{
5869 m_annEnumType = md;
5870}
5871
5872void MemberDefImpl::setPrototype(bool p,const DString &df,int line,int column)
5873{
5874 m_proto=p;
5875 if (p)
5876 {
5877 setDeclFile(df,line,column);
5878 }
5879 else
5880 {
5881 setDefFile(df,line,column);
5882 }
5883}
5884
5885void MemberDefImpl::setExplicitExternal(bool b,const DString &df,int line,int column)
5886{
5887 m_explExt=b;
5888 if (b)
5889 {
5890 setDeclFile(df,line,column);
5891 }
5892 else
5893 {
5894 setDefFile(df,line,column);
5895 }
5896}
5897
5898void MemberDefImpl::setDeclFile(const DString &df,int line,int column)
5899{
5900 m_declFileName = df;
5901 m_declLine = line;
5902 m_declColumn = column;
5903}
5904
5906{
5907 m_grpId=id;
5908}
5909
5914
5920
5925
5930
5932{
5933 m_groupAlias = md;
5934}
5935
5940
5945
5950
5952{
5953 return m_category;
5954}
5955
5957{
5958 m_category = def;
5959}
5960
5962{
5963 return m_categoryRelation;
5964}
5965
5970
5972{
5973 m_enumBaseType = type;
5974}
5975
5977{
5978 return m_enumBaseType;
5979}
5980
5982{
5983 m_requiresClause = req;
5984}
5985
5990
5991void MemberDefImpl::cacheTypedefVal(const ClassDef*val, const DString & templSpec, const DString &resolvedType)
5992{
5995 m_cachedTypedefTemplSpec=templSpec;
5996 m_cachedResolvedType=resolvedType;
5997 //printf("MemberDefImpl::cacheTypedefVal=%s m_impl=%p\n",qPrint(m_cachedResolvedType),m_impl);
5998}
5999
6001{
6002 {
6003 const ArgumentList &srcAl = bmd->argumentList();
6004 ArgumentList &dstAl = m_defArgList;
6005 auto srcIt = srcAl.begin();
6006 auto dstIt = dstAl.begin();
6007 while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
6008 {
6009 Argument &argDst = *dstIt;
6010 const Argument &argSrc = *srcIt;
6011 if (!argSrc.name.empty())
6012 {
6013 argDst.name = argSrc.name;
6014 }
6015 argDst.docs = argSrc.docs;
6016 ++srcIt;
6017 ++dstIt;
6018 }
6019 }
6020
6021 {
6022 const ArgumentList &srcAl = bmd->declArgumentList();
6023 ArgumentList &dstAl = m_declArgList;
6024 auto srcIt = srcAl.begin();
6025 auto dstIt = dstAl.begin();
6026
6027 while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
6028 {
6029 Argument &argDst = *dstIt;
6030 const Argument &argSrc = *srcIt;
6031 if (!argSrc.name.empty())
6032 {
6033 argDst.name = argSrc.name;
6034 }
6035 argDst.docs = argSrc.docs;
6036 ++srcIt;
6037 ++dstIt;
6038 }
6039 }
6040}
6041
6043{
6044 for (Argument &a : al)
6045 {
6046 a.canType.clear();
6047 }
6048}
6049
6055
6060
6062{
6063 return m_numberOfFlowKW;
6064}
6065
6066//----------------
6067
6069{
6070 return DefinitionMixin::name();
6071}
6072
6073//----------------
6074
6076{
6077 for (auto decIt = decAl.begin(), defIt = defAl.begin();
6078 decIt!= decAl.end() && defIt!= defAl.end();
6079 ++decIt, ++defIt)
6080 {
6081 Argument &decA = *decIt;
6082 Argument &defA = *defIt;
6083 if (decA.docs.empty() && !defA.docs.empty())
6084 {
6085 decA.docs = defA.docs;
6086 }
6087 else if (defA.docs.empty() && !decA.docs.empty())
6088 {
6089 defA.docs = decA.docs;
6090 }
6091 //printf("transferArgumentDocumentation(%s<->%s)\n",qPrint(decA.name),qPrint(defA.name));
6092 if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
6093 {
6094 if (decA.name.empty() && !defA.name.empty())
6095 {
6096 decA.name = defA.name;
6097 }
6098 else if (defA.name.empty() && !decA.name.empty())
6099 {
6100 defA.name = decA.name;
6101 }
6102 }
6103 }
6104}
6105
6107{
6108 AUTO_TRACE("mdec='{}' mdef='{}' mdec.isPrototype={} mdef.isPrototype={}",
6109 mdec->name(), mdef->name(), mdec->isPrototype(), mdef->isPrototype());
6110 if (
6111 (!mdef->isDocTransferDone() || !mdec->isDocTransferDone()) &&
6112 (
6113 (mdef->isFunction() && !mdef->isStatic() && !mdef->isPrototype()) ||
6114 (mdef->isVariable() && !mdef->isExternal() && !mdef->isStatic())
6115 )
6116 )
6117 {
6118 bool sameNumTemplateArgs = mdef->templateArguments().size()==mdec->templateArguments().size();
6119
6120 ArgumentList &mdefAl = const_cast<ArgumentList&>(mdef->argumentList());
6121 ArgumentList &mdecAl = const_cast<ArgumentList&>(mdec->argumentList());
6122 if (sameNumTemplateArgs &&
6123 matchArguments2(mdef->getOuterScope(),mdef->getFileDef(),mdef->typeString(),&mdefAl,
6124 mdec->getOuterScope(),mdec->getFileDef(),mdec->typeString(),&mdecAl,
6125 true,mdef->getLanguage()
6126 )
6127 ) /* match found */
6128 {
6129 AUTO_TRACE_ADD("combining definition and declaration");
6130
6131 if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
6132 {
6133 mdec->resolveUnnamedParameters(mdef);
6134 }
6135
6136 // first merge argument documentation
6137 transferArgumentDocumentation(mdecAl,mdefAl);
6138
6139 // copy brief description between definition and declaration
6140 DString mdefBrief = mdef->briefDescription();
6141 DString mdecBrief = mdec->briefDescription();
6142 DString mdefBriefFile = mdef->briefFile();
6143 DString mdecBriefFile = mdec->briefFile();
6144 int mdefBriefLine = mdef->briefLine();
6145 int mdecBriefLine = mdec->briefLine();
6146 if (!mdef->isDocTransferDone() && !mdecBrief.empty())
6147 {
6148 mdef->setBriefDescription(mdecBrief,mdecBriefFile,mdecBriefLine);
6149 }
6150 if (!mdec->isDocTransferDone() && !mdefBrief.empty())
6151 {
6152 mdec->setBriefDescription(mdefBrief,mdefBriefFile,mdefBriefLine);
6153 }
6154
6155 // copy detailed description between definition and declaration
6156 DString mdefDocs = mdef->documentation();
6157 DString mdecDocs = mdec->documentation();
6158 DString mdefFile = mdef->docFile();
6159 DString mdecFile = mdec->docFile();
6160 int mdefLine = mdef->docLine();
6161 int mdecLine = mdec->docLine();
6162 bool mdefDocsForDef = mdef->isDocsForDefinition();
6163 bool mdecDocsForDef = mdec->isDocsForDefinition();
6164 if (!mdec->isDocTransferDone() && !mdefDocs.empty())
6165 {
6166 //printf("transferring docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
6167 mdec->setDocumentation(mdefDocs,mdefFile,mdefLine);
6168 mdec->setDocsForDefinition(mdefDocsForDef);
6169 if (mdefAl.hasParameters())
6170 {
6171 auto mdefAlComb = stringToArgumentList(mdef->getLanguage(),mdef->argsString());
6172 transferArgumentDocumentation(mdefAl,*mdefAlComb);
6173 mdec->moveArgumentList(std::move(mdefAlComb));
6174 }
6175 }
6176 if (!mdef->isDocTransferDone() && !mdecDocs.empty())
6177 {
6178 //printf("transferring docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
6179 mdef->setDocumentation(mdecDocs,mdecFile,mdecLine);
6180 mdef->setDocsForDefinition(mdecDocsForDef);
6181 if (mdecAl.hasParameters())
6182 {
6183 auto mdecAlComb = stringToArgumentList(mdec->getLanguage(),mdec->argsString());
6184 transferArgumentDocumentation(mdecAl,*mdecAlComb);
6185 mdef->moveDeclArgumentList(std::move(mdecAlComb));
6186 }
6187 }
6188
6189 // copy inbody documentation between definition and declaration
6190 DString mdefInbodyDocs = mdef->inbodyDocumentation();
6191 DString mdecInbodyDocs = mdec->inbodyDocumentation();
6192 DString mdefInbodyFile = mdef->inbodyFile();
6193 DString mdecInbodyFile = mdec->inbodyFile();
6194 int mdefInbodyLine = mdef->inbodyLine();
6195 int mdecInbodyLine = mdec->inbodyLine();
6196 if (!mdec->isDocTransferDone() && !mdefInbodyDocs.empty())
6197 {
6198 mdec->setInbodyDocumentation(mdefInbodyDocs,mdefInbodyFile,mdefInbodyLine);
6199 }
6200 if (!mdef->isDocTransferDone() && !mdecInbodyDocs.empty())
6201 {
6202 mdef->setInbodyDocumentation(mdecInbodyDocs,mdecInbodyFile,mdecInbodyLine);
6203 }
6204
6205 if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
6206 {
6207 //printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
6208 mdef->setBodySegment(mdec->getDefLine(),mdec->getStartBodyLine(),mdec->getEndBodyLine());
6209 mdef->setBodyDef(mdec->getBodyDef());
6210 //mdef->setBodyMember(mdec);
6211 }
6212 else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
6213 {
6214 //printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
6215 mdec->setBodySegment(mdef->getDefLine(),mdef->getStartBodyLine(),mdef->getEndBodyLine());
6216 mdec->setBodyDef(mdef->getBodyDef());
6217 //mdec->setBodyMember(mdef);
6218 }
6221
6222 // copy group info.
6223 if (mdec->getGroupDef()==nullptr && mdef->getGroupDef()!=nullptr)
6224 {
6225 mdec->setGroupDef(mdef->getGroupDef(),
6226 mdef->getGroupPri(),
6227 mdef->docFile(),
6228 mdef->docLine(),
6229 mdef->hasDocumentation(),
6230 mdef
6231 );
6232 }
6233 else if (mdef->getGroupDef()==nullptr && mdec->getGroupDef()!=nullptr)
6234 {
6235 mdef->setGroupDef(mdec->getGroupDef(),
6236 mdec->getGroupPri(),
6237 mdec->docFile(),
6238 mdec->docLine(),
6239 mdec->hasDocumentation(),
6240 mdec
6241 );
6242 }
6243
6244
6245 mdec->mergeRefItems(mdef);
6246 mdef->mergeRefItems(mdec);
6247
6248 mdef->setMemberDeclaration(mdec);
6249 mdec->setMemberDefinition(mdef);
6250
6251 mergeMemberOverrideOptions(mdec,mdef);
6252
6253 mdef->addQualifiers(mdec->getQualifiers());
6254 mdec->addQualifiers(mdef->getQualifiers());
6255
6256 mdef->setDocTransferDone();
6257 mdec->setDocTransferDone();
6258 }
6259 }
6260}
6261
6263{
6264 if (m_templateMaster)
6265 {
6266 return m_templateMaster->briefDescription(abbr);
6267 }
6268 else
6269 {
6271 }
6272}
6273
6275{
6276 if (m_templateMaster)
6277 {
6279 }
6280 else
6281 {
6283 }
6284}
6285
6287{
6288 if (m_templateMaster)
6289 {
6291 }
6292 else
6293 {
6295 }
6296}
6297
6299{
6300 return m_typeConstraints;
6301}
6302
6304{
6305 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
6306 bool isFriendToHide = hideFriendCompounds &&
6307 (m_type=="friend class" ||
6308 m_type=="friend struct" ||
6309 m_type=="friend union");
6310 return isFriendToHide;
6311}
6312
6314{
6315 return (isFriend() &&
6316 (m_type=="friend class" || m_type=="friend struct" ||
6317 m_type=="friend union"));
6318}
6319
6320
6322{
6323 return !(isFriend() && isFriendToHide());
6324}
6325
6327{
6328 return isFunction() || isSlot() || isSignal();
6329}
6330
6332{
6333 return isRelated() || isForeign() || (isFriend() && !isFriendToHide());
6334}
6335
6341
6343{
6344 switch (memberType())
6345 {
6346 case MemberType::Define: return CodeSymbolType::Define;
6347 case MemberType::Function: return CodeSymbolType::Function;
6348 case MemberType::Variable: return CodeSymbolType::Variable;
6349 case MemberType::Typedef: return CodeSymbolType::Typedef;
6350 case MemberType::Enumeration: return CodeSymbolType::Enumeration;
6351 case MemberType::EnumValue: return CodeSymbolType::EnumValue;
6352 case MemberType::Signal: return CodeSymbolType::Signal;
6353 case MemberType::Slot: return CodeSymbolType::Slot;
6354 case MemberType::Friend: return CodeSymbolType::Friend;
6355 case MemberType::DCOP: return CodeSymbolType::DCOP;
6356 case MemberType::Property: return CodeSymbolType::Property;
6357 case MemberType::Event: return CodeSymbolType::Event;
6358 case MemberType::Interface: return CodeSymbolType::Interface;
6359 case MemberType::Service: return CodeSymbolType::Service;
6360 case MemberType::Sequence: return CodeSymbolType::Sequence;
6361 case MemberType::Dictionary: return CodeSymbolType::Dictionary;
6362 }
6364}
6365
6367{
6368 return m_redefineCount;
6369}
6370
6372{
6373 m_redefineCount=count;
6374}
6375
6376//-------------------------------------------------------------------------------
6377// Helpers
6378
6380
6382{
6383 MemberDefMutable *src = toMemberDefMutable(const_cast<MemberDef*>(s));
6384 MemberDefMutable *dst = toMemberDefMutable(const_cast<MemberDef*>(d));
6385 if (src==nullptr || dst==nullptr) return;
6386 //printf("--> addDocCrossReference src=%s,dst=%s\n",qPrint(src->name()),qPrint(dst->name()));
6387 if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
6388 if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
6389 src->isCallable()
6390 )
6391 {
6392 DString sourceRefName = src->sourceRefName();
6395
6396 // ---- critical section
6397 std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
6398 dst->addSourceReferencedBy(src,sourceRefName);
6399 if (mdDef)
6400 {
6401 mdDef->addSourceReferencedBy(src,sourceRefName);
6402 }
6403 if (mdDecl)
6404 {
6405 mdDecl->addSourceReferencedBy(src,sourceRefName);
6406 }
6407 // ---- end critical section
6408 }
6409 if ((src->hasReferencesRelation() || src->hasCallGraph()) &&
6410 src->isCallable()
6411 )
6412 {
6413 DString sourceRefName = dst->sourceRefName();
6416
6417 // ---- critical section
6418 std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
6419 src->addSourceReferences(dst,sourceRefName);
6420 if (mdDef)
6421 {
6422 mdDef->addSourceReferences(dst,sourceRefName);
6423 }
6424 if (mdDecl)
6425 {
6426 mdDecl->addSourceReferences(dst,sourceRefName);
6427 }
6428 // ---- end critical section
6429 }
6430}
6431
6432// --- Cast functions
6433//
6435{
6436 if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6437 {
6438 return static_cast<MemberDef*>(d);
6439 }
6440 else
6441 {
6442 return nullptr;
6443 }
6444}
6445
6447{
6448 Definition *d = toDefinition(md);
6449 if (d && typeid(*d)==typeid(MemberDefImpl))
6450 {
6451 return static_cast<MemberDef*>(d);
6452 }
6453 else
6454 {
6455 return nullptr;
6456 }
6457}
6458
6460{
6461 if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6462 {
6463 return static_cast<const MemberDef*>(d);
6464 }
6465 else
6466 {
6467 return nullptr;
6468 }
6469}
6470
6472{
6473 if (d && typeid(*d)==typeid(MemberDefImpl))
6474 {
6475 return static_cast<MemberDefMutable*>(d);
6476 }
6477 else
6478 {
6479 return nullptr;
6480 }
6481}
6482
6483
constexpr auto prefix
Definition anchor.cpp:44
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:147
This class represents an function or template argument list.
Definition arguments.h:65
RefQualifierType refQualifier() const
Definition arguments.h:116
iterator end()
Definition arguments.h:94
bool hasParameters() const
Definition arguments.h:76
Argument & front()
Definition arguments.h:105
DString trailingReturnType() const
Definition arguments.h:114
bool isDeleted() const
Definition arguments.h:115
size_t size() const
Definition arguments.h:100
bool constSpecifier() const
Definition arguments.h:111
bool hasDocumentation(bool allowEmptyNames=false) const
Definition arguments.cpp:22
bool empty() const
Definition arguments.h:99
bool hasTemplateDocumentation() const
Definition arguments.cpp:30
iterator begin()
Definition arguments.h:93
bool volatileSpecifier() const
Definition arguments.h:112
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual int isBaseClass(const ClassDef *bcd, bool followInstances, const DString &templSpec=DString()) 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 DString compoundTypeString() const =0
Returns the type of compound as a string.
virtual ClassDef * categoryOf() const =0
Returns the class of which this is a category (Objective-C only).
@ Interface
Definition classdef.h:112
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e. class/struct/union/...
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:89
void clear()
Definition dstring.h:219
DString()=default
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:249
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:323
DString lower() const
Definition dstring.h:331
DString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition dstring.cpp:118
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:153
std::string_view view() const
Definition dstring.h:167
DString & remove(size_t index, size_t len)
Definition dstring.h:524
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:183
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:675
DString & append(char c)
Definition dstring.h:478
DString right(size_t len) const
Definition dstring.h:316
DString & prepend(const char *s)
Definition dstring.h:504
int contains(char c, bool cs=true) const
Definition dstring.cpp:76
size_t find(char c, size_t pos=0) const
Definition dstring.h:244
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:342
DString left(size_t len) const
Definition dstring.h:311
const std::string & str() const
Definition dstring.h:634
bool stripPrefix(const DString &prefix)
Definition dstring.h:295
bool startsWith(const char *s) const
Definition dstring.h:589
bool endsWith(const char *s) const
Definition dstring.h:606
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:156
const Definition * getAlias() const
const Definition * getScope() const
DefinitionAliasMixin(const Definition *scope, const Definition *alias)
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual DString briefDescription(bool abbreviate=false) const =0
virtual DString inbodyFile() const =0
virtual int getEndBodyLine() const =0
virtual DString briefFile() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual DString getDefFileName() const =0
virtual DString documentation() const =0
virtual bool isLinkable() const =0
virtual DString inbodyDocumentation() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual const DString & localName() 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 bool hasUserDocumentation() const =0
virtual bool isAnonymous() const =0
virtual DString displayName(bool includeScope=true) const =0
virtual DString qualifiedName() const =0
virtual DString anchor() const =0
virtual DString getReference() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual Definition * getOuterScope() const =0
virtual DString docFile() const =0
virtual int getStartBodyLine() const =0
virtual bool isReference() const =0
virtual DString getOutputFileBase() const =0
bool isReference() const override
DString docFile() const override
void writeSourceDef(OutputList &ol) const override
bool hasUserDocumentation() const override
DString qualifiedName() const override
bool hasBriefDescription() const override
DString briefFile() const override
bool hasRequirementRefs() const override
DString briefDescription(bool abbreviate=false) const override
DefinitionMixin(const DString &defFileName, int defLine, int defColumn, const DString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=true)
const DString & name() const override
DString inbodyFile() const override
void setOuterScope(Definition *def) override
DString getReference() const override
void writeRequirementRefs(OutputList &ol) const override
void setInbodyDocumentation(const DString &doc, const DString &docFile, int docLine) override
const RefItemVector & xrefListItems() const override
bool hasSourceReffedBy() const override
Definition * getOuterScope() const override
void setBriefDescription(const DString &brief, const DString &briefFile, int briefLine) override
void setDocumentation(const DString &doc, const DString &docFile, int docLine, bool stripWhiteSpace=true) override
const DString & localName() const override
void setReference(const DString &r) override
DString getDefFileExtension() const override
DString getDefFileName() const override
DString documentation() const override
const FileDef * getBodyDef() const override
DString inbodyDocumentation() const override
void writeSourceReffedBy(OutputList &ol, const DString &scopeName) const override
void writeInlineCode(OutputList &ol, const DString &scopeName) const override
void setDefFile(const DString &df, int defLine, int defColumn) override
void setHidden(bool b) override
DString getSourceFileBase() const override
void writeDocAnchorsToTagFile(TextStream &fs) const override
bool hasDocumentation() const override
void writeSourceRefs(OutputList &ol, const DString &scopeName) const override
SrcLangExt getLanguage() const override
virtual void setBodySegment(int defLine, int bls, int ble)=0
virtual void setInbodyDocumentation(const DString &d, const DString &docFile, int docLine)=0
virtual void setDocumentation(const DString &d, const DString &docFile, int docLine, bool stripWhiteSpace=true)=0
virtual void addSourceReferences(MemberDef *d, const DString &sourceRefName)=0
virtual void addSourceReferencedBy(MemberDef *d, const DString &sourceRefName)=0
virtual void setBriefDescription(const DString &b, const DString &briefFile, int briefLine)=0
virtual void mergeRefItems(Definition *d)=0
virtual void setBodyDef(const FileDef *fd)=0
Representation of an call graph.
int numNodes() const
bool isTooBig() const
bool isTrivial() const
static bool suppressDocWarnings
Definition doxygen.h:130
static bool parseSourcesNeeded
Definition doxygen.h:123
static ParserManager * parserManager
Definition doxygen.h:129
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
bool inSort(const Example &ex)
Definition example.h:39
A model of a file symbol.
Definition filedef.h:99
virtual DString absFilePath() const =0
A model of a group of symbols.
Definition groupdef.h:52
bool hasEnumValues() const override
bool isConstEval() const override
const ClassDef * getCachedTypedefVal() const override
NamespaceDef * getNamespaceDef() override
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 DString &inheritId=DString()) const override
const NamespaceDef * getNamespaceDef() const override
bool hasExamples() const override
DString getGroupFileName() const override
GroupDef * getGroupDef() 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
bool isConstInit() const override
bool isFinal() 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 MemberDef * reimplements() const override
DString argsString() const override
const DString & initializer() const override
bool isOptional() const override
const ClassDef * getClassDefOfAnonymousType() 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
DString typeString() 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
DString getOutputFileBase() 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
const MemberDef * templateMaster() const override
void warnIfUndocumentedParams() const override
bool isExternal() const override
DString excpString() const override
bool isProperty() const override
bool isWritable() const override
bool isDocumentedFriendClass() const override
int redefineCount() const override
bool isConstExpr() const override
int initializerLines() const override
bool isMaybeVoid() const override
int getMemberGroupId() const override
DString objCMethodName(bool localLink, bool showStatic) 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
bool hasCallGraph() const override
bool isCopy() const override
DString displayDefinition() const override
DString getWriteAccessor() const override
int getDeclLine() const override
bool isEnumerate() const override
DString getReference() const override
bool isReference() const override
TypeSpecifier getMemberSpecifiers() const override
bool isThreadLocal() const override
bool hasMultiLineInitializer() const override
bool isDocsForDefinition() const override
Grouping::GroupPri_t getGroupPri() const override
bool isTypedefValCached() const override
bool isRaisable() const override
bool isUnretained() const override
bool isGettable() const override
const MemberVector & enumFieldList() const override
DString anchor() const override
bool isObjCProperty() const override
int getDeclColumn() const override
DString qualifiedName() const override
const ArgumentList & declArgumentList() const override
DString briefDescription(bool) const override
bool isCallable() const override
bool isDefine() const override
bool isLinkableInProject() const override
bool hasDetailedDescription() const override
bool isFriendToHide() const override
DString getCachedTypedefTemplSpec() 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
DString requiresClause() const override
bool isFunctionPtr() const override
StringVector getLabels(const Definition *container) const override
std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const override
bool isAddable() 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
bool isInline() const override
bool isRelatedOrFriend() const override
bool hasReferencesRelation() const override
bool isStrong() const override
const MemberDef * getMdAlias() const
bool isObjCMethod() const override
const DString & name() const override
bool isAbstract() const override
DString extraTypeChars() const override
bool isStatic() const override
bool isPrivateSettable() const override
bool isSealed() const override
bool isRelated() const override
MemberDef * getMdAlias()
DString memberTypeName() const override
bool isOverride() const override
bool isForeign() const override
bool isImplementation() const override
const MemberVector & reimplementedBy() const override
VhdlSpecifier getVhdlSpecifiers() const override
bool isMaybeDefault() const override
MemberType memberType() const override
bool isLinkable() const override
DString getDeclFileName() const override
bool isProtectedSettable() const override
bool isReadonly() const override
DString declaration() const override
DString getCachedResolvedTypedef() const override
const MemberDef * categoryRelation() const override
ClassDef * getClassDef() override
DString documentation() const override
MemberDefAliasImpl(const Definition *newScope, const MemberDef *md)
const MemberDef * getEnumScope() const override
DString getReadAccessor() const override
Protection protection() const override
bool isSlot() const override
DString displayName(bool b=true) const override
bool isDelete() const override
bool isReadable() const override
bool isEvent() const override
bool isNonAtomic() const override
DefType definitionType() const override
DString getScopeString() const override
bool isReimplementedBy(const ClassDef *cd) const override
bool isDCOP() const override
DString bitfieldString() const override
void writeEnumDeclaration(OutputList &typeDecl, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod) const override
bool isDocTransferDone() const override
bool isDetailedSectionVisible(MemberListContainer container) const override
bool isNotFriend() const override
const MemberList * getSectionList(const Definition *container) const override
bool isTemplateSpecialization() const override
const ModuleDef * getModuleDef() const override
bool isExplicit() const override
DString enumBaseType() const override
CodeSymbolType codeSymbolType() 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
MemberDef * resolveAlias() override
const FileDef * getFileDef() const override
std::optional< ArgumentList > formalTemplateArguments() const override
DString sourceRefName() const override
DString definition() 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
DString fieldType() 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
DString getDeclType() const override
bool visibleInIndex() const override
ClassDef * relatedAlso() const override
bool isRetain() const override
bool isEnumStruct() const override
bool isBriefSectionVisible() const override
const ArgumentList & templateArguments() const override
~MemberDefAliasImpl() override
StringVector getQualifiers() const override
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
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 bool isDestructor() const =0
virtual DString getDeclType() 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 bool isObjCMethod() const =0
virtual bool hasDocumentedEnumValues() const =0
virtual MemberDef * memberDeclaration() const =0
virtual DString requiresClause() 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 DString argsString() const =0
virtual bool isForeign() const =0
virtual bool isSealed() const =0
virtual bool hasExamples() const =0
virtual bool isDelete() const =0
virtual int numberOfFlowKeyWords() const =0
virtual const MemberDef * inheritsDocsFrom() const =0
virtual bool isDefault() const =0
virtual DString objCMethodName(bool localLink, bool showStatic) const =0
virtual bool isRelated() const =0
virtual bool isDocumentedFriendClass() const =0
virtual bool isConstInit() const =0
virtual bool isDeleted() const =0
virtual DString definition() const =0
virtual const ClassDef * getCachedTypedefVal() const =0
virtual bool isRelatedOrFriend() 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 DString &inheritId=DString()) 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 DString declaration() const =0
virtual DString excpString() const =0
virtual DString getCachedResolvedTypedef() const =0
virtual const ArgumentList & templateArguments() const =0
virtual DString getDeclFileName() const =0
virtual const DString & initializer() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isSettable() 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 DString getReadAccessor() const =0
virtual const ArgumentList & argumentList() 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 bool isCopy() const =0
virtual int getMemberGroupId() const =0
virtual bool isDictionary() const =0
virtual DString bitfieldString() const =0
virtual int getDeclLine() const =0
virtual bool isTypeAlias() 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 bool hasInlineSource() const =0
virtual bool isTemplateSpecialization() const =0
virtual bool isPrivateSettable() const =0
virtual DString displayDefinition() const =0
virtual StringVector getQualifiers() const =0
virtual bool isRaisable() const =0
virtual bool isRemovable() const =0
virtual bool isTypedefValCached() const =0
virtual bool isConstrained() const =0
virtual DString getWriteAccessor() 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 isThreadLocal() const =0
virtual bool isDefine() const =0
virtual DString extraTypeChars() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual bool isPublished() const =0
virtual DString getScopeString() const =0
virtual bool isFunctionPtr() const =0
virtual DString sourceRefName() 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 const ArgumentList & typeConstraints() const =0
virtual bool isProtectedSettable() const =0
virtual const ClassDef * getClassDefOfAnonymousType() const =0
virtual bool isImplementation() const =0
virtual bool isProtectedGettable() 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 DString getCachedTypedefTemplSpec() 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 DString fieldType() const =0
virtual bool isReadable() const =0
virtual bool isWeak() const =0
virtual bool isDocTransferDone() const =0
virtual bool isNoDiscard() const =0
virtual DString enumBaseType() const =0
virtual bool isUnretained() 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 DString getGroupFileName() const =0
virtual bool isDCOP() const =0
virtual bool isStrong() const =0
virtual DString typeString() const =0
virtual bool isSliceLocal() const =0
virtual Specifier virtualness(int count=0) const =0
virtual bool isUNOProperty() const =0
virtual int redefineCount() const =0
virtual const MemberDef * categoryRelation() const =0
virtual int initializerLines() const =0
virtual bool isFinal() const =0
virtual const ArgumentList & declArgumentList() const =0
virtual const ExampleList & getExamples() const =0
virtual bool isAbstract() const =0
virtual DString memberTypeName() 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 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 bool isProperty() const =0
bool _hasVisibleCallerGraph() const
DString getCachedTypedefTemplSpec() const override
void _writeCallerGraph(OutputList &ol) const
void insertReimplementedBy(MemberDef *md) override
bool isDCOP() const override
DString enumBaseType() const override
VhdlSpecifier m_vhdlSpec
bool isDetailedSectionVisible(MemberListContainer container) const override
bool _isReimplements() const
bool isFunction() const override
void cacheTypedefVal(const ClassDef *val, const DString &templSpec, const DString &resolvedType) 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 writeDocumentation(const MemberList *ml, int memCount, int memTotal, OutputList &ol, const DString &scopeName, const Definition *container, bool inGroup, bool showEnumValues=false, bool showInline=false) const override
void setDocumentedEnumValues(bool value) override
bool m_detailedDescriptionCachedValue
bool isTypedefValCached() const override
DString objCMethodName(bool localLink, bool showStatic) const override
bool isInline() const override
const ExampleList & getExamples() const override
ArgumentLists m_defTmpArgLists
DString getWriteAccessor() const override
bool isFriendToHide() const override
void invalidateTypedefValCache() override
bool isFriendClass() const override
void setNamespace(NamespaceDef *nd) override
void setProtection(Protection p) override
const NamespaceDef * getNamespaceDef() 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 DString &inheritId=DString()) const override
void setHidden(bool b) override
void _writeTypeConstraints(OutputList &ol) const
bool isSliceLocal() const override
void makeRelated() override
int getGroupStartLine() const override
void warnIfUndocumented() const override
bool m_hasReferencedByRelation
void setMemberType(MemberType t) override
const ArgumentList & typeConstraints() const override
void setRequiresClause(const DString &req) override
DefType definitionType() const override
Definition memberdef.cpp:64
bool isDestructor() const override
StringVector getQualifiers() const override
Specifier m_virt
DString getDeclFileName() const override
void setRedefineCount(int) override
void setAnonymousEnumType(const MemberDef *md) override
bool isOptional() const override
void _writeExamples(OutputList &ol) const
void moveTo(Definition *) override
bool isCallable() const override
void setBriefDescription(const DString &b, const DString &briefFile, int briefLine) override
DString getScopeString() const override
bool m_docTransferDone
bool isBriefSectionVisible() const override
const MemberDef * m_categoryRelation
void setCategoryRelation(const MemberDef *) override
bool isReference() const override
DString m_cachedResolvedType
Protection m_prot
void warnIfUndocumentedParams() const override
VhdlSpecifier getVhdlSpecifiers() const override
bool _hasVisibleCallGraph() const
void setFormalTemplateArguments(const ArgumentList &al) override
ClassDef * m_category
DString extraTypeChars() const override
void setClassDefOfAnonymousType(const ClassDef *cd) override
bool isDefine() const override
void findSectionsInDocumentation() override
DString m_exception
DString displayDefinition() 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
void _writeReimplementedBy(OutputList &ol) const
bool isNew() const override
void setMaxInitLines(int lines) override
bool isDocsForDefinition() const override
DString definition() const override
void setEnumClassScope(ClassDef *cd) override
void setReadAccessor(const DString &r) override
bool isUnretained() const override
bool isGettable() const override
MemberGroup * getMemberGroup() const override
bool hasUserDocumentation() const override
std::optional< ArgumentList > formalTemplateArguments() const override
std::map< const Definition *, const MemberList * > m_sectionMap
bool isEnumValue() const override
bool isObjCMethod() const override
MemberDef * memberDefinition() const override
bool m_isTypedefValCached
bool m_hasDocumentedReturnType
DString anchor() const override
StringVector m_qualifiers
MemberDefImpl(const DString &defFileName, int defLine, int defColumn, const DString &type, const DString &name, const DString &args, const DString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const DString &metaData)
void overrideCallGraph(bool e) override
void setInheritsDocsFrom(const MemberDef *md) override
bool addExample(const DString &anchor, const DString &name, const DString &file) override
Specifier virtualness(int count=0) const override
ClassDefMutable * getClassDefMutable() override
bool hasDetailedDescription() const override
void setMemberGroupId(int id) override
DString getReference() const override
bool isCSharpProperty() const override
DString m_groupFileName
void setSectionList(const Definition *container, const MemberList *sl) override
bool isRaisable() const override
void setTemplateMaster(const MemberDef *mt) override
std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const override
bool m_explicitInherited
const GroupDef * getGroupDef() const override
DString m_enumBaseType
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
void setMemberGroup(MemberGroup *grp) override
void setMemberDeclaration(MemberDef *md) override
bool isUNOProperty() const override
bool m_hasDocumentedParams
ModuleDef * m_moduleDef
bool m_hasReferencesRelation
void _computeIsConstructor()
size_t _countReimplementedBy() const
bool isRequired() const override
const MemberVector & reimplementedBy() const override
bool isStrong() const override
bool m_hasInlineSource
void moveDeclArgumentList(std::unique_ptr< ArgumentList > al) override
bool isTypeAlias() const override
void setMemberClass(ClassDef *cd) override
const MemberDef * templateMaster() const override
void setDocsForDefinition(bool b) override
const ClassDef * getCachedTypedefVal() const override
int initializerLines() const override
bool getGroupHasDocs() const override
const MemberDef * getEnumScope() const override
bool m_hasCallerGraph
bool isMaybeDefault() const override
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
DString m_write
MemberDef * memberDeclaration() const override
std::optional< ArgumentList > m_formalTemplateArguments
bool isInitonly() const override
bool isAddable() const override
void setWriteAccessor(const DString &w) override
bool isRelated() const override
void moveArgumentList(std::unique_ptr< ArgumentList > al) override
DString qualifiedName() const override
const ClassDef * m_cachedTypedefValue
MemberDef * m_redefines
void setCategory(ClassDef *) override
uint8_t m_isDestructorCached
MemberType memberType() const override
DString sourceRefName() const override
const ClassDef * m_anonymousType
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
void setType(const DString &t) override
DString declaration() const override
DString m_metaData
bool isReadonly() const override
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
void _writeMultiLineInitializer(OutputList &ol, const DString &scopeName) const
MemberDef * resolveAlias() override
Definition memberdef.cpp:65
bool isFinal() const override
bool isAttribute() const override
const MemberDef * m_enumScope
DString m_explicitOutputFileBase
int redefineCount() const override
bool isDictionary() const override
bool isSlot() const override
DString bitfieldString() const override
void setExplicitExternal(bool b, const DString &df, int line, int column) override
DString memberTypeName() const override
void setDeclFile(const DString &df, int line, int column) override
bool hasInlineSource() const override
void setAnchor() override
Relationship m_related
MemberGroup * m_memberGroup
const MemberDef * m_groupAlias
bool isRetain() const override
MemberVector m_redefinedBy
ClassDef * category() const override
void overrideEnumValues(bool e) override
bool isDocTransferDone() const override
bool isDocumentedFriendClass() const override
bool isConstEval() const override
bool hasReferencesRelation() const override
void _writeTagData(const DefType) const
void overrideReferencedByRelation(bool e) override
bool isEnumStruct() const override
bool hasEnumValues() const override
DString m_declFileName
bool isExplicit() const override
void _writeCategoryRelation(OutputList &ol) const
void setTemplateSpecialization(bool b) override
bool isTemplateSpecialization() const override
DString typeString() 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
DString m_extraTypeChars
bool livesInsideEnum() const override
bool isDelete() const override
DString getCachedResolvedTypedef() const override
DString m_bitfields
DString excpString() const override
DString fieldType() const override
bool isNoExcept() const override
DString argsString() const override
bool isWeak() const override
const MemberDef * getAnonymousEnumType() const override
void setDocumentation(const DString &d, const DString &docFile, int docLine, bool stripWhiteSpace=true) override
const ModuleDef * getModuleDef() const override
void setDocTransferDone() override
bool isNoDiscard() const override
GroupDef * m_group
void incrementFlowKeyWordCount() override
const MemberDef * getGroupAlias() const override
bool isConstInit() const override
void setModuleDef(ModuleDef *mod) override
TypeSpecifier m_memSpec
DString getDeclType() const override
TypeSpecifier getMemberSpecifiers() const override
bool hasReferencedByRelation() const override
DString m_requiresClause
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
void detectUndocumentedParams(bool hasParamCommand, bool hasReturnCommand) const override
ClassDef * m_relatedAlso
const MemberDef * m_annEnumType
bool isWritable() const override
DString m_cachedTypedefTemplSpec
const MemberDef * m_templateMaster
bool isSealed() const override
bool isAbstract() const override
bool isPrivateSettable() const override
void setInitializer(const DString &i) override
bool isSequence() const override
void _computeLinkableInProject()
Grouping::GroupPri_t m_grouppri
void setRelatedAlso(ClassDef *cd) override
void addRequirementReferences(const Definition *) override
bool hasExamples() const override
void resolveUnnamedParameters(const MemberDef *md) override
void setMemberDefinition(MemberDef *md) override
bool isThreadLocal() const override
void writeMemberDocSimple(OutputList &ol, const Definition *container) const override
void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr) override
bool isSignal() const override
bool isMaybeVoid() const override
void init(Definition *def, const DString &t, const DString &a, const DString &e, Protection p, Specifier v, bool s, Relationship r, MemberType mt, const ArgumentList &tal, const ArgumentList &al, const DString &meta)
void _writeReimplements(OutputList &ol) const
bool isMaybeAmbiguous() const override
bool hasOneLineInitializer() const override
const MemberList * getSectionList(const Definition *) const override
bool isForeign() const override
void addQualifiers(const StringVector &qualifiers) override
void setEnumBaseType(const DString &type) override
bool isAssign() const override
bool isStrongEnumValue() const override
DString getReadAccessor() const override
void _computeIsDestructor()
bool isNotFriend() const override
const ClassDef * getClassDefOfAnonymousType() const override
void copyArgumentNames(const MemberDef *bmd) override
bool isRemovable() const override
void setExplicitInherited(bool b) override
bool isDeleted() const override
DString getGroupFileName() const override
MemberDef * m_memDef
MemberDef * m_groupMember
const DString & initializer() const override
bool isFriend() const override
DString documentation() const override
bool m_livesInsideEnum
void setArgsString(const DString &as) override
ArgumentList m_typeConstraints
ClassDef * relatedAlso() const override
DString m_initializer
void setReimplements(MemberDef *md) 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
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
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
void setDefinition(const DString &d) override
bool isFunctionOrSignalSlot() const override
void overrideInlineSource(bool e) override
void overrideCallerGraph(bool e) override
bool isPrivateGettable() const override
bool isEvent() const override
void setMemberSpecifiers(TypeSpecifier s) override
bool isFunctionPtr() const override
bool hasCallerGraph() const override
bool isObjCProperty() const override
void setEnumScope(MemberDef *md, bool livesInsideEnum=false) override
bool isPrototype() const override
DString requiresClause() const override
bool isTypedef() const override
void _writeGroupInclude(OutputList &ol, bool inGroup) const
void setPrototype(bool p, const DString &df, int line, int column) override
FileDef * m_fileDef
bool hasDocumentedEnumValues() const override
~MemberDefImpl() override=default
void _writeEnumValues(OutputList &ol, const Definition *container, const DString &cfname, const DString &ciname, const DString &cname) const
uint8_t m_isLinkableCached
bool isVariable() const override
void mergeMemberSpecifiers(TypeSpecifier s) override
DString displayName(bool=true) const override
ArgumentList m_tArgList
bool isConstrained() const override
bool isReadable() const override
DString getOutputFileBase() const override
void addListReference(const Definition *) override
bool isDefault() const override
void _writeCallGraph(OutputList &ol) const
DString briefDescription(bool abbr=false) const override
bool isOverride() const override
const MemberDef * m_docProvider
bool isSettable() const override
bool isBound() const override
CodeSymbolType codeSymbolType() const override
void setBitfields(const DString &s) override
void setInbodyDocumentation(const DString &d, const DString &inbodyFile, int inbodyLine) override
virtual void setMemberDeclaration(MemberDef *md)=0
virtual void setDocTransferDone()=0
virtual void resolveUnnamedParameters(const MemberDef *md)=0
virtual void setDocsForDefinition(bool b)=0
virtual void mergeMemberSpecifiers(TypeSpecifier s)=0
virtual void addQualifiers(const StringVector &qualifiers)=0
virtual void moveDeclArgumentList(std::unique_ptr< ArgumentList > al)=0
virtual void setMemberDefinition(MemberDef *md)=0
virtual void moveArgumentList(std::unique_ptr< ArgumentList > al)=0
virtual void insertReimplementedBy(MemberDef *md)=0
virtual void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr)=0
A class representing a group of members.
Definition membergroup.h:44
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:125
A vector of MemberDef object.
Definition memberlist.h:35
iterator end() noexcept
Definition memberlist.h:56
bool contains(const MemberDef *md) const
Definition memberlist.h:89
void inSort(MemberDef *md)
Definition memberlist.h:80
iterator begin() noexcept
Definition memberlist.h:54
void push_back(const T &value)
Definition memberlist.h:48
An abstract interface of a namespace symbol.
virtual DString compoundTypeString() const =0
void startCodeFragment(const DString &style)
Definition outputlist.h:280
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:315
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:383
void endIndent()
Definition outputlist.h:584
void startMemberDeclaration()
Definition outputlist.h:569
void parseText(const DString &textStr)
void endDescTableRow()
Definition outputlist.h:634
void startMemberDocName(bool align)
Definition outputlist.h:680
void endParameterExtra(bool last, bool one, bool bracket)
Definition outputlist.h:694
void writeChar(char c)
Definition outputlist.h:529
void disable(OutputType o)
void startParagraph(const DString &classDef=DString())
Definition outputlist.h:407
void writeObjectLink(const DString &ref, const DString &file, const DString &anchor, const DString &name)
Definition outputlist.h:439
void endMemberDocName()
Definition outputlist.h:682
void endMemberDoc(bool hasArgs)
Definition outputlist.h:535
void startDescTableInit()
Definition outputlist.h:640
void startCallGraph()
Definition outputlist.h:656
void addIndexItem(const DString &s1, const DString &s2)
Definition outputlist.h:590
void endDescTable()
Definition outputlist.h:630
void startParameterExtra()
Definition outputlist.h:692
const OutputCodeList & codeGenerators() const
Definition outputlist.h:358
void startParameterList(bool openBracket)
Definition outputlist.h:700
void writeLatexSpacing()
Definition outputlist.h:545
void enable(OutputType o)
void endInlineMemberType()
Definition outputlist.h:728
void endMemberDescription()
Definition outputlist.h:567
void endMemberDeclaration(const DString &anchor, const DString &inheritId)
Definition outputlist.h:571
void startInlineMemberType()
Definition outputlist.h:726
void docify(const DString &s)
Definition outputlist.h:437
void startInlineMemberDoc()
Definition outputlist.h:734
void endMemberTemplateParams(const DString &anchor, const DString &inheritId)
Definition outputlist.h:499
void lineBreak(const DString &style=DString())
Definition outputlist.h:559
void startMemberDoc(const DString &clName, const DString &memName, const DString &anchor, const DString &title, int memCount, int memTotal, bool showInline)
Definition outputlist.h:531
void endDescTableTitle()
Definition outputlist.h:638
void insertMemberAlign(bool templ=false)
Definition outputlist.h:517
void startIndent()
Definition outputlist.h:582
void writeString(const DString &text)
Definition outputlist.h:411
void endDescForItem()
Definition outputlist.h:549
void endExamples()
Definition outputlist.h:580
void endDoxyAnchor(const DString &fn, const DString &anchor)
Definition outputlist.h:541
void startDescTable(const DString &title, const bool hasInits)
Definition outputlist.h:628
void endParagraph()
Definition outputlist.h:409
void endDescTableData()
Definition outputlist.h:646
void disableAll()
void startDescTableTitle()
Definition outputlist.h:636
void startExamples()
Definition outputlist.h:578
void endInlineMemberDoc()
Definition outputlist.h:736
void endMemberDocPrefixItem()
Definition outputlist.h:678
void startParameterDefVal(const char *separator)
Definition outputlist.h:696
void addLabel(const DString &fName, const DString &anchor)
Definition outputlist.h:543
void startBold()
Definition outputlist.h:561
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:495
void startTypewriter()
Definition outputlist.h:449
void startDescTableData()
Definition outputlist.h:644
void pushGeneratorState()
void startDescForItem()
Definition outputlist.h:547
void endParameterDefVal()
Definition outputlist.h:698
void disableAllBut(OutputType o)
void exceptionEntry(const DString &prefix, bool closeBracket)
Definition outputlist.h:704
void endParameterName()
Definition outputlist.h:690
void popGeneratorState()
void endBold()
Definition outputlist.h:563
void writeLabel(const DString &l, bool isLast)
Definition outputlist.h:740
void endLabels()
Definition outputlist.h:742
void startMemberItem(const DString &anchor, OutputGenerator::MemberItemType type, const DString &id=DString())
Definition outputlist.h:493
void startMemberDescription(const DString &anchor, const DString &inheritId=DString(), bool typ=false)
Definition outputlist.h:565
void endParameterList()
Definition outputlist.h:702
void endCallGraph(DotCallGraph &g)
Definition outputlist.h:658
void startInlineMemberName()
Definition outputlist.h:730
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
void startLabels()
Definition outputlist.h:738
void endParameterType()
Definition outputlist.h:686
void startMemberDocPrefixItem()
Definition outputlist.h:676
void endAnonTypeScope(int i1)
Definition outputlist.h:491
void startParameterName(bool one)
Definition outputlist.h:688
void enableAll()
void startParameterType(bool first, const DString &key)
Definition outputlist.h:684
void endTypewriter()
Definition outputlist.h:451
void endInlineMemberName()
Definition outputlist.h:732
void writeNonBreakableSpace(int num)
Definition outputlist.h:626
void startDoxyAnchor(const DString &fName, const DString &manName, const DString &anchor, const DString &name, const DString &args)
Definition outputlist.h:537
void endDescTableInit()
Definition outputlist.h:642
void startDescTableRow()
Definition outputlist.h:632
void startMemberTemplateParams()
Definition outputlist.h:497
std::unique_ptr< CodeParserInterface > getCodeParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
Definition parserintf.h:254
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)
TextGeneratorOLImpl(OutputList &ol)
Text streaming class that buffers data.
Definition textstream.h:36
virtual DString trProvidedByCategory()=0
virtual DString trReimplementedFromList(int numEntries)=0
virtual DString trDefineValue()=0
virtual DString trSubprogram(bool first_capital, bool singular)=0
virtual DString trImplementedInList(int numEntries)=0
virtual DString trInitialValue()=0
virtual DString trImplementedFromList(int numEntries)=0
virtual DString trVhdlType(VhdlSpecifier type, bool single)=0
virtual DString trReimplementedInList(int numEntries)=0
virtual DString trExtendsClass()=0
virtual DString trCallerGraph()=0
virtual DString trMember(bool first_capital, bool singular)=0
virtual DString trEnumerationValues()=0
virtual DString trCallGraph()=0
virtual DString trGlobal(bool first_capital, bool singular)=0
Wrapper class for a number of boolean properties.
Definition types.h:694
constexpr TypeSpecifier() noexcept
Definition types.h:696
static bool writeVHDLTypeDocumentation(const MemberDef *mdef, const Definition *d, OutputList &ol)
static bool isMisc(const MemberDef *mdef)
static void writeSource(const MemberDef *mdef, OutputList &ol, const DString &cname)
ClassDefMutable * toClassDefMutable(Definition *d)
ClassDef * getClass(const DString &n)
ClassDef * toClassDef(Definition *d)
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:154
SubMatch prefix() const
Return the part of the string before the match.
Definition regex.h:169
size_t position() const
Returns the position of the match or std::string::npos if no position is set.
Definition regex.h:160
SubMatch suffix() const
Return the part of the string after the match.
Definition regex.h:172
size_t length() const
Returns the position of the match or std::string::npos if no length is set.
Definition regex.h:163
std::string str() const
Returns the matching part as a string.
Definition regex.h:132
#define Config_getInt(name)
Definition config.h:34
#define Config_getList(name)
Definition config.h:38
#define Config_getBool(name)
Definition config.h:33
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::vector< std::string > StringVector
Definition containers.h:33
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
Definition defargs.l:828
Definition * toDefinition(DefinitionMutable *dm)
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:49
#define AUTO_TRACE(...)
Definition docnode.cpp:48
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
void docFindSections(const DString &input, const Definition *d, const DString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:476
#define ASSERT(x)
Definition dstring.h:29
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1966
GroupDef * toGroupDef(Definition *d)
Translator * theTranslator
Definition language.cpp:71
void linkifyText(const TextGeneratorIntf &out, const DString &text, const LinkifyTextOptions &options)
DString md5str(const std::string_view &str)
Definition md5hash.h:33
static DString simplifyTypeForTable(const DString &s)
static DString addTemplateNames(const DString &s, const DString &n, const DString &t)
static void writeExceptionListImpl(OutputList &ol, const ClassDef *cd, const MemberDef *md, DString const &exception)
static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberDef *md)
std::unique_ptr< MemberDef > createMemberDef(const DString &defFileName, int defLine, int defColumn, const DString &type, const DString &name, const DString &args, const DString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const DString &metaData)
Factory method to create a new instance of a MemberDef.
static DString combineArgsAndException(DString args, DString 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)
static DString stripTrailingReturn(const DString &trailRet)
void combineDeclarationAndDefinition(MemberDefMutable *mdec, MemberDefMutable *mdef)
MemberDef * toMemberDef(Definition *d)
static const reg::Ex reAnonymous(R"([\w:@]*@\d+)")
#define warn_undoc(file, line, fmt,...)
Definition message.h:102
#define warn_uncond(fmt,...)
Definition message.h:122
#define warn(file, line, fmt,...)
Definition message.h:97
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
ModuleDef * toModuleDef(Definition *d)
NamespaceDef * toNamespaceDef(Definition *d)
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:847
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
DString docs
Definition arguments.h:47
DString attrib
Definition arguments.h:41
DString defval
Definition arguments.h:46
DString array
Definition arguments.h:45
DString name
Definition arguments.h:44
DString type
Definition arguments.h:42
Options to configure the code parser.
Definition parserintf.h:78
Example(const DString &a, const DString &n, const DString &f)
Definition example.h:30
GroupPri_t
Grouping priority.
Definition types.h:230
@ GROUPING_AUTO_DEF
membership in group was defined via @defgroup
Definition types.h:234
LinkifyTextOptions & setScope(const Definition *scope)
Definition linkifytext.h:56
LinkifyTextOptions & setSelf(const Definition *self)
Definition linkifytext.h:62
LinkifyTextOptions & setFileScope(const FileDef *fileScope)
Definition linkifytext.h:59
This struct is used to capture the tag file information for an Entry.
Definition entry.h:104
DString tagName
Definition entry.h:105
DString anchor
Definition entry.h:107
DString fileName
Definition entry.h:106
CodeSymbolType
Definition types.h:481
MemberType
Definition types.h:569
MemberListContainer
Definition types.h:472
Protection
Definition types.h:32
SrcLangExt
Definition types.h:207
Relationship
Definition types.h:167
Specifier
Definition types.h:80
VhdlSpecifier
Definition types.h:770
DString stripExtension(const DString &fName)
Definition util.cpp:4710
DString substituteTemplateArgumentsInString(const DString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
Definition util.cpp:4130
DString inlineArgListToDoc(const ArgumentList &al)
Definition util.cpp:932
bool protectionLevelVisible(Protection prot)
Definition util.cpp:5698
DString stripFromIncludePath(const DString &path)
Definition util.cpp:287
DString detab(const DString &s, size_t &refIndent)
Definition util.cpp:6481
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:5222
void addRefItem(const RefItemVector &sli, const DString &key, const DString &prefix, const DString &name, const DString &title, const DString &args, const Definition *scope)
Definition util.cpp:4589
void writePageRef(OutputList &ol, const DString &cn, const DString &mn)
Definition util.cpp:212
DString removeRedundantWhiteSpace(const DString &s)
Definition util.cpp:525
DString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1026
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4975
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const DString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:1756
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:4686
void stripIndentationVerbatim(DString &doc, const int indentationLevel, bool skipFirstLine)
Definition util.cpp:5799
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3673
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5658
void mergeMemberOverrideOptions(MemberDefMutable *md1, MemberDefMutable *md2)
Definition util.cpp:6617
DString removeAnonymousScopes(const DString &str)
Definition util.cpp:114
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:852
DString inlineTemplateArgListToDoc(const ArgumentList &al)
Definition util.cpp:955
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:903
A bunch of utility functions.
bool isId(int c)
Definition util.h:165