Classes | Functions
memberdef.cpp File Reference
#include <stdio.h>
#include <qglobal.h>
#include <qregexp.h>
#include <assert.h>
#include "md5.h"
#include "memberdef.h"
#include "membername.h"
#include "doxygen.h"
#include "util.h"
#include "code.h"
#include "message.h"
#include "htmlhelp.h"
#include "language.h"
#include "outputlist.h"
#include "example.h"
#include "membergroup.h"
#include "groupdef.h"
#include "defargs.h"
#include "docparser.h"
#include "dot.h"
#include "searchindex.h"
#include "parserintf.h"
#include "marshal.h"
#include "objcache.h"
#include "vhdldocgen.h"
#include "arguments.h"
#include "memberlist.h"
#include "namespacedef.h"
#include "filedef.h"
#include "config.h"

Go to the source code of this file.

Classes

class  MemberDefImpl
 

Functions

static QCString addTemplateNames (const QCString &s, const QCString &n, const QCString &t)
 
static bool writeDefArgumentList (OutputList &ol, Definition *scope, MemberDef *md)
 
static void writeExceptionListImpl (OutputList &ol, ClassDef *cd, MemberDef *md, QCString const &exception)
 
static void writeExceptionList (OutputList &ol, ClassDef *cd, MemberDef *md)
 
static void writeTemplatePrefix (OutputList &ol, ArgumentList *al)
 
static QCString simplifyTypeForTable (const QCString &s)
 
static void invalidateCachedTypesInArgumentList (ArgumentList *al)
 
static void transferArgumentDocumentation (ArgumentList *decAl, ArgumentList *defAl)
 
void combineDeclarationAndDefinition (MemberDef *mdec, MemberDef *mdef)
 

Function Documentation

static QCString addTemplateNames ( const QCString s,
const QCString n,
const QCString t 
)
static

Definition at line 54 of file memberdef.cpp.

55 {
57  QCString clRealName=n;
58  int p=0,i;
59  if ((i=clRealName.find('<'))!=-1)
60  {
61  clRealName=clRealName.left(i); // strip template specialization
62  }
63  if ((i=clRealName.findRev("::"))!=-1)
64  {
65  clRealName=clRealName.right(clRealName.length()-i-2);
66  }
67  while ((i=s.find(clRealName,p))!=-1)
68  {
69  result+=s.mid(p,i-p);
70  uint j=clRealName.length()+i;
71  if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j))))
72  { // add template names
73  //printf("Adding %s+%s\n",clRealName.data(),t.data());
74  result+=clRealName+t;
75  }
76  else
77  { // template names already present
78  //printf("Adding %s\n",clRealName.data());
79  result+=clRealName;
80  }
81  p=i+clRealName.length();
82  }
83  result+=s.right(s.length()-p);
84  //printf("addTemplateNames(%s,%s,%s)=%s\n",s.data(),n.data(),t.data(),result.data());
85  return result;
86 }
static QCString result
uint length() const
Definition: qcstring.h:195
char & at(uint i) const
Definition: qcstring.h:326
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString right(uint len) const
Definition: qcstring.cpp:231
std::void_t< T > n
p
Definition: test.py:223
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
bool isId(int c)
Definition: util.h:224
unsigned uint
Definition: qglobal.h:351
void combineDeclarationAndDefinition ( MemberDef mdec,
MemberDef mdef 
)

Definition at line 4946 of file memberdef.cpp.

4947 {
4948  //printf("mdec=%s isPrototype()=%d\n",mdec->name().data(),mdec->isPrototype());
4949  if (
4950  (mdef->isFunction() && !mdef->isStatic() && !mdef->isPrototype()) ||
4951  (mdef->isVariable() && !mdef->isExternal() && !mdef->isStatic())
4952  )
4953  {
4954  //printf("mdef=(%p,%s) mdec=(%p,%s)\n",
4955  // mdef, mdef ? mdef->name().data() : "",
4956  // mdec, mdec ? mdec->name().data() : "");
4957 
4958  ArgumentList *mdefAl = mdef->argumentList();
4959  ArgumentList *mdecAl = mdec->argumentList();
4960  if (matchArguments2(mdef->getOuterScope(),mdef->getFileDef(),mdefAl,
4961  mdec->getOuterScope(),mdec->getFileDef(),mdecAl,
4962  TRUE
4963  )
4964  ) /* match found */
4965  {
4966  //printf("Found member %s: definition in %s (doc=`%s') and declaration in %s (doc=`%s')\n",
4967  // mn->memberName(),
4968  // mdef->getFileDef()->name().data(),mdef->documentation().data(),
4969  // mdec->getFileDef()->name().data(),mdec->documentation().data()
4970  // );
4971 
4972  // first merge argument documentation
4973  transferArgumentDocumentation(mdecAl,mdefAl);
4974 
4975  /* copy documentation between function definition and declaration */
4976  if (!mdec->briefDescription().isEmpty())
4977  {
4978  mdef->setBriefDescription(mdec->briefDescription(),mdec->briefFile(),mdec->briefLine());
4979  }
4980  else if (!mdef->briefDescription().isEmpty())
4981  {
4982  mdec->setBriefDescription(mdef->briefDescription(),mdef->briefFile(),mdef->briefLine());
4983  }
4984  if (!mdef->documentation().isEmpty())
4985  {
4986  //printf("transferring docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
4987  mdec->setDocumentation(mdef->documentation(),mdef->docFile(),mdef->docLine());
4989  if (mdefAl!=0)
4990  {
4991  ArgumentList *mdefAlComb = new ArgumentList;
4992  stringToArgumentList(mdef->argsString(),mdefAlComb);
4993  transferArgumentDocumentation(mdefAl,mdefAlComb);
4994  mdec->setArgumentList(mdefAlComb);
4995  }
4996  }
4997  else if (!mdec->documentation().isEmpty())
4998  {
4999  //printf("transferring docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
5000  mdef->setDocumentation(mdec->documentation(),mdec->docFile(),mdec->docLine());
5002  if (mdecAl!=0)
5003  {
5004  ArgumentList *mdecAlComb = new ArgumentList;
5005  stringToArgumentList(mdec->argsString(),mdecAlComb);
5006  transferArgumentDocumentation(mdecAl,mdecAlComb);
5007  mdef->setDeclArgumentList(mdecAlComb);
5008  }
5009  }
5010  if (!mdef->inbodyDocumentation().isEmpty())
5011  {
5012  mdec->setInbodyDocumentation(mdef->inbodyDocumentation(),mdef->inbodyFile(),mdef->inbodyLine());
5013  }
5014  else if (!mdec->inbodyDocumentation().isEmpty())
5015  {
5016  mdef->setInbodyDocumentation(mdec->inbodyDocumentation(),mdec->inbodyFile(),mdec->inbodyLine());
5017  }
5018  if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
5019  {
5020  //printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
5021  mdef->setBodySegment(mdec->getStartBodyLine(),mdec->getEndBodyLine());
5022  mdef->setBodyDef(mdec->getBodyDef());
5023  //mdef->setBodyMember(mdec);
5024  }
5025  else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
5026  {
5027  //printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
5028  mdec->setBodySegment(mdef->getStartBodyLine(),mdef->getEndBodyLine());
5029  mdec->setBodyDef(mdef->getBodyDef());
5030  //mdec->setBodyMember(mdef);
5031  }
5034 
5035 
5036  // copy group info.
5037  if (mdec->getGroupDef()==0 && mdef->getGroupDef()!=0)
5038  {
5039  mdec->setGroupDef(mdef->getGroupDef(),
5040  mdef->getGroupPri(),
5041  mdef->docFile(),
5042  mdef->docLine(),
5043  mdef->hasDocumentation(),
5044  mdef
5045  );
5046  }
5047  else if (mdef->getGroupDef()==0 && mdec->getGroupDef()!=0)
5048  {
5049  mdef->setGroupDef(mdec->getGroupDef(),
5050  mdec->getGroupPri(),
5051  mdec->docFile(),
5052  mdec->docLine(),
5053  mdec->hasDocumentation(),
5054  mdec
5055  );
5056  }
5057 
5058 
5059  mdec->mergeRefItems(mdef);
5060  mdef->mergeRefItems(mdec);
5061 
5062  mdef->setMemberDeclaration(mdec);
5063  mdec->setMemberDefinition(mdef);
5064 
5065  mdef->enableCallGraph(mdec->hasCallGraph() || mdef->hasCallGraph());
5066  mdef->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph());
5067  mdec->enableCallGraph(mdec->hasCallGraph() || mdef->hasCallGraph());
5068  mdec->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph());
5069  }
5070  }
5071 }
void setArgumentList(ArgumentList *al)
Definition: memberdef.cpp:3876
QCString docFile() const
bool isDocsForDefinition() const
Definition: memberdef.cpp:4482
This class represents an function or template argument list.
Definition: arguments.h:82
bool matchArguments2(Definition *srcScope, FileDef *srcFileScope, ArgumentList *srcAl, Definition *dstScope, FileDef *dstFileScope, ArgumentList *dstAl, bool checkCV)
Definition: util.cpp:3647
void setMemberDefinition(MemberDef *md)
Definition: memberdef.cpp:4786
bool isEmpty() const
Definition: qcstring.h:189
bool hasDocumentation() const
Definition: memberdef.cpp:3274
Grouping::GroupPri_t getGroupPri() const
Definition: memberdef.cpp:4100
void setBodyDef(FileDef *fd)
bool isPrototype() const
Definition: memberdef.cpp:4507
QCString inbodyDocumentation() const
FileDef * getBodyDef() const
void enableCallGraph(bool e)
Definition: memberdef.cpp:3923
void enableCallerGraph(bool e)
Definition: memberdef.cpp:3929
int briefLine() const
bool isVariable() const
Definition: memberdef.cpp:4140
bool hasCallerGraph() const
Definition: memberdef.cpp:4562
bool hasCallGraph() const
Definition: memberdef.cpp:4557
void mergeMemberSpecifiers(uint64 s)
Definition: memberdef.cpp:4643
FileDef * getFileDef() const
Definition: memberdef.cpp:4075
QCString inbodyFile() const
void setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace=TRUE)
Definition: memberdef.cpp:1126
void setInbodyDocumentation(const char *d, const char *inbodyFile, int inbodyLine)
Definition: memberdef.cpp:1138
QCString briefDescription(bool abbr=FALSE) const
Definition: memberdef.cpp:5073
static void transferArgumentDocumentation(ArgumentList *decAl, ArgumentList *defAl)
Definition: memberdef.cpp:4919
void stringToArgumentList(const char *argsString, ArgumentList *al, QCString *extraTypeChars)
Definition: defargs.cpp:2922
QCString briefFile() const
uint64 getMemberSpecifiers() const
Definition: memberdef.cpp:4065
int inbodyLine() const
void setDocsForDefinition(bool b)
Definition: memberdef.cpp:4771
virtual Definition * getOuterScope() const
QCString documentation() const
Definition: memberdef.cpp:5085
int getEndBodyLine() const
GroupDef * getGroupDef() const
Definition: memberdef.cpp:4095
ArgumentList * argumentList() const
Definition: memberdef.cpp:4512
int getStartBodyLine() const
void setMemberDeclaration(MemberDef *md)
Definition: memberdef.cpp:4791
void mergeRefItems(Definition *d)
void setDeclArgumentList(ArgumentList *al)
Definition: memberdef.cpp:3882
bool isFunction() const
Definition: memberdef.cpp:4160
void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=0)
Definition: memberdef.cpp:3363
int docLine() const
const char * argsString() const
Definition: memberdef.cpp:4040
bool isStatic() const
Definition: memberdef.cpp:4205
bool isExternal() const
Definition: memberdef.cpp:4438
void setBriefDescription(const char *b, const char *briefFile, int briefLine)
Definition: memberdef.cpp:1132
const bool TRUE
Definition: qglobal.h:371
void setBodySegment(int bls, int ble)
static void invalidateCachedTypesInArgumentList ( ArgumentList al)
static

Definition at line 4866 of file memberdef.cpp.

4867 {
4868  if (al)
4869  {
4870  ArgumentListIterator ali(*al);
4871  Argument *a;
4872  for (ali.toFirst();(a=ali.current());++ali)
4873  {
4874  a->canType.resize(0);
4875  }
4876  }
4877 }
bool resize(uint newlen)
Definition: qcstring.h:225
QCString canType
Definition: arguments.h:68
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
const double a
static QCString simplifyTypeForTable ( const QCString s)
static

Definition at line 3022 of file memberdef.cpp.

3023 {
3025  if (ts.right(2)=="::") ts = ts.left(ts.length()-2);
3026  static QRegExp re("[A-Z_a-z0-9]+::");
3027  int i,l;
3028  while ((i=re.match(ts,0,&l))!=-1)
3029  {
3030  ts=ts.left(i)+ts.mid(i+l);
3031  }
3032  i=ts.findRev('.');
3033  if (i!=-1) ts = ts.left(i);
3034  i=ts.findRev('.');
3035  if (i!=-1) ts = ts.right(ts.length()-i-1);
3036  //printf("simplifyTypeForTable(%s)->%s\n",s.data(),ts.data());
3037  return ts;
3038 }
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
uint length() const
Definition: qcstring.h:195
QCString left(uint len) const
Definition: qcstring.cpp:213
static QStrList * l
Definition: config.cpp:1044
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString removeAnonymousScopes(const QCString &s)
Definition: util.cpp:164
QCString right(uint len) const
Definition: qcstring.cpp:231
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static void transferArgumentDocumentation ( ArgumentList decAl,
ArgumentList defAl 
)
static

Definition at line 4919 of file memberdef.cpp.

4920 {
4921  if (decAl && defAl)
4922  {
4923  ArgumentListIterator decAli(*decAl);
4924  ArgumentListIterator defAli(*defAl);
4925  Argument *decA,*defA;
4926  for (decAli.toFirst(),defAli.toFirst();
4927  (decA=decAli.current()) && (defA=defAli.current());
4928  ++decAli,++defAli)
4929  {
4930  //printf("Argument decA->name=%s (doc=%s) defA->name=%s (doc=%s)\n",
4931  // decA->name.data(),decA->docs.data(),
4932  // defA->name.data(),defA->docs.data()
4933  // );
4934  if (decA->docs.isEmpty() && !defA->docs.isEmpty())
4935  {
4936  decA->docs = defA->docs.copy();
4937  }
4938  else if (defA->docs.isEmpty() && !decA->docs.isEmpty())
4939  {
4940  defA->docs = decA->docs.copy();
4941  }
4942  }
4943  }
4944 }
bool isEmpty() const
Definition: qcstring.h:189
QCString copy() const
Definition: qcstring.h:250
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
QCString docs
Definition: arguments.h:72
static bool writeDefArgumentList ( OutputList ol,
Definition scope,
MemberDef md 
)
static

Definition at line 121 of file memberdef.cpp.

122 {
123  ArgumentList *defArgList=(md->isDocsForDefinition()) ?
124  md->argumentList() : md->declArgumentList();
125  //printf("writeDefArgumentList `%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition());
126  if (defArgList==0 || md->isProperty())
127  {
128  return FALSE; // member has no function like argument list
129  }
130 
131  // simple argument list for tcl
132  if (md->getLanguage()==SrcLangExt_Tcl)
133  {
134  if (defArgList->count()==0) return FALSE;
135  ArgumentListIterator ali(*defArgList);
136  Argument *a;
137  ol.endMemberDocName();
139  ol.startParameterType(TRUE,0);
140  ol.endParameterType();
142  for (;(a=ali.current());++ali)
143  {
144  if (a->defval.isEmpty())
145  {
146  ol.docify(a->name+" ");
147  }
148  else
149  {
150  ol.docify("?"+a->name+"? ");
151  }
152  }
154  return TRUE;
155  }
156 
157  if (!md->isDefine()) ol.docify(" ");
158 
159  //printf("writeDefArgList(%d)\n",defArgList->count());
160  ol.pushGeneratorState();
161  //ol.disableAllBut(OutputGenerator::Html);
162  bool htmlOn = ol.isEnabled(OutputGenerator::Html);
163  bool latexOn = ol.isEnabled(OutputGenerator::Latex);
164  {
165  // html and latex
166  if (htmlOn) ol.enable(OutputGenerator::Html);
167  if (latexOn) ol.enable(OutputGenerator::Latex);
168 
169  ol.endMemberDocName();
170  ol.startParameterList(!md->isObjCMethod());
171  }
172  ol.enableAll();
175  {
176  // other formats
177  if (!md->isObjCMethod()) ol.docify("("); // start argument list
178  ol.endMemberDocName();
179  }
180  ol.popGeneratorState();
181  //printf("===> name=%s isDefine=%d\n",md->name().data(),md->isDefine());
182 
183  QCString cName;
184  if (scope)
185  {
186  cName=scope->name();
187  int il=cName.find('<');
188  int ir=cName.findRev('>');
189  if (il!=-1 && ir!=-1 && ir>il)
190  {
191  cName=cName.mid(il,ir-il+1);
192  //printf("1. cName=%s\n",cName.data());
193  }
194  else if (scope->definitionType()==Definition::TypeClass && ((ClassDef*)scope)->templateArguments())
195  {
196  cName=tempArgListToString(((ClassDef*)scope)->templateArguments(),scope->getLanguage());
197  //printf("2. cName=%s\n",cName.data());
198  }
199  else // no template specifier
200  {
201  cName.resize(0);
202  }
203  }
204  //printf("~~~ %s cName=%s\n",md->name().data(),cName.data());
205 
206  bool first=TRUE;
207  bool paramTypeStarted=FALSE;
208  bool isDefine = md->isDefine();
209  ArgumentListIterator ali(*defArgList);
210  Argument *a=ali.current();
211  while (a)
212  {
213  if (isDefine || first)
214  {
215  ol.startParameterType(first,0);
216  paramTypeStarted=TRUE;
217  if (isDefine)
218  {
219  ol.endParameterType();
221  }
222  }
223  QRegExp re(")("),res("(.*\\*");
224  int vp=a->type.find(re);
225  int wp=a->type.find(res);
226 
227  // use the following to put the function pointer type before the name
228  bool hasFuncPtrType=FALSE;
229 
230  if (!a->attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
231  {
232  ol.docify(a->attrib+" ");
233  }
234  if (hasFuncPtrType) // argument type is a function pointer
235  {
236  //printf("a->type=`%s' a->name=`%s'\n",a->type.data(),a->name.data());
237  QCString n=a->type.left(vp);
238  if (hasFuncPtrType) n=a->type.left(wp);
239  if (md->isObjCMethod()) { n.prepend("("); n.append(")"); }
240  if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
241  linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n);
242  }
243  else // non-function pointer type
244  {
245  QCString n=a->type;
246  if (md->isObjCMethod()) { n.prepend("("); n.append(")"); }
247  if (a->type!="...")
248  {
249  if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
250  linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n);
251  }
252  }
253  if (!isDefine)
254  {
255  if (paramTypeStarted)
256  {
257  ol.endParameterType();
258  paramTypeStarted=FALSE;
259  }
260  ol.startParameterName(defArgList->count()<2);
261  }
262  if (hasFuncPtrType)
263  {
264  ol.docify(a->type.mid(wp,vp-wp));
265  }
266  if (!a->name.isEmpty() || a->type=="...") // argument has a name
267  {
268  //if (!hasFuncPtrType)
269  //{
270  // ol.docify(" ");
271  //}
274  ol.docify(" "); /* man page */
275  if (htmlOn) ol.enable(OutputGenerator::Html);
277  ol.startEmphasis();
279  if (latexOn) ol.enable(OutputGenerator::Latex);
280  if (a->name.isEmpty()) ol.docify(a->type); else ol.docify(a->name);
283  ol.endEmphasis();
285  if (latexOn) ol.enable(OutputGenerator::Latex);
286  }
287  if (!a->array.isEmpty())
288  {
289  ol.docify(a->array);
290  }
291  if (hasFuncPtrType) // write the part of the argument type
292  // that comes after the name
293  {
295  md,a->type.right(a->type.length()-vp));
296  }
297  if (!a->defval.isEmpty()) // write the default value
298  {
299  QCString n=a->defval;
300  if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
301  ol.docify(" = ");
302 
303  ol.startTypewriter();
305  ol.endTypewriter();
306 
307  }
308  ++ali;
309  a=ali.current();
310  if (a)
311  {
312  if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
313  if (!isDefine)
314  {
315  QCString key;
316  if (md->isObjCMethod() && a->attrib.length()>=2)
317  {
318  //printf("Found parameter keyword %s\n",a->attrib.data());
319  // strip [ and ]
320  key=a->attrib.mid(1,a->attrib.length()-2);
321  if (key!=",") key+=":"; // for normal keywords add colon
322  }
323  ol.endParameterName(FALSE,FALSE,!md->isObjCMethod());
324  if (paramTypeStarted)
325  {
326  ol.endParameterType();
327  }
328  ol.startParameterType(FALSE,key);
329  paramTypeStarted=TRUE;
330  }
331  else // isDefine
332  {
333  ol.endParameterName(FALSE,FALSE,TRUE);
334  }
335  }
336  first=FALSE;
337  }
338  ol.pushGeneratorState();
341  if (!md->isObjCMethod()) ol.docify(")"); // end argument list
342  ol.enableAll();
343  if (htmlOn) ol.enable(OutputGenerator::Html);
344  if (latexOn) ol.enable(OutputGenerator::Latex);
345  if (first) ol.startParameterName(defArgList->count()<2);
346  ol.endParameterName(TRUE,defArgList->count()<2,!md->isObjCMethod());
347  ol.popGeneratorState();
348  if (md->extraTypeChars())
349  {
350  ol.docify(md->extraTypeChars());
351  }
352  if (defArgList->constSpecifier)
353  {
354  ol.docify(" const");
355  }
356  if (defArgList->volatileSpecifier)
357  {
358  ol.docify(" volatile");
359  }
360  if (!defArgList->trailingReturnType.isEmpty())
361  {
362  linkifyText(TextGeneratorOLImpl(ol), // out
363  scope, // scope
364  md->getBodyDef(), // fileScope
365  md, // self
366  defArgList->trailingReturnType, // text
367  FALSE // autoBreak
368  );
369 
370  }
371  return TRUE;
372 }
void startParameterType(bool first, const char *key)
Definition: outputlist.h:418
QCString type
Definition: arguments.h:67
bool resize(uint newlen)
Definition: qcstring.h:225
bool isProperty() const
Definition: memberdef.cpp:4185
bool isDocsForDefinition() const
Definition: memberdef.cpp:4482
This class represents an function or template argument list.
Definition: arguments.h:82
bool isEmpty() const
Definition: qcstring.h:189
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
uint length() const
Definition: qcstring.h:195
QCString defval
Definition: arguments.h:71
FileDef * getBodyDef() const
const bool FALSE
Definition: qglobal.h:370
void endEmphasis()
Definition: outputlist.h:257
void startEmphasis()
Definition: outputlist.h:255
QCString left(uint len) const
Definition: qcstring.cpp:213
bool isDefine() const
Definition: memberdef.cpp:4170
bool isEnabled(OutputGenerator::OutputType o)
Definition: outputlist.cpp:99
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
ArgumentList * declArgumentList() const
Definition: memberdef.cpp:4517
void startParameterName(bool one)
Definition: outputlist.h:422
void endParameterName(bool last, bool one, bool bracket)
Definition: outputlist.h:424
bool constSpecifier
Definition: arguments.h:99
void popGeneratorState()
Definition: outputlist.cpp:121
virtual DefType definitionType() const =0
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
uint count() const
Definition: qlist.h:66
bool volatileSpecifier
Definition: arguments.h:101
void endParameterType()
Definition: outputlist.h:420
const QCString & name() const
Definition: definition.h:114
void pushGeneratorState()
Definition: outputlist.cpp:111
def key(type, name=None)
Definition: graph.py:13
QCString right(uint len) const
Definition: qcstring.cpp:231
SrcLangExt getLanguage() const
std::void_t< T > n
const double a
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:79
void startParameterList(bool openBracket)
Definition: outputlist.h:426
void enable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:89
bool isObjCMethod() const
Definition: memberdef.cpp:3956
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
QCString attrib
Definition: arguments.h:66
ArgumentList * argumentList() const
Definition: memberdef.cpp:4512
void startTypewriter()
Definition: outputlist.h:172
QCString tempArgListToString(ArgumentList *al, SrcLangExt lang)
Definition: util.cpp:2197
const char * extraTypeChars() const
Definition: memberdef.cpp:4030
QCString name
Definition: arguments.h:69
void endMemberDocName()
Definition: outputlist.h:416
void enableAll()
Definition: outputlist.cpp:59
QCString trailingReturnType
Definition: arguments.h:105
void docify(const char *s)
Definition: outputlist.h:145
void linkifyText(const TextGeneratorIntf &out, Definition *scope, FileDef *fileScope, Definition *self, const char *text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition: util.cpp:1916
static QCString addTemplateNames(const QCString &s, const QCString &n, const QCString &t)
Definition: memberdef.cpp:54
const bool TRUE
Definition: qglobal.h:371
QCString & append(const char *s)
Definition: qcstring.cpp:383
QCString array
Definition: arguments.h:70
void endTypewriter()
Definition: outputlist.h:174
static void writeExceptionList ( OutputList ol,
ClassDef cd,
MemberDef md 
)
static

Definition at line 413 of file memberdef.cpp.

414 {
415  QCString exception(QCString(md->excpString()).stripWhiteSpace());
416  if ('{'==exception.at(0))
417  {
418  // this is an UNO IDL attribute - need special handling
419  int index = exception.find(';');
420  int oldIndex = 1;
421  while (-1 != index) // there should be no more than 2 (set / get)
422  {
423  // omit '{' and ';' -> "set raises (...)"
424  writeExceptionListImpl(ol,cd,md,exception.mid(oldIndex,index-oldIndex));
425  oldIndex=index+1;
426  index = exception.find(';',oldIndex);
427  }
428  // the rest is now just '}' - omit that
429  }
430  else
431  {
433  }
434 }
static void writeExceptionListImpl(OutputList &ol, ClassDef *cd, MemberDef *md, QCString const &exception)
Definition: memberdef.cpp:374
const char * excpString() const
Definition: memberdef.cpp:4045
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
static void writeExceptionListImpl ( OutputList ol,
ClassDef cd,
MemberDef md,
QCString const &  exception 
)
static

Definition at line 374 of file memberdef.cpp.

376 {
377  // this is ordinary exception spec - there must be a '('
378  //printf("exception='%s'\n",exception.data());
379  int index = exception.find('(');
380  if (index!=-1)
381  {
382  ol.exceptionEntry(exception.left(index),false);
383  ++index; // paren in second column so skip it here
384  for (int comma = exception.find(',', index); comma!=-1; )
385  {
386  ++comma; // include comma
388  exception.mid(index,comma-index));
389  ol.exceptionEntry(0,false);
390  index=comma;
391  comma = exception.find(',', index);
392  }
393  int close = exception.find(')', index);
394  if (close!=-1)
395  {
396  QCString type=removeRedundantWhiteSpace(exception.mid(index,close-index));
398  ol.exceptionEntry(0,true);
399  }
400  else
401  {
402  warn(md->getDefFileName(),md->getDefLine(),
403  "missing ) in exception list on member %s",qPrint(md->name()));
404  }
405  }
406  else // Java Exception
407  {
408  ol.docify(" ");
410  }
411 }
FileDef * getBodyDef() const
void exceptionEntry(const char *prefix, bool closeBracket)
Definition: outputlist.h:430
QCString getDefFileName() const
int close(int)
Closes the file descriptor fd.
const QCString & name() const
Definition: definition.h:114
int getDefLine() const
Definition: definition.h:188
void warn(const char *file, int line, const char *fmt,...)
Definition: message.cpp:183
QCString removeRedundantWhiteSpace(const QCString &s)
Definition: util.cpp:1655
static QCString type
Definition: declinfo.cpp:672
void docify(const char *s)
Definition: outputlist.h:145
void linkifyText(const TextGeneratorIntf &out, Definition *scope, FileDef *fileScope, Definition *self, const char *text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition: util.cpp:1916
const char * qPrint(const char *s)
Definition: qcstring.h:797
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
static void writeTemplatePrefix ( OutputList ol,
ArgumentList al 
)
static

Definition at line 436 of file memberdef.cpp.

437 {
438  ol.docify("template<");
439  ArgumentListIterator ali(*al);
440  Argument *a = ali.current();
441  while (a)
442  {
443  ol.docify(a->type);
444  ol.docify(" ");
445  ol.docify(a->name);
446  if (a->defval.length()!=0)
447  {
448  ol.docify(" = ");
449  ol.docify(a->defval);
450  }
451  ++ali;
452  a=ali.current();
453  if (a) ol.docify(", ");
454  }
455  ol.docify("> ");
456 }
QCString type
Definition: arguments.h:67
uint length() const
Definition: qcstring.h:195
QCString defval
Definition: arguments.h:71
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
const double a
QCString name
Definition: arguments.h:69
void docify(const char *s)
Definition: outputlist.h:145