summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-09-16 18:55:11 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-09-16 18:55:11 (GMT)
commit09b04bcb61a0e127cf502bc0533cd9bce9293406 (patch)
tree5b81b4d5e8d966a6dd9a5ea304da840383ed6465 /src
parentdd472de9333768545f2a0135d20da8ff06d1f8b0 (diff)
downloadDoxygen-09b04bcb61a0e127cf502bc0533cd9bce9293406.zip
Doxygen-09b04bcb61a0e127cf502bc0533cd9bce9293406.tar.gz
Doxygen-09b04bcb61a0e127cf502bc0533cd9bce9293406.tar.bz2
Renamed EXTRACT_ANON_ARGUMENTS to RESOLVE_UNNAMED_PARAMS and enabled it by default
Diffstat (limited to 'src')
-rw-r--r--src/config.xml7
-rw-r--r--src/memberdef.cpp25
-rw-r--r--src/memberdef.h2
3 files changed, 19 insertions, 15 deletions
diff --git a/src/config.xml b/src/config.xml
index 7bacf3e..39e83ad 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -916,11 +916,12 @@ Go to the <a href="commands.html">next</a> section or return to the
]]>
</docs>
</option>
- <option type='bool' id='EXTRACT_ANON_ARGUMENTS' defval='0'>
+ <option type='bool' id='RESOLVE_UNNAMED_PARAMS' defval='1'>
<docs>
<![CDATA[
- If this flag is set to \c YES, the name of anonymous arguments in declarations will be
- extracted from the definitions. By default anonymous arguments will stay nameless.
+ If this flag is set to \c YES, the name of an unnamed parameter in a declaration will be
+ determined by the corresponding definition. By default unnamed parameters remain unnamed
+ in the output.
]]>
</docs>
</option>
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 1901970..6d179c2 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -277,7 +277,6 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
virtual void setDeclFile(const QCString &df,int line,int column);
virtual void moveArgumentList(std::unique_ptr<ArgumentList> al);
virtual void moveDeclArgumentList(std::unique_ptr<ArgumentList> al);
- virtual void extractArgumentNames(const MemberDef& md);
virtual void setDefinitionTemplateParameterLists(const ArgumentLists &lists);
virtual void setTypeConstraints(const ArgumentList &al);
virtual void setType(const char *t);
@@ -331,6 +330,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
bool onlyText=FALSE) const;
virtual void addToSearchIndex() const;
+ virtual void resolveUnnamedParameters(const MemberDef *md);
private:
void _computeLinkableInProject();
@@ -790,7 +790,6 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
virtual void setDeclFile(const QCString &df,int line,int column) {}
virtual void moveArgumentList(std::unique_ptr<ArgumentList> al) {}
virtual void moveDeclArgumentList(std::unique_ptr<ArgumentList> al) {}
- virtual void extractArgumentNames(const MemberDef& md) {}
virtual void setDefinitionTemplateParameterLists(const ArgumentLists &lists) {}
virtual void setTypeConstraints(const ArgumentList &al) {}
virtual void setType(const char *t) {}
@@ -852,6 +851,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
virtual void warnIfUndocumented() const {}
virtual void warnIfUndocumentedParams() const {}
virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const {}
+ virtual void resolveUnnamedParameters(const MemberDef *md) {}
private:
MemberGroup *m_memberGroup; // group's member definition
};
@@ -5487,12 +5487,12 @@ const ArgumentList &MemberDefImpl::declArgumentList() const
return m_impl->declArgList;
}
-void MemberDefImpl::extractArgumentNames(const MemberDef& md)
+void MemberDefImpl::resolveUnnamedParameters(const MemberDef *md)
{
ArgumentList &decAl = m_impl->declArgList;
ArgumentList &defAl = m_impl->defArgList;
- const ArgumentList &decAlSrc = md.declArgumentList();
- const ArgumentList &defAlSrc = md.argumentList();
+ const ArgumentList &decAlSrc = md->declArgumentList();
+ const ArgumentList &defAlSrc = md->argumentList();
auto decSrc = decAlSrc.begin(), defSrc = defAlSrc.begin();
for (auto decIt = decAl.begin(), defIt = defAl.begin();
decIt != decAl.end() && defIt != defAl.end() && decSrc != decAlSrc.end() && defSrc != defAlSrc.end();
@@ -6001,13 +6001,16 @@ static void transferArgumentDocumentation(ArgumentList &decAl,ArgumentList &defA
{
defA.docs = decA.docs;
}
- if (decA.name.isEmpty() && !defA.name.isEmpty())
+ if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
{
+ if (decA.name.isEmpty() && !defA.name.isEmpty())
+ {
decA.name = defA.name;
- }
- else if (defA.name.isEmpty() && !decA.name.isEmpty())
- {
+ }
+ else if (defA.name.isEmpty() && !decA.name.isEmpty())
+ {
defA.name = decA.name;
+ }
}
}
}
@@ -6040,9 +6043,9 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
// mdec->getFileDef()->name().data(),mdec->documentation().data()
// );
- if (Config_getBool(EXTRACT_ANON_ARGUMENTS))
+ if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
{
- mdec->extractArgumentNames(*mdef);
+ mdec->resolveUnnamedParameters(mdef);
}
// first merge argument documentation
diff --git a/src/memberdef.h b/src/memberdef.h
index da30c9f..cc467ea 100644
--- a/src/memberdef.h
+++ b/src/memberdef.h
@@ -336,7 +336,7 @@ class MemberDef : virtual public Definition
// argument related members
virtual void moveArgumentList(std::unique_ptr<ArgumentList> al) = 0;
virtual void moveDeclArgumentList(std::unique_ptr<ArgumentList> al) = 0;
- virtual void extractArgumentNames(const MemberDef& md) = 0;
+ virtual void resolveUnnamedParameters(const MemberDef *md) = 0;
virtual void setDefinitionTemplateParameterLists(const ArgumentLists &lists) = 0;
virtual void setTypeConstraints(const ArgumentList &al) = 0;
virtual void setType(const char *t) = 0;