diff options
Diffstat (limited to 'src/defgen.cpp')
-rw-r--r-- | src/defgen.cpp | 97 |
1 files changed, 46 insertions, 51 deletions
diff --git a/src/defgen.cpp b/src/defgen.cpp index aa9a1da..f5e12aa 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -144,71 +144,66 @@ void generateDEFForMember(MemberDef *md, if (isFunc) //function { - ArgumentList *declAl = new ArgumentList; - const ArgumentList *defAl = md->argumentList(); + const ArgumentList &defAl = md->argumentList(); + ArgumentList declAl; stringToArgumentList(md->argsString(),declAl); QCString fcnPrefix = " " + memPrefix + "param-"; - if (defAl && declAl->count()>0) + auto defIt = defAl.begin(); + for (const Argument &a : declAl) { - ArgumentListIterator declAli(*declAl); - ArgumentListIterator defAli(*defAl); - Argument *a; - for (declAli.toFirst();(a=declAli.current());++declAli) + const Argument *defArg = 0; + if (defIt!=defAl.end()) { - Argument *defArg = defAli.current(); - t << memPrefix << "param = {" << endl; - if (!a->attrib.isEmpty()) - { - t << fcnPrefix << "attributes = "; - writeDEFString(t,a->attrib); - t << ';' << endl; - } - if (!a->type.isEmpty()) - { - t << fcnPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl - << a->type << endl << "_EnD_oF_dEf_TeXt_;" << endl; - } - if (!a->name.isEmpty()) - { - t << fcnPrefix << "declname = "; - writeDEFString(t,a->name); - t << ';' << endl; - } - if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name) - { - t << fcnPrefix << "defname = "; - writeDEFString(t,defArg->name); - t << ';' << endl; - } - if (!a->array.isEmpty()) - { - t << fcnPrefix << "array = "; - writeDEFString(t,a->array); - t << ';' << endl; - } - if (!a->defval.isEmpty()) - { - t << fcnPrefix << "defval = <<_EnD_oF_dEf_TeXt_" << endl - << a->defval << endl << "_EnD_oF_dEf_TeXt_;" << endl; - } - if (defArg) ++defAli; - t << " }; /*" << fcnPrefix << "-param */" << endl; + defArg = &(*defIt); + ++defIt; } + t << memPrefix << "param = {" << endl; + if (!a.attrib.isEmpty()) + { + t << fcnPrefix << "attributes = "; + writeDEFString(t,a.attrib); + t << ';' << endl; + } + if (!a.type.isEmpty()) + { + t << fcnPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl + << a.type << endl << "_EnD_oF_dEf_TeXt_;" << endl; + } + if (!a.name.isEmpty()) + { + t << fcnPrefix << "declname = "; + writeDEFString(t,a.name); + t << ';' << endl; + } + if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name) + { + t << fcnPrefix << "defname = "; + writeDEFString(t,defArg->name); + t << ';' << endl; + } + if (!a.array.isEmpty()) + { + t << fcnPrefix << "array = "; + writeDEFString(t,a.array); + t << ';' << endl; + } + if (!a.defval.isEmpty()) + { + t << fcnPrefix << "defval = <<_EnD_oF_dEf_TeXt_" << endl + << a.defval << endl << "_EnD_oF_dEf_TeXt_;" << endl; + } + t << " }; /*" << fcnPrefix << "-param */" << endl; } - delete declAl; } else if ( md->memberType()==MemberType_Define && md->argsString()!=0) { - ArgumentListIterator ali(*md->argumentList()); - Argument *a; QCString defPrefix = " " + memPrefix + "def-"; - - for (ali.toFirst();(a=ali.current());++ali) + for (const Argument &a : md->argumentList()) { t << memPrefix << "param = {" << endl; - t << defPrefix << "name = '" << a->type << "';" << endl; + t << defPrefix << "name = '" << a.type << "';" << endl; t << " }; /*" << defPrefix << "-param */" << endl; } } |