Doxygen
definition.cpp
浏览该文件的文档.
1 
2 #include <algorithm>
3 #include <iterator>
4 #include <unordered_map>
5 #include <string>
6 
7 #include <ctype.h>
8 #include "md5.h"
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <assert.h>
12 #include "regex.h"
13 #include "config.h"
14 #include "definitionimpl.h"
15 #include "doxygen.h"
16 #include "language.h"
17 #include "message.h"
18 #include "portable.h"
19 #include "outputlist.h"
20 #include "code.h"
21 #include "util.h"
22 #include "groupdef.h"
23 #include "pagedef.h"
24 #include "section.h"
25 #include "htags.h"
26 #include "parserintf.h"
27 #include "debug.h"
28 #include "vhdldocgen.h"
29 #include "memberlist.h"
30 #include "namespacedef.h"
31 #include "filedef.h"
32 #include "dirdef.h"
33 #include "pagedef.h"
34 #include "bufstr.h"
35 #include "reflist.h"
36 #include "utf8.h"
37 
38 //-----------------------------------------------------------------------------------------
39 
40 /** Private data associated with a Symbol DefinitionImpl object. */
42 {
43  public:
44  ~IMPL();
45  void init(const QCString &df, const QCString &n);
46  void setDefFileName(const QCString &df);
47 
49 
51 
52  std::unordered_map<std::string,const MemberDef *> sourceRefByDict;
53  std::unordered_map<std::string,const MemberDef *> sourceRefsDict;
56 
57  DocInfo *details = 0; // not exported
58  DocInfo *inbodyDocs = 0; // not exported
59  BriefInfo *brief = 0; // not exported
60  BodyInfo *body = 0; // not exported
63 
64  QCString localName; // local (unqualified) name of the definition
65  // in the future m_name should become m_localName
67  QCString ref; // reference to external documentation
68 
69  bool hidden = FALSE;
72 
73  Definition *outerScope = 0; // not owner
74 
75  // where the item was defined
78 
80 
81  QCString id; // clang unique id
82 
84  bool isSymbol;
86  int defLine;
87  int defColumn;
88 
91 };
92 
93 
95 {
96  delete brief;
97  delete details;
98  delete body;
99  delete inbodyDocs;
100 }
101 
103 {
104  defFileName = df;
105  int lastDot = defFileName.findRev('.');
106  if (lastDot!=-1)
107  {
108  defFileExt = defFileName.mid(lastDot);
109  }
110 }
111 
113 {
114  setDefFileName(df);
115  QCString lname = n;
116  if (lname!="<globalScope>")
117  {
118  //extractNamespaceName(m_name,m_localName,ns);
120  }
121  else
122  {
123  localName=n;
124  }
125  //printf("m_localName=%s\n",qPrint(m_localName));
126 
127  brief = 0;
128  details = 0;
129  body = 0;
130  inbodyDocs = 0;
131  sourceRefByDict.clear();
132  sourceRefsDict.clear();
133  outerScope = Doxygen::globalScope;
134  hidden = FALSE;
136  lang = SrcLangExt_Unknown;
137 }
138 
139 void DefinitionImpl::setDefFile(const QCString &df,int defLine,int defCol)
140 {
141  m_impl->setDefFileName(df);
142  m_impl->defLine = defLine;
143  m_impl->defColumn = defCol;
144 }
145 
146 //-----------------------------------------------------------------------------------------
147 
148 static bool matchExcludedSymbols(const QCString &name)
149 {
150  const StringVector &exclSyms = Config_getList(EXCLUDE_SYMBOLS);
151  if (exclSyms.empty()) return FALSE; // nothing specified
152  std::string symName = name.str();
153  for (const auto &pat : exclSyms)
154  {
155  QCString pattern = pat.c_str();
156  bool forceStart=FALSE;
157  bool forceEnd=FALSE;
158  if (pattern.at(0)=='^')
159  pattern=pattern.mid(1),forceStart=TRUE;
160  if (pattern.at(pattern.length()-1)=='$')
161  pattern=pattern.left(pattern.length()-1),forceEnd=TRUE;
162  if (pattern.find('*')!=-1) // wildcard mode
163  {
164  const reg::Ex re(substitute(pattern,"*",".*").str());
166  if (reg::search(symName,match,re)) // wildcard match
167  {
168  size_t ui = match.position();
169  size_t pl = match.length();
170  size_t sl = symName.length();
171  if ((ui==0 || pattern.at(0)=='*' || (!isId(symName.at(ui-1)) && !forceStart)) &&
172  (ui+pl==sl || pattern.at(pattern.length()-1)=='*' || (!isId(symName.at(ui+pl)) && !forceEnd))
173  )
174  {
175  //printf("--> name=%s pattern=%s match at %d\n",qPrint(symName),qPrint(pattern),i);
176  return TRUE;
177  }
178  }
179  }
180  else if (!pattern.isEmpty()) // match words
181  {
182  size_t i = symName.find(pattern.str());
183  if (i!=std::string::npos) // we have a match!
184  {
185  size_t ui=i;
186  size_t pl=pattern.length();
187  size_t sl=symName.length();
188  // check if it is a whole word match
189  if ((ui==0 || (!isId(symName.at(ui-1)) && !forceStart)) &&
190  (ui+pl==sl || (!isId(symName.at(ui+pl)) && !forceEnd))
191  )
192  {
193  //printf("--> name=%s pattern=%s match at %d\n",qPrint(symName),qPrint(pattern),i);
194  return TRUE;
195  }
196  }
197  }
198  }
199  //printf("--> name=%s: no match\n",name);
200  return FALSE;
201 }
202 
203 static void addToMap(const QCString &name,Definition *d)
204 {
205  bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
208  if (!vhdlOpt && index!=-1) symbolName=symbolName.mid(index+2);
209  if (!symbolName.isEmpty())
210  {
212 
214  }
215 }
216 
217 static void removeFromMap(const QCString &name,Definition *d)
218 {
220 }
221 
223  const QCString &df,int dl,int dc,
224  const QCString &name,const char *b,
225  const char *d,bool isSymbol)
226 {
228  setName(name);
229  m_impl->def = def;
230  m_impl->defLine = dl;
231  m_impl->defColumn = dc;
232  m_impl->init(df,name);
233  m_impl->isSymbol = isSymbol;
234  if (isSymbol) addToMap(name,def);
235  _setBriefDescription(b,df,dl);
236  _setDocumentation(d,df,dl,TRUE,FALSE);
238  {
239  m_impl->hidden = TRUE;
240  }
241 }
242 
244 {
246  *m_impl = *d.m_impl;
247  m_impl->brief = 0;
248  m_impl->details = 0;
249  m_impl->body = 0;
250  m_impl->inbodyDocs = 0;
251  if (d.m_impl->brief)
252  {
253  m_impl->brief = new BriefInfo(*d.m_impl->brief);
254  }
255  if (d.m_impl->details)
256  {
257  m_impl->details = new DocInfo(*d.m_impl->details);
258  }
259  if (d.m_impl->body)
260  {
261  m_impl->body = new BodyInfo(*d.m_impl->body);
262  }
263  if (d.m_impl->inbodyDocs)
264  {
266  }
267 
269 }
270 
272 {
273  if (m_impl->isSymbol)
274  {
276  }
277  delete m_impl;
278  m_impl=0;
279 }
280 
282 {
283  if (name.isEmpty()) return;
284  m_impl->name = name;
286  m_impl->name.at(0)=='@' ||
287  m_impl->name.find("::@")!=-1;
288 }
289 
291 {
292  if (id.isEmpty()) return;
293  m_impl->id = id;
295  {
296  //printf("DefinitionImpl::setId '%s'->'%s'\n",id,qPrint(m_impl->name));
297  Doxygen::clangUsrMap->insert(std::make_pair(id.str(),m_impl->def));
298  }
299 }
300 
302 {
303  return m_impl->id;
304 }
305 
306 void DefinitionImpl::addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList)
307 {
308  //printf("%s: addSectionsToDefinition(%d)\n",qPrint(name()),anchorList->count());
309  for (const SectionInfo *si : anchorList)
310  {
311  //printf("Add section '%s' to definition '%s'\n",
312  // qPrint(si->label()),qPrint(name()));
314  SectionInfo *gsi=sm.find(si->label());
315  //printf("===== label=%s gsi=%p\n",qPrint(si->label),gsi);
316  if (gsi==0)
317  {
318  gsi = sm.add(*si);
319  }
320  if (m_impl->sectionRefs.find(gsi->label())==0)
321  {
322  m_impl->sectionRefs.add(gsi);
323  gsi->setDefinition(m_impl->def);
324  }
325  }
326 }
327 
329 {
330  //printf("DefinitionImpl::hasSections(%s) #sections=%d\n",qPrint(name()),
331  // m_impl->sectionRefs.size());
332  if (m_impl->sectionRefs.empty()) return FALSE;
333  for (const SectionInfo *si : m_impl->sectionRefs)
334  {
335  if (isSection(si->type()))
336  {
337  return TRUE;
338  }
339  }
340  return FALSE;
341 }
342 
344 {
345  if (m_impl->sectionRefs.empty()) return;
346  //printf("DefinitionImpl::addSectionsToIndex()\n");
347  int level=1;
348  for (auto it = m_impl->sectionRefs.begin(); it!=m_impl->sectionRefs.end(); ++it)
349  {
350  const SectionInfo *si = *it;
351  SectionType type = si->type();
352  if (isSection(type))
353  {
354  //printf(" level=%d title=%s\n",level,qPrint(si->title));
355  int nextLevel = (int)type;
356  int i;
357  if (nextLevel>level)
358  {
359  for (i=level;i<nextLevel;i++)
360  {
362  }
363  }
364  else if (nextLevel<level)
365  {
366  for (i=nextLevel;i<level;i++)
367  {
369  }
370  }
371  QCString title = si->title();
372  if (title.isEmpty()) title = si->label();
373  // determine if there is a next level inside this item
374  auto it_next = std::next(it);
375  bool isDir = (it_next!=m_impl->sectionRefs.end()) ?
376  ((int)((*it_next)->type()) > nextLevel) : FALSE;
377  Doxygen::indexList->addContentsItem(isDir,title,
378  getReference(),
380  si->label(),
381  FALSE,
382  TRUE);
383  level = nextLevel;
384  }
385  }
386  while (level>1)
387  {
389  level--;
390  }
391 }
392 
394 {
395  if (!m_impl->sectionRefs.empty())
396  {
397  //printf("%s: writeDocAnchorsToTagFile(%d)\n",qPrint(name()),m_impl->sectionRef.size());
398  for (const SectionInfo *si : m_impl->sectionRefs)
399  {
400  if (!si->generated() && si->ref().isEmpty() && !si->label().startsWith("autotoc_md"))
401  {
402  //printf("write an entry!\n");
403  if (m_impl->def->definitionType()==Definition::TypeMember) tagFile << " ";
404  tagFile << " <docanchor file=\"" << addHtmlExtensionIfMissing(si->fileName()) << "\"";
405  if (!si->title().isEmpty())
406  {
407  tagFile << " title=\"" << convertToXML(si->title()) << "\"";
408  }
409  tagFile << ">" << si->label() << "</docanchor>\n";
410  }
411  }
412  }
413 }
414 
416 {
417  uchar md5_sig[16];
418  char sigStr[33];
419  // to avoid mismatches due to differences in indenting, we first remove
420  // double whitespaces...
421  QCString docStr = doc.simplifyWhiteSpace();
422  MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
423  MD5SigToString(md5_sig,sigStr);
424  //printf("%s:_docsAlreadyAdded doc='%s' sig='%s' docSigs='%s'\n",
425  // qPrint(name()),qPrint(doc),qPrint(sigStr),qPrint(sigList));
426  if (sigList.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
427  {
428  sigList+=QCString(":")+sigStr;
429  return FALSE;
430  }
431  else
432  {
433  return TRUE;
434  }
435 }
436 
438  bool stripWhiteSpace,bool atTop)
439 {
440  //printf("%s::setDocumentation(%s,%s,%d,%d)\n",qPrint(name()),d,docFile,docLine,stripWhiteSpace);
441  if (d.isEmpty()) return;
442  QCString doc = d;
443  if (stripWhiteSpace)
444  {
446  }
447  else // don't strip whitespace
448  {
449  doc=d;
450  }
452  {
453  //printf("setting docs for %s: '%s'\n",qPrint(name()),qPrint(m_doc));
454  if (m_impl->details==0)
455  {
456  m_impl->details = new DocInfo;
457  }
458  if (m_impl->details->doc.isEmpty()) // fresh detailed description
459  {
460  m_impl->details->doc = doc;
461  }
462  else if (atTop) // another detailed description, append it to the start
463  {
464  m_impl->details->doc = doc+"\n\n"+m_impl->details->doc;
465  }
466  else // another detailed description, append it to the end
467  {
468  m_impl->details->doc += "\n\n"+doc;
469  }
470  if (docLine!=-1) // store location if valid
471  {
474  }
475  else
476  {
478  m_impl->details->line = 1;
479  }
480  }
481 }
482 
483 void DefinitionImpl::setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace)
484 {
485  if (d.isEmpty()) return;
486  _setDocumentation(d,docFile,docLine,stripWhiteSpace,FALSE);
487 }
488 
490 {
491  static OUTPUT_LANGUAGE_t outputLanguage = Config_getEnum(OUTPUT_LANGUAGE);
492  static bool needsDot = outputLanguage!=OUTPUT_LANGUAGE_t::Japanese &&
493  outputLanguage!=OUTPUT_LANGUAGE_t::Chinese &&
494  outputLanguage!=OUTPUT_LANGUAGE_t::Korean;
495  QCString brief = b;
496  brief = brief.stripWhiteSpace();
498  brief = brief.stripWhiteSpace();
499  if (brief.isEmpty()) return;
500  uint bl = brief.length();
501  if (bl>0 && needsDot) // add punctuation if needed
502  {
503  int c = brief.at(bl-1);
504  switch(c)
505  {
506  case '.': case '!': case '?': case '>': case ':': case ')': break;
507  default:
508  if (isUTF8CharUpperCase(brief.str(),0) && !lastUTF8CharIsMultibyte(brief.str())) brief+='.';
509  break;
510  }
511  }
512 
514  {
515  if (m_impl->brief && !m_impl->brief->doc.isEmpty())
516  {
517  //printf("adding to details\n");
519  }
520  else
521  {
522  //fprintf(stderr,"DefinitionImpl::setBriefDescription(%s,%s,%d)\n",b,briefFile,briefLine);
523  if (m_impl->brief==0)
524  {
525  m_impl->brief = new BriefInfo;
526  }
527  m_impl->brief->doc=brief;
528  if (briefLine!=-1)
529  {
532  }
533  else
534  {
536  m_impl->brief->line = 1;
537  }
538  }
539  }
540  else
541  {
542  //printf("do nothing!\n");
543  }
544 }
545 
547 {
548  if (b.isEmpty()) return;
550 }
551 
553 {
554  if (m_impl->inbodyDocs==0)
555  {
556  m_impl->inbodyDocs = new DocInfo;
557  }
558  if (m_impl->inbodyDocs->doc.isEmpty()) // fresh inbody docs
559  {
560  m_impl->inbodyDocs->doc = doc;
563  }
564  else // another inbody documentation fragment, append this to the end
565  {
566  m_impl->inbodyDocs->doc += QCString("\n\n")+doc;
567  }
568 }
569 
571 {
572  if (d.isEmpty()) return;
574 }
575 
576 //---------------------------------------
577 
579 {
581  size_t fileSize;
582 };
583 
584 /*! Cache for storing the result of filtering a file */
586 {
587  public:
588  FilterCache() : m_endPos(0) { }
589  bool getFileContents(const QCString &fileName,BufStr &str)
590  {
591  static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
592  QCString filter = getFileFilter(fileName,TRUE);
593  bool usePipe = !filter.isEmpty() && filterSourceFiles;
594  FILE *f=0;
595  const int blockSize = 4096;
596  char buf[blockSize];
597  auto it = m_cache.find(fileName.str());
598  if (usePipe && it!=m_cache.end()) // cache hit: reuse stored result
599  {
600  auto item = it->second;
601  //printf("getFileContents(%s): cache hit\n",qPrint(fileName));
602  // file already processed, get the results after filtering from the tmp file
603  Debug::print(Debug::FilterOutput,0,"Reusing filter result for %s from %s at offset=%d size=%d\n",
604  qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item.filePos,(int)item.fileSize);
606  if (f)
607  {
608  bool success=TRUE;
609  str.resize(static_cast<uint>(item.fileSize+1));
610  if (Portable::fseek(f,item.filePos,SEEK_SET)==-1)
611  {
612  err("Failed to seek to position %d in filter database file %s\n",(int)item.filePos,qPrint(Doxygen::filterDBFileName));
613  success=FALSE;
614  }
615  if (success)
616  {
617  size_t numBytes = fread(str.data(),1,item.fileSize,f);
618  if (numBytes!=item.fileSize)
619  {
620  err("Failed to read %d bytes from position %d in filter database file %s: got %d bytes\n",
621  (int)item.fileSize,(int)item.filePos,qPrint(Doxygen::filterDBFileName),(int)numBytes);
622  success=FALSE;
623  }
624  }
625  str.addChar('\0');
626  fclose(f);
627  return success;
628  }
629  else
630  {
631  err("Failed to open filter database file %s\n",qPrint(Doxygen::filterDBFileName));
632  return FALSE;
633  }
634  }
635  else if (usePipe) // cache miss: filter active but file not previously processed
636  {
637  //printf("getFileContents(%s): cache miss\n",qPrint(fileName));
638  // filter file
639  QCString cmd=filter+" \""+fileName+"\"";
640  Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
641  f = Portable::popen(cmd,"r");
642  FILE *bf = Portable::fopen(Doxygen::filterDBFileName,"a+b");
643  FilterCacheItem item;
644  item.filePos = m_endPos;
645  if (bf==0)
646  {
647  // handle error
648  err("Error opening filter database file %s\n",qPrint(Doxygen::filterDBFileName));
649  str.addChar('\0');
650  Portable::pclose(f);
651  return FALSE;
652  }
653  // append the filtered output to the database file
654  size_t size=0;
655  while (!feof(f))
656  {
657  size_t bytesRead = fread(buf,1,blockSize,f);
658  size_t bytesWritten = fwrite(buf,1,bytesRead,bf);
659  if (bytesRead!=bytesWritten)
660  {
661  // handle error
662  err("Failed to write to filter database %s. Wrote %d out of %d bytes\n",
663  qPrint(Doxygen::filterDBFileName),(int)bytesWritten,(int)bytesRead);
664  str.addChar('\0');
665  Portable::pclose(f);
666  fclose(bf);
667  return FALSE;
668  }
669  size+=bytesWritten;
670  str.addArray(buf,static_cast<uint>(bytesWritten));
671  }
672  str.addChar('\0');
673  item.fileSize = size;
674  // add location entry to the dictionary
675  m_cache.insert(std::make_pair(fileName.str(),item));
676  Debug::print(Debug::FilterOutput,0,"Storing new filter result for %s in %s at offset=%d size=%d\n",
677  qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item.filePos,(int)item.fileSize);
678  // update end of file position
679  m_endPos += size;
680  Portable::pclose(f);
681  fclose(bf);
682  }
683  else // no filtering
684  {
685  // normal file
686  //printf("getFileContents(%s): no filter\n",qPrint(fileName));
687  f = Portable::fopen(fileName,"r");
688  while (!feof(f))
689  {
690  size_t bytesRead = fread(buf,1,blockSize,f);
691  str.addArray(buf,static_cast<uint>(bytesRead));
692  }
693  str.addChar('\0');
694  fclose(f);
695  }
696  return TRUE;
697  }
698  private:
699  std::unordered_map<std::string,FilterCacheItem> m_cache;
701 };
702 
704 
705 //-----------------------------------------
706 
707 
708 /*! Reads a fragment of code from file \a fileName starting at
709  * line \a startLine and ending at line \a endLine (inclusive). The fragment is
710  * stored in \a result. If FALSE is returned the code fragment could not be
711  * found.
712  *
713  * The file is scanned for a opening bracket ('{') from \a startLine onward
714  * The line actually containing the bracket is returned via startLine.
715  * The file is scanned for a closing bracket ('}') from \a endLine backward.
716  * The line actually containing the bracket is returned via endLine.
717  * Note that for VHDL code the bracket search is not done.
718  */
719 bool readCodeFragment(const QCString &fileName,
720  int &startLine,int &endLine,QCString &result)
721 {
722  //printf("readCodeFragment(%s,startLine=%d,endLine=%d)\n",fileName,startLine,endLine);
723  static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
724  QCString filter = getFileFilter(fileName,TRUE);
725  bool usePipe = !filter.isEmpty() && filterSourceFiles;
726  int tabSize = Config_getInt(TAB_SIZE);
727  SrcLangExt lang = getLanguageFromFileName(fileName);
728  const int blockSize = 4096;
729  BufStr str(blockSize);
730  g_filterCache.getFileContents(fileName,str);
731 
732  bool found = lang==SrcLangExt_VHDL ||
733  lang==SrcLangExt_Python ||
734  lang==SrcLangExt_Fortran;
735  // for VHDL, Python, and Fortran no bracket search is possible
736  char *p=str.data();
737  if (p)
738  {
739  char c=0;
740  int col=0;
741  int lineNr=1;
742  // skip until the startLine has reached
743  while (lineNr<startLine && *p)
744  {
745  while ((c=*p++)!='\n' && c!=0) /* skip */;
746  lineNr++;
747  if (found && c == '\n') c = '\0';
748  }
749  if (*p)
750  {
751  // skip until the opening bracket or lonely : is found
752  char cn=0;
753  while (lineNr<=endLine && *p && !found)
754  {
755  int pc=0;
756  while ((c=*p++)!='{' && c!=':' && c!=0)
757  {
758  //printf("parsing char '%c'\n",c);
759  if (c=='\n')
760  {
761  lineNr++,col=0;
762  }
763  else if (c=='\t')
764  {
765  col+=tabSize - (col%tabSize);
766  }
767  else if (pc=='/' && c=='/') // skip single line comment
768  {
769  while ((c=*p++)!='\n' && c!=0) pc=c;
770  if (c=='\n') lineNr++,col=0;
771  }
772  else if (pc=='/' && c=='*') // skip C style comment
773  {
774  while (((c=*p++)!='/' || pc!='*') && c!=0)
775  {
776  if (c=='\n') lineNr++,col=0;
777  pc=c;
778  }
779  }
780  else
781  {
782  col++;
783  }
784  pc = c;
785  }
786  if (c==':')
787  {
788  cn=*p++;
789  if (cn!=':') found=TRUE;
790  }
791  else if (c=='{')
792  {
793  found=TRUE;
794  }
795  }
796  //printf(" -> readCodeFragment(%s,%d,%d) lineNr=%d\n",fileName,startLine,endLine,lineNr);
797  if (found)
798  {
799  // For code with more than one line,
800  // fill the line with spaces until we are at the right column
801  // so that the opening brace lines up with the closing brace
802  if (endLine!=startLine)
803  {
804  QCString spaces;
805  spaces.fill(' ',col);
806  result+=spaces;
807  }
808  // copy until end of line
809  if (c) result+=c;
810  startLine=lineNr;
811  if (c==':')
812  {
813  result+=cn;
814  if (cn=='\n') lineNr++;
815  }
816  char lineStr[blockSize];
817  do
818  {
819  //printf("reading line %d in range %d-%d\n",lineNr,startLine,endLine);
820  int size_read;
821  do
822  {
823  // read up to maxLineLength-1 bytes, the last byte being zero
824  int i=0;
825  while ((c=*p++) && i<blockSize-1)
826  {
827  lineStr[i++]=c;
828  if (c=='\n') break; // stop at end of the line
829  }
830  lineStr[i]=0;
831  size_read=i;
832  result+=lineStr; // append line to the output
833  } while (size_read == (blockSize-1)); // append more if line does not fit in buffer
834  lineNr++;
835  } while (lineNr<=endLine && *p);
836 
837  // strip stuff after closing bracket
838  int newLineIndex = result.findRev('\n');
839  int braceIndex = result.findRev('}');
840  if (braceIndex > newLineIndex)
841  {
842  result.truncate((uint)braceIndex+1);
843  }
844  endLine=lineNr-1;
845  }
846  }
847  if (usePipe)
848  {
849  Debug::print(Debug::FilterOutput, 0, "Filter output\n");
850  Debug::print(Debug::FilterOutput,0,"-------------\n%s\n-------------\n",qPrint(result));
851  }
852  }
853  result = transcodeCharacterStringToUTF8(result);
854  if (!result.isEmpty() && result.at(result.length()-1)!='\n') result += "\n";
855  //printf("readCodeFragment(%d-%d)=%s\n",startLine,endLine,qPrint(result));
856  return found;
857 }
858 
860 {
861  ASSERT(m_impl->def->definitionType()!=Definition::TypeFile); // file overloads this method
862  QCString fn;
863  static bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
864  if (sourceBrowser &&
866  {
868  }
869  return fn;
870 }
871 
873 {
874  const int maxAnchorStrLen = 20;
875  char anchorStr[maxAnchorStrLen];
876  anchorStr[0]='\0';
877  if (m_impl->body && m_impl->body->startLine!=-1)
878  {
879  if (Htags::useHtags)
880  {
881  qsnprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->defLine);
882  }
883  else
884  {
885  qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->defLine);
886  }
887  }
888  return anchorStr;
889 }
890 
891 /*! Write a reference to the source code defining this definition */
893 {
894  //printf("DefinitionImpl::writeSourceRef %d %p\n",bodyLine,bodyDef);
896  if (!fn.isEmpty())
897  {
899  int lineMarkerPos = refText.find("@0");
900  int fileMarkerPos = refText.find("@1");
901  if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
902  {
903  QCString lineStr;
904  lineStr.sprintf("%d",m_impl->body->defLine);
905  QCString anchorStr = getSourceAnchor();
906  ol.startParagraph("definition");
907  if (lineMarkerPos<fileMarkerPos) // line marker before file marker
908  {
909  // write text left from linePos marker
910  ol.parseText(refText.left(lineMarkerPos));
911  ol.writeObjectLink(QCString(),fn,anchorStr,lineStr);
912  // write text between markers
913  ol.parseText(refText.mid(lineMarkerPos+2,fileMarkerPos-lineMarkerPos-2));
914  // write file link
916  // write text right from file marker
917  ol.parseText(refText.right(refText.length()-(uint)fileMarkerPos-2));
918  }
919  else // file marker before line marker
920  {
921  // write text left from file marker
922  ol.parseText(refText.left(fileMarkerPos));
923  // write file link
925  // write text between markers
926  ol.parseText(refText.mid(fileMarkerPos+2,lineMarkerPos-fileMarkerPos-2));
927  // write line link
928  ol.writeObjectLink(QCString(),fn,anchorStr,lineStr);
929  // write text right from linePos marker
930  ol.parseText(refText.right(refText.length()-(uint)lineMarkerPos-2));
931  }
932  ol.endParagraph();
933  }
934  else
935  {
936  err("translation error: invalid markers in trDefinedAtLineInSourceFile()\n");
937  }
938  }
939 }
940 
941 void DefinitionImpl::setBodySegment(int defLine, int bls,int ble)
942 {
943  //printf("setBodySegment(%d,%d) for %s\n",bls,ble,qPrint(name()));
944  if (m_impl->body==0) m_impl->body = new BodyInfo;
945  m_impl->body->defLine = defLine;
946  m_impl->body->startLine = bls;
947  m_impl->body->endLine = ble;
948 }
949 
951 {
952  if (m_impl->body==0) m_impl->body = new BodyInfo;
953  m_impl->body->fileDef=fd;
954 }
955 
957 {
958  return m_impl->body && m_impl->body->startLine!=-1 &&
960  m_impl->body->fileDef;
961 }
962 
963 /*! Write code of this definition into the documentation */
964 void DefinitionImpl::writeInlineCode(OutputList &ol,const QCString &scopeName) const
965 {
966  static bool inlineSources = Config_getBool(INLINE_SOURCES);
967  ol.pushGeneratorState();
968  //printf("Source Fragment %s: %d-%d bodyDef=%p\n",qPrint(name()),
969  // m_startBodyLine,m_endBodyLine,m_bodyDef);
970  if (inlineSources && hasSources())
971  {
972  QCString codeFragment;
973  int actualStart=m_impl->body->startLine,actualEnd=m_impl->body->endLine;
975  actualStart,actualEnd,codeFragment)
976  )
977  {
978  //printf("Adding code fragment '%s' ext='%s'\n",
979  // qPrint(codeFragment),qPrint(m_impl->defFileExt));
981  intf->resetCodeParserState();
982  //printf("Read:\n'%s'\n\n",qPrint(codeFragment));
983  const MemberDef *thisMd = 0;
985  {
986  thisMd = toMemberDef(m_impl->def);
987  }
988 
989  ol.startCodeFragment("DoxyCode");
990  intf->parseCode(ol, // codeOutIntf
991  scopeName, // scope
992  codeFragment, // input
993  m_impl->lang, // lang
994  FALSE, // isExample
995  QCString(), // exampleName
996  m_impl->body->fileDef, // fileDef
997  actualStart, // startLine
998  actualEnd, // endLine
999  TRUE, // inlineFragment
1000  thisMd, // memberDef
1001  TRUE // show line numbers
1002  );
1003  ol.endCodeFragment("DoxyCode");
1004  }
1005  }
1006  ol.popGeneratorState();
1007 }
1008 
1009 static inline MemberVector refMapToVector(const std::unordered_map<std::string,const MemberDef *> &map)
1010 {
1011  // convert map to a vector of values
1012  MemberVector result;
1013  std::transform(map.begin(),map.end(), // iterate over map
1014  std::back_inserter(result), // add results to vector
1015  [](const auto &item)
1016  { return item.second; } // extract value to add from map Key,Value pair
1017  );
1018  // and sort it
1019  std::sort(result.begin(),result.end(),
1020  [](const auto &m1,const auto &m2) { return genericCompareMembers(m1,m2)<0; });
1021  return result;
1022 }
1023 
1024 /*! Write a reference to the source code fragments in which this
1025  * definition is used.
1026  */
1028  const QCString &text,const std::unordered_map<std::string,const MemberDef *> &membersMap,
1029  bool /*funcOnly*/) const
1030 {
1031  static bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1032  static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE);
1033  if (!membersMap.empty())
1034  {
1035  auto members = refMapToVector(membersMap);
1036 
1037  auto replaceFunc = [this,&members,scopeName,&ol](size_t entryIndex)
1038  {
1039  const MemberDef *md=members[entryIndex];
1040  if (md)
1041  {
1042  QCString scope=md->getScopeString();
1043  QCString name=md->name();
1044  //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),qPrint(scope),scopeName);
1045  if (!scope.isEmpty() && scope!=scopeName)
1046  {
1048  }
1049  if (!md->isObjCMethod() &&
1050  (md->isFunction() || md->isSlot() ||
1051  md->isPrototype() || md->isSignal()
1052  )
1053  )
1054  {
1055  name+="()";
1056  }
1057  if (sourceBrowser &&
1058  !(md->isLinkable() && !refLinkSource) &&
1059  md->getStartBodyLine()!=-1 &&
1060  md->getBodyDef()
1061  )
1062  {
1063  const int maxLineNrStr = 10;
1064  char anchorStr[maxLineNrStr];
1065  qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine());
1066  //printf("Write object link to %s\n",qPrint(md->getBodyDef()->getSourceFileBase()));
1067  ol.writeObjectLink(QCString(),md->getBodyDef()->getSourceFileBase(),anchorStr,name);
1068  }
1069  else if (md->isLinkable())
1070  {
1071  ol.writeObjectLink(md->getReference(),
1072  md->getOutputFileBase(),
1073  md->anchor(),name);
1074  }
1075  else
1076  {
1077  ol.docify(name);
1078  }
1079  }
1080  };
1081 
1082  ol.startParagraph("reference");
1083  ol.parseText(text);
1084  ol.docify(" ");
1085  writeMarkerList(ol,
1086  theTranslator->trWriteList((int)members.size()).str(),
1087  members.size(),
1088  replaceFunc);
1089  ol.writeString(".");
1090  ol.endParagraph();
1091 
1092  }
1093 }
1094 
1096 {
1098 }
1099 
1100 void DefinitionImpl::writeSourceRefs(OutputList &ol,const QCString &scopeName) const
1101 {
1103 }
1104 
1106 {
1107  return !m_impl->sourceRefByDict.empty();
1108 }
1109 
1111 {
1112  return !m_impl->sourceRefsDict.empty();
1113 }
1114 
1116 {
1117  static bool extractAll = Config_getBool(EXTRACT_ALL);
1118  //static bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1119  bool hasDocs =
1120  (m_impl->details && !m_impl->details->doc.isEmpty()) || // has detailed docs
1121  (m_impl->brief && !m_impl->brief->doc.isEmpty()) || // has brief description
1122  (m_impl->inbodyDocs && !m_impl->inbodyDocs->doc.isEmpty()) || // has inbody docs
1123  extractAll //|| // extract everything
1124  // (sourceBrowser && m_impl->body &&
1125  // m_impl->body->startLine!=-1 && m_impl->body->fileDef)
1126  ; // link to definition
1127  return hasDocs;
1128 }
1129 
1131 {
1132  bool hasDocs =
1133  (m_impl->details && !m_impl->details->doc.isEmpty()) ||
1134  (m_impl->brief && !m_impl->brief->doc.isEmpty()) ||
1136  return hasDocs;
1137 }
1138 
1139 
1141 {
1142  if (md)
1143  {
1144  QCString name = md->name();
1145  QCString scope = md->getScopeString();
1146 
1147  if (!scope.isEmpty())
1148  {
1149  name.prepend(scope+"::");
1150  }
1151 
1152  m_impl->sourceRefByDict.insert({name.str(),md});
1153  }
1154 }
1155 
1157 {
1158  if (md)
1159  {
1160  QCString name = md->name();
1161  QCString scope = md->getScopeString();
1162 
1163  if (!scope.isEmpty())
1164  {
1165  name.prepend(scope+"::");
1166  }
1167 
1168  m_impl->sourceRefsDict.insert({name.str(),md});
1169  }
1170 }
1171 
1173 {
1174  return 0;
1175 }
1176 
1178 {
1179  err("DefinitionImpl::addInnerCompound() called\n");
1180 }
1181 
1183 {
1184  //static int count=0;
1185  //count++;
1186  if (!m_impl->qualifiedName.isEmpty())
1187  {
1188  //count--;
1189  return m_impl->qualifiedName;
1190  }
1191 
1192  //printf("start %s::qualifiedName() localName=%s\n",qPrint(name()),qPrint(m_impl->localName));
1193  if (m_impl->outerScope==0)
1194  {
1195  if (m_impl->localName=="<globalScope>")
1196  {
1197  //count--;
1198  return "";
1199  }
1200  else
1201  {
1202  //count--;
1203  return m_impl->localName;
1204  }
1205  }
1206 
1207  if (m_impl->outerScope->name()=="<globalScope>")
1208  {
1210  }
1211  else
1212  {
1215  m_impl->localName;
1216  }
1217  //printf("end %s::qualifiedName()=%s\n",qPrint(name()),qPrint(m_impl->qualifiedName));
1218  //count--;
1219  return m_impl->qualifiedName;
1220 }
1221 
1223 {
1224  //printf("%s::setOuterScope(%s)\n",qPrint(name()),d?qPrint(d->name()):"<none>");
1226  bool found=false;
1227  // make sure that we are not creating a recursive scope relation.
1228  while (p && !found)
1229  {
1230  found = (p==d);
1231  p = p->getOuterScope();
1232  }
1233  if (!found)
1234  {
1235  m_impl->qualifiedName.resize(0); // flush cached scope name
1236  m_impl->outerScope = d;
1237  }
1238  m_impl->hidden = m_impl->hidden || d->isHidden();
1239 }
1240 
1242 {
1243  return m_impl->localName;
1244 }
1245 
1247 {
1248  m_impl->partOfGroups.push_back(gd);
1249 }
1250 
1252 {
1253  m_impl->xrefListItems.insert(m_impl->xrefListItems.end(), sli.cbegin(), sli.cend());
1254 }
1255 
1257 {
1258  auto otherXrefList = d->xrefListItems();
1259 
1260  // append vectors
1261  m_impl->xrefListItems.reserve(m_impl->xrefListItems.size()+otherXrefList.size());
1262  m_impl->xrefListItems.insert (m_impl->xrefListItems.end(),
1263  otherXrefList.begin(),otherXrefList.end());
1264 
1265  // sort results on itemId
1266  std::sort(m_impl->xrefListItems.begin(),m_impl->xrefListItems.end(),
1267  [](RefItem *left,RefItem *right)
1268  { return left->id() <right->id() ||
1269  (left->id()==right->id() &&
1270  left->list()->listName() < right->list()->listName());
1271  });
1272 
1273  // filter out duplicates
1274  auto last = std::unique(m_impl->xrefListItems.begin(),m_impl->xrefListItems.end(),
1275  [](const RefItem *left,const RefItem *right)
1276  { return left->id()==right->id() &&
1277  left->list()->listName()==right->list()->listName();
1278  });
1279  m_impl->xrefListItems.erase(last, m_impl->xrefListItems.end());
1280 }
1281 
1282 int DefinitionImpl::_getXRefListId(const QCString &listName) const
1283 {
1284  for (const RefItem *item : m_impl->xrefListItems)
1285  {
1286  if (item->list()->listName()==listName)
1287  {
1288  return item->id();
1289  }
1290  }
1291  return -1;
1292 }
1293 
1295 {
1296  return m_impl->xrefListItems;
1297 }
1298 
1300 {
1301  QCString result;
1303  {
1304  result = m_impl->outerScope->pathFragment();
1305  }
1306  if (m_impl->def->isLinkable())
1307  {
1308  if (!result.isEmpty()) result+="/";
1311  {
1312  result+=toGroupDef(m_impl->def)->groupTitle();
1313  }
1316  {
1317  result+=toPageDef(m_impl->def)->title();
1318  }
1319  else
1320  {
1321  result+=m_impl->localName;
1322  }
1323  }
1324  else
1325  {
1326  result+=m_impl->localName;
1327  }
1328  return result;
1329 }
1330 
1331 //----------------------------------------------------------------------------------------
1332 
1333 // TODO: move to htmlgen
1334 /*! Returns the string used in the footer for $navpath when
1335  * GENERATE_TREEVIEW is enabled
1336  */
1338 {
1339  QCString result;
1340  Definition *outerScope = getOuterScope();
1341  QCString locName = localName();
1342  if (outerScope && outerScope!=Doxygen::globalScope)
1343  {
1344  result+=outerScope->navigationPathAsString();
1345  }
1348  {
1349  result+=(toFileDef(m_impl->def))->getDirDef()->navigationPathAsString();
1350  }
1351  result+="<li class=\"navelem\">";
1352  if (m_impl->def->isLinkable())
1353  {
1356  {
1357  result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase())+"\">"+
1359  }
1362  {
1363  result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase())+"\">"+
1364  convertToHtml((toPageDef(m_impl->def))->title())+"</a>";
1365  }
1367  {
1368  QCString name = locName;
1369  if (name.right(2)=="-p" /*|| name.right(2)=="-g"*/)
1370  {
1371  name = name.left(name.length()-2);
1372  }
1373  result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase());
1374  if (!m_impl->def->anchor().isEmpty()) result+="#"+m_impl->def->anchor();
1375  result+="\">"+convertToHtml(name)+"</a>";
1376  }
1377  else
1378  {
1379  result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase())+"\">"+
1380  convertToHtml(locName)+"</a>";
1381  }
1382  }
1383  else
1384  {
1385  result+="<b>"+convertToHtml(locName)+"</b>";
1386  }
1387  result+="</li>";
1388  return result;
1389 }
1390 
1391 // TODO: move to htmlgen
1393 {
1394  ol.pushGeneratorState();
1396 
1397  QCString navPath;
1398  navPath += "<div id=\"nav-path\" class=\"navpath\">\n"
1399  " <ul>\n";
1400  navPath += navigationPathAsString();
1401  navPath += " </ul>\n"
1402  "</div>\n";
1403  ol.writeNavigationPath(navPath);
1404 
1405  ol.popGeneratorState();
1406 }
1407 
1408 // TODO: move to htmlgen
1409 void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const
1410 {
1411  if (m_impl->sectionRefs.empty()) return;
1412  if (localToc.isHtmlEnabled())
1413  {
1414  int maxLevel = localToc.htmlLevel();
1415  ol.pushGeneratorState();
1417  ol.writeString("<div class=\"toc\">");
1418  ol.writeString("<h3>");
1420  ol.writeString("</h3>\n");
1421  ol.writeString("<ul>");
1422  int level=1,l;
1423  char cs[2];
1424  cs[1]='\0';
1425  BoolVector inLi(maxLevel+1,false);
1426  for (const SectionInfo *si : m_impl->sectionRefs)
1427  {
1428  SectionType type = si->type();
1429  if (isSection(type))
1430  {
1431  //printf(" level=%d title=%s\n",level,qPrint(si->title));
1432  int nextLevel = (int)type;
1433  if (nextLevel>level)
1434  {
1435  for (l=level;l<nextLevel;l++)
1436  {
1437  if (l < maxLevel) ol.writeString("<ul>");
1438  }
1439  }
1440  else if (nextLevel<level)
1441  {
1442  for (l=level;l>nextLevel;l--)
1443  {
1444  if (l <= maxLevel && inLi[l]) ol.writeString("</li>\n");
1445  inLi[l]=false;
1446  if (l <= maxLevel) ol.writeString("</ul>\n");
1447  }
1448  }
1449  cs[0]=(char)('0'+nextLevel);
1450  if (nextLevel <= maxLevel && inLi[nextLevel])
1451  {
1452  ol.writeString("</li>\n");
1453  }
1454  QCString titleDoc = convertToHtml(si->title());
1455  if (nextLevel <= maxLevel)
1456  {
1457  ol.writeString("<li class=\"level"+QCString(cs)+"\">"
1458  "<a href=\"#"+si->label()+"\">"+
1459  (si->title().isEmpty()?si->label():titleDoc)+"</a>");
1460  }
1461  inLi[nextLevel]=true;
1462  level = nextLevel;
1463  }
1464  }
1465  if (level > maxLevel) level = maxLevel;
1466  while (level>1 && level <= maxLevel)
1467  {
1468  if (inLi[level])
1469  {
1470  ol.writeString("</li>\n");
1471  }
1472  inLi[level]=FALSE;
1473  ol.writeString("</ul>\n");
1474  level--;
1475  }
1476  if (level <= maxLevel && inLi[level]) ol.writeString("</li>\n");
1477  ol.writeString("</ul>\n");
1478  ol.writeString("</div>\n");
1479  ol.popGeneratorState();
1480  }
1481 
1482  if (localToc.isDocbookEnabled())
1483  {
1484  ol.pushGeneratorState();
1486  ol.writeString(" <toc>\n");
1487  ol.writeString(" <title>" + theTranslator->trRTFTableOfContents() + "</title>\n");
1488  int level=1,l;
1489  int maxLevel = localToc.docbookLevel();
1490  BoolVector inLi(maxLevel+1,false);
1491  for (const SectionInfo *si : m_impl->sectionRefs)
1492  {
1493  SectionType type = si->type();
1494  if (isSection(type))
1495  {
1496  //printf(" level=%d title=%s\n",level,qPrint(si->title));
1497  int nextLevel = (int)type;
1498  if (nextLevel>level)
1499  {
1500  for (l=level;l<nextLevel;l++)
1501  {
1502  if (l < maxLevel) ol.writeString(" <tocdiv>\n");
1503  }
1504  }
1505  else if (nextLevel<level)
1506  {
1507  for (l=level;l>nextLevel;l--)
1508  {
1509  inLi[l]=FALSE;
1510  if (l <= maxLevel) ol.writeString(" </tocdiv>\n");
1511  }
1512  }
1513  if (nextLevel <= maxLevel)
1514  {
1515  QCString titleDoc = convertToDocBook(si->title());
1516  ol.writeString(" <tocentry>" +
1517  (si->title().isEmpty()?si->label():titleDoc) +
1518  "</tocentry>\n");
1519  }
1520  inLi[nextLevel]=TRUE;
1521  level = nextLevel;
1522  }
1523  }
1524  if (level > maxLevel) level = maxLevel;
1525  while (level>1 && level <= maxLevel)
1526  {
1527  inLi[level]=FALSE;
1528  ol.writeString("</tocdiv>\n");
1529  level--;
1530  }
1531  ol.writeString(" </toc>\n");
1532  ol.popGeneratorState();
1533  }
1534 
1535  if (localToc.isLatexEnabled())
1536  {
1537  ol.pushGeneratorState();
1539  int maxLevel = localToc.latexLevel();
1540 
1541  ol.writeString("\\etocsetnexttocdepth{"+QCString().setNum(maxLevel)+"}\n");
1542 
1543  ol.writeString("\\localtableofcontents\n");
1544  ol.popGeneratorState();
1545  }
1546 }
1547 
1548 //----------------------------------------------------------------------------------------
1549 
1551 {
1552  return m_impl->sectionRefs;
1553 }
1554 
1556 {
1557  return m_impl->symbolName;
1558 }
1559 
1560 //----------------------
1561 
1563 {
1564  return m_impl->details ? m_impl->details->doc : QCString("");
1565 }
1566 
1568 {
1569  return m_impl->details ? m_impl->details->line : 1;
1570 }
1571 
1573 {
1574  return m_impl->details ? m_impl->details->file : QCString("<"+m_impl->name+">");
1575 }
1576 
1577 //----------------------------------------------------------------------------
1578 // strips w from s iff s starts with w
1579 static bool stripWord(QCString &s,QCString w)
1580 {
1581  bool success=FALSE;
1582  if (s.left(w.length())==w)
1583  {
1584  success=TRUE;
1585  s=s.right(s.length()-w.length());
1586  }
1587  return success;
1588 }
1589 
1590 //----------------------------------------------------------------------------
1591 // some quasi intelligent brief description abbreviator :^)
1592 static QCString abbreviate(const QCString &s,const QCString &name)
1593 {
1594  QCString scopelessName=name;
1595  int i=scopelessName.findRev("::");
1596  if (i!=-1) scopelessName=scopelessName.mid(i+2);
1597  QCString result=s;
1598  result=result.stripWhiteSpace();
1599  // strip trailing .
1600  if (!result.isEmpty() && result.at(result.length()-1)=='.')
1601  result=result.left(result.length()-1);
1602 
1603  // strip any predefined prefix
1604  const StringVector &briefDescAbbrev = Config_getList(ABBREVIATE_BRIEF);
1605  for (const auto &p : briefDescAbbrev)
1606  {
1607  QCString str = substitute(p.c_str(),"$name",scopelessName); // replace $name with entity name
1608  str += " ";
1609  stripWord(result,str);
1610  }
1611 
1612  // capitalize first word
1613  if (!result.isEmpty())
1614  {
1615  char c=result[0];
1616  if (c>='a' && c<='z') c+='A'-'a';
1617  result[0]=c;
1618  }
1619  return result;
1620 }
1621 
1622 
1623 //----------------------
1624 
1626 {
1627  //printf("%s::briefDescription(%d)='%s'\n",qPrint(name()),abbr,m_impl->brief?qPrint(m_impl->brief->doc):"<none>");
1628  return m_impl->brief ?
1629  (abbr ? abbreviate(m_impl->brief->doc,m_impl->def->displayName()) : m_impl->brief->doc) :
1630  QCString("");
1631 }
1632 
1634 {
1635  if (m_impl->brief && m_impl->brief->tooltip.isEmpty() && !m_impl->brief->doc.isEmpty())
1636  {
1639  m_impl->brief->tooltip = parseCommentAsText(scope,md,
1641  }
1642 }
1643 
1645 {
1646  return m_impl->brief ? m_impl->brief->tooltip : QCString();
1647 }
1648 
1650 {
1651  return m_impl->brief ? m_impl->brief->line : 1;
1652 }
1653 
1655 {
1656  return m_impl->brief ? m_impl->brief->file : QCString("<"+m_impl->name+">");
1657 }
1658 
1659 //----------------------
1660 
1662 {
1663  return m_impl->inbodyDocs ? m_impl->inbodyDocs->doc : QCString("");
1664 }
1665 
1667 {
1668  return m_impl->inbodyDocs ? m_impl->inbodyDocs->line : 1;
1669 }
1670 
1672 {
1673  return m_impl->inbodyDocs ? m_impl->inbodyDocs->file : QCString("<"+m_impl->name+">");
1674 }
1675 
1676 
1677 //----------------------
1678 
1680 {
1681  return m_impl->defFileName;
1682 }
1683 
1685 {
1686  return m_impl->defFileExt;
1687 }
1688 
1690 {
1691  return m_impl->hidden;
1692 }
1693 
1695 {
1696  return m_impl->def->isLinkableInProject() && !m_impl->hidden;
1697 }
1698 
1700 {
1701  return m_impl->def->isLinkable() && !m_impl->hidden;
1702 }
1703 
1705 {
1706  return m_impl->isArtificial;
1707 }
1708 
1710 {
1711  return m_impl->ref;
1712 }
1713 
1715 {
1716  return !m_impl->ref.isEmpty();
1717 }
1718 
1720 {
1721  return m_impl->body ? m_impl->body->defLine : -1;
1722 }
1723 
1725 {
1726  return m_impl->body ? m_impl->body->startLine : -1;
1727 }
1728 
1730 {
1731  return m_impl->body ? m_impl->body->endLine : -1;
1732 }
1733 
1735 {
1736  return m_impl->body ? m_impl->body->fileDef : 0;
1737 }
1738 
1740 {
1741  return m_impl->partOfGroups;
1742 }
1743 
1745 {
1746  for (const auto &gd : partOfGroups())
1747  {
1748  if (gd->isLinkable()) return true;
1749  }
1750  return false;
1751 }
1752 
1754 {
1755  return m_impl->outerScope;
1756 }
1757 
1759 {
1760  if (m_impl->referencesMembers.empty() && !m_impl->sourceRefsDict.empty())
1761  {
1763  }
1764  return m_impl->referencesMembers;
1765 }
1766 
1768 {
1770  {
1772  }
1773  return m_impl->referencedByMembers;
1774 }
1775 
1777 {
1778  const DefinitionImpl *defImpl = other->toDefinitionImpl_();
1779  if (defImpl)
1780  {
1781  for (const auto &kv : defImpl->m_impl->sourceRefsDict)
1782  {
1783  auto it = m_impl->sourceRefsDict.find(kv.first);
1784  if (it != m_impl->sourceRefsDict.end())
1785  {
1786  m_impl->sourceRefsDict.insert(kv);
1787  }
1788  }
1789  }
1790 }
1791 
1793 {
1794  const DefinitionImpl *defImpl = other->toDefinitionImpl_();
1795  if (defImpl)
1796  {
1797  for (const auto &kv : defImpl->m_impl->sourceRefByDict)
1798  {
1799  auto it = m_impl->sourceRefByDict.find(kv.first);
1800  if (it != m_impl->sourceRefByDict.end())
1801  {
1802  m_impl->sourceRefByDict.insert({kv.first,kv.second});
1803  }
1804  }
1805  }
1806 }
1807 
1808 
1810 {
1811  m_impl->ref=r;
1812 }
1813 
1815 {
1816  return m_impl->lang;
1817 }
1818 
1820 {
1821  m_impl->hidden = m_impl->hidden || b;
1822 }
1823 
1825 {
1826  m_impl->isArtificial = b;
1827 }
1828 
1830 {
1832 }
1833 
1835 {
1836  m_impl->lang=lang;
1837 }
1838 
1839 
1841 {
1843 }
1844 
1846 {
1847  return m_impl->symbolName;
1848 }
1849 
1851 {
1852  static bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
1853  return !briefDescription().isEmpty() && briefMemberDesc;
1854 }
1855 
1857 {
1858  QCString ref = getReference();
1859  if (!ref.isEmpty())
1860  {
1861  auto it = Doxygen::tagDestinationMap.find(ref.str());
1862  if (it!=Doxygen::tagDestinationMap.end())
1863  {
1864  QCString result(it->second);
1865  uint l = result.length();
1866  if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
1867  { // relative path -> prepend relPath.
1868  result.prepend(relPath);
1869  l+=relPath.length();
1870  }
1871  if (l>0 && result.at(l-1)!='/') result+='/';
1872  return result;
1873  }
1874  }
1875  return relPath;
1876 }
1877 
1879 {
1880  return m_impl->name;
1881 }
1882 
1884 {
1885  return m_impl->isAnonymous;
1886 }
1887 
1889 {
1890  return m_impl->defLine;
1891 }
1892 
1894 {
1895  return m_impl->defColumn;
1896 }
1897 
1899 {
1900 }
1901 
1903 {
1904 }
1905 
1906 //---------------------------------------------------------------------------------
1907 
1909  : m_def(def), m_scope(scope), m_symbolName(alias->_symbolName())
1910 {
1911 }
1912 
1914 {
1915 }
1916 
1918 {
1919  //printf("%s::addToMap(%s)\n",qPrint(name()),qPrint(alias->name()));
1921 }
1922 
1924 {
1926 }
1927 
1929 {
1930  //printf("start %s::qualifiedName() localName=%s\n",qPrint(name()),qPrint(m_impl->localName));
1931  if (m_scope==0)
1932  {
1933  return m_def->localName();
1934  }
1935  else
1936  {
1937  return m_scope->qualifiedName()+
1939  m_def->localName();
1940  }
1941 }
1942 
1944 {
1945  return qualifiedName();
1946 }
1947 
1948 //---------------------------------------------------------------------------------
1949 
1951 {
1952  if (dm==0) return 0;
1953  return dm->toDefinition_();
1954 }
1955 
1957 {
1958  if (d==0) return 0;
1959  return d->toDefinitionMutable_();
1960 }
1961 
1963 {
1964  return toDefinitionMutable(const_cast<Definition*>(d));
1965 }
1966 
toDefinition
Definition * toDefinition(DefinitionMutable *dm)
Definition: definition.cpp:1950
Debug::ExtCmd
@ ExtCmd
Definition: debug.h:36
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
OutputList::disableAllBut
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:76
qsnprintf
#define qsnprintf
Definition: qcstring.h:57
DefinitionImpl::IMPL::docSignatures
QCString docSignatures
Definition: definition.cpp:62
SrcLangExt_Unknown
@ SrcLangExt_Unknown
Definition: types.h:43
DefinitionImpl::getReference
QCString getReference() const
Definition: definition.cpp:1709
DefinitionImpl::isArtificial
bool isArtificial() const
Definition: definition.cpp:1704
outputlist.h
DefinitionImpl::getDefFileName
QCString getDefFileName() const
Definition: definition.cpp:1679
DefinitionImpl::_setSymbolName
void _setSymbolName(const QCString &name)
Definition: definition.cpp:1840
writeMarkerList
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition: util.cpp:1096
MemberVector::end
iterator end()
Definition: memberlist.h:44
DefinitionImpl::setRefItems
void setRefItems(const RefItemVector &sli)
Definition: definition.cpp:1251
toGroupDef
GroupDef * toGroupDef(Definition *d)
Definition: groupdef.cpp:1766
DefinitionImpl::IMPL::defColumn
int defColumn
Definition: definition.cpp:87
DefinitionImpl::writeSummaryLinks
void writeSummaryLinks(OutputList &) const
Definition: definition.cpp:1902
Portable::popen
FILE * popen(const QCString &name, const QCString &type)
Definition: portable.cpp:452
FileDef::getSourceFileBase
virtual QCString getSourceFileBase() const =0
DefinitionImpl::pathFragment
QCString pathFragment() const
Definition: definition.cpp:1299
BodyInfo::fileDef
const FileDef * fileDef
file definition containing the function body
Definition: definition.h:68
Config_getEnum
#define Config_getEnum(name)
Definition: config.h:35
DefinitionImpl::writeInlineCode
void writeInlineCode(OutputList &ol, const QCString &scopeName) const
Definition: definition.cpp:964
Definition::TypeMember
@ TypeMember
Definition: definition.h:90
FilterCache
Definition: definition.cpp:585
DefinitionImpl::setLanguage
void setLanguage(SrcLangExt lang)
Definition: definition.cpp:1834
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
Portable::fopen
FILE * fopen(const QCString &fileName, const QCString &mode)
Definition: portable.cpp:322
MemberDef::isSignal
virtual bool isSignal() const =0
stripScope
QCString stripScope(const QCString &name)
Definition: util.cpp:3815
DefinitionImpl::inbodyFile
QCString inbodyFile() const
Definition: definition.cpp:1671
removeFromMap
static void removeFromMap(const QCString &name, Definition *d)
Definition: definition.cpp:217
Definition::isLinkable
virtual bool isLinkable() const =0
DefinitionImpl::getEndBodyLine
int getEndBodyLine() const
Definition: definition.cpp:1729
OutputList::docify
void docify(const QCString &s)
Definition: outputlist.h:137
DefinitionImpl::DefinitionImpl
DefinitionImpl(Definition *def, const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=0, const char *d=0, bool isSymbol=TRUE)
Definition: definition.cpp:222
DefinitionImpl::briefDescription
QCString briefDescription(bool abbreviate=FALSE) const
Definition: definition.cpp:1625
pagedef.h
BufStr
Buffer used to store strings
Definition: bufstr.h:29
SectionRefs::add
void add(const SectionInfo *si)
Adds a non-owning section reference.
Definition: section.h:113
isUTF8CharUpperCase
bool isUTF8CharUpperCase(const std::string &input, size_t pos)
Returns true iff the input string at byte position pos holds an upper case character.
Definition: utf8.cpp:218
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
Doxygen::tagDestinationMap
static StringMap tagDestinationMap
Definition: doxygen.h:98
DefinitionImpl::m_impl
IMPL * m_impl
Definition: definitionimpl.h:152
Htags::useHtags
static bool useHtags
Definition: htags.h:23
DefinitionImpl::inbodyLine
int inbodyLine() const
Definition: definition.cpp:1666
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
DefinitionImpl::IMPL::symbolName
QCString symbolName
Definition: definition.cpp:85
DefinitionImpl::addInnerCompound
void addInnerCompound(const Definition *d)
Definition: definition.cpp:1177
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
BufStr::data
char * data() const
Definition: bufstr.h:96
DefinitionImpl::setBodyDef
void setBodyDef(const FileDef *fd)
Definition: definition.cpp:950
reg::match
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition: regex.cpp:729
DefinitionImpl::IMPL::isSymbol
bool isSymbol
Definition: definition.cpp:84
DefinitionImpl::isAnonymous
bool isAnonymous() const
Definition: definition.cpp:1883
DocInfo::doc
QCString doc
Definition: definition.h:48
section.h
DefinitionImpl::IMPL::referencedByMembers
MemberVector referencedByMembers
Definition: definition.cpp:90
LocalToc::latexLevel
int latexLevel() const
Definition: types.h:343
namespacedef.h
Doxygen::indexList
static IndexList * indexList
Definition: doxygen.h:114
BoolVector
std::vector< bool > BoolVector
Definition: containers.h:34
GroupDef::groupTitle
virtual QCString groupTitle() const =0
Definition::TypePage
@ TypePage
Definition: definition.h:93
DefinitionImpl::getReferencesMembers
const MemberVector & getReferencesMembers() const
Definition: definition.cpp:1758
OutputList::writeString
void writeString(const QCString &text)
Definition: outputlist.h:111
DefinitionImpl::docLine
int docLine() const
Definition: definition.cpp:1567
BriefInfo::file
QCString file
Definition: definition.h:59
RefItem
This struct represents an item in the list of references.
Definition: reflist.h:30
DefinitionImpl::xrefListItems
const RefItemVector & xrefListItems() const
Definition: definition.cpp:1294
IndexList::decContentsDepth
void decContentsDepth()
Definition: index.h:95
transcodeCharacterStringToUTF8
QCString transcodeCharacterStringToUTF8(const QCString &input)
Definition: util.cpp:1350
Definition::toDefinitionImpl_
virtual const DefinitionImpl * toDefinitionImpl_() const =0
DefinitionImpl::IMPL::isArtificial
bool isArtificial
Definition: definition.cpp:70
toMemberDef
MemberDef * toMemberDef(Definition *d)
Definition: memberdef.cpp:6088
DefinitionImpl::getDefColumn
int getDefColumn() const
Definition: definition.cpp:1893
Translator::trDefinedAtLineInSourceFile
virtual QCString trDefinedAtLineInSourceFile()=0
DefinitionImpl::IMPL::briefSignatures
QCString briefSignatures
Definition: definition.cpp:61
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
FilterCache::FilterCache
FilterCache()
Definition: definition.cpp:588
DefinitionImpl::setBriefDescription
void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)
Definition: definition.cpp:546
portable_off_t
off_t portable_off_t
Definition: portable.h:10
MemberDef::isPrototype
virtual bool isPrototype() const =0
DefinitionImpl::IMPL::setDefFileName
void setDefFileName(const QCString &df)
Definition: definition.cpp:102
Doxygen::globalScope
static NamespaceDefMutable * globalScope
Definition: doxygen.h:102
DefinitionAliasImpl::~DefinitionAliasImpl
virtual ~DefinitionAliasImpl()
Definition: definition.cpp:1913
DefinitionImpl::getLanguage
SrcLangExt getLanguage() const
Definition: definition.cpp:1814
DefinitionImpl::isReference
bool isReference() const
Definition: definition.cpp:1714
QCString::str
std::string str() const
Definition: qcstring.h:442
DefinitionImpl::IMPL::referencesMembers
MemberVector referencesMembers
Definition: definition.cpp:89
DefinitionImpl::isHidden
bool isHidden() const
Definition: definition.cpp:1689
DocInfo::file
QCString file
Definition: definition.h:50
Definition::isHidden
virtual bool isHidden() const =0
DefinitionImpl::IMPL::partOfGroups
GroupList partOfGroups
Definition: definition.cpp:55
Definition::TypeGroup
@ TypeGroup
Definition: definition.h:91
definitionimpl.h
LocalToc::isLatexEnabled
bool isLatexEnabled() const
Definition: types.h:338
matchExcludedSymbols
static bool matchExcludedSymbols(const QCString &name)
Definition: definition.cpp:148
DefinitionImpl::inbodyDocumentation
QCString inbodyDocumentation() const
Definition: definition.cpp:1661
DefinitionImpl::mergeReferencedBy
void mergeReferencedBy(const Definition *other)
Definition: definition.cpp:1792
err
void err(const char *fmt,...)
Definition: message.cpp:203
SectionRefs::end
const_iterator end() const
Definition: section.h:120
DefinitionImpl::IMPL::outerScope
Definition * outerScope
Definition: definition.cpp:73
DefinitionImpl::writeSourceRefs
void writeSourceRefs(OutputList &ol, const QCString &scopeName) const
Definition: definition.cpp:1100
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
DefinitionImpl::externalReference
QCString externalReference(const QCString &relPath) const
Definition: definition.cpp:1856
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
Translator::trRTFTableOfContents
virtual QCString trRTFTableOfContents()=0
DefinitionImpl::isVisible
bool isVisible() const
Definition: definition.cpp:1699
DefinitionAliasImpl::m_symbolName
QCString m_symbolName
Definition: definitionimpl.h:307
DefinitionImpl::IMPL::~IMPL
~IMPL()
Definition: definition.cpp:94
DefinitionImpl::_getXRefListId
int _getXRefListId(const QCString &listName) const
Definition: definition.cpp:1282
Definition::pathFragment
virtual QCString pathFragment() const =0
g_filterCache
static FilterCache g_filterCache
Definition: definition.cpp:703
SectionInfo::generated
bool generated() const
Definition: section.h:71
DefinitionImpl::writeNavigationPath
void writeNavigationPath(OutputList &ol) const
Definition: definition.cpp:1392
DefinitionImpl::getSourceFileBase
QCString getSourceFileBase() const
Definition: definition.cpp:859
abbreviate
static QCString abbreviate(const QCString &s, const QCString &name)
Definition: definition.cpp:1592
SectionType
SectionType
enum representing the various types of sections and entities that can be referred to.
Definition: section.h:28
DefinitionImpl::_setBriefDescription
void _setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)
Definition: definition.cpp:489
code.h
DefinitionImpl::_setInbodyDocumentation
void _setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)
Definition: definition.cpp:552
MemberDef::getReference
virtual QCString getReference() const =0
DefinitionImpl::isLinkableViaGroup
bool isLinkableViaGroup() const
Definition: definition.cpp:1744
SectionInfo::setDefinition
void setDefinition(Definition *d)
Definition: section.h:79
SectionInfo::label
QCString label() const
Definition: section.h:65
SectionInfo::ref
QCString ref() const
Definition: section.h:68
LocalToc::isDocbookEnabled
bool isDocbookEnabled() const
Definition: types.h:340
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
MemberDef::isObjCMethod
virtual bool isObjCMethod() const =0
DefinitionImpl::hasUserDocumentation
bool hasUserDocumentation() const
Definition: definition.cpp:1130
Doxygen::symbolMap
static SymbolMap< Definition > * symbolMap
Definition: doxygen.h:106
BodyInfo
Data associated with description found in the body.
Definition: definition.h:63
BriefInfo::doc
QCString doc
Definition: definition.h:56
DefinitionImpl::localName
QCString localName() const
Definition: definition.cpp:1241
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
SectionRefs::empty
bool empty() const
Definition: section.h:121
toPageDef
PageDef * toPageDef(Definition *d)
Definition: pagedef.cpp:408
MemberDef::isLinkable
virtual bool isLinkable() const =0
DefinitionImpl::~DefinitionImpl
virtual ~DefinitionImpl()
Definition: definition.cpp:271
GroupDef
A model of a group of symbols.
Definition: groupdef.h:49
DefinitionAliasImpl::m_def
Definition * m_def
Definition: definitionimpl.h:305
DocInfo::line
int line
Definition: definition.h:49
uint
unsigned uint
Definition: qcstring.h:40
toDefinitionMutable
DefinitionMutable * toDefinitionMutable(Definition *d)
Definition: definition.cpp:1956
MemberDef::anchor
virtual QCString anchor() const =0
Definition::getBodyDef
virtual const FileDef * getBodyDef() const =0
LocalToc
Definition: types.h:301
OutputList
Class representing a list of output generators that are written to in parallel.
Definition: outputlist.h:37
Definition::qualifiedName
virtual QCString qualifiedName() const =0
FilterCacheItem::filePos
portable_off_t filePos
Definition: definition.cpp:580
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
OutputGenerator::Latex
@ Latex
Definition: outputgen.h:333
DocInfo
Data associated with a detailed description.
Definition: definition.h:46
DefinitionImpl::IMPL
Private data associated with a Symbol DefinitionImpl object.
Definition: definition.cpp:41
DefinitionImpl::setDocumentation
void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)
Definition: definition.cpp:483
DefinitionImpl::getOuterScope
Definition * getOuterScope() const
Definition: definition.cpp:1753
DefinitionImpl::IMPL::name
QCString name
Definition: definition.cpp:83
DefinitionImpl::setInbodyDocumentation
void setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)
Definition: definition.cpp:570
QCString::stripWhiteSpace
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition: qcstring.h:243
DefinitionImpl::getStartDefLine
int getStartDefLine() const
Definition: definition.cpp:1719
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
DefinitionImpl::_setDocumentation
void _setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace, bool atTop)
Definition: definition.cpp:437
uchar
unsigned char uchar
Definition: qcstring.h:38
isId
bool isId(int c)
Definition: util.h:172
details
Definition: variant.h:22
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
MemberVector::empty
bool empty() const
Definition: memberlist.h:47
message.h
FileDef::name
virtual QCString name() const =0
IndexList::addContentsItem
void addContentsItem(bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex=FALSE, bool addToNavIndex=FALSE, const Definition *def=0)
Definition: index.h:97
SectionRefs::begin
const_iterator begin() const
Definition: section.h:119
BriefInfo::tooltip
QCString tooltip
Definition: definition.h:57
Doxygen::parserManager
static ParserManager * parserManager
Definition: doxygen.h:111
DefinitionImpl::mergeRefItems
void mergeRefItems(Definition *d)
Definition: definition.cpp:1256
Portable::fclose
int fclose(FILE *f)
Definition: portable.cpp:342
DefinitionImpl::hasSections
bool hasSections() const
Definition: definition.cpp:328
DefinitionImpl::IMPL::sectionRefs
SectionRefs sectionRefs
Definition: definition.cpp:50
DefinitionMutable
Definition: definition.h:308
DefinitionImpl::name
QCString name() const
Definition: definition.cpp:1878
Definition::TypeFile
@ TypeFile
Definition: definition.h:88
DefinitionImpl::_writeSourceRefList
void _writeSourceRefList(OutputList &ol, const QCString &scopeName, const QCString &text, const std::unordered_map< std::string, const MemberDef * > &members, bool) const
Definition: definition.cpp:1027
Translator::trReferences
virtual QCString trReferences()=0
Debug::print
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition: debug.cpp:57
DefinitionImpl
Definition: definitionimpl.h:26
DefinitionAliasImpl::deinit
void deinit()
Definition: definition.cpp:1923
BriefInfo
Data associated with a brief description.
Definition: definition.h:54
MemberDef::isSlot
virtual bool isSlot() const =0
DefinitionImpl::IMPL::xrefListItems
RefItemVector xrefListItems
Definition: definition.cpp:54
DefinitionImpl::addSourceReferences
void addSourceReferences(const MemberDef *d)
Definition: definition.cpp:1156
htags.h
QCString::simplifyWhiteSpace
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition: qcstring.cpp:180
DefinitionImpl::_docsAlreadyAdded
bool _docsAlreadyAdded(const QCString &doc, QCString &sigList)
Definition: definition.cpp:415
theTranslator
Translator * theTranslator
Definition: language.cpp:156
Definition::displayName
virtual QCString displayName(bool includeScope=TRUE) const =0
DefinitionImpl::findInnerCompound
const Definition * findInnerCompound(const QCString &name) const
Definition: definition.cpp:1172
DefinitionImpl::setHidden
void setHidden(bool b)
Definition: definition.cpp:1819
Definition::name
virtual QCString name() const =0
DefinitionImpl::_symbolName
QCString _symbolName() const
Definition: definition.cpp:1845
DefinitionImpl::docFile
QCString docFile() const
Definition: definition.cpp:1572
doxygen.h
SectionManager
singleton class that owns the list of all sections
Definition: section.h:130
parserintf.h
parseCommentAsText
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
Definition: util.cpp:5738
IndexList::incContentsDepth
void incContentsDepth()
Definition: index.h:93
lastUTF8CharIsMultibyte
bool lastUTF8CharIsMultibyte(const std::string &input)
Returns true iff the last character in input is a multibyte character.
Definition: utf8.cpp:212
DefinitionImpl::IMPL::isAnonymous
bool isAnonymous
Definition: definition.cpp:71
DefinitionImpl::IMPL::inbodyDocs
DocInfo * inbodyDocs
Definition: definition.cpp:58
Portable::pclose
int pclose(FILE *stream)
Definition: portable.cpp:461
language.h
addToMap
static void addToMap(const QCString &name, Definition *d)
Definition: definition.cpp:203
FilterCache::m_endPos
portable_off_t m_endPos
Definition: definition.cpp:700
DefinitionImpl::IMPL::init
void init(const QCString &df, const QCString &n)
Definition: definition.cpp:112
SrcLangExt_Python
@ SrcLangExt_Python
Definition: types.h:52
Debug::FilterOutput
@ FilterOutput
Definition: debug.h:38
DefinitionImpl::IMPL::ref
QCString ref
Definition: definition.cpp:67
getLanguageSpecificSeparator
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang
Definition: util.cpp:6545
computeQualifiedIndex
int computeQualifiedIndex(const QCString &name)
Definition: util.cpp:486
MemberDef::isFunction
virtual bool isFunction() const =0
OutputList::endParagraph
void endParagraph()
Definition: outputlist.h:109
readCodeFragment
bool readCodeFragment(const QCString &fileName, int &startLine, int &endLine, QCString &result)
Reads a fragment from file fileName starting with line startLine and ending with line endLine.
Definition: definition.cpp:719
DefinitionImpl::setLocalName
void setLocalName(const QCString &name)
Definition: definition.cpp:1829
SectionInfo::fileName
QCString fileName() const
Definition: section.h:70
reg::Match
Object representing the matching results.
Definition: regex.h:163
ParserManager::getCodeParser
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
Definition: parserintf.h:217
getLanguageFromFileName
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition: util.cpp:5574
TRUE
#define TRUE
Definition: qcstring.h:36
Definition::getOutputFileBase
virtual QCString getOutputFileBase() const =0
RefList::listName
QCString listName() const
Definition: reflist.h:100
DefinitionImpl::hasSourceReffedBy
bool hasSourceReffedBy() const
Definition: definition.cpp:1105
Definition::getStartBodyLine
virtual int getStartBodyLine() const =0
MemberVector
A vector of MemberDef object
Definition: memberlist.h:32
DefinitionImpl::setOuterScope
void setOuterScope(Definition *d)
Definition: definition.cpp:1222
regex.h
BodyInfo::endLine
int endLine
line number of the end of the definition's body
Definition: definition.h:67
SrcLangExt_Fortran
@ SrcLangExt_Fortran
Definition: types.h:53
filedef.h
SymbolMap::add
void add(const QCString &name, Ptr def)
Add a symbol def into the map under key name
Definition: symbolmap.h:52
PageDef::hasTitle
virtual bool hasTitle() const =0
DefinitionImpl::briefFile
QCString briefFile() const
Definition: definition.cpp:1654
DefinitionAliasImpl::qualifiedName
QCString qualifiedName() const
Definition: definition.cpp:1928
DefinitionImpl::IMPL::details
DocInfo * details
Definition: definition.cpp:57
Definition::navigationPathAsString
virtual QCString navigationPathAsString() const =0
DefinitionImpl::getSourceAnchor
QCString getSourceAnchor() const
Definition: definition.cpp:872
OutputGenerator::Html
@ Html
Definition: outputgen.h:333
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
LocalToc::htmlLevel
int htmlLevel() const
Definition: types.h:342
DefinitionImpl::IMPL::id
QCString id
Definition: definition.cpp:81
BodyInfo::startLine
int startLine
line number of the start of the definition's body
Definition: definition.h:66
DefinitionImpl::getDefLine
int getDefLine() const
Definition: definition.cpp:1888
reflist.h
DefinitionImpl::IMPL::lang
SrcLangExt lang
Definition: definition.cpp:79
QCString::fill
bool fill(char c, int len=-1)
Fills a string with a predefined character
Definition: qcstring.h:175
SectionInfo::title
QCString title() const
Definition: section.h:66
Translator::trReferencedBy
virtual QCString trReferencedBy()=0
OutputList::writeNavigationPath
void writeNavigationPath(const QCString &s)
Definition: outputlist.h:353
DefinitionAliasImpl::init
void init()
Definition: definition.cpp:1917
memberlist.h
SectionManager::add
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
Definition: section.h:135
FilterCacheItem
Definition: definition.cpp:578
Definition::TypeClass
@ TypeClass
Definition: definition.h:87
BufStr::addArray
void addArray(const char *a, uint len)
Definition: bufstr.h:62
DefinitionImpl::setBodySegment
void setBodySegment(int defLine, int bls, int ble)
Definition: definition.cpp:941
Definition::definitionType
virtual DefType definitionType() const =0
DefinitionImpl::partOfGroups
const GroupList & partOfGroups() const
Definition: definition.cpp:1739
dirdef.h
OutputList::popGeneratorState
void popGeneratorState()
Definition: outputlist.cpp:134
OutputGenerator::Docbook
@ Docbook
Definition: outputgen.h:333
GroupList
Definition: groupdef.h:127
DefinitionImpl::IMPL::body
BodyInfo * body
Definition: definition.cpp:60
QCString::truncate
bool truncate(size_t pos)
Truncates the string at position pos.
Definition: qcstring.h:167
Portable::fseek
portable_off_t fseek(FILE *f, portable_off_t offset, int whence)
Definition: portable.cpp:300
utf8.h
Various UTF8 related helper functions.
OutputList::startCodeFragment
void startCodeFragment(const QCString &style)
Definition: outputlist.h:241
DefinitionImpl::addSectionsToDefinition
void addSectionsToDefinition(const std::vector< const SectionInfo * > &anchorList)
Definition: definition.cpp:306
DefinitionImpl::makePartOfGroup
void makePartOfGroup(const GroupDef *gd)
Definition: definition.cpp:1246
DefinitionImpl::addSourceReferencedBy
void addSourceReferencedBy(const MemberDef *d)
Definition: definition.cpp:1140
BriefInfo::line
int line
Definition: definition.h:58
SymbolMap::remove
void remove(const QCString &name, Ptr def)
Remove a symbol def from the map that was stored under key name
Definition: symbolmap.h:58
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
DefinitionImpl::documentation
QCString documentation() const
Definition: definition.cpp:1562
DefinitionImpl::getDefFileExtension
QCString getDefFileExtension() const
Definition: definition.cpp:1684
Doxygen::filterDBFileName
static QCString filterDBFileName
Definition: doxygen.h:113
DefinitionImpl::symbolName
QCString symbolName() const
Definition: definition.cpp:1555
DefinitionImpl::writeSourceDef
void writeSourceDef(OutputList &ol, const QCString &scopeName) const
Definition: definition.cpp:892
RefItemVector
std::vector< RefItem * > RefItemVector
Definition: reflist.h:132
MemberDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
DefinitionImpl::setName
void setName(const QCString &name)
Definition: definition.cpp:281
DefinitionImpl::IMPL::defFileName
QCString defFileName
Definition: definition.cpp:76
DefinitionImpl::writeToc
void writeToc(OutputList &ol, const LocalToc &lt) const
Definition: definition.cpp:1409
Definition::anchor
virtual QCString anchor() const =0
DefinitionImpl::qualifiedName
QCString qualifiedName() const
Definition: definition.cpp:1182
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DefinitionImpl::IMPL::sourceRefsDict
std::unordered_map< std::string, const MemberDef * > sourceRefsDict
Definition: definition.cpp:53
LocalToc::isHtmlEnabled
bool isHtmlEnabled() const
Definition: types.h:337
DefinitionAliasImpl::m_scope
const Definition * m_scope
Definition: definitionimpl.h:306
SectionRefs::find
const SectionInfo * find(const QCString &label) const
Returns a constant pointer to the section info given a section label or nullptr if no section with th...
Definition: section.h:106
MemberDef::getScopeString
virtual QCString getScopeString() const =0
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
DefinitionImpl::setDefFile
void setDefFile(const QCString &df, int defLine, int defColumn)
Definition: definition.cpp:139
DefinitionImpl::addSectionsToIndex
void addSectionsToIndex()
Definition: definition.cpp:343
reg::Ex
Class representing a regular expression.
Definition: regex.h:48
DefinitionImpl::IMPL::defLine
int defLine
Definition: definition.cpp:86
DefinitionImpl::writeQuickMemberLinks
void writeQuickMemberLinks(OutputList &, const MemberDef *) const
Definition: definition.cpp:1898
DefinitionImpl::getReferencedByMembers
const MemberVector & getReferencedByMembers() const
Definition: definition.cpp:1767
RefItem::list
RefList * list() const
Definition: reflist.h:52
DefinitionImpl::mergeReferences
void mergeReferences(const Definition *other)
Definition: definition.cpp:1776
Definition::getOuterScope
virtual Definition * getOuterScope() const =0
Definition::_setSymbolName
virtual void _setSymbolName(const QCString &name)=0
DefinitionImpl::hasBriefDescription
bool hasBriefDescription() const
Definition: definition.cpp:1850
QCString::startsWith
bool startsWith(const char *s) const
Definition: qcstring.h:408
OutputList::parseText
void parseText(const QCString &textStr)
Definition: outputlist.cpp:179
FileDef::absFilePath
virtual QCString absFilePath() const =0
DefinitionImpl::IMPL::qualifiedName
QCString qualifiedName
Definition: definition.cpp:66
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
DefinitionImpl::briefLine
int briefLine() const
Definition: definition.cpp:1649
SectionRefs
class that represents a list of constant references to sections.
Definition: section.h:98
DefinitionImpl::IMPL::localName
QCString localName
Definition: definition.cpp:64
stripLeadingAndTrailingEmptyLines
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition: util.cpp:5394
DefinitionImpl::hasDocumentation
bool hasDocumentation() const
Definition: definition.cpp:1115
FilterCache::getFileContents
bool getFileContents(const QCString &fileName, BufStr &str)
Definition: definition.cpp:589
DefinitionImpl::navigationPathAsString
QCString navigationPathAsString() const
Definition: definition.cpp:1337
isSection
constexpr bool isSection(SectionType type)
return true if type is a section, and false if it is a page, anchor or table.
Definition: section.h:40
DefinitionImpl::briefDescriptionAsTooltip
QCString briefDescriptionAsTooltip() const
Definition: definition.cpp:1644
SectionInfo
class that provide information about a section.
Definition: section.h:49
convertToDocBook
QCString convertToDocBook(const QCString &s)
Definition: util.cpp:3999
config.h
DefinitionImpl::writeDocAnchorsToTagFile
void writeDocAnchorsToTagFile(TextStream &) const
Definition: definition.cpp:393
DefinitionAliasImpl::name
QCString name() const
Definition: definition.cpp:1943
DefinitionMutable::toDefinition_
virtual Definition * toDefinition_()=0
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
OutputList::pushGeneratorState
void pushGeneratorState()
Definition: outputlist.cpp:126
groupdef.h
DefinitionImpl::isVisibleInProject
bool isVisibleInProject() const
Definition: definition.cpp:1694
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
LocalToc::docbookLevel
int docbookLevel() const
Definition: types.h:345
DefinitionImpl::IMPL::defFileExt
QCString defFileExt
Definition: definition.cpp:77
convertToXML
QCString convertToXML(const QCString &s, bool keepEntities)
Definition: util.cpp:3948
DefinitionImpl::setArtificial
void setArtificial(bool b)
Definition: definition.cpp:1824
FileDef
A model of a file symbol.
Definition: filedef.h:73
PageDef::title
virtual QCString title() const =0
toFileDef
FileDef * toFileDef(Definition *d)
Definition: filedef.cpp:1778
SrcLangExt_VHDL
@ SrcLangExt_VHDL
Definition: types.h:54
Definition::toDefinitionMutable_
virtual DefinitionMutable * toDefinitionMutable_()=0
MemberVector::begin
iterator begin()
Definition: memberlist.h:43
DefinitionImpl::hasSources
bool hasSources() const
Definition: definition.cpp:956
DefinitionImpl::getSectionRefs
const SectionRefs & getSectionRefs() const
Definition: definition.cpp:1550
DefinitionImpl::id
QCString id() const
Definition: definition.cpp:301
DefinitionImpl::IMPL::def
Definition * def
Definition: definition.cpp:48
Definition::isLinkableInProject
virtual bool isLinkableInProject() const =0
OutputList::writeObjectLink
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition: outputlist.h:141
Definition::xrefListItems
virtual const RefItemVector & xrefListItems() const =0
DefinitionImpl::IMPL::sourceRefByDict
std::unordered_map< std::string, const MemberDef * > sourceRefByDict
Definition: definition.cpp:52
DefinitionImpl::hasSourceRefs
bool hasSourceRefs() const
Definition: definition.cpp:1110
DefinitionImpl::setReference
void setReference(const QCString &r)
Definition: definition.cpp:1809
DefinitionImpl::writeSourceReffedBy
void writeSourceReffedBy(OutputList &ol, const QCString &scopeName) const
Definition: definition.cpp:1095
portable.h
Portable versions of functions that are platform dependent.
bufstr.h
FileDef::getDirDef
virtual DirDef * getDirDef() const =0
reg::search
bool search(const std::string &str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition: regex.cpp:718
RefItem::id
int id() const
Definition: reflist.h:51
FilterCache::m_cache
std::unordered_map< std::string, FilterCacheItem > m_cache
Definition: definition.cpp:699
SectionInfo::type
SectionType type() const
Definition: section.h:67
stripWord
static bool stripWord(QCString &s, QCString w)
Definition: definition.cpp:1579
util.h
A bunch of utility functions.
getFileFilter
QCString getFileFilter(const QCString &name, bool isSourceCode)
Definition: util.cpp:1315
Definition::localName
virtual QCString localName() const =0
BufStr::resize
void resize(uint newlen)
Definition: bufstr.h:78
BodyInfo::defLine
int defLine
line number of the start of the definition
Definition: definition.h:65
FilterCacheItem::fileSize
size_t fileSize
Definition: definition.cpp:581
DefinitionImpl::IMPL::brief
BriefInfo * brief
Definition: definition.cpp:59
DefinitionImpl::IMPL::hidden
bool hidden
Definition: definition.cpp:69
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
OutputList::endCodeFragment
void endCodeFragment(const QCString &style)
Definition: outputlist.h:243
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
QCString::sprintf
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:24
DefinitionImpl::computeTooltip
void computeTooltip()
Definition: definition.cpp:1633
debug.h
convertToHtml
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition: util.cpp:4063
refMapToVector
static MemberVector refMapToVector(const std::unordered_map< std::string, const MemberDef * > &map)
Definition: definition.cpp:1009
DefinitionImpl::getBodyDef
const FileDef * getBodyDef() const
Definition: definition.cpp:1734
OutputList::startParagraph
void startParagraph(const QCString &classDef=QCString())
Definition: outputlist.h:107
Doxygen::clangUsrMap
static ClangUsrMap * clangUsrMap
Definition: doxygen.h:107
DefinitionImpl::setId
void setId(const QCString &name)
Definition: definition.cpp:290
vhdldocgen.h
Config_getList
#define Config_getList(name)
Definition: config.h:37
Translator::trWriteList
virtual QCString trWriteList(int numEntries)=0
FALSE
#define FALSE
Definition: qcstring.h:33
DefinitionAliasImpl::DefinitionAliasImpl
DefinitionAliasImpl(Definition *def, const Definition *scope, const Definition *alias)
Definition: definition.cpp:1908
DefinitionImpl::getStartBodyLine
int getStartBodyLine() const
Definition: definition.cpp:1724
BufStr::addChar
void addChar(char c)
Definition: bufstr.h:57
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108