Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Definition Class Referenceabstract

#include <definition.h>

Inheritance diagram for Definition:
DefinitionIntf ClassDef DirDef FileDef GroupDef MemberDef NamespaceDef PageDef

Classes

struct  Cookie
 

Public Member Functions

 Definition (const char *defFileName, int defLine, int defColumn, const char *name, const char *b=0, const char *d=0, bool isSymbol=TRUE)
 
virtual ~Definition ()
 
const QCStringname () const
 
virtual QCString displayName (bool includeScope=TRUE) const =0
 
QCString localName () const
 
virtual QCString qualifiedName () const
 
QCString symbolName () const
 
virtual QCString getOutputFileBase () const =0
 
virtual QCString anchor () const =0
 
virtual QCString getSourceFileBase () const
 
virtual QCString getSourceAnchor () const
 
virtual QCString documentation () const
 
int docLine () const
 
QCString docFile () const
 
virtual QCString briefDescription (bool abbreviate=FALSE) const
 
QCString briefDescriptionAsTooltip () const
 
int briefLine () const
 
QCString inbodyDocumentation () const
 
QCString inbodyFile () const
 
int inbodyLine () const
 
QCString briefFile () const
 
QCString getDefFileName () const
 
QCString getDefFileExtension () const
 
int getDefLine () const
 
int getDefColumn () const
 
virtual bool hasDocumentation () const
 
virtual bool hasUserDocumentation () const
 
virtual bool isLinkableInProject () const =0
 
virtual bool isLinkable () const =0
 
virtual bool isVisibleInProject () const
 
virtual bool isVisible () const
 
bool isHidden () const
 
bool isArtificial () const
 
virtual QCString getReference () const
 
virtual bool isReference () const
 
QCString externalReference (const QCString &relPath) const
 
int getStartBodyLine () const
 
int getEndBodyLine () const
 
FileDefgetBodyDef () const
 
SrcLangExt getLanguage () const
 
GroupListpartOfGroups () const
 
QList< ListItemInfo > * xrefListItems () const
 
virtual DefinitionfindInnerCompound (const char *name)
 
virtual DefinitiongetOuterScope () const
 
MemberSDictgetReferencesMembers () const
 
MemberSDictgetReferencedByMembers () const
 
bool hasSections () const
 
bool hasSources () const
 
bool hasBriefDescription () const
 
QCString id () const
 
virtual void setName (const char *name)
 
void setId (const char *name)
 
virtual void setDocumentation (const char *d, const char *docFile, int docLine, bool stripWhiteSpace=TRUE)
 
virtual void setBriefDescription (const char *b, const char *briefFile, int briefLine)
 
virtual void setInbodyDocumentation (const char *d, const char *docFile, int docLine)
 
void setReference (const char *r)
 
void addSectionsToDefinition (QList< SectionInfo > *anchorList)
 
void setBodySegment (int bls, int ble)
 
void setBodyDef (FileDef *fd)
 
void addSourceReferencedBy (MemberDef *d)
 
void addSourceReferences (MemberDef *d)
 
void setRefItems (const QList< ListItemInfo > *sli)
 
void mergeRefItems (Definition *d)
 
virtual void addInnerCompound (Definition *d)
 
virtual void setOuterScope (Definition *d)
 
virtual void setHidden (bool b)
 
void setArtificial (bool b)
 
void setLanguage (SrcLangExt lang)
 
QCString convertNameToFile (const char *name, bool allowDots=FALSE) const
 
void writeSourceDef (OutputList &ol, const char *scopeName)
 
void writeInlineCode (OutputList &ol, const char *scopeName)
 
void writeSourceRefs (OutputList &ol, const char *scopeName)
 
void writeSourceReffedBy (OutputList &ol, const char *scopeName)
 
void makePartOfGroup (GroupDef *gd)
 
void writeNavigationPath (OutputList &ol) const
 
QCString navigationPathAsString () const
 
virtual void writeQuickMemberLinks (OutputList &, MemberDef *) const
 
virtual void writeSummaryLinks (OutputList &)
 
QCString pathFragment () const
 
void writeDocAnchorsToTagFile (FTextStream &)
 
void setLocalName (const QCString name)
 
void addSectionsToIndex ()
 
void writeToc (OutputList &ol)
 
void setCookie (Cookie *cookie)
 
Cookiecookie () const
 
- Public Member Functions inherited from DefinitionIntf
 DefinitionIntf ()
 
virtual ~DefinitionIntf ()
 
virtual DefType definitionType () const =0
 

Protected Member Functions

 Definition (const Definition &d)
 

Private Member Functions

void _setSymbolName (const QCString &name)
 
int _getXRefListId (const char *listName) const
 
void _writeSourceRefList (OutputList &ol, const char *scopeName, const QCString &text, MemberSDict *members, bool)
 
void _setBriefDescription (const char *b, const char *briefFile, int briefLine)
 
void _setDocumentation (const char *d, const char *docFile, int docLine, bool stripWhiteSpace, bool atTop)
 
void _setInbodyDocumentation (const char *d, const char *docFile, int docLine)
 
bool _docsAlreadyAdded (const QCString &doc, QCString &sigList)
 

Static Private Member Functions

static void addToMap (const char *name, Definition *d)
 
static void removeFromMap (Definition *d)
 

Private Attributes

DefinitionImplm_impl
 
QCString m_name
 
bool m_isSymbol
 
QCString m_symbolName
 
int m_defLine
 
int m_defColumn
 
Cookiem_cookie
 

Additional Inherited Members

- Public Types inherited from DefinitionIntf
enum  DefType {
  TypeClass = 0, TypeFile = 1, TypeNamespace = 2, TypeMember = 3,
  TypeGroup = 4, TypePackage = 5, TypePage = 6, TypeDir = 7,
  TypeSymbolList = 8
}
 

Detailed Description

The common base class of all entity definitions found in the sources.

This can be a class or a member function, or a file, or a namespace, etc. Use definitionType() to find which type of definition this is.

Definition at line 92 of file definition.h.

Constructor & Destructor Documentation

Definition::Definition ( const char *  defFileName,
int  defLine,
int  defColumn,
const char *  name,
const char *  b = 0,
const char *  d = 0,
bool  isSymbol = TRUE 
)

Create a new definition

Definition at line 283 of file definition.cpp.

285  : m_cookie(0)
286 {
287  m_name = name;
288  m_defLine = dl;
289  m_defColumn = dc;
290  m_impl = new DefinitionImpl;
291  m_impl->init(df,name);
292  m_isSymbol = isSymbol;
293  if (isSymbol) addToMap(name,this);
294  _setBriefDescription(b,df,dl);
295  _setDocumentation(d,df,dl,TRUE,FALSE);
297  {
298  m_impl->hidden = TRUE;
299  }
300 }
Cookie * m_cookie
Definition: definition.h:377
const bool FALSE
Definition: qglobal.h:370
void _setBriefDescription(const char *b, const char *briefFile, int briefLine)
Definition: definition.cpp:632
static void addToMap(const char *name, Definition *d)
Definition: definition.cpp:207
bool m_isSymbol
Definition: definition.h:373
const QCString & name() const
Definition: definition.h:114
static bool matchExcludedSymbols(const char *name)
Definition: definition.cpp:150
void init(const char *df, const char *n)
Definition: definition.cpp:113
QCString m_name
Definition: definition.h:372
void _setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace, bool atTop)
Definition: definition.cpp:566
static bool * b
Definition: config.cpp:1043
int m_defLine
Definition: definition.h:375
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
int m_defColumn
Definition: definition.h:376
Definition::~Definition ( )
virtual

Destroys the definition

Definition at line 381 of file definition.cpp.

382 {
383  if (m_isSymbol)
384  {
385  removeFromMap(this);
386  }
387  if (m_impl)
388  {
389  delete m_impl;
390  m_impl=0;
391  }
392  delete m_cookie;
393  m_cookie=0;
394 }
Cookie * m_cookie
Definition: definition.h:377
bool m_isSymbol
Definition: definition.h:373
static void removeFromMap(Definition *d)
Definition: definition.cpp:254
DefinitionImpl * m_impl
Definition: definition.h:371
Definition::Definition ( const Definition d)
protected

Definition at line 302 of file definition.cpp.

302  : DefinitionIntf(), m_cookie(0)
303 {
304  m_name = d.m_name;
305  m_defLine = d.m_defLine;
306  m_impl = new DefinitionImpl;
307  *m_impl = *d.m_impl;
308  m_impl->sectionDict = 0;
309  m_impl->sourceRefByDict = 0;
310  m_impl->sourceRefsDict = 0;
311  m_impl->partOfGroups = 0;
312  m_impl->xrefListItems = 0;
313  m_impl->brief = 0;
314  m_impl->details = 0;
315  m_impl->body = 0;
316  m_impl->inbodyDocs = 0;
317  if (d.m_impl->sectionDict)
318  {
319  m_impl->sectionDict = new SectionDict(17);
321  SectionInfo *si;
322  for (it.toFirst();(si=it.current());++it)
323  {
324  m_impl->sectionDict->append(si->label,si);
325  }
326  }
327  if (d.m_impl->sourceRefByDict)
328  {
331  MemberDef *md;
332  for (it.toFirst();(md=it.current());++it)
333  {
334  m_impl->sourceRefByDict->append(it.currentKey(),md);
335  }
336  }
337  if (d.m_impl->sourceRefsDict)
338  {
341  MemberDef *md;
342  for (it.toFirst();(md=it.current());++it)
343  {
344  m_impl->sourceRefsDict->append(it.currentKey(),md);
345  }
346  }
347  if (d.m_impl->partOfGroups)
348  {
350  GroupDef *gd;
351  for (it.toFirst();(gd=it.current());++it)
352  {
353  makePartOfGroup(gd);
354  }
355  }
356  if (d.m_impl->xrefListItems)
357  {
359  }
360  if (d.m_impl->brief)
361  {
362  m_impl->brief = new BriefInfo(*d.m_impl->brief);
363  }
364  if (d.m_impl->details)
365  {
366  m_impl->details = new DocInfo(*d.m_impl->details);
367  }
368  if (d.m_impl->body)
369  {
370  m_impl->body = new BodyInfo(*d.m_impl->body);
371  }
372  if (d.m_impl->inbodyDocs)
373  {
375  }
376 
378  if (m_isSymbol) addToMap(m_name,this);
379 }
Cookie * m_cookie
Definition: definition.h:377
SectionDict * sectionDict
Definition: definition.cpp:59
QCString label
Definition: section.h:56
void append(const char *key, const T *d)
Definition: sortdict.h:135
GroupList * partOfGroups
Definition: definition.cpp:64
MemberSDict * sourceRefByDict
Definition: definition.cpp:61
Definition: sortdict.h:73
static void addToMap(const char *name, Definition *d)
Definition: definition.cpp:207
bool m_isSymbol
Definition: definition.h:373
QCString m_name
Definition: definition.h:372
MemberSDict * sourceRefsDict
Definition: definition.cpp:62
void makePartOfGroup(GroupDef *gd)
DocInfo * details
Definition: definition.cpp:66
friend class IteratorDict
Definition: sortdict.h:353
void setRefItems(const QList< ListItemInfo > *sli)
DocInfo * inbodyDocs
Definition: definition.cpp:67
QList< ListItemInfo > * xrefListItems
Definition: definition.cpp:63
BriefInfo * brief
Definition: definition.cpp:68
BodyInfo * body
Definition: definition.cpp:69
int m_defLine
Definition: definition.h:375
DefinitionImpl * m_impl
Definition: definition.h:371

Member Function Documentation

bool Definition::_docsAlreadyAdded ( const QCString doc,
QCString sigList 
)
private

Definition at line 544 of file definition.cpp.

545 {
546  uchar md5_sig[16];
547  QCString sigStr(33);
548  // to avoid mismatches due to differences in indenting, we first remove
549  // double whitespaces...
550  QCString docStr = doc.simplifyWhiteSpace();
551  MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
552  MD5SigToString(md5_sig,sigStr.rawData(),33);
553  //printf("%s:_docsAlreadyAdded doc='%s' sig='%s' docSigs='%s'\n",
554  // name().data(),doc.data(),sigStr.data(),sigList.data());
555  if (sigList.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
556  {
557  sigList+=":"+sigStr;
558  return FALSE;
559  }
560  else
561  {
562  return TRUE;
563  }
564 }
uint length() const
Definition: qcstring.h:195
const bool FALSE
Definition: qglobal.h:370
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
unsigned char uchar
Definition: nybbler.cc:11
void MD5Buffer(const unsigned char *buf, unsigned int len, unsigned char sig[16])
Definition: md5.c:275
const char * data() const
Definition: qcstring.h:207
void MD5SigToString(unsigned char signature[16], char *str, int len)
Definition: md5.c:285
const bool TRUE
Definition: qglobal.h:371
QCString simplifyWhiteSpace() const
Definition: qcstring.cpp:323
int Definition::_getXRefListId ( const char *  listName) const
private

Definition at line 1488 of file definition.cpp.

1489 {
1490  if (m_impl->xrefListItems)
1491  {
1493  ListItemInfo *lii;
1494  for (slii.toFirst();(lii=slii.current());++slii)
1495  {
1496  if (qstrcmp(lii->type,listName)==0)
1497  {
1498  return lii->itemId;
1499  }
1500  }
1501  }
1502  return -1;
1503 }
int itemId
Definition: types.h:101
QList< ListItemInfo > * xrefListItems
Definition: definition.cpp:63
QCString type
Definition: types.h:100
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:95
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::_setBriefDescription ( const char *  b,
const char *  briefFile,
int  briefLine 
)
private

Definition at line 632 of file definition.cpp.

633 {
634  static QCString outputLanguage = Config_getEnum("OUTPUT_LANGUAGE");
635  static bool needsDot = outputLanguage!="Japanese" &&
636  outputLanguage!="Chinese" &&
637  outputLanguage!="Korean";
638  QCString brief = b;
639  brief = brief.stripWhiteSpace();
640  if (brief.isEmpty()) return;
641  int bl = brief.length();
642  if (bl>0 && needsDot) // add punctuation if needed
643  {
644  int c = brief.at(bl-1);
645  switch(c)
646  {
647  case '.': case '!': case '?': case '>': case ':': case ')': break;
648  default:
649  if (uni_isupper(brief.at(0)) && !lastCharIsMultibyte(brief)) brief+='.';
650  break;
651  }
652  }
653 
655  {
656  if (m_impl->brief && !m_impl->brief->doc.isEmpty())
657  {
658  //printf("adding to details\n");
660  }
661  else
662  {
663  //fprintf(stderr,"Definition::setBriefDescription(%s,%s,%d)\n",b,briefFile,briefLine);
664  if (m_impl->brief==0)
665  {
666  m_impl->brief = new BriefInfo;
667  }
668  m_impl->brief->doc=brief;
669  if (briefLine!=-1)
670  {
673  }
674  else
675  {
677  m_impl->brief->line = 1;
678  }
679  }
680  }
681  else
682  {
683  //printf("do nothing!\n");
684  }
685 }
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
bool brief
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
char & at(uint i) const
Definition: qcstring.h:326
const bool FALSE
Definition: qglobal.h:370
int briefLine() const
QCString briefSignatures
Definition: definition.cpp:70
#define Config_getEnum(val)
Definition: config.cpp:663
int line
Definition: definition.h:52
#define uni_isupper(c)
Definition: definition.cpp:618
QCString file
Definition: definition.h:53
QCString briefFile() const
static bool lastCharIsMultibyte(const QCString &s)
Definition: definition.cpp:622
void _setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace, bool atTop)
Definition: definition.cpp:566
static bool * b
Definition: config.cpp:1043
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
QCString doc
Definition: definition.h:50
const bool TRUE
Definition: qglobal.h:371
bool _docsAlreadyAdded(const QCString &doc, QCString &sigList)
Definition: definition.cpp:544
void Definition::_setDocumentation ( const char *  d,
const char *  docFile,
int  docLine,
bool  stripWhiteSpace,
bool  atTop 
)
private

Definition at line 566 of file definition.cpp.

568 {
569  //printf("%s::setDocumentation(%s,%s,%d,%d)\n",name().data(),d,docFile,docLine,stripWhiteSpace);
570  if (d==0) return;
571  QCString doc = d;
572  if (stripWhiteSpace)
573  {
575  }
576  else // don't strip whitespace
577  {
578  doc=d;
579  }
581  {
582  //printf("setting docs for %s: `%s'\n",name().data(),m_doc.data());
583  if (m_impl->details==0)
584  {
585  m_impl->details = new DocInfo;
586  }
587  if (m_impl->details->doc.isEmpty()) // fresh detailed description
588  {
589  m_impl->details->doc = doc;
590  }
591  else if (atTop) // another detailed description, append it to the start
592  {
593  m_impl->details->doc = doc+"\n\n"+m_impl->details->doc;
594  }
595  else // another detailed description, append it to the end
596  {
597  m_impl->details->doc += "\n\n"+doc;
598  }
599  if (docLine!=-1) // store location if valid
600  {
603  }
604  else
605  {
607  m_impl->details->line = 1;
608  }
609  }
610 }
QCString docFile() const
bool isEmpty() const
Definition: qcstring.h:189
QCString file
Definition: definition.h:44
int line
Definition: definition.h:43
QCString docSignatures
Definition: definition.cpp:71
QCString doc
Definition: definition.h:42
DocInfo * details
Definition: definition.cpp:66
QCString doc
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Definition: util.cpp:6876
int docLine() const
DefinitionImpl * m_impl
Definition: definition.h:371
bool _docsAlreadyAdded(const QCString &doc, QCString &sigList)
Definition: definition.cpp:544
void Definition::_setInbodyDocumentation ( const char *  d,
const char *  docFile,
int  docLine 
)
private

Definition at line 693 of file definition.cpp.

694 {
695  if (m_impl->inbodyDocs==0)
696  {
697  m_impl->inbodyDocs = new DocInfo;
698  }
699  if (m_impl->inbodyDocs->doc.isEmpty()) // fresh inbody docs
700  {
701  m_impl->inbodyDocs->doc = doc;
704  }
705  else // another inbody documentation fragment, append this to the end
706  {
707  m_impl->inbodyDocs->doc += QCString("\n\n")+doc;
708  }
709 }
bool isEmpty() const
Definition: qcstring.h:189
QCString file
Definition: definition.h:44
int line
Definition: definition.h:43
QCString inbodyFile() const
QCString doc
Definition: definition.h:42
int inbodyLine() const
DocInfo * inbodyDocs
Definition: definition.cpp:67
QCString doc
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::_setSymbolName ( const QCString name)
private

Definition at line 1937 of file definition.cpp.

1938 {
1939  m_symbolName=name;
1940 }
QCString m_symbolName
Definition: definition.h:374
const QCString & name() const
Definition: definition.h:114
void Definition::_writeSourceRefList ( OutputList ol,
const char *  scopeName,
const QCString text,
MemberSDict members,
bool   
)
private

Write a reference to the source code fragments in which this definition is used.

Definition at line 1142 of file definition.cpp.

1144 {
1145  static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE");
1146  static bool rtfSourceCode = Config_getBool("RTF_SOURCE_CODE");
1147  static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
1148  static bool refLinkSource = Config_getBool("REFERENCES_LINK_SOURCE");
1149  ol.pushGeneratorState();
1150  if (members)
1151  {
1152  members->sort();
1153 
1154  ol.startParagraph();
1155  ol.parseText(text);
1156  ol.docify(" ");
1157 
1158  QCString ldefLine=theTranslator->trWriteList(members->count());
1159 
1160  QRegExp marker("@[0-9]+");
1161  int index=0,newIndex,matchLen;
1162  // now replace all markers in inheritLine with links to the classes
1163  while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1)
1164  {
1165  bool ok;
1166  ol.parseText(ldefLine.mid(index,newIndex-index));
1167  uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
1168  MemberDef *md=members->at(entryIndex);
1169  if (ok && md)
1170  {
1172  QCString name=md->name();
1173  //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName);
1174  if (!scope.isEmpty() && scope!=scopeName)
1175  {
1177  }
1178  if (!md->isObjCMethod() &&
1179  (md->isFunction() || md->isSlot() ||
1180  md->isPrototype() || md->isSignal()
1181  )
1182  )
1183  {
1184  name+="()";
1185  }
1186  //Definition *d = md->getOutputFileBase();
1187  //if (d==Doxygen::globalScope) d=md->getBodyDef();
1188  if (sourceBrowser &&
1189  !(md->isLinkable() && !refLinkSource) &&
1190  md->getStartBodyLine()!=-1 &&
1191  md->getBodyDef()
1192  )
1193  {
1194  //printf("md->getBodyDef()=%p global=%p\n",md->getBodyDef(),Doxygen::globalScope);
1195  // for HTML write a real link
1196  ol.pushGeneratorState();
1197  //ol.disableAllBut(OutputGenerator::Html);
1198 
1200  if (!latexSourceCode)
1201  {
1203  }
1204  if (!rtfSourceCode)
1205  {
1207  }
1208  const int maxLineNrStr = 10;
1209  char anchorStr[maxLineNrStr];
1210  qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine());
1211  //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data());
1212  ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name);
1213  ol.popGeneratorState();
1214 
1215  // for the other output formats just mention the name
1216  ol.pushGeneratorState();
1218  if (latexSourceCode)
1219  {
1221  }
1222  if (rtfSourceCode)
1223  {
1225  }
1226  ol.docify(name);
1227  ol.popGeneratorState();
1228  }
1229  else if (md->isLinkable() /*&& d && d->isLinkable()*/)
1230  {
1231  // for HTML write a real link
1232  ol.pushGeneratorState();
1233  //ol.disableAllBut(OutputGenerator::Html);
1235  if (!latexSourceCode)
1236  {
1238  }
1239  if (!rtfSourceCode)
1240  {
1242  }
1243 
1244  ol.writeObjectLink(md->getReference(),
1245  md->getOutputFileBase(),
1246  md->anchor(),name);
1247  ol.popGeneratorState();
1248 
1249  // for the other output formats just mention the name
1250  ol.pushGeneratorState();
1252  if (latexSourceCode)
1253  {
1255  }
1256  if (rtfSourceCode)
1257  {
1259  }
1260  ol.docify(name);
1261  ol.popGeneratorState();
1262  }
1263  else
1264  {
1265  ol.docify(name);
1266  }
1267  }
1268  index=newIndex+matchLen;
1269  }
1270  ol.parseText(ldefLine.right(ldefLine.length()-index));
1271  ol.writeString(".");
1272  ol.endParagraph();
1273  }
1274  ol.popGeneratorState();
1275 }
static QCString scope
Definition: declinfo.cpp:668
bool isEmpty() const
Definition: qcstring.h:189
QCString getReference() const
Definition: memberdef.cpp:1001
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
uint length() const
Definition: qcstring.h:195
void writeString(const char *text)
Definition: outputlist.h:119
bool isPrototype() const
Definition: memberdef.cpp:4507
#define qsnprintf
Definition: qcstring.h:73
void startParagraph()
Definition: outputlist.h:115
FileDef * getBodyDef() const
bool isSignal() const
Definition: memberdef.cpp:4130
bool isSlot() const
Definition: memberdef.cpp:4135
int count() const
Definition: sortdict.h:284
bool parseText(const QCString &textStr)
Definition: outputlist.cpp:175
void popGeneratorState()
Definition: outputlist.cpp:121
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition: util.cpp:8065
void endParagraph()
Definition: outputlist.h:117
const QCString & name() const
Definition: definition.h:114
QCString getScopeString() const
Definition: memberdef.cpp:3301
void pushGeneratorState()
Definition: outputlist.cpp:111
QCString getSourceFileBase() const
Definition: filedef.cpp:1771
QCString right(uint len) const
Definition: qcstring.cpp:231
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:79
QCString anchor() const
Definition: memberdef.cpp:1031
#define Config_getBool(val)
Definition: config.cpp:664
bool isObjCMethod() const
Definition: memberdef.cpp:3956
SrcLangExt lang
Definition: definition.cpp:87
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
void sort()
Definition: sortdict.h:188
int getStartBodyLine() const
uint toUInt(bool *ok=0) const
Definition: qcstring.cpp:445
QCString getOutputFileBase() const
Definition: memberdef.cpp:941
T * at(uint i)
Definition: sortdict.h:258
Translator * theTranslator
Definition: language.cpp:157
bool isFunction() const
Definition: memberdef.cpp:4160
void docify(const char *s)
Definition: outputlist.h:145
virtual QCString trWriteList(int numEntries)=0
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
Definition: outputlist.h:149
unsigned uint
Definition: qglobal.h:351
bool isLinkable() const
Definition: memberdef.cpp:1161
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::addInnerCompound ( Definition d)
virtual

Reimplemented in ClassDef, NamespaceDef, and PageDef.

Definition at line 1369 of file definition.cpp.

1370 {
1371  err("Definition::addInnerCompound() called\n");
1372 }
void err(const char *fmt,...)
Definition: message.cpp:226
void Definition::addSectionsToDefinition ( QList< SectionInfo > *  anchorList)

Add the list of anchors that mark the sections that are found in the documentation.

Definition at line 418 of file definition.cpp.

419 {
420  if (!anchorList) return;
421  //printf("%s: addSectionsToDefinition(%d)\n",name().data(),anchorList->count());
422  QListIterator<SectionInfo> it(*anchorList);
423  SectionInfo *si;
424  for (;(si=it.current());++it)
425  {
426  //printf("Add section `%s' to definition `%s'\n",
427  // si->label.data(),name().data());
429  //printf("===== label=%s gsi=%p\n",si->label.data(),gsi);
430  if (gsi==0)
431  {
432  gsi = new SectionInfo(*si);
434  }
435  if (m_impl->sectionDict==0)
436  {
437  m_impl->sectionDict = new SectionDict(17);
438  }
439  if (m_impl->sectionDict->find(gsi->label)==0)
440  {
441  m_impl->sectionDict->append(gsi->label,gsi);
442  gsi->definition = this;
443  }
444  }
445 }
SectionDict * sectionDict
Definition: definition.cpp:59
QCString label
Definition: section.h:56
void append(const char *key, const T *d)
Definition: sortdict.h:135
static SectionDict * sectionDict
Definition: doxygen.h:117
Definition * definition
Definition: section.h:60
T * find(const char *key)
Definition: sortdict.h:232
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::addSectionsToIndex ( )

Definition at line 467 of file definition.cpp.

468 {
469  if (m_impl->sectionDict==0) return;
470  //printf("Definition::addSectionsToIndex()\n");
472  SectionInfo *si;
473  int level=1;
474  for (li.toFirst();(si=li.current());++li)
475  {
476  if (si->type==SectionInfo::Section ||
480  {
481  //printf(" level=%d title=%s\n",level,si->title.data());
482  int nextLevel = (int)si->type;
483  int i;
484  if (nextLevel>level)
485  {
486  for (i=level;i<nextLevel;i++)
487  {
489  }
490  }
491  else if (nextLevel<level)
492  {
493  for (i=nextLevel;i<level;i++)
494  {
496  }
497  }
498  QCString title = si->title;
499  if (title.isEmpty()) title = si->label;
500  // determine if there is a next level inside this item
501  ++li;
502  bool isDir = ((li.current()) ? (int)(li.current()->type > nextLevel):FALSE);
503  --li;
504  Doxygen::indexList->addContentsItem(isDir,title,
505  getReference(),
507  si->label,
508  FALSE,
509  TRUE);
510  level = nextLevel;
511  }
512  }
513  while (level>1)
514  {
516  level--;
517  }
518 }
virtual QCString getReference() const
bool isEmpty() const
Definition: qcstring.h:189
SectionType type
Definition: section.h:58
SectionDict * sectionDict
Definition: definition.cpp:59
const bool FALSE
Definition: qglobal.h:370
QCString label
Definition: section.h:56
virtual QCString getOutputFileBase() const =0
Definition: sortdict.h:73
void decContentsDepth()
Definition: index.h:135
QCString title
Definition: section.h:57
void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor, bool separateIndex=FALSE, bool addToNavIndex=FALSE, Definition *def=0)
Definition: index.h:137
if(!yymsg) yymsg
DefinitionImpl * m_impl
Definition: definition.h:371
void incContentsDepth()
Definition: index.h:133
const bool TRUE
Definition: qglobal.h:371
static IndexList * indexList
Definition: doxygen.h:149
void Definition::addSourceReferencedBy ( MemberDef d)

Definition at line 1318 of file definition.cpp.

1319 {
1320  if (md)
1321  {
1322  QCString name = md->name();
1323  QCString scope = md->getScopeString();
1324 
1325  if (!scope.isEmpty())
1326  {
1327  name.prepend(scope+"::");
1328  }
1329 
1330  if (m_impl->sourceRefByDict==0)
1331  {
1333  }
1334  if (m_impl->sourceRefByDict->find(name)==0)
1335  {
1336  m_impl->sourceRefByDict->append(name,md);
1337  }
1338  }
1339 }
static QCString scope
Definition: declinfo.cpp:668
bool isEmpty() const
Definition: qcstring.h:189
void append(const char *key, const T *d)
Definition: sortdict.h:135
MemberSDict * sourceRefByDict
Definition: definition.cpp:61
const QCString & name() const
Definition: definition.h:114
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
T * find(const char *key)
Definition: sortdict.h:232
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::addSourceReferences ( MemberDef d)

Definition at line 1341 of file definition.cpp.

1342 {
1343  if (md)
1344  {
1345  QCString name = md->name();
1346  QCString scope = md->getScopeString();
1347 
1348  if (!scope.isEmpty())
1349  {
1350  name.prepend(scope+"::");
1351  }
1352 
1353  if (m_impl->sourceRefsDict==0)
1354  {
1356  }
1357  if (m_impl->sourceRefsDict->find(name)==0)
1358  {
1359  m_impl->sourceRefsDict->append(name,md);
1360  }
1361  }
1362 }
static QCString scope
Definition: declinfo.cpp:668
bool isEmpty() const
Definition: qcstring.h:189
void append(const char *key, const T *d)
Definition: sortdict.h:135
const QCString & name() const
Definition: definition.h:114
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
MemberSDict * sourceRefsDict
Definition: definition.cpp:62
T * find(const char *key)
Definition: sortdict.h:232
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::addToMap ( const char *  name,
Definition d 
)
staticprivate

Definition at line 207 of file definition.cpp.

208 {
209  bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
211  int index=computeQualifiedIndex(symbolName);
212  if (!vhdlOpt && index!=-1) symbolName=symbolName.mid(index+2);
213  if (!symbolName.isEmpty())
214  {
215  //printf("******* adding symbol `%s' (%p)\n",symbolName.data(),d);
216  DefinitionIntf *di=Doxygen::symbolMap->find(symbolName);
217  //printf(" addToMap(%p): looking for symbol %s: %p\n",d,symbolName.data(),di);
218  if (di==0) // new Symbol
219  {
220  //printf(" new symbol!\n");
221  Doxygen::symbolMap->insert(symbolName,d);
222  }
223  else // existing symbol
224  {
225  //printf(" existing symbol: ");
226  if (di->definitionType()==DefinitionIntf::TypeSymbolList) // already multiple symbols
227  {
228  //printf("adding to exiting list\n");
229  DefinitionList *dl = (DefinitionList*)di;
230  dl->append(d);
231  }
232  else // going from one to two symbols
233  {
234  Doxygen::symbolMap->take(symbolName);
235  DefinitionList *dl = new DefinitionList;
236  //printf("replacing symbol by list %p with elements %p and %p\n",dl,di,d);
237  dl->append((Definition*)di);
238  dl->append(d);
239  Doxygen::symbolMap->insert(symbolName,dl);
240  }
241  }
242 
243  // auto resize if needed
244  static int sizeIndex=9;
245  if (Doxygen::symbolMap->size()>SDict_primes[sizeIndex])
246  {
247  Doxygen::symbolMap->resize(SDict_primes[++sizeIndex]);
248  }
249 
250  d->_setSymbolName(symbolName);
251  }
252 }
QCString symbolName() const
bool isEmpty() const
Definition: qcstring.h:189
void append(const type *d)
Definition: qlist.h:73
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
virtual DefType definitionType() const =0
const QCString & name() const
Definition: definition.h:114
static QDict< DefinitionIntf > * symbolMap
Definition: doxygen.h:134
#define Config_getBool(val)
Definition: config.cpp:664
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
const uint SDict_primes[]
Definition: sortdict.h:29
int computeQualifiedIndex(const QCString &name)
Definition: util.cpp:1203
void _setSymbolName(const QCString &name)
virtual QCString Definition::anchor ( ) const
pure virtual

Returns the anchor within a page where this item can be found

Implemented in ClassDef, FileDef, MemberDef, DirDef, GroupDef, PageDef, and NamespaceDef.

QCString Definition::briefDescription ( bool  abbreviate = FALSE) const
virtual

Returns the brief description of this definition. This can include commands.

Reimplemented in MemberDef.

Definition at line 1768 of file definition.cpp.

1769 {
1770  //printf("%s::briefDescription(%d)='%s'\n",name().data(),abbr,m_impl->brief?m_impl->brief->doc.data():"<none>");
1771  return m_impl->brief ?
1772  (abbr ? abbreviate(m_impl->brief->doc,displayName()) : m_impl->brief->doc) :
1773  QCString("");
1774 }
bool brief
virtual QCString displayName(bool includeScope=TRUE) const =0
QCString doc
QCString abbreviate(const char *s, const char *name)
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
QCString doc
Definition: definition.h:50
QCString Definition::briefDescriptionAsTooltip ( ) const

Returns a plain text version of the brief description suitable for use as a tool tip.

Definition at line 1776 of file definition.cpp.

1777 {
1778  if (m_impl->brief)
1779  {
1780  if (m_impl->brief->tooltip.isEmpty() && !m_impl->brief->doc.isEmpty())
1781  {
1782  static bool reentering=FALSE;
1783  if (!reentering)
1784  {
1785  MemberDef *md = definitionType()==TypeMember ? (MemberDef*)this : 0;
1786  const Definition *scope = definitionType()==TypeMember ? getOuterScope() : this;
1787  reentering=TRUE; // prevent requests for tooltips while parsing a tooltip
1789  scope,md,
1790  m_impl->brief->doc,
1791  m_impl->brief->file,
1792  m_impl->brief->line);
1793  reentering=FALSE;
1794  }
1795  }
1796  return m_impl->brief->tooltip;
1797  }
1798  return QCString("");
1799 }
static QCString scope
Definition: declinfo.cpp:668
bool isEmpty() const
Definition: qcstring.h:189
QCString tooltip
Definition: definition.h:51
const bool FALSE
Definition: qglobal.h:370
virtual DefType definitionType() const =0
int line
Definition: definition.h:52
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
Definition: util.cpp:7242
QCString file
Definition: definition.h:53
virtual Definition * getOuterScope() const
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
QCString doc
Definition: definition.h:50
const bool TRUE
Definition: qglobal.h:371
QCString Definition::briefFile ( ) const

Returns the file in which the brief description was found. This can differ from getDefFileName().

Definition at line 1806 of file definition.cpp.

1807 {
1808  return m_impl->brief ? m_impl->brief->file : QCString("<"+m_name+">");
1809 }
QCString m_name
Definition: definition.h:372
QCString file
Definition: definition.h:53
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
int Definition::briefLine ( ) const

Returns the line number at which the brief description was found.

Definition at line 1801 of file definition.cpp.

1802 {
1803  return m_impl->brief ? m_impl->brief->line : 1;
1804 }
int line
Definition: definition.h:52
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::convertNameToFile ( const char *  name,
bool  allowDots = FALSE 
) const

Definition at line 1511 of file definition.cpp.

1512 {
1513  if (!m_impl->ref.isEmpty())
1514  {
1515  return name;
1516  }
1517  else
1518  {
1519  return ::convertNameToFile(name,allowDots);
1520  }
1521 }
bool isEmpty() const
Definition: qcstring.h:189
const QCString & name() const
Definition: definition.h:114
QCString convertNameToFile(const char *name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:5354
DefinitionImpl * m_impl
Definition: definition.h:371
QCString ref
Definition: definition.cpp:76
Cookie* Definition::cookie ( ) const
inline

Definition at line 352 of file definition.h.

352 { return m_cookie; }
Cookie * m_cookie
Definition: definition.h:377
virtual QCString Definition::displayName ( bool  includeScope = TRUE) const
pure virtual

Returns the name of the definition as it appears in the output

Implemented in MemberDef, ClassDef, FileDef, NamespaceDef, PageDef, DirDef, and GroupDef.

QCString Definition::docFile ( ) const

Returns the file in which the detailed documentation block was found. This can differ from getDefFileName().

Definition at line 1712 of file definition.cpp.

1713 {
1714  return m_impl->details ? m_impl->details->file : QCString("<"+m_name+">");
1715 }
QCString file
Definition: definition.h:44
QCString m_name
Definition: definition.h:372
DocInfo * details
Definition: definition.cpp:66
DefinitionImpl * m_impl
Definition: definition.h:371
int Definition::docLine ( ) const

Returns the line number at which the detailed documentation was found.

Definition at line 1707 of file definition.cpp.

1708 {
1709  return m_impl->details ? m_impl->details->line : 1;
1710 }
int line
Definition: definition.h:43
DocInfo * details
Definition: definition.cpp:66
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::documentation ( ) const
virtual

Returns the detailed description of this definition

Reimplemented in MemberDef.

Definition at line 1702 of file definition.cpp.

1703 {
1704  return m_impl->details ? m_impl->details->doc : QCString("");
1705 }
QCString doc
Definition: definition.h:42
DocInfo * details
Definition: definition.cpp:66
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::externalReference ( const QCString relPath) const

Convenience method to return a resolved external link

Definition at line 1948 of file definition.cpp.

1949 {
1950  QCString ref = getReference();
1951  if (!ref.isEmpty())
1952  {
1954  if (dest)
1955  {
1956  QCString result = *dest;
1957  int l = result.length();
1958  if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
1959  { // relative path -> prepend relPath.
1960  result.prepend(relPath);
1961  l+=relPath.length();
1962  }
1963  if (l>0 && result.at(l-1)!='/') result+='/';
1964  return result;
1965  }
1966  }
1967  return relPath;
1968 }
virtual QCString getReference() const
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
char & at(uint i) const
Definition: qcstring.h:326
static QStrList * l
Definition: config.cpp:1044
static StringDict tagDestinationDict
Definition: doxygen.h:124
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
Definition * Definition::findInnerCompound ( const char *  name)
virtual

Reimplemented in ClassDef, and NamespaceDef.

Definition at line 1364 of file definition.cpp.

1365 {
1366  return 0;
1367 }
FileDef * Definition::getBodyDef ( ) const

Returns the file in which the body of this item is located or 0 if no body is available.

Definition at line 1881 of file definition.cpp.

1882 {
1883  return m_impl->body ? m_impl->body->fileDef : 0;
1884 }
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
FileDef * fileDef
file definition containing the function body
Definition: definition.h:61
int Definition::getDefColumn ( ) const
inline

returns the column number at which the definition was found

Definition at line 191 of file definition.h.

191 { return m_defColumn; }
int m_defColumn
Definition: definition.h:376
QCString Definition::getDefFileExtension ( ) const

returns the extension of the file in which this definition was found

Definition at line 1836 of file definition.cpp.

1837 {
1838  return m_impl->defFileExt;
1839 }
QCString defFileExt
Definition: definition.cpp:85
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::getDefFileName ( ) const

returns the file in which this definition was found

Definition at line 1831 of file definition.cpp.

1832 {
1833  return m_impl->defFileName;
1834 }
QCString defFileName
Definition: definition.cpp:84
DefinitionImpl * m_impl
Definition: definition.h:371
int Definition::getDefLine ( ) const
inline

returns the line number at which the definition was found

Definition at line 188 of file definition.h.

188 { return m_defLine; }
int m_defLine
Definition: definition.h:375
int Definition::getEndBodyLine ( ) const

Returns the last line of the body of this item (applicable to classes and functions).

Definition at line 1876 of file definition.cpp.

1877 {
1878  return m_impl->body ? m_impl->body->endLine : -1;
1879 }
int endLine
line number of the end of the definition
Definition: definition.h:60
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
SrcLangExt Definition::getLanguage ( ) const

Returns the programming language this definition was written in.

Definition at line 1911 of file definition.cpp.

1912 {
1913  return m_impl->lang;
1914 }
SrcLangExt lang
Definition: definition.cpp:87
DefinitionImpl * m_impl
Definition: definition.h:371
Definition * Definition::getOuterScope ( ) const
virtual

Definition at line 1891 of file definition.cpp.

1892 {
1893  return m_impl->outerScope;
1894 }
Definition * outerScope
Definition: definition.cpp:81
DefinitionImpl * m_impl
Definition: definition.h:371
virtual QCString Definition::getOutputFileBase ( ) const
pure virtual

Returns the base file name (without extension) of this definition. as it is referenced to/written to disk.

Implemented in ClassDef, FileDef, MemberDef, DirDef, GroupDef, PageDef, and NamespaceDef.

QCString Definition::getReference ( ) const
virtual

If this definition was imported via a tag file, this function returns the tagfile for the external project. This can be translated into an external link target via Doxygen::tagDestinationDict

Reimplemented in ClassDef, and MemberDef.

Definition at line 1861 of file definition.cpp.

1862 {
1863  return m_impl->ref;
1864 }
DefinitionImpl * m_impl
Definition: definition.h:371
QCString ref
Definition: definition.cpp:76
MemberSDict * Definition::getReferencedByMembers ( ) const

Definition at line 1901 of file definition.cpp.

1902 {
1903  return m_impl->sourceRefByDict;
1904 }
MemberSDict * sourceRefByDict
Definition: definition.cpp:61
DefinitionImpl * m_impl
Definition: definition.h:371
MemberSDict * Definition::getReferencesMembers ( ) const

Definition at line 1896 of file definition.cpp.

1897 {
1898  return m_impl->sourceRefsDict;
1899 }
MemberSDict * sourceRefsDict
Definition: definition.cpp:62
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::getSourceAnchor ( ) const
virtual

Returns the anchor of the source listing of this definition.

Definition at line 898 of file definition.cpp.

899 {
900  const int maxAnchorStrLen = 20;
901  char anchorStr[maxAnchorStrLen];
902  anchorStr[0]='\0';
903  if (m_impl->body && m_impl->body->startLine!=-1)
904  {
905  if (Htags::useHtags)
906  {
907  qsnprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->startLine);
908  }
909  else
910  {
911  qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->startLine);
912  }
913  }
914  return anchorStr;
915 }
#define qsnprintf
Definition: qcstring.h:73
static bool useHtags
Definition: htags.h:23
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
int startLine
line number of the start of the definition
Definition: definition.h:59
QCString Definition::getSourceFileBase ( ) const
virtual

Returns the name of the source listing of this definition.

Reimplemented in ClassDef, and FileDef.

Definition at line 885 of file definition.cpp.

886 {
887  ASSERT(definitionType()!=Definition::TypeFile); // file overloads this method
888  QCString fn;
889  static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
890  if (sourceBrowser &&
892  {
894  }
895  return fn;
896 }
virtual DefType definitionType() const =0
QAsciiDict< Entry > fn
QCString getSourceFileBase() const
Definition: filedef.cpp:1771
#define Config_getBool(val)
Definition: config.cpp:664
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
FileDef * fileDef
file definition containing the function body
Definition: definition.h:61
#define ASSERT(x)
Definition: qglobal.h:590
int startLine
line number of the start of the definition
Definition: definition.h:59
int Definition::getStartBodyLine ( ) const

Returns the first line of the body of this item (applicable to classes and functions).

Definition at line 1871 of file definition.cpp.

1872 {
1873  return m_impl->body ? m_impl->body->startLine : -1;
1874 }
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
int startLine
line number of the start of the definition
Definition: definition.h:59
bool Definition::hasBriefDescription ( ) const

returns TRUE if this class has a brief description

Definition at line 1942 of file definition.cpp.

1943 {
1944  static bool briefMemberDesc = Config_getBool("BRIEF_MEMBER_DESC");
1945  return !briefDescription().isEmpty() && briefMemberDesc;
1946 }
bool isEmpty() const
Definition: qcstring.h:189
#define Config_getBool(val)
Definition: config.cpp:664
virtual QCString briefDescription(bool abbreviate=FALSE) const
bool Definition::hasDocumentation ( ) const
virtual

Returns TRUE iff the definition is documented (which could be generated documentation)

See also
hasUserDocumentation()

Reimplemented in MemberDef, and ClassDef.

Definition at line 1293 of file definition.cpp.

1294 {
1295  static bool extractAll = Config_getBool("EXTRACT_ALL");
1296  //static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
1297  bool hasDocs =
1298  (m_impl->details && !m_impl->details->doc.isEmpty()) || // has detailed docs
1299  (m_impl->brief && !m_impl->brief->doc.isEmpty()) || // has brief description
1300  (m_impl->inbodyDocs && !m_impl->inbodyDocs->doc.isEmpty()) || // has inbody docs
1301  extractAll //|| // extract everything
1302  // (sourceBrowser && m_impl->body &&
1303  // m_impl->body->startLine!=-1 && m_impl->body->fileDef)
1304  ; // link to definition
1305  return hasDocs;
1306 }
bool isEmpty() const
Definition: qcstring.h:189
#define Config_getBool(val)
Definition: config.cpp:664
QCString doc
Definition: definition.h:42
DocInfo * details
Definition: definition.cpp:66
DocInfo * inbodyDocs
Definition: definition.cpp:67
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
QCString doc
Definition: definition.h:50
bool Definition::hasSections ( ) const

Definition at line 447 of file definition.cpp.

448 {
449  //printf("Definition::hasSections(%s) #sections=%d\n",name().data(),
450  // m_impl->sectionDict ? m_impl->sectionDict->count() : 0);
451  if (m_impl->sectionDict==0) return FALSE;
453  SectionInfo *si;
454  for (li.toFirst();(si=li.current());++li)
455  {
456  if (si->type==SectionInfo::Section ||
460  {
461  return TRUE;
462  }
463  }
464  return FALSE;
465 }
SectionType type
Definition: section.h:58
SectionDict * sectionDict
Definition: definition.cpp:59
const bool FALSE
Definition: qglobal.h:370
Definition: sortdict.h:73
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
bool Definition::hasSources ( ) const

Definition at line 1089 of file definition.cpp.

1090 {
1091  return m_impl->body && m_impl->body->startLine!=-1 &&
1093  m_impl->body->fileDef;
1094 }
int endLine
line number of the end of the definition
Definition: definition.h:60
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
FileDef * fileDef
file definition containing the function body
Definition: definition.h:61
int startLine
line number of the start of the definition
Definition: definition.h:59
bool Definition::hasUserDocumentation ( ) const
virtual

Returns TRUE iff the definition is documented by the user.

Definition at line 1308 of file definition.cpp.

1309 {
1310  bool hasDocs =
1311  (m_impl->details && !m_impl->details->doc.isEmpty()) ||
1312  (m_impl->brief && !m_impl->brief->doc.isEmpty()) ||
1314  return hasDocs;
1315 }
bool isEmpty() const
Definition: qcstring.h:189
QCString doc
Definition: definition.h:42
DocInfo * details
Definition: definition.cpp:66
DocInfo * inbodyDocs
Definition: definition.cpp:67
BriefInfo * brief
Definition: definition.cpp:68
DefinitionImpl * m_impl
Definition: definition.h:371
QCString doc
Definition: definition.h:50
QCString Definition::id ( ) const

Definition at line 413 of file definition.cpp.

414 {
415  return m_impl->id;
416 }
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::inbodyDocumentation ( ) const

Returns the documentation found inside the body of a member

Definition at line 1813 of file definition.cpp.

1814 {
1815  return m_impl->inbodyDocs ? m_impl->inbodyDocs->doc : QCString("");
1816 }
QCString doc
Definition: definition.h:42
DocInfo * inbodyDocs
Definition: definition.cpp:67
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::inbodyFile ( ) const

Returns the file in which the in body documentation was found

Definition at line 1823 of file definition.cpp.

1824 {
1825  return m_impl->inbodyDocs ? m_impl->inbodyDocs->file : QCString("<"+m_name+">");
1826 }
QCString file
Definition: definition.h:44
QCString m_name
Definition: definition.h:372
DocInfo * inbodyDocs
Definition: definition.cpp:67
DefinitionImpl * m_impl
Definition: definition.h:371
int Definition::inbodyLine ( ) const

Returns the line at which the first in body documentation part was found

Definition at line 1818 of file definition.cpp.

1819 {
1820  return m_impl->inbodyDocs ? m_impl->inbodyDocs->line : 1;
1821 }
int line
Definition: definition.h:43
DocInfo * inbodyDocs
Definition: definition.cpp:67
DefinitionImpl * m_impl
Definition: definition.h:371
bool Definition::isArtificial ( ) const

returns TRUE if this entity was artificially introduced, for instance because it is used to show a template instantiation relation.

Definition at line 1856 of file definition.cpp.

1857 {
1858  return m_impl->isArtificial;
1859 }
DefinitionImpl * m_impl
Definition: definition.h:371
bool Definition::isHidden ( ) const

Returns TRUE iff this item is supposed to be hidden from the output.

Definition at line 1841 of file definition.cpp.

1842 {
1843  return m_impl->hidden;
1844 }
DefinitionImpl * m_impl
Definition: definition.h:371
virtual bool Definition::isLinkable ( ) const
pure virtual

Returns TRUE iff it is possible to link to this item. This can be a link to another project imported via a tag file.

Implemented in MemberDef, ClassDef, FileDef, NamespaceDef, GroupDef, DirDef, and PageDef.

virtual bool Definition::isLinkableInProject ( ) const
pure virtual

Returns TRUE iff it is possible to link to this item within this project.

Implemented in MemberDef, ClassDef, FileDef, NamespaceDef, GroupDef, DirDef, and PageDef.

bool Definition::isReference ( ) const
virtual

Returns TRUE if this definition is imported via a tag file.

Reimplemented in MemberDef, and ClassDef.

Definition at line 1866 of file definition.cpp.

1867 {
1868  return !m_impl->ref.isEmpty();
1869 }
bool isEmpty() const
Definition: qcstring.h:189
DefinitionImpl * m_impl
Definition: definition.h:371
QCString ref
Definition: definition.cpp:76
bool Definition::isVisible ( ) const
virtual

Returns TRUE iff the name may appear in the output

Definition at line 1851 of file definition.cpp.

1852 {
1853  return isLinkable() && !m_impl->hidden;
1854 }
virtual bool isLinkable() const =0
DefinitionImpl * m_impl
Definition: definition.h:371
bool Definition::isVisibleInProject ( ) const
virtual

Returns TRUE iff the name is part of this project and may appear in the output

Definition at line 1846 of file definition.cpp.

1847 {
1848  return isLinkableInProject() && !m_impl->hidden;
1849 }
virtual bool isLinkableInProject() const =0
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::localName ( ) const

Returns the local name without any scope qualifiers.

Definition at line 1433 of file definition.cpp.

1434 {
1435  return m_impl->localName;
1436 }
QCString localName
Definition: definition.cpp:73
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::makePartOfGroup ( GroupDef gd)

Definition at line 1438 of file definition.cpp.

1439 {
1441  m_impl->partOfGroups->append(gd);
1442 }
void append(const type *d)
Definition: qlist.h:73
GroupList * partOfGroups
Definition: definition.cpp:64
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::mergeRefItems ( Definition d)

Definition at line 1464 of file definition.cpp.

1465 {
1466  //printf("%s::mergeRefItems()\n",name().data());
1467  QList<ListItemInfo> *xrefList = d->xrefListItems();
1468  if (xrefList!=0)
1469  {
1470  // deep copy the list
1471  if (m_impl->xrefListItems==0)
1472  {
1475  }
1476  QListIterator<ListItemInfo> slii(*xrefList);
1477  ListItemInfo *lii;
1478  for (slii.toFirst();(lii=slii.current());++slii)
1479  {
1480  if (_getXRefListId(lii->type)==-1)
1481  {
1482  m_impl->xrefListItems->append(new ListItemInfo(*lii));
1483  }
1484  }
1485  }
1486 }
int _getXRefListId(const char *listName) const
void append(const type *d)
Definition: qlist.h:73
QList< ListItemInfo > * xrefListItems() const
QList< ListItemInfo > * xrefListItems
Definition: definition.cpp:63
QCString type
Definition: types.h:100
void setAutoDelete(bool enable)
Definition: qlist.h:99
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
const QCString& Definition::name ( ) const
inline

Returns the name of the definition

Definition at line 114 of file definition.h.

114 { return m_name; }
QCString m_name
Definition: definition.h:372
QCString Definition::navigationPathAsString ( ) const

Returns the string used in the footer for $navpath when GENERATE_TREEVIEW is enabled

Definition at line 1559 of file definition.cpp.

1560 {
1561  QCString result;
1562  Definition *outerScope = getOuterScope();
1563  QCString locName = localName();
1564  if (outerScope && outerScope!=Doxygen::globalScope)
1565  {
1566  result+=outerScope->navigationPathAsString();
1567  }
1568  else if (definitionType()==Definition::TypeFile && ((const FileDef*)this)->getDirDef())
1569  {
1570  result+=((const FileDef*)this)->getDirDef()->navigationPathAsString();
1571  }
1572  result+="<li class=\"navelem\">";
1573  if (isLinkable())
1574  {
1575  if (definitionType()==Definition::TypeGroup && ((const GroupDef*)this)->groupTitle())
1576  {
1577  result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
1578  convertToHtml(((const GroupDef*)this)->groupTitle())+"</a>";
1579  }
1580  else if (definitionType()==Definition::TypePage && !((const PageDef*)this)->title().isEmpty())
1581  {
1582  result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
1583  convertToHtml(((const PageDef*)this)->title())+"</a>";
1584  }
1586  {
1587  QCString name = locName;
1588  if (name.right(2)=="-p" /*|| name.right(2)=="-g"*/)
1589  {
1590  name = name.left(name.length()-2);
1591  }
1592  result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension;
1593  if (!anchor().isEmpty()) result+="#"+anchor();
1594  result+="\">"+convertToHtml(name)+"</a>";
1595  }
1596  else
1597  {
1598  result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
1599  convertToHtml(locName)+"</a>";
1600  }
1601  }
1602  else
1603  {
1604  result+="<b>"+convertToHtml(locName)+"</b>";
1605  }
1606  result+="</li>";
1607  return result;
1608 }
virtual bool isLinkable() const =0
static QCString result
uint length() const
Definition: qcstring.h:195
static QCString htmlFileExtension
Definition: doxygen.h:130
QCString left(uint len) const
Definition: qcstring.cpp:213
virtual QCString getOutputFileBase() const =0
static NamespaceDef * globalScope
Definition: doxygen.h:128
virtual DefType definitionType() const =0
const QCString & name() const
Definition: definition.h:114
QCString navigationPathAsString() const
QCString convertToHtml(const char *s, bool keepEntities)
Definition: util.cpp:5746
QCString right(uint len) const
Definition: qcstring.cpp:231
virtual Definition * getOuterScope() const
A model of a page symbol.
Definition: pagedef.h:29
QCString localName() const
virtual QCString anchor() const =0
GroupList * Definition::partOfGroups ( ) const

Definition at line 1886 of file definition.cpp.

1887 {
1888  return m_impl->partOfGroups;
1889 }
GroupList * partOfGroups
Definition: definition.cpp:64
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::pathFragment ( ) const

Definition at line 1523 of file definition.cpp.

1524 {
1525  QCString result;
1527  {
1528  result = m_impl->outerScope->pathFragment();
1529  }
1530  if (isLinkable())
1531  {
1532  if (!result.isEmpty()) result+="/";
1533  if (definitionType()==Definition::TypeGroup && ((const GroupDef*)this)->groupTitle())
1534  {
1535  result+=((const GroupDef*)this)->groupTitle();
1536  }
1537  else if (definitionType()==Definition::TypePage && !((const PageDef*)this)->title().isEmpty())
1538  {
1539  result+=((const PageDef*)this)->title();
1540  }
1541  else
1542  {
1543  result+=m_impl->localName;
1544  }
1545  }
1546  else
1547  {
1548  result+=m_impl->localName;
1549  }
1550  return result;
1551 }
virtual bool isLinkable() const =0
Definition * outerScope
Definition: definition.cpp:81
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
QCString localName
Definition: definition.cpp:73
QCString pathFragment() const
static NamespaceDef * globalScope
Definition: doxygen.h:128
virtual DefType definitionType() const =0
A model of a page symbol.
Definition: pagedef.h:29
DefinitionImpl * m_impl
Definition: definition.h:371
QCString Definition::qualifiedName ( ) const
virtual

Returns the fully qualified name of this definition

Reimplemented in MemberDef.

Definition at line 1374 of file definition.cpp.

1375 {
1376  //static int count=0;
1377  //count++;
1378  if (!m_impl->qualifiedName.isEmpty())
1379  {
1380  //count--;
1381  return m_impl->qualifiedName;
1382  }
1383 
1384  //printf("start %s::qualifiedName() localName=%s\n",name().data(),m_impl->localName.data());
1385  if (m_impl->outerScope==0)
1386  {
1387  if (m_impl->localName=="<globalScope>")
1388  {
1389  //count--;
1390  return "";
1391  }
1392  else
1393  {
1394  //count--;
1395  return m_impl->localName;
1396  }
1397  }
1398 
1399  if (m_impl->outerScope->name()=="<globalScope>")
1400  {
1402  }
1403  else
1404  {
1407  m_impl->localName;
1408  }
1409  //printf("end %s::qualifiedName()=%s\n",name().data(),m_impl->qualifiedName.data());
1410  //count--;
1411  return m_impl->qualifiedName;
1412 }
QCString qualifiedName
Definition: definition.cpp:75
Definition * outerScope
Definition: definition.cpp:81
bool isEmpty() const
Definition: qcstring.h:189
QCString localName
Definition: definition.cpp:73
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition: util.cpp:8065
const QCString & name() const
Definition: definition.h:114
SrcLangExt getLanguage() const
virtual QCString qualifiedName() const
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::removeFromMap ( Definition d)
staticprivate

Definition at line 254 of file definition.cpp.

255 {
257  if (!symbolName.isEmpty())
258  {
259  //printf("******* removing symbol `%s' (%p)\n",symbolName.data(),d);
260  DefinitionIntf *di=Doxygen::symbolMap->find(symbolName);
261  if (di)
262  {
263  if (di!=d) // symbolName not unique
264  {
265  //printf(" removing from list: %p!\n",di);
266  DefinitionList *dl = (DefinitionList*)di;
267  bool b = dl->removeRef(d);
268  ASSERT(b==TRUE);
269  if (dl->isEmpty())
270  {
271  Doxygen::symbolMap->take(symbolName);
272  }
273  }
274  else // symbolName unique
275  {
276  //printf(" removing symbol %p\n",di);
277  Doxygen::symbolMap->take(symbolName);
278  }
279  }
280  }
281 }
QCString symbolName() const
QCString m_symbolName
Definition: definition.h:374
bool isEmpty() const
Definition: qcstring.h:189
bool isEmpty() const
Definition: qlist.h:67
static QDict< DefinitionIntf > * symbolMap
Definition: doxygen.h:134
static bool * b
Definition: config.cpp:1043
bool removeRef(const type *d)
Definition: qlist.h:78
const bool TRUE
Definition: qglobal.h:371
#define ASSERT(x)
Definition: qglobal.h:590
void Definition::setArtificial ( bool  b)

Definition at line 1921 of file definition.cpp.

1922 {
1923  m_impl->isArtificial = b;
1924 }
static bool * b
Definition: config.cpp:1043
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::setBodyDef ( FileDef fd)

Definition at line 1083 of file definition.cpp.

1084 {
1085  if (m_impl->body==0) m_impl->body = new BodyInfo;
1086  m_impl->body->fileDef=fd;
1087 }
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
FileDef * fileDef
file definition containing the function body
Definition: definition.h:61
void Definition::setBodySegment ( int  bls,
int  ble 
)

Definition at line 1075 of file definition.cpp.

1076 {
1077  //printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data());
1078  if (m_impl->body==0) m_impl->body = new BodyInfo;
1079  m_impl->body->startLine=bls;
1080  m_impl->body->endLine=ble;
1081 }
int endLine
line number of the end of the definition
Definition: definition.h:60
BodyInfo * body
Definition: definition.cpp:69
DefinitionImpl * m_impl
Definition: definition.h:371
int startLine
line number of the start of the definition
Definition: definition.h:59
void Definition::setBriefDescription ( const char *  b,
const char *  briefFile,
int  briefLine 
)
virtual

Sets the brief description of this definition to b. A dot is added to the sentence if not available.

Reimplemented in MemberDef.

Definition at line 687 of file definition.cpp.

688 {
689  if (b==0) return;
691 }
int briefLine() const
void _setBriefDescription(const char *b, const char *briefFile, int briefLine)
Definition: definition.cpp:632
QCString briefFile() const
static bool * b
Definition: config.cpp:1043
void Definition::setCookie ( Cookie cookie)
inline

Definition at line 351 of file definition.h.

351 { delete m_cookie; m_cookie = cookie; }
Cookie * cookie() const
Definition: definition.h:352
Cookie * m_cookie
Definition: definition.h:377
void Definition::setDocumentation ( const char *  d,
const char *  docFile,
int  docLine,
bool  stripWhiteSpace = TRUE 
)
virtual

Sets the documentation of this definition to d.

Reimplemented in MemberDef.

Definition at line 612 of file definition.cpp.

613 {
614  if (d==0) return;
615  _setDocumentation(d,docFile,docLine,stripWhiteSpace,FALSE);
616 }
QCString docFile() const
const bool FALSE
Definition: qglobal.h:370
void _setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace, bool atTop)
Definition: definition.cpp:566
int docLine() const
void Definition::setHidden ( bool  b)
virtual

Reimplemented in MemberDef.

Definition at line 1916 of file definition.cpp.

1917 {
1918  m_impl->hidden = m_impl->hidden || b;
1919 }
static bool * b
Definition: config.cpp:1043
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::setId ( const char *  name)

Sets a unique id for the symbol. Used for libclang integration.

Definition at line 402 of file definition.cpp.

403 {
404  if (id==0) return;
405  m_impl->id = id;
407  {
408  //printf("Definition::setId '%s'->'%s'\n",id,m_name.data());
409  Doxygen::clangUsrMap->insert(id,this);
410  }
411 }
QCString id() const
Definition: definition.cpp:413
static QDict< Definition > * clangUsrMap
Definition: doxygen.h:135
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::setInbodyDocumentation ( const char *  d,
const char *  docFile,
int  docLine 
)
virtual

Set the documentation that was found inside the body of an item. If there was already some documentation set, the new documentation will be appended.

Reimplemented in MemberDef.

Definition at line 711 of file definition.cpp.

712 {
713  if (d==0) return;
715 }
QCString inbodyFile() const
int inbodyLine() const
void _setInbodyDocumentation(const char *d, const char *docFile, int docLine)
Definition: definition.cpp:693
void Definition::setLanguage ( SrcLangExt  lang)

Definition at line 1931 of file definition.cpp.

1932 {
1933  m_impl->lang=lang;
1934 }
SrcLangExt lang
Definition: definition.cpp:87
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::setLocalName ( const QCString  name)

Definition at line 1926 of file definition.cpp.

1927 {
1928  m_impl->localName=name;
1929 }
QCString localName
Definition: definition.cpp:73
const QCString & name() const
Definition: definition.h:114
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::setName ( const char *  name)
virtual

Sets a new name for the definition

Reimplemented in ClassDef.

Definition at line 396 of file definition.cpp.

397 {
398  if (name==0) return;
399  m_name = name;
400 }
const QCString & name() const
Definition: definition.h:114
QCString m_name
Definition: definition.h:372
void Definition::setOuterScope ( Definition d)
virtual

Definition at line 1414 of file definition.cpp.

1415 {
1416  //printf("%s::setOuterScope(%s)\n",name().data(),d?d->name().data():"<none>");
1418  bool found=false;
1419  // make sure that we are not creating a recursive scope relation.
1420  while (p && !found)
1421  {
1422  found = (p==d);
1423  p = p->m_impl->outerScope;
1424  }
1425  if (!found)
1426  {
1427  m_impl->qualifiedName.resize(0); // flush cached scope name
1428  m_impl->outerScope = d;
1429  }
1430  m_impl->hidden = m_impl->hidden || d->isHidden();
1431 }
bool resize(uint newlen)
Definition: qcstring.h:225
QCString qualifiedName
Definition: definition.cpp:75
Definition * outerScope
Definition: definition.cpp:81
p
Definition: test.py:223
bool isHidden() const
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::setReference ( const char *  r)

Sets the tag file id via which this definition was imported.

Definition at line 1906 of file definition.cpp.

1907 {
1908  m_impl->ref=r;
1909 }
DefinitionImpl * m_impl
Definition: definition.h:371
QCString ref
Definition: definition.cpp:76
void Definition::setRefItems ( const QList< ListItemInfo > *  sli)

Definition at line 1444 of file definition.cpp.

1445 {
1446  //printf("%s::setRefItems()\n",name().data());
1447  if (sli)
1448  {
1449  // deep copy the list
1450  if (m_impl->xrefListItems==0)
1451  {
1454  }
1455  QListIterator<ListItemInfo> slii(*sli);
1456  ListItemInfo *lii;
1457  for (slii.toFirst();(lii=slii.current());++slii)
1458  {
1459  m_impl->xrefListItems->append(new ListItemInfo(*lii));
1460  }
1461  }
1462 }
void append(const type *d)
Definition: qlist.h:73
QList< ListItemInfo > * xrefListItems
Definition: definition.cpp:63
void setAutoDelete(bool enable)
Definition: qlist.h:99
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
QCString Definition::symbolName ( ) const

Returns the name of this definition as it appears in the symbol map.

Definition at line 1695 of file definition.cpp.

1696 {
1697  return m_symbolName;
1698 }
QCString m_symbolName
Definition: definition.h:374
void Definition::writeDocAnchorsToTagFile ( FTextStream tagFile)

Writes the documentation anchors of the definition to the Doxygen::tagFile stream.

Definition at line 520 of file definition.cpp.

521 {
522  if (m_impl->sectionDict)
523  {
524  //printf("%s: writeDocAnchorsToTagFile(%d)\n",name().data(),m_impl->sectionDict->count());
526  SectionInfo *si;
527  for (;(si=sdi.current());++sdi)
528  {
529  if (!si->generated)
530  {
531  //printf("write an entry!\n");
532  if (definitionType()==TypeMember) tagFile << " ";
533  tagFile << " <docanchor file=\"" << si->fileName << "\"";
534  if (!si->title.isEmpty())
535  {
536  tagFile << " title=\"" << convertToXML(si->title) << "\"";
537  }
538  tagFile << ">" << si->label << "</docanchor>" << endl;
539  }
540  }
541  }
542 }
QCString convertToXML(const char *s)
Definition: util.cpp:5717
bool isEmpty() const
Definition: qcstring.h:189
SectionDict * sectionDict
Definition: definition.cpp:59
bool generated
Definition: section.h:63
QCString label
Definition: section.h:56
virtual DefType definitionType() const =0
Definition: sortdict.h:73
QCString fileName
Definition: section.h:61
QCString title
Definition: section.h:57
DefinitionImpl * m_impl
Definition: definition.h:371
QTextStream & endl(QTextStream &s)
void Definition::writeInlineCode ( OutputList ol,
const char *  scopeName 
)

Write code of this definition into the documentation

Definition at line 1097 of file definition.cpp.

1098 {
1099  static bool inlineSources = Config_getBool("INLINE_SOURCES");
1100  ol.pushGeneratorState();
1101  //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(),
1102  // m_startBodyLine,m_endBodyLine,m_bodyDef);
1103  if (inlineSources && hasSources())
1104  {
1105  QCString codeFragment;
1106  int actualStart=m_impl->body->startLine,actualEnd=m_impl->body->endLine;
1108  actualStart,actualEnd,codeFragment)
1109  )
1110  {
1111  //printf("Adding code fragement '%s' ext='%s'\n",
1112  // codeFragment.data(),m_impl->defFileExt.data());
1114  pIntf->resetCodeParserState();
1115  //printf("Read:\n`%s'\n\n",codeFragment.data());
1116  MemberDef *thisMd = 0;
1117  if (definitionType()==TypeMember) thisMd = (MemberDef *)this;
1118 
1119  ol.startCodeFragment();
1120  pIntf->parseCode(ol, // codeOutIntf
1121  scopeName, // scope
1122  codeFragment, // input
1123  m_impl->lang, // lang
1124  FALSE, // isExample
1125  0, // exampleName
1126  m_impl->body->fileDef, // fileDef
1127  actualStart, // startLine
1128  actualEnd, // endLine
1129  TRUE, // inlineFragment
1130  thisMd, // memberDef
1131  TRUE // show line numbers
1132  );
1133  ol.endCodeFragment();
1134  }
1135  }
1136  ol.popGeneratorState();
1137 }
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
Abstract interface for programming language parsers.
Definition: parserintf.h:38
void startCodeFragment()
Definition: outputlist.h:244
const bool FALSE
Definition: qglobal.h:370
void endCodeFragment()
Definition: outputlist.h:246
QCString defFileExt
Definition: definition.cpp:85
static ParserManager * parserManager
Definition: doxygen.h:141
void popGeneratorState()
Definition: outputlist.cpp:121
virtual DefType definitionType() const =0
void pushGeneratorState()
Definition: outputlist.cpp:111
int endLine
line number of the end of the definition
Definition: definition.h:60
#define Config_getBool(val)
Definition: config.cpp:664
QCString absFilePath() const
Definition: filedef.h:96
SrcLangExt lang
Definition: definition.cpp:87
bool readCodeFragment(const char *fileName, int &startLine, int &endLine, QCString &result)
Definition: definition.cpp:728
bool hasSources() const
BodyInfo * body
Definition: definition.cpp:69
virtual void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)=0
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
FileDef * fileDef
file definition containing the function body
Definition: definition.h:61
int startLine
line number of the start of the definition
Definition: definition.h:59
virtual void resetCodeParserState()=0
void Definition::writeNavigationPath ( OutputList ol) const

Definition at line 1611 of file definition.cpp.

1612 {
1613  ol.pushGeneratorState();
1615 
1616  QCString navPath;
1617  navPath += "<div id=\"nav-path\" class=\"navpath\">\n"
1618  " <ul>\n";
1619  navPath += navigationPathAsString();
1620  navPath += " </ul>\n"
1621  "</div>\n";
1622  ol.writeNavigationPath(navPath);
1623 
1624  ol.popGeneratorState();
1625 }
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:49
void popGeneratorState()
Definition: outputlist.cpp:121
void pushGeneratorState()
Definition: outputlist.cpp:111
QCString navigationPathAsString() const
void writeNavigationPath(const char *s)
Definition: outputlist.h:356
virtual void Definition::writeQuickMemberLinks ( OutputList ,
MemberDef  
) const
inlinevirtual

Reimplemented in ClassDef, FileDef, GroupDef, and NamespaceDef.

Definition at line 338 of file definition.h.

338 {}
void Definition::writeSourceDef ( OutputList ol,
const char *  scopeName 
)

Write a reference to the source code defining this definition

Definition at line 918 of file definition.cpp.

919 {
920  static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE");
921  static bool rtfSourceCode = Config_getBool("RTF_SOURCE_CODE");
922  ol.pushGeneratorState();
923  //printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef);
925  if (!fn.isEmpty())
926  {
928  int lineMarkerPos = refText.find("@0");
929  int fileMarkerPos = refText.find("@1");
930  if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
931  {
932  QCString lineStr;
933  lineStr.sprintf("%d",m_impl->body->startLine);
934  QCString anchorStr = getSourceAnchor();
935  ol.startParagraph();
936  if (lineMarkerPos<fileMarkerPos) // line marker before file marker
937  {
938  // write text left from linePos marker
939  ol.parseText(refText.left(lineMarkerPos));
940  ol.pushGeneratorState();
942  if (!latexSourceCode)
943  {
945  }
946  if (!rtfSourceCode)
947  {
949  }
950  // write line link (HTML, LaTeX optionally, RTF optionally)
951  ol.writeObjectLink(0,fn,anchorStr,lineStr);
952  ol.enableAll();
954  if (latexSourceCode)
955  {
957  }
958  if (rtfSourceCode)
959  {
961  }
962  // write normal text (Man, Latex optionally, RTF optionally)
963  ol.docify(lineStr);
964  ol.popGeneratorState();
965 
966  // write text between markers
967  ol.parseText(refText.mid(lineMarkerPos+2,
968  fileMarkerPos-lineMarkerPos-2));
969 
970  ol.pushGeneratorState();
972  if (!latexSourceCode)
973  {
975  }
976  if (!rtfSourceCode)
977  {
979  }
980  // write file link (HTML, LaTeX optionally, RTF optionally)
981  ol.writeObjectLink(0,fn,0,m_impl->body->fileDef->name());
982  ol.enableAll();
984  if (latexSourceCode)
985  {
987  }
988  if (rtfSourceCode)
989  {
991  }
992  // write normal text (Man, Latex optionally, RTF optionally)
993  ol.docify(m_impl->body->fileDef->name());
994  ol.popGeneratorState();
995 
996  // write text right from file marker
997  ol.parseText(refText.right(
998  refText.length()-fileMarkerPos-2));
999  }
1000  else // file marker before line marker
1001  {
1002  // write text left from file marker
1003  ol.parseText(refText.left(fileMarkerPos));
1004  ol.pushGeneratorState();
1006  if (!latexSourceCode)
1007  {
1009  }
1010  if (!rtfSourceCode)
1011  {
1013  }
1014  // write file link (HTML only)
1015  ol.writeObjectLink(0,fn,0,m_impl->body->fileDef->name());
1016  ol.enableAll();
1018  if (latexSourceCode)
1019  {
1021  }
1022  if (rtfSourceCode)
1023  {
1025  }
1026  // write normal text (RTF/Latex/Man only)
1027  ol.docify(m_impl->body->fileDef->name());
1028  ol.popGeneratorState();
1029 
1030  // write text between markers
1031  ol.parseText(refText.mid(fileMarkerPos+2,
1032  lineMarkerPos-fileMarkerPos-2));
1033 
1034  ol.pushGeneratorState();
1036  if (!latexSourceCode)
1037  {
1039  }
1040  if (!rtfSourceCode)
1041  {
1043  }
1045  // write line link (HTML only)
1046  ol.writeObjectLink(0,fn,anchorStr,lineStr);
1047  ol.enableAll();
1049  if (latexSourceCode)
1050  {
1052  }
1053  if (rtfSourceCode)
1054  {
1056  }
1057  // write normal text (Latex/Man only)
1058  ol.docify(lineStr);
1059  ol.popGeneratorState();
1060 
1061  // write text right from linePos marker
1062  ol.parseText(refText.right(
1063  refText.length()-lineMarkerPos-2));
1064  }
1065  ol.endParagraph();
1066  }
1067  else
1068  {
1069  err("translation error: invalid markers in trDefinedInSourceFile()\n");
1070  }
1071  }
1072  ol.popGeneratorState();
1073 }
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:49
void startParagraph()
Definition: outputlist.h:115
QCString left(uint len) const
Definition: qcstring.cpp:213
virtual QCString trDefinedAtLineInSourceFile()=0
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
bool parseText(const QCString &textStr)
Definition: outputlist.cpp:175
void popGeneratorState()
Definition: outputlist.cpp:121
QAsciiDict< Entry > fn
void endParagraph()
Definition: outputlist.h:117
void pushGeneratorState()
Definition: outputlist.cpp:111
QCString name() const
Definition: filedef.cpp:1193
virtual QCString getSourceFileBase() const
Definition: definition.cpp:885
virtual QCString getSourceAnchor() const
Definition: definition.cpp:898
QCString right(uint len) const
Definition: qcstring.cpp:231
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:79
#define Config_getBool(val)
Definition: config.cpp:664
void err(const char *fmt,...)
Definition: message.cpp:226
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
void enableAll()
Definition: outputlist.cpp:59
Translator * theTranslator
Definition: language.cpp:157
BodyInfo * body
Definition: definition.cpp:69
void docify(const char *s)
Definition: outputlist.h:145
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
Definition: outputlist.h:149
DefinitionImpl * m_impl
Definition: definition.h:371
FileDef * fileDef
file definition containing the function body
Definition: definition.h:61
int startLine
line number of the start of the definition
Definition: definition.h:59
void Definition::writeSourceReffedBy ( OutputList ol,
const char *  scopeName 
)

Definition at line 1277 of file definition.cpp.

1278 {
1279  if (Config_getBool("REFERENCED_BY_RELATION"))
1280  {
1282  }
1283 }
const bool FALSE
Definition: qglobal.h:370
void _writeSourceRefList(OutputList &ol, const char *scopeName, const QCString &text, MemberSDict *members, bool)
MemberSDict * sourceRefByDict
Definition: definition.cpp:61
#define Config_getBool(val)
Definition: config.cpp:664
virtual QCString trReferencedBy()=0
Translator * theTranslator
Definition: language.cpp:157
DefinitionImpl * m_impl
Definition: definition.h:371
void Definition::writeSourceRefs ( OutputList ol,
const char *  scopeName 
)

Definition at line 1285 of file definition.cpp.

1286 {
1287  if (Config_getBool("REFERENCES_RELATION"))
1288  {
1290  }
1291 }
void _writeSourceRefList(OutputList &ol, const char *scopeName, const QCString &text, MemberSDict *members, bool)
MemberSDict * sourceRefsDict
Definition: definition.cpp:62
#define Config_getBool(val)
Definition: config.cpp:664
virtual QCString trReferences()=0
Translator * theTranslator
Definition: language.cpp:157
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
virtual void Definition::writeSummaryLinks ( OutputList )
inlinevirtual

Reimplemented in ClassDef, FileDef, GroupDef, and NamespaceDef.

Definition at line 339 of file definition.h.

339 {}
void Definition::writeToc ( OutputList ol)

Definition at line 1628 of file definition.cpp.

1629 {
1630  SectionDict *sectionDict = m_impl->sectionDict;
1631  if (sectionDict==0) return;
1632  ol.pushGeneratorState();
1634  ol.writeString("<div class=\"toc\">");
1635  ol.writeString("<h3>");
1637  ol.writeString("</h3>\n");
1638  ol.writeString("<ul>");
1639  SDict<SectionInfo>::Iterator li(*sectionDict);
1640  SectionInfo *si;
1641  int level=1,l;
1642  char cs[2];
1643  cs[1]='\0';
1644  bool inLi[5]={ FALSE, FALSE, FALSE, FALSE };
1645  for (li.toFirst();(si=li.current());++li)
1646  {
1647  if (si->type==SectionInfo::Section ||
1648  si->type==SectionInfo::Subsection ||
1651  {
1652  //printf(" level=%d title=%s\n",level,si->title.data());
1653  int nextLevel = (int)si->type;
1654  if (nextLevel>level)
1655  {
1656  for (l=level;l<nextLevel;l++)
1657  {
1658  ol.writeString("<ul>");
1659  }
1660  }
1661  else if (nextLevel<level)
1662  {
1663  for (l=level;l>nextLevel;l--)
1664  {
1665  if (inLi[l]) ol.writeString("</li>\n");
1666  inLi[l]=FALSE;
1667  ol.writeString("</ul>\n");
1668  }
1669  }
1670  cs[0]='0'+nextLevel;
1671  if (inLi[nextLevel]) ol.writeString("</li>\n");
1672  QCString titleDoc = convertToHtml(si->title);
1673  ol.writeString("<li class=\"level"+QCString(cs)+"\"><a href=\"#"+si->label+"\">"+(si->title.isEmpty()?si->label:titleDoc)+"</a>");
1674  inLi[nextLevel]=TRUE;
1675  level = nextLevel;
1676  }
1677  }
1678  while (level>1)
1679  {
1680  if (inLi[level]) ol.writeString("</li>\n");
1681  inLi[level]=FALSE;
1682  ol.writeString("</ul>\n");
1683  level--;
1684  }
1685  if (inLi[level]) ol.writeString("</li>\n");
1686  inLi[level]=FALSE;
1687  ol.writeString("</ul>\n");
1688  ol.writeString("</div>\n");
1689  ol.popGeneratorState();
1690 }
virtual QCString trRTFTableOfContents()=0
bool isEmpty() const
Definition: qcstring.h:189
SectionType type
Definition: section.h:58
SectionDict * sectionDict
Definition: definition.cpp:59
void writeString(const char *text)
Definition: outputlist.h:119
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:49
const bool FALSE
Definition: qglobal.h:370
QCString label
Definition: section.h:56
static QStrList * l
Definition: config.cpp:1044
void popGeneratorState()
Definition: outputlist.cpp:121
Definition: sortdict.h:73
void pushGeneratorState()
Definition: outputlist.cpp:111
QCString convertToHtml(const char *s, bool keepEntities)
Definition: util.cpp:5746
QCString title
Definition: section.h:57
Translator * theTranslator
Definition: language.cpp:157
const char * cs
if(!yymsg) yymsg
DefinitionImpl * m_impl
Definition: definition.h:371
const bool TRUE
Definition: qglobal.h:371
QList< ListItemInfo > * Definition::xrefListItems ( ) const

Definition at line 1505 of file definition.cpp.

1506 {
1507  return m_impl->xrefListItems;
1508 }
QList< ListItemInfo > * xrefListItems
Definition: definition.cpp:63
DefinitionImpl * m_impl
Definition: definition.h:371

Member Data Documentation

Cookie* Definition::m_cookie
private

Definition at line 377 of file definition.h.

int Definition::m_defColumn
private

Definition at line 376 of file definition.h.

int Definition::m_defLine
private

Definition at line 375 of file definition.h.

DefinitionImpl* Definition::m_impl
private

Definition at line 371 of file definition.h.

bool Definition::m_isSymbol
private

Definition at line 373 of file definition.h.

QCString Definition::m_name
private

Definition at line 372 of file definition.h.

QCString Definition::m_symbolName
private

Definition at line 374 of file definition.h.


The documentation for this class was generated from the following files: