doxygen  1.8.18
About: Doxygen is a source code documentation generator tool for C++, C, Objective-C, C#, PHP, Java, Python, IDL (diverse flavors), Fortran, VHDL, Tcl, and to some extent D. Different output formats are supported.
  Fossies Dox: doxygen-1.8.18.src.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

searchindex.cpp
Go to the documentation of this file.
1 
18 #include <ctype.h>
19 #include <assert.h>
20 
21 #include <qfile.h>
22 #include <qregexp.h>
23 
24 #include "searchindex.h"
25 #include "config.h"
26 #include "util.h"
27 #include "doxygen.h"
28 #include "language.h"
29 #include "pagedef.h"
30 #include "growbuf.h"
31 #include "message.h"
32 #include "version.h"
33 #include "groupdef.h"
34 #include "classlist.h"
35 #include "filedef.h"
36 #include "memberdef.h"
37 #include "filename.h"
38 #include "membername.h"
39 #include "resourcemgr.h"
40 
41 // file format: (all multi-byte values are stored in big endian format)
42 // 4 byte header
43 // 256*256*4 byte index (4 bytes)
44 // for each index entry: a zero terminated list of words
45 // for each word: a \0 terminated string + 4 byte offset to the stats info
46 // padding bytes to align at 4 byte boundary
47 // for each word: the number of urls (4 bytes)
48 // + for each url containing the word 8 bytes statistics
49 // (4 bytes index to url string + 4 bytes frequency counter)
50 // for each url: a \0 terminated string
51 
52 const int numIndexEntries = 256*256;
53 
54 //--------------------------------------------------------------------
55 
56 IndexWord::IndexWord(const char *word) : m_word(word), m_urls(17)
57 {
59  //printf("IndexWord::IndexWord(%s)\n",word);
60 }
61 
62 void IndexWord::addUrlIndex(int idx,bool hiPriority)
63 {
64  //printf("IndexWord::addUrlIndex(%d,%d)\n",idx,hiPriority);
65  URLInfo *ui = m_urls.find(idx);
66  if (ui==0)
67  {
68  //printf("URLInfo::URLInfo(%d)\n",idx);
69  ui=new URLInfo(idx,0);
70  m_urls.insert(idx,ui);
71  }
72  ui->freq+=2;
73  if (hiPriority) ui->freq|=1; // mark as high priority document
74 }
75 
76 //--------------------------------------------------------------------
77 
79  m_words(328829), m_index(numIndexEntries), m_url2IdMap(10007), m_urls(10007), m_urlIndex(-1)
80 {
81  int i;
82  m_words.setAutoDelete(TRUE);
83  m_url2IdMap.setAutoDelete(TRUE);
86  for (i=0;i<numIndexEntries;i++) m_index.insert(i,new QList<IndexWord>);
87 }
88 
89 void SearchIndex::setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile)
90 {
91  if (ctx==0) return;
92  assert(!isSourceFile || ctx->definitionType()==Definition::TypeFile);
93  //printf("SearchIndex::setCurrentDoc(%s,%s,%s)\n",name,baseName,anchor);
94  QCString url=isSourceFile ? (dynamic_cast<const FileDef*>(ctx))->getSourceFileBase() : ctx->getOutputFileBase();
95  url+=Config_getString(HTML_FILE_EXTENSION);
96  QCString baseUrl = url;
97  if (anchor) url+=QCString("#")+anchor;
98  if (!isSourceFile) baseUrl=url;
99  QCString name=ctx->qualifiedName();
101  {
102  const MemberDef *md = dynamic_cast<const MemberDef *>(ctx);
103  name.prepend((md->getLanguage()==SrcLangExt_Fortran ?
106  }
107  else // compound type
108  {
109  SrcLangExt lang = ctx->getLanguage();
111  if (sep!="::")
112  {
113  name = substitute(name,"::",sep);
114  }
115  switch (ctx->definitionType())
116  {
118  {
119  const PageDef *pd = dynamic_cast<const PageDef *>(ctx);
120  if (pd->hasTitle())
121  {
122  name = theTranslator->trPage(TRUE,TRUE)+" "+pd->title();
123  }
124  else
125  {
126  name = theTranslator->trPage(TRUE,TRUE)+" "+pd->name();
127  }
128  }
129  break;
131  {
132  const ClassDef *cd = dynamic_cast<const ClassDef *>(ctx);
133  name.prepend(cd->compoundTypeString()+" ");
134  }
135  break;
137  {
138  if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
139  {
140  name = theTranslator->trPackage(name);
141  }
142  else if (lang==SrcLangExt_Fortran)
143  {
144  name.prepend(theTranslator->trModule(TRUE,TRUE)+" ");
145  }
146  else
147  {
149  }
150  }
151  break;
153  {
154  const GroupDef *gd = dynamic_cast<const GroupDef *>(ctx);
155  if (gd->groupTitle())
156  {
157  name = theTranslator->trGroup(TRUE,TRUE)+" "+gd->groupTitle();
158  }
159  else
160  {
161  name.prepend(theTranslator->trGroup(TRUE,TRUE)+" ");
162  }
163  }
164  break;
165  default:
166  break;
167  }
168  }
169 
170  int *pIndex = m_url2IdMap.find(baseUrl);
171  if (pIndex==0)
172  {
173  ++m_urlIndex;
174  m_url2IdMap.insert(baseUrl,new int(m_urlIndex));
175  m_urls.insert(m_urlIndex,new URL(name,url));
176  }
177  else
178  {
179  m_urls.insert(*pIndex,new URL(name,url));
180  }
181 }
182 
183 static int charsToIndex(const char *word)
184 {
185  if (word==0) return -1;
186 
187  // Fast string hashing algorithm
188  //register ushort h=0;
189  //const char *k = word;
190  //ushort mask=0xfc00;
191  //while ( *k )
192  //{
193  // h = (h&mask)^(h<<6)^(*k++);
194  //}
195  //return h;
196 
197  // Simple hashing that allows for substring searching
198  uint c1=((uchar *)word)[0];
199  if (c1==0) return -1;
200  uint c2=((uchar *)word)[1];
201  if (c2==0) return -1;
202  return c1*256+c2;
203 }
204 
205 void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
206 {
207  static QRegExp nextPart("[_a-z:][A-Z]");
208  if (word==0 || word[0]=='\0') return;
209  QCString wStr = QCString(word).lower();
210  //printf("SearchIndex::addWord(%s,%d) wStr=%s\n",word,hiPriority,wStr.data());
211  IndexWord *w = m_words[wStr];
212  if (w==0)
213  {
214  int idx=charsToIndex(wStr);
215  //fprintf(stderr,"addWord(%s) at index %d\n",word,idx);
216  if (idx<0) return;
217  w = new IndexWord(wStr);
218  m_index[idx]->append(w);
219  m_words.insert(wStr,w);
220  }
221  w->addUrlIndex(m_urlIndex,hiPriority);
222  int i;
223  bool found=FALSE;
224  if (!recurse) // the first time we check if we can strip the prefix
225  {
226  i=getPrefixIndex(word);
227  if (i>0)
228  {
229  addWord(word+i,hiPriority,TRUE);
230  found=TRUE;
231  }
232  }
233  if (!found) // no prefix stripped
234  {
235  if ((i=nextPart.match(word))>=1)
236  {
237  addWord(word+i+1,hiPriority,TRUE);
238  }
239  }
240 }
241 
242 void SearchIndex::addWord(const char *word,bool hiPriority)
243 {
244  addWord(word,hiPriority,FALSE);
245 }
246 
247 static void writeInt(QFile &f,int index)
248 {
249  f.putch(((uint)index)>>24);
250  f.putch((((uint)index)>>16)&0xff);
251  f.putch((((uint)index)>>8)&0xff);
252  f.putch(((uint)index)&0xff);
253 }
254 
255 static void writeString(QFile &f,const char *s)
256 {
257  const char *p = s;
258  while (*p) f.putch(*p++);
259  f.putch(0);
260 }
261 
262 void SearchIndex::write(const char *fileName)
263 {
264  int i;
265  int size=4; // for the header
266  size+=4*numIndexEntries; // for the index
267  int wordsOffset = size;
268  // first pass: compute the size of the wordlist
269  for (i=0;i<numIndexEntries;i++)
270  {
271  QList<IndexWord> *wlist = m_index[i];
272  if (!wlist->isEmpty())
273  {
274  QListIterator<IndexWord> iwi(*wlist);
275  IndexWord *iw;
276  for (iwi.toFirst();(iw=iwi.current());++iwi)
277  {
278  int ws = iw->word().length()+1;
279  size+=ws+4; // word + url info list offset
280  }
281  size+=1; // zero list terminator
282  }
283  }
284 
285  // second pass: compute the offsets in the index
286  int indexOffsets[numIndexEntries];
287  int offset=wordsOffset;
288  for (i=0;i<numIndexEntries;i++)
289  {
290  QList<IndexWord> *wlist = m_index[i];
291  if (!wlist->isEmpty())
292  {
293  indexOffsets[i]=offset;
294  QListIterator<IndexWord> iwi(*wlist);
295  IndexWord *iw;
296  for (iwi.toFirst();(iw=iwi.current());++iwi)
297  {
298  offset+= iw->word().length()+1;
299  offset+=4; // word + offset to url info array
300  }
301  offset+=1; // zero list terminator
302  }
303  else
304  {
305  indexOffsets[i]=0;
306  }
307  }
308  int padding = size;
309  size = (size+3)&~3; // round up to 4 byte boundary
310  padding = size - padding;
311 
312  //int statsOffset = size;
313  //IndexWord *iw;
314  int *wordStatOffsets = new int[m_words.count()];
315 
316  int count=0;
317 
318  // third pass: compute offset to stats info for each word
319  for (i=0;i<numIndexEntries;i++)
320  {
321  QList<IndexWord> *wlist = m_index[i];
322  if (!wlist->isEmpty())
323  {
324  QListIterator<IndexWord> iwi(*wlist);
325  IndexWord *iw;
326  for (iwi.toFirst();(iw=iwi.current());++iwi)
327  {
328  //printf("wordStatOffsets[%d]=%d\n",count,size);
329  wordStatOffsets[count++] = size;
330  size+=4+iw->urls().count()*8; // count + (url_index,freq) per url
331  }
332  }
333  }
334  int *urlOffsets = new int[m_urls.count()];
335  //int urlsOffset = size;
337  URL *url;
338  for (udi.toFirst();(url=udi.current());++udi)
339  {
340  urlOffsets[udi.currentKey()]=size;
341  size+=url->name.length()+1+
342  url->url.length()+1;
343  }
344  //printf("Total size %x bytes (word=%x stats=%x urls=%x)\n",size,wordsOffset,statsOffset,urlsOffset);
345  QFile f(fileName);
346  if (f.open(IO_WriteOnly))
347  {
348  // write header
349  f.putch('D'); f.putch('O'); f.putch('X'); f.putch('S');
350  // write index
351  for (i=0;i<numIndexEntries;i++)
352  {
353  writeInt(f,indexOffsets[i]);
354  }
355  // write word lists
356  count=0;
357  for (i=0;i<numIndexEntries;i++)
358  {
359  QList<IndexWord> *wlist = m_index[i];
360  if (!wlist->isEmpty())
361  {
362  QListIterator<IndexWord> iwi(*wlist);
363  IndexWord *iw;
364  for (iwi.toFirst();(iw=iwi.current());++iwi)
365  {
366  writeString(f,iw->word());
367  writeInt(f,wordStatOffsets[count++]);
368  }
369  f.putch(0);
370  }
371  }
372  // write extra padding bytes
373  for (i=0;i<padding;i++) f.putch(0);
374  // write word statistics
375  for (i=0;i<numIndexEntries;i++)
376  {
377  QList<IndexWord> *wlist = m_index[i];
378  if (!wlist->isEmpty())
379  {
380  QListIterator<IndexWord> iwi(*wlist);
381  IndexWord *iw;
382  for (iwi.toFirst();(iw=iwi.current());++iwi)
383  {
384  int numUrls = iw->urls().count();
385  writeInt(f,numUrls);
386  QIntDictIterator<URLInfo> uli(iw->urls());
387  URLInfo *ui;
388  for (uli.toFirst();(ui=uli.current());++uli)
389  {
390  writeInt(f,urlOffsets[ui->urlIdx]);
391  writeInt(f,ui->freq);
392  }
393  }
394  }
395  }
396  // write urls
397  for (udi.toFirst();(url=udi.current());++udi)
398  {
399  writeString(f,url->name);
400  writeString(f,url->url);
401  }
402  }
403 
404  delete[] urlOffsets;
405  delete[] wordStatOffsets;
406 }
407 
408 
409 //---------------------------------------------------------------------------
410 // the following part is for writing an external search index
411 
413 {
421 };
422 
424 {
425  Private() : docEntries(12251) {}
428 };
429 
431 {
434  p->current=0;
435 }
436 
438 {
439  //printf("p->docEntries.count()=%d\n",p->docEntries.count());
440  delete p;
441 }
442 
444 {
445  if (ctx && ctx->definitionType()==Definition::TypeMember)
446  {
447  const MemberDef *md = dynamic_cast<const MemberDef*>(ctx);
448  if (md->isFunction())
449  return "function";
450  else if (md->isSlot())
451  return "slot";
452  else if (md->isSignal())
453  return "signal";
454  else if (md->isVariable())
455  return "variable";
456  else if (md->isTypedef())
457  return "typedef";
458  else if (md->isEnumerate())
459  return "enum";
460  else if (md->isEnumValue())
461  return "enumvalue";
462  else if (md->isProperty())
463  return "property";
464  else if (md->isEvent())
465  return "event";
466  else if (md->isRelated() || md->isForeign())
467  return "related";
468  else if (md->isFriend())
469  return "friend";
470  else if (md->isDefine())
471  return "define";
472  }
473  else if (ctx)
474  {
475  switch(ctx->definitionType())
476  {
478  return (dynamic_cast<const ClassDef*>(ctx))->compoundTypeString();
480  return "file";
482  return "namespace";
484  return "group";
486  return "package";
488  return "page";
489  case Definition::TypeDir:
490  return "dir";
491  default:
492  break;
493  }
494  }
495  return "unknown";
496 }
497 
498 void SearchIndexExternal::setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile)
499 {
500  QCString extId = stripPath(Config_getString(EXTERNAL_SEARCH_ID));
501  QCString baseName = isSourceFile ? (dynamic_cast<const FileDef*>(ctx))->getSourceFileBase() : ctx->getOutputFileBase();
502  QCString url = baseName + Doxygen::htmlFileExtension;
503  if (anchor) url+=QCString("#")+anchor;
504  QCString key = extId+";"+url;
505 
506  p->current = p->docEntries.find(key);
507  //printf("setCurrentDoc(url=%s,isSourceFile=%d) current=%p\n",url.data(),isSourceFile,p->current);
508  if (!p->current)
509  {
511  e->type = isSourceFile ? QCString("source") : definitionToName(ctx);
512  e->name = ctx->qualifiedName();
514  {
515  e->args = (dynamic_cast<const MemberDef*>(ctx))->argsString();
516  }
517  e->extId = extId;
518  e->url = url;
519  p->current = e;
520  p->docEntries.append(key,e);
521  //printf("searchIndexExt %s : %s\n",e->name.data(),e->url.data());
522  }
523 }
524 
525 void SearchIndexExternal::addWord(const char *word,bool hiPriority)
526 {
527  if (word==0 || !isId(*word) || p->current==0) return;
528  GrowBuf *pText = hiPriority ? &p->current->importantText : &p->current->normalText;
529  if (pText->getPos()>0) pText->addChar(' ');
530  pText->addStr(word);
531  //printf("addWord %s\n",word);
532 }
533 
534 void SearchIndexExternal::write(const char *fileName)
535 {
536  QFile f(fileName);
537  if (f.open(IO_WriteOnly))
538  {
539  FTextStream t(&f);
540  t << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
541  t << "<add>" << endl;
543  SearchDocEntry *doc;
544  for (it.toFirst();(doc=it.current());++it)
545  {
546  doc->normalText.addChar(0); // make sure buffer ends with a 0 terminator
547  doc->importantText.addChar(0); // make sure buffer ends with a 0 terminator
548  t << " <doc>" << endl;
549  t << " <field name=\"type\">" << doc->type << "</field>" << endl;
550  t << " <field name=\"name\">" << convertToXML(doc->name) << "</field>" << endl;
551  if (!doc->args.isEmpty())
552  {
553  t << " <field name=\"args\">" << convertToXML(doc->args) << "</field>" << endl;
554  }
555  if (!doc->extId.isEmpty())
556  {
557  t << " <field name=\"tag\">" << convertToXML(doc->extId) << "</field>" << endl;
558  }
559  t << " <field name=\"url\">" << convertToXML(doc->url) << "</field>" << endl;
560  t << " <field name=\"keywords\">" << convertToXML(doc->importantText.get()) << "</field>" << endl;
561  t << " <field name=\"text\">" << convertToXML(doc->normalText.get()) << "</field>" << endl;
562  t << " </doc>" << endl;
563  }
564  t << "</add>" << endl;
565  }
566  else
567  {
568  err("Failed to open file %s for writing!\n",fileName);
569  }
570 }
571 
572 //---------------------------------------------------------------------------
573 // the following part is for the javascript based search engine
574 
575 #include "memberdef.h"
576 #include "namespacedef.h"
577 #include "pagedef.h"
578 #include "classdef.h"
579 #include "filedef.h"
580 #include "language.h"
581 #include "doxygen.h"
582 #include "message.h"
583 
585 
586 static void addMemberToSearchIndex(const MemberDef *md)
587 {
588  static bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
589  bool isLinkable = md->isLinkable();
590  const ClassDef *cd=0;
591  const NamespaceDef *nd=0;
592  const FileDef *fd=0;
593  const GroupDef *gd=0;
594  if (isLinkable &&
595  (
596  ((cd=md->getClassDef()) && cd->isLinkable() && cd->templateMaster()==0) ||
597  ((gd=md->getGroupDef()) && gd->isLinkable())
598  )
599  )
600  {
601  QCString n = md->name();
602  if (!n.isEmpty())
603  {
604  uint letter = getUtf8CodeToLower(n,0);
605  bool isFriendToHide = hideFriendCompounds &&
606  (QCString(md->typeString())=="friend class" ||
607  QCString(md->typeString())=="friend struct" ||
608  QCString(md->typeString())=="friend union");
609  if (!(md->isFriend() && isFriendToHide))
610  {
612  }
613  if (md->isFunction() || md->isSlot() || md->isSignal())
614  {
616  }
617  else if (md->isVariable())
618  {
620  }
621  else if (md->isSequence())
622  {
624  }
625  else if (md->isDictionary())
626  {
628  }
629  else if (md->isTypedef())
630  {
632  }
633  else if (md->isEnumerate())
634  {
636  }
637  else if (md->isEnumValue())
638  {
640  }
641  else if (md->isProperty())
642  {
644  }
645  else if (md->isEvent())
646  {
648  }
649  else if (md->isRelated() || md->isForeign() ||
650  (md->isFriend() && !isFriendToHide))
651  {
653  }
654  }
655  }
656  else if (isLinkable &&
657  (((nd=md->getNamespaceDef()) && nd->isLinkable()) ||
658  ((fd=md->getFileDef()) && fd->isLinkable())
659  )
660  )
661  {
662  QCString n = md->name();
663  if (!n.isEmpty())
664  {
665  uint letter = getUtf8CodeToLower(n,0);
667 
668  if (md->isFunction())
669  {
671  }
672  else if (md->isVariable())
673  {
675  }
676  else if (md->isSequence())
677  {
679  }
680  else if (md->isDictionary())
681  {
683  }
684  else if (md->isTypedef())
685  {
687  }
688  else if (md->isEnumerate())
689  {
691  }
692  else if (md->isEnumValue())
693  {
695  }
696  else if (md->isDefine())
697  {
699  }
700  }
701  }
702 }
703 
704 // see also function convertToId() in search.js, which should match in
705 // behaviour
706 static QCString searchId(const QCString &s)
707 {
708  int c;
709  uint i;
710  QCString result;
711  for (i=0;i<s.length();i++)
712  {
713  c=s.at(i);
714  if (c>0x7f || c<0) // part of multibyte character
715  {
716  result+=(char)c;
717  }
718  else if (isalnum(c)) // simply alpha numerical character
719  {
720  result+=(char)tolower(c);
721  }
722  else // other 'unprintable' characters
723  {
724  char val[4];
725  sprintf(val,"_%02x",(uchar)c);
726  result+=val;
727  }
728  }
729  return result;
730 }
731 
733 {
734  bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
735 
736  // set index names
757 
758  // set index texts
782 
783  // add symbols to letter -> symbol list map
784 
785  // index classes
787  ClassDef *cd;
788  for (;(cd=cli.current());++cli)
789  {
790  uint letter = getUtf8CodeToLower(cd->localName(),0);
791  if (cd->isLinkable() && isId(letter))
792  {
794  if (sliceOpt)
795  {
797  {
799  }
800  else if (cd->compoundType()==ClassDef::Struct)
801  {
803  }
804  else if (cd->compoundType()==ClassDef::Exception)
805  {
807  }
808  else // cd->compoundType()==ClassDef::Class
809  {
811  }
812  }
813  else // non slice optimisation: group all types under classes
814  {
816  }
817  }
818  }
819 
820  // index namespaces
822  NamespaceDef *nd;
823  for (;(nd=nli.current());++nli)
824  {
825  uint letter = getUtf8CodeToLower(nd->name(),0);
826  if (nd->isLinkable() && isId(letter))
827  {
830  }
831  }
832 
833  // index files
834  for (const auto &fn : *Doxygen::inputNameLinkedMap)
835  {
836  for (const auto &fd : *fn)
837  {
838  uint letter = getUtf8CodeToLower(fd->name(),0);
839  if (fd->isLinkable() && isId(letter))
840  {
843  }
844  }
845  }
846 
847  // index class members
848  {
849  // for each member name
850  for (const auto &mn : *Doxygen::memberNameLinkedMap)
851  {
852  // for each member definition
853  for (const auto &md : *mn)
854  {
855  addMemberToSearchIndex(md.get());
856  }
857  }
858  }
859 
860  // index file/namespace members
861  {
862  // for each member name
863  for (const auto &mn : *Doxygen::functionNameLinkedMap)
864  {
865  // for each member definition
866  for (const auto &md : *mn)
867  {
868  addMemberToSearchIndex(md.get());
869  }
870  }
871  }
872 
873  // index groups
875  GroupDef *gd;
876  for (gli.toFirst();(gd=gli.current());++gli)
877  {
878  if (gd->isLinkable())
879  {
880  QCString title = gd->groupTitle();
881  if (!title.isEmpty()) // TODO: able searching for all word in the title
882  {
883  uchar charCode = title.at(0);
884  uint letter = charCode<128 ? tolower(charCode) : charCode;
885  if (isId(letter))
886  {
889  }
890  }
891  }
892  }
893 
894  // index pages
896  PageDef *pd=0;
897  for (pdi.toFirst();(pd=pdi.current());++pdi)
898  {
899  if (pd->isLinkable())
900  {
901  QCString title = pd->title();
902  if (!title.isEmpty())
903  {
904  uchar charCode = title.at(0);
905  uint letter = charCode<128 ? tolower(charCode) : charCode;
906  if (isId(letter))
907  {
910  }
911  }
912  }
913  }
914  if (Doxygen::mainPage)
915  {
916  QCString title = Doxygen::mainPage->title();
917  if (!title.isEmpty())
918  {
919  uchar charCode = title.at(0);
920  uint letter = charCode<128 ? tolower(charCode) : charCode;
921  if (isId(letter))
922  {
925  }
926  }
927  }
928 
929  // sort all lists
930  int i;
931  for (i=0;i<NUM_SEARCH_INDICES;i++)
932  {
934  SearchIndexList *sl;
935  for (it.toFirst();(sl=it.current());++it)
936  {
937  sl->sort();
938  }
939  }
940 }
941 
943 {
944  int i;
945  int cnt = 0;
946  // write index files
947  QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
948 
949  for (i=0;i<NUM_SEARCH_INDICES;i++) // for each index
950  {
952  SearchIndexList *sl;
953  int p=0;
954  for (it.toFirst();(sl=it.current());++it,++p) // for each letter
955  {
956  QCString baseName;
957  baseName.sprintf("%s_%x",g_searchIndexInfo[i].name.data(),p);
958 
959  QCString fileName = searchDirName + "/"+baseName+".html";
960  QCString dataFileName = searchDirName + "/"+baseName+".js";
961 
962  QFile outFile(fileName);
963  QFile dataOutFile(dataFileName);
964  if (outFile.open(IO_WriteOnly) && dataOutFile.open(IO_WriteOnly))
965  {
966  {
967  FTextStream t(&outFile);
968 
969  t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
970  " \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl;
971  t << "<html><head><title></title>" << endl;
972  t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl;
973  t << "<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() << "\"/>" << endl;
974  t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl;
975  t << "<script type=\"text/javascript\" src=\"" << baseName << ".js\"></script>" << endl;
976  t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl;
977  t << "</head>" << endl;
978  t << "<body class=\"SRPage\">" << endl;
979  t << "<div id=\"SRIndex\">" << endl;
980  t << "<div class=\"SRStatus\" id=\"Loading\">" << theTranslator->trLoading() << "</div>" << endl;
981  t << "<div id=\"SRResults\"></div>" << endl; // here the results will be inserted
982  t << "<script type=\"text/javascript\"><!--" << endl;
983  t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
984  t << "createResults();" << endl; // this function will insert the results
985  t << "/* @license-end */\n";
986  t << "--></script>" << endl;
987  t << "<div class=\"SRStatus\" id=\"Searching\">"
988  << theTranslator->trSearching() << "</div>" << endl;
989  t << "<div class=\"SRStatus\" id=\"NoMatches\">"
990  << theTranslator->trNoMatches() << "</div>" << endl;
991 
992  t << "<script type=\"text/javascript\"><!--" << endl;
993  t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
994  t << "document.getElementById(\"Loading\").style.display=\"none\";" << endl;
995  t << "document.getElementById(\"NoMatches\").style.display=\"none\";" << endl;
996  t << "var searchResults = new SearchResults(\"searchResults\");" << endl;
997  t << "searchResults.Search();" << endl;
998  t << "window.addEventListener(\"message\", function(event) {" << endl;
999  t << " if (event.data == \"take_focus\") {" << endl;
1000  t << " var elem = searchResults.NavNext(0);" << endl;
1001  t << " if (elem) elem.focus();" << endl;
1002  t << " }" << endl;
1003  t << "});" << endl;
1004  t << "/* @license-end */\n";
1005  t << "--></script>" << endl;
1006  t << "</div>" << endl; // SRIndex
1007  t << "</body>" << endl;
1008  t << "</html>" << endl;
1009  }
1010  FTextStream ti(&dataOutFile);
1011 
1012  ti << "var searchData=" << endl;
1013  // format
1014  // searchData[] = array of items
1015  // searchData[x][0] = id
1016  // searchData[x][1] = [ name + child1 + child2 + .. ]
1017  // searchData[x][1][0] = name as shown
1018  // searchData[x][1][y+1] = info for child y
1019  // searchData[x][1][y+1][0] = url
1020  // searchData[x][1][y+1][1] = 1 => target="_parent"
1021  // searchData[x][1][y+1][2] = scope
1022 
1023  ti << "[" << endl;
1024  bool firstEntry=TRUE;
1025 
1028  int itemCount=0;
1029  for (li.toFirst();(dl=li.current());++li)
1030  {
1031  const Definition *d = dl->getFirst();
1032 
1033  if (!firstEntry)
1034  {
1035  ti << "," << endl;
1036  }
1037  firstEntry=FALSE;
1038 
1039  ti << " ['" << dl->id() << "_" << cnt++ << "',['" << convertToXML(dl->name()) << "',[";
1040 
1041  if (dl->count()==1) // item with a unique name
1042  {
1043  const MemberDef *md = dynamic_cast<const MemberDef*>(d);
1044  QCString anchor = d->anchor();
1045 
1046  ti << "'" << externalRef("../",d->getReference(),TRUE)
1048  if (!anchor.isEmpty())
1049  {
1050  ti << "#" << anchor;
1051  }
1052  ti << "',";
1053 
1054  static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
1055  if (!extLinksInWindow || d->getReference().isEmpty())
1056  {
1057  ti << "1,";
1058  }
1059  else
1060  {
1061  ti << "0,";
1062  }
1063 
1065  {
1066  ti << "'" << convertToXML(d->getOuterScope()->name()) << "'";
1067  }
1068  else if (md)
1069  {
1070  const FileDef *fd = md->getBodyDef();
1071  if (fd==0) fd = md->getFileDef();
1072  if (fd)
1073  {
1074  ti << "'" << convertToXML(fd->localName()) << "'";
1075  }
1076  }
1077  else
1078  {
1079  ti << "''";
1080  }
1081  ti << "]]";
1082  }
1083  else // multiple items with the same name
1084  {
1085  QListIterator<Definition> di(*dl);
1086  bool overloadedFunction = FALSE;
1087  const Definition *prevScope = 0;
1088  int childCount=0;
1089  for (di.toFirst();(d=di.current());)
1090  {
1091  ++di;
1092  const Definition *scope = d->getOuterScope();
1093  const Definition *next = di.current();
1094  const Definition *nextScope = 0;
1095  const MemberDef *md = dynamic_cast<const MemberDef*>(d);
1096  if (next) nextScope = next->getOuterScope();
1097  QCString anchor = d->anchor();
1098 
1099  if (childCount>0)
1100  {
1101  ti << "],[";
1102  }
1103  ti << "'" << externalRef("../",d->getReference(),TRUE)
1105  if (!anchor.isEmpty())
1106  {
1107  ti << "#" << anchor;
1108  }
1109  ti << "',";
1110 
1111  static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
1112  if (!extLinksInWindow || d->getReference().isEmpty())
1113  {
1114  ti << "1,";
1115  }
1116  else
1117  {
1118  ti << "0,";
1119  }
1120  bool found=FALSE;
1121  overloadedFunction = ((prevScope!=0 && scope==prevScope) ||
1122  (scope && scope==nextScope)
1123  ) && md &&
1124  (md->isFunction() || md->isSlot());
1125  QCString prefix;
1126  if (md) prefix=convertToXML(md->localName());
1127  if (overloadedFunction) // overloaded member function
1128  {
1129  prefix+=convertToXML(md->argsString());
1130  // show argument list to disambiguate overloaded functions
1131  }
1132  else if (md) // unique member function
1133  {
1134  prefix+="()"; // only to show it is a function
1135  }
1136  QCString name;
1138  {
1139  name = convertToXML((dynamic_cast<const ClassDef*>(d))->displayName());
1140  found = TRUE;
1141  }
1143  {
1144  name = convertToXML((dynamic_cast<const NamespaceDef*>(d))->displayName());
1145  found = TRUE;
1146  }
1147  else if (scope==0 || scope==Doxygen::globalScope) // in global scope
1148  {
1149  if (md)
1150  {
1151  const FileDef *fd = md->getBodyDef();
1152  if (fd==0) fd = md->resolveAlias()->getFileDef();
1153  if (fd)
1154  {
1155  if (!prefix.isEmpty()) prefix+=":&#160;";
1156  name = prefix + convertToXML(fd->localName());
1157  found = TRUE;
1158  }
1159  }
1160  }
1161  else if (md && (md->resolveAlias()->getClassDef() || md->resolveAlias()->getNamespaceDef()))
1162  // member in class or namespace scope
1163  {
1164  SrcLangExt lang = md->getLanguage();
1165  name = convertToXML(d->getOuterScope()->qualifiedName())
1166  + getLanguageSpecificSeparator(lang) + prefix;
1167  found = TRUE;
1168  }
1169  else if (scope) // some thing else? -> show scope
1170  {
1171  name = prefix + convertToXML(scope->name());
1172  found = TRUE;
1173  }
1174  if (!found) // fallback
1175  {
1176  name = prefix + "("+theTranslator->trGlobalNamespace()+")";
1177  }
1178 
1179  ti << "'" << name << "'";
1180 
1181  prevScope = scope;
1182  childCount++;
1183  }
1184 
1185  ti << "]]";
1186  }
1187  ti << "]";
1188  itemCount++;
1189  }
1190  if (!firstEntry)
1191  {
1192  ti << endl;
1193  }
1194 
1195  ti << "];" << endl;
1196 
1197  }
1198  else
1199  {
1200  err("Failed to open file '%s' for writing...\n",fileName.data());
1201  }
1202  }
1203  }
1204 
1205  {
1206  QFile f(searchDirName+"/searchdata.js");
1207  if (f.open(IO_WriteOnly))
1208  {
1209  FTextStream t(&f);
1210  t << "var indexSectionsWithContent =" << endl;
1211  t << "{" << endl;
1212  bool first=TRUE;
1213  int j=0;
1214  for (i=0;i<NUM_SEARCH_INDICES;i++)
1215  {
1216  if (g_searchIndexInfo[i].symbolList.count()>0)
1217  {
1218  if (!first) t << "," << endl;
1219  t << " " << j << ": \"";
1220 
1222  SearchIndexList *sl;
1223  for (it.toFirst();(sl=it.current());++it) // for each letter
1224  {
1225  if ( sl->letter() == '"' ) t << QString( QChar( '\\' ) ).utf8();
1226  t << QString( QChar( sl->letter() ) ).utf8();
1227  }
1228  t << "\"";
1229  first=FALSE;
1230  j++;
1231  }
1232  }
1233  if (!first) t << "\n";
1234  t << "};" << endl << endl;
1235  t << "var indexSectionNames =" << endl;
1236  t << "{" << endl;
1237  first=TRUE;
1238  j=0;
1239  for (i=0;i<NUM_SEARCH_INDICES;i++)
1240  {
1241  if (g_searchIndexInfo[i].symbolList.count()>0)
1242  {
1243  if (!first) t << "," << endl;
1244  t << " " << j << ": \"" << g_searchIndexInfo[i].name << "\"";
1245  first=FALSE;
1246  j++;
1247  }
1248  }
1249  if (!first) t << "\n";
1250  t << "};" << endl << endl;
1251  t << "var indexSectionLabels =" << endl;
1252  t << "{" << endl;
1253  first=TRUE;
1254  j=0;
1255  for (i=0;i<NUM_SEARCH_INDICES;i++)
1256  {
1257  if (g_searchIndexInfo[i].symbolList.count()>0)
1258  {
1259  if (!first) t << "," << endl;
1260  t << " " << j << ": \"" << convertToXML(g_searchIndexInfo[i].text) << "\"";
1261  first=FALSE;
1262  j++;
1263  }
1264  }
1265  if (!first) t << "\n";
1266  t << "};" << endl << endl;
1267  }
1268  ResourceMgr::instance().copyResource("search.js",searchDirName);
1269  }
1270  {
1271  QFile f(searchDirName+"/nomatches.html");
1272  if (f.open(IO_WriteOnly))
1273  {
1274  FTextStream t(&f);
1275  t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
1276  "\"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl;
1277  t << "<html><head><title></title>" << endl;
1278  t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl;
1279  t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl;
1280  t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl;
1281  t << "</head>" << endl;
1282  t << "<body class=\"SRPage\">" << endl;
1283  t << "<div id=\"SRIndex\">" << endl;
1284  t << "<div class=\"SRStatus\" id=\"NoMatches\">"
1285  << theTranslator->trNoMatches() << "</div>" << endl;
1286  t << "</div>" << endl;
1287  t << "</body>" << endl;
1288  t << "</html>" << endl;
1289  }
1290  }
1291  Doxygen::indexList->addStyleSheetFile("search/search.js");
1292 }
1293 
1295 {
1296  return g_searchIndexInfo;
1297 }
1298 
1299 //---------------------------------------------------------------------------------------------
1300 
1302  : SDict< SearchDefinitionList >(17,FALSE), m_letter(letter)
1303 {
1305 }
1306 
1308 {
1309 }
1310 
1312 {
1313  QCString dispName = d->localName();
1314  SearchDefinitionList *l = find(dispName);
1315  if (l==0)
1316  {
1318  {
1319  dispName = (dynamic_cast<const GroupDef*>(d))->groupTitle();
1320  }
1321  else if (d->definitionType()==Definition::TypePage)
1322  {
1323  dispName = (dynamic_cast<const PageDef*>(d))->title();
1324  }
1325  l=new SearchDefinitionList(searchId(dispName),dispName);
1327  }
1328  l->append(d);
1329 }
1330 
1332 {
1333  return m_letter;
1334 }
1335 
1337 {
1338  QCString n1 = md1->getFirst()->localName();
1339  QCString n2 = md2->getFirst()->localName();
1340  return qstricmp(n1.data(),n2.data());
1341 }
1342 
1343 //---------------------------------------------------------------------------------------------
1344 
1346 {
1347  static bool searchEngine = Config_getBool(SEARCHENGINE);
1348  static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
1349  static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
1350  if (searchEngine && serverBasedSearch)
1351  {
1352  if (externalSearch) // external tools produce search index and engine
1353  {
1355  }
1356  else // doxygen produces search index and engine
1357  {
1359  }
1360  }
1361  else // no search engine or pure javascript based search function
1362  {
1364  }
1365 }
1366 
1368 {
1369  delete Doxygen::searchIndex;
1370 }
qfile.h
SearchIndex::m_words
QDict< IndexWord > m_words
Definition: searchindex.h:92
IndexWord::IndexWord
IndexWord(const char *word)
Definition: searchindex.cpp:56
PageDef::hasTitle
virtual bool hasTitle() const =0
PageDef::isLinkable
virtual bool isLinkable() const =0
Definition::anchor
virtual QCString anchor() const =0
QRegExp
Definition of QRegExp class.
Definition: qregexp.h:47
Translator::trTypedefs
virtual QCString trTypedefs()=0
SEARCH_INDEX_DEFINES
#define SEARCH_INDEX_DEFINES
Definition: searchindex.h:132
Doxygen::classSDict
static ClassSDict * classSDict
Definition: doxygen.h:94
SearchIndex::m_url2IdMap
QDict< int > m_url2IdMap
Definition: searchindex.h:94
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition: qcstring.h:191
GrowBuf::getPos
uint getPos() const
Definition: growbuf.h:49
SEARCH_INDEX_STRUCTS
#define SEARCH_INDEX_STRUCTS
Definition: searchindex.h:118
SearchIndexInfo::text
QCString text
Definition: searchindex.h:165
Definition::getOutputFileBase
virtual QCString getOutputFileBase() const =0
SEARCH_INDEX_FILES
#define SEARCH_INDEX_FILES
Definition: searchindex.h:121
IndexWord::urls
const QIntDict< URLInfo > & urls() const
Definition: searchindex.h:61
PageDef
A model of a page symbol.
Definition: pagedef.h:30
getSearchIndices
const SearchIndexInfo * getSearchIndices()
Definition: searchindex.cpp:1294
stripPath
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1299
SEARCH_INDEX_EXCEPTIONS
#define SEARCH_INDEX_EXCEPTIONS
Definition: searchindex.h:119
uint
unsigned uint
Definition: qglobal.h:351
MemberDef::isFunction
virtual bool isFunction() const =0
ClassDef
A abstract class representing of a compound symbol.
Definition: classdef.h:61
ClassDef::Interface
@ Interface
Definition: classdef.h:67
Private
@ Private
Definition: types.h:27
MemberDef::isSignal
virtual bool isSignal() const =0
pagedef.h
Doxygen::searchIndex
static SearchIndexIntf * searchIndex
Definition: doxygen.h:122
ClassDef::isLinkable
virtual bool isLinkable() const =0
return TRUE iff a link to this class is possible (either within this project, or as a cross-reference...
SearchIndex::write
void write(const char *file)
Definition: searchindex.cpp:262
writeJavaScriptSearchIndex
void writeJavaScriptSearchIndex()
Definition: searchindex.cpp:942
SEARCH_INDEX_NAMESPACES
#define SEARCH_INDEX_NAMESPACES
Definition: searchindex.h:120
SearchIndex::m_index
QVector< QList< IndexWord > > m_index
Definition: searchindex.h:93
SEARCH_INDEX_ENUMVALUES
#define SEARCH_INDEX_ENUMVALUES
Definition: searchindex.h:128
SearchIndexExternal::Private::docEntries
SDict< SearchDocEntry > docEntries
Definition: searchindex.cpp:426
memberdef.h
MemberDef::isDictionary
virtual bool isDictionary() const =0
FTextStream
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:12
SearchIndexList::letter
uint letter() const
Definition: searchindex.cpp:1331
qregexp.h
namespacedef.h
SearchIndex::setCurrentDoc
void setCurrentDoc(const Definition *ctx, const char *anchor, bool isSourceFile)
Definition: searchindex.cpp:89
SearchIndexList::compareValues
int compareValues(const SearchDefinitionList *md1, const SearchDefinitionList *md2) const
Definition: searchindex.cpp:1336
SearchIndexExternal::SearchIndexExternal
SearchIndexExternal()
Definition: searchindex.cpp:430
membername.h
getUtf8CodeToLower
uint getUtf8CodeToLower(const QCString &s, int idx)
Returns one unicode character as an unsigned integer from utf-8 string, making the character lower ca...
Definition: util.cpp:8133
ClassDef::compoundType
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
QIntDictIterator
The QIntDictIterator class provides an iterator for QIntDict collections.
Definition: qintdict.h:86
Doxygen::memberNameLinkedMap
static MemberNameLinkedMap * memberNameLinkedMap
Definition: doxygen.h:108
SrcLangExt
SrcLangExt
Language as given by extension.
Definition: types.h:43
GrowBuf::get
const char * get()
Definition: growbuf.h:48
SearchIndexExternal::Private::Private
Private()
Definition: searchindex.cpp:425
QCString::lower
QCString lower() const
Definition: qcstring.cpp:291
growbuf.h
QListIterator
The QListIterator class provides an iterator for QList collections.
Definition: qlist.h:128
ResourceMgr::copyResource
bool copyResource(const char *name, const char *targetDir) const
Copies a registered resource to a given target directory.
Definition: resourcemgr.cpp:162
FileDef::isLinkable
virtual bool isLinkable() const =0
SearchIndexExternal::write
void write(const char *file)
Definition: searchindex.cpp:534
Translator::trFile
virtual QCString trFile(bool first_capital, bool singular)=0
Translator::trExceptions
virtual QCString trExceptions()=0
QCString::length
uint length() const
Returns the length of the string, excluding the 0-terminator.
Definition: qcstring.h:197
Translator::trVariables
virtual QCString trVariables()=0
languages.l
l
Definition: languages.py:75
SearchDocEntry::type
QCString type
Definition: searchindex.cpp:414
IO_WriteOnly
#define IO_WriteOnly
Definition: qiodevice.h:62
QVector::insert
bool insert(uint i, const type *d)
Definition: qvector.h:61
err
void err(const char *fmt,...)
Definition: message.cpp:238
SrcLangExt_Java
@ SrcLangExt_Java
Definition: types.h:46
MemberDef::typeString
virtual const char * typeString() const =0
Doxygen::inputNameLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
Definition: doxygen.h:103
QList
Definition of QList template/macro class.
Definition: qlist.h:55
writeString
static void writeString(QFile &f, const char *s)
Definition: searchindex.cpp:255
version.h
LetterToIndexMap::append
void append(uint letter, typename T::ElementType *elem)
Definition: util.h:100
GrowBuf::addStr
void addStr(const QCString &s)
Definition: growbuf.h:20
SEARCH_INDEX_RELATED
#define SEARCH_INDEX_RELATED
Definition: searchindex.h:131
IndexWord::m_urls
QIntDict< URLInfo > m_urls
Definition: searchindex.h:66
filename.h
DefinitionIntf::TypePackage
@ TypePackage
Definition: definition.h:85
charsToIndex
static int charsToIndex(const char *word)
Definition: searchindex.cpp:183
config.h
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const char *fName)
Definition: util.cpp:6589
Translator::trFriends
virtual QCString trFriends()=0
createJavaScriptSearchIndex
void createJavaScriptSearchIndex()
Definition: searchindex.cpp:732
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:134
GroupDef
A model of a group of symbols.
Definition: groupdef.h:48
QList::isEmpty
bool isEmpty() const
Definition: qlist.h:67
ClassDef::Exception
@ Exception
Definition: classdef.h:70
DefinitionIntf::TypeMember
@ TypeMember
Definition: definition.h:83
GroupDef::isLinkable
virtual bool isLinkable() const =0
Translator::trDictionaries
virtual QCString trDictionaries()=0
Definition::localName
virtual QCString localName() const =0
MemberDef::isSlot
virtual bool isSlot() const =0
SDict::append
void append(const char *key, const T *d)
Definition: sortdict.h:135
SearchIndexList::append
void append(const Definition *d)
Definition: searchindex.cpp:1311
FileDef
A model of a file symbol.
Definition: filedef.h:65
Config_getString
#define Config_getString(val)
Definition: config.h:34
SearchDocEntry::normalText
GrowBuf normalText
Definition: searchindex.cpp:420
SearchIndex::m_urls
QIntDict< URL > m_urls
Definition: searchindex.h:95
DefinitionIntf::TypePage
@ TypePage
Definition: definition.h:86
Translator::trOperations
virtual QCString trOperations()=0
ResourceMgr::instance
static ResourceMgr & instance()
Returns the one and only instance of this class.
Definition: resourcemgr.cpp:35
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
TRUE
@ TRUE
Definition: mscgen_bool.h:29
QFile::putch
int putch(int)
Definition: qfile.cpp:386
FALSE
@ FALSE
Definition: mscgen_bool.h:28
searchId
static QCString searchId(const QCString &s)
Definition: searchindex.cpp:706
convertToXML
QCString convertToXML(const char *s, bool keepEntities)
Definition: util.cpp:5386
Translator::trClasses
virtual QCString trClasses()=0
SEARCH_INDEX_SEQUENCES
#define SEARCH_INDEX_SEQUENCES
Definition: searchindex.h:125
classlist.h
ws
QTextStream & ws(QTextStream &s)
Definition: qtextstream.cpp:2042
Definition::getOuterScope
virtual Definition * getOuterScope() const =0
Doxygen::mainPage
static PageDef * mainPage
Definition: doxygen.h:98
SearchIndexList::m_letter
uint m_letter
Definition: searchindex.h:158
isId
bool isId(int c)
Definition: util.h:226
QString::utf8
QCString utf8() const
Definition: qstring.cpp:14558
QIntDictIterator::toFirst
type * toFirst()
Definition: qintdict.h:92
MemberDef::getNamespaceDef
virtual const NamespaceDef * getNamespaceDef() const =0
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
ClassDef::compoundTypeString
virtual QCString compoundTypeString() const =0
Returns the type of compound as a string.
SearchDocEntry
Definition: searchindex.cpp:413
Doxygen::htmlFileExtension
static QCString htmlFileExtension
Definition: doxygen.h:119
message.h
uchar
unsigned char uchar
Definition: qglobal.h:349
MemberDef::isProperty
virtual bool isProperty() const =0
PageDef::title
virtual QCString title() const =0
QIntDict::insert
void insert(long k, const type *d)
Definition: qintdict.h:57
QCString::at
char & at(uint i) const
Returns a reference to the character at index i.
Definition: qcstring.h:329
Translator::trGlobalNamespace
virtual QCString trGlobalNamespace()=0
Translator::trSequences
virtual QCString trSequences()=0
initSearchIndexer
void initSearchIndexer()
Definition: searchindex.cpp:1345
IndexWord::word
QCString word() const
Definition: searchindex.h:62
DefinitionIntf::TypeFile
@ TypeFile
Definition: definition.h:81
NamespaceDef
An abstract interface of a namespace symbol.
Definition: namespacedef.h:38
QIntDict::count
uint count() const
Definition: qintdict.h:54
URLInfo::freq
int freq
Definition: searchindex.h:53
qstricmp
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:746
OPTIMIZE_OUTPUT_SLICE
#define OPTIMIZE_OUTPUT_SLICE
Copyright (C) 1997-2019 by Dimitri van Heesch.
Definition: dotgfxhierarchytable.cpp:24
theTranslator
Translator * theTranslator
Copyright (C) 1997-2015 by Dimitri van Heesch.
Definition: language.cpp:157
SearchDocEntry::importantText
GrowBuf importantText
Definition: searchindex.cpp:419
Doxygen::globalScope
static NamespaceDef * globalScope
Definition: doxygen.h:118
DefinitionIntf::TypeDir
@ TypeDir
Definition: definition.h:87
resourcemgr.h
SearchIndex::addWord
void addWord(const char *word, bool hiPriority)
Definition: searchindex.cpp:242
URLInfo
Definition: searchindex.h:50
QCollection::setAutoDelete
void setAutoDelete(bool enable)
Definition: qcollection.h:55
doxygen.h
Translator::trSubprogram
virtual QCString trSubprogram(bool first_capital, bool singular)=0
SearchDocEntry::extId
QCString extId
Definition: searchindex.cpp:417
SDict::setAutoDelete
void setAutoDelete(bool val)
Definition: sortdict.h:222
Doxygen::groupSDict
static GroupSDict * groupSDict
Definition: doxygen.h:112
SearchIndexExternal::setCurrentDoc
void setCurrentDoc(const Definition *ctx, const char *anchor, bool isSourceFile)
Definition: searchindex.cpp:498
Translator::trModules
virtual QCString trModules()=0
Translator::trEnumerations
virtual QCString trEnumerations()=0
Translator::trNamespace
virtual QCString trNamespace(bool first_capital, bool singular)=0
language.h
SearchDocEntry::args
QCString args
Definition: searchindex.cpp:416
DefinitionIntf::TypeClass
@ TypeClass
Definition: definition.h:80
QFile::open
bool open(int)
Definition: qfile_unix.cpp:134
SIntDict
Ordered dictionary of elements of type T.
Definition: sortdict.h:74
Translator::trModule
virtual QCString trModule(bool first_capital, bool singular)=0
QList::count
uint count() const
Definition: qlist.h:66
SEARCH_INDEX_INTERFACES
#define SEARCH_INDEX_INTERFACES
Definition: searchindex.h:117
DefinitionIntf::definitionType
virtual DefType definitionType() const =0
getLanguageSpecificSeparator
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition: util.cpp:7921
QListIterator::current
type * current() const
Definition: qlist.h:147
Translator::trStructs
virtual QCString trStructs()=0
IndexWord::addUrlIndex
void addUrlIndex(int, bool)
Definition: searchindex.cpp:62
Translator::trPackage
virtual QCString trPackage(const char *name)=0
SearchIndex::m_urlIndex
int m_urlIndex
Definition: searchindex.h:96
MemberDef::getClassDef
virtual const ClassDef * getClassDef() const =0
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:100
SearchIndexExternal::p
Private * p
Definition: searchindex.h:110
MemberDef::isTypedef
virtual bool isTypedef() const =0
SrcLangExt_Fortran
@ SrcLangExt_Fortran
Definition: types.h:54
filedef.h
Definition::getReference
virtual QCString getReference() const =0
MemberDef::isDefine
virtual bool isDefine() const =0
MemberDef::isVariable
virtual bool isVariable() const =0
Translator::trProperties
virtual QCString trProperties()=0
SearchIndexExternal::~SearchIndexExternal
~SearchIndexExternal()
Definition: searchindex.cpp:437
SearchIndexList::SearchIndexList
SearchIndexList(uint letter)
Definition: searchindex.cpp:1301
QChar
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
Translator::trSearching
virtual QCString trSearching()=0
SEARCH_INDEX_EVENTS
#define SEARCH_INDEX_EVENTS
Definition: searchindex.h:130
Translator::trLoading
virtual QCString trLoading()=0
IndexList::addStyleSheetFile
void addStyleSheetFile(const char *name)
Definition: index.h:104
SrcLangExt_CSharp
@ SrcLangExt_CSharp
Definition: types.h:47
URL::name
QCString name
Definition: searchindex.h:44
SEARCH_INDEX_CLASSES
#define SEARCH_INDEX_CLASSES
Definition: searchindex.h:116
Translator::trGroup
virtual QCString trGroup(bool first_capital, bool singular)=0
Doxygen::indexList
static IndexList * indexList
Definition: doxygen.h:137
MemberDef::isFriend
virtual bool isFriend() const =0
QIntDictIterator::currentKey
long currentKey() const
Definition: qintdict.h:95
MemberDef::getGroupDef
virtual const GroupDef * getGroupDef() const =0
Translator::trEvents
virtual QCString trEvents()=0
ClassDef::Struct
@ Struct
Definition: classdef.h:65
QListIterator::toFirst
type * toFirst()
Definition: qlist.h:136
getPrefixIndex
int getPrefixIndex(const QCString &name)
Definition: util.cpp:4739
definitionToName
static QCString definitionToName(const Definition *ctx)
Definition: searchindex.cpp:443
QIntDict::find
type * find(long k) const
Definition: qintdict.h:63
MemberDef::isLinkable
virtual bool isLinkable() const =0
SDict< ClassDef >::Iterator
friend class Iterator
Definition: sortdict.h:285
SearchIndexInfo
Definition: searchindex.h:162
SearchIndex::SearchIndex
SearchIndex()
Definition: searchindex.cpp:78
SearchIndexIntf
Definition: searchindex.h:70
SEARCH_INDEX_TYPEDEFS
#define SEARCH_INDEX_TYPEDEFS
Definition: searchindex.h:124
classdef.h
SDict< SearchDocEntry >
Translator::trSliceInterfaces
virtual QCString trSliceInterfaces()=0
Translator::trConstants
virtual QCString trConstants()=0
MemberDef::resolveAlias
virtual MemberDef * resolveAlias()=0
SearchDefinitionList::id
QCString id() const
Definition: searchindex.h:141
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:209
SearchDocEntry::name
QCString name
Definition: searchindex.cpp:415
Translator::trDefines
virtual QCString trDefines()=0
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.cpp:415
GroupDef::groupTitle
virtual const char * groupTitle() const =0
SEARCH_INDEX_GROUPS
#define SEARCH_INDEX_GROUPS
Definition: searchindex.h:133
SEARCH_INDEX_VARIABLES
#define SEARCH_INDEX_VARIABLES
Definition: searchindex.h:123
GrowBuf::addChar
void addChar(char c)
Definition: growbuf.h:17
g_searchIndexInfo
static SearchIndexInfo g_searchIndexInfo[20]
Definition: searchindex.cpp:584
finalizeSearchIndexer
void finalizeSearchIndexer()
Definition: searchindex.cpp:1367
Translator::trEnumerationValues
virtual QCString trEnumerationValues()=0
QIntDictIterator::current
type * current() const
Definition: qintdict.h:94
MemberDef::isRelated
virtual bool isRelated() const =0
SearchIndexInfo::name
QCString name
Definition: searchindex.h:164
MemberDef::getFileDef
virtual const FileDef * getFileDef() const =0
Translator::trPage
virtual QCString trPage(bool first_capital, bool singular)=0
numIndexEntries
const int numIndexEntries
Copyright (C) 1997-2015 by Dimitri van Heesch.
Definition: searchindex.cpp:52
SearchIndexInfo::symbolList
LetterToIndexMap< SearchIndexList > symbolList
Definition: searchindex.h:163
NUM_SEARCH_INDICES
#define NUM_SEARCH_INDICES
Definition: searchindex.h:135
URLInfo::urlIdx
int urlIdx
Definition: searchindex.h:52
SearchIndexExternal::addWord
void addWord(const char *word, bool hiPriority)
Definition: searchindex.cpp:525
SEARCH_INDEX_DICTIONARIES
#define SEARCH_INDEX_DICTIONARIES
Definition: searchindex.h:126
NamespaceDef::isLinkable
virtual bool isLinkable() const =0
Config_getBool
#define Config_getBool(val)
Definition: config.h:35
Translator::trMember
virtual QCString trMember(bool first_capital, bool singular)=0
DefinitionIntf::TypeGroup
@ TypeGroup
Definition: definition.h:84
SearchIndexExternal
Definition: searchindex.h:101
URL::url
QCString url
Definition: searchindex.h:45
Translator::trAll
virtual QCString trAll()=0
SEARCH_INDEX_ENUMS
#define SEARCH_INDEX_ENUMS
Definition: searchindex.h:127
MemberDef::isEvent
virtual bool isEvent() const =0
groupdef.h
writeInt
static void writeInt(QFile &f, int index)
Definition: searchindex.cpp:247
SearchDefinitionList::name
QCString name() const
Definition: searchindex.h:142
SearchDocEntry::url
QCString url
Definition: searchindex.cpp:418
SEARCH_INDEX_FUNCTIONS
#define SEARCH_INDEX_FUNCTIONS
Definition: searchindex.h:122
SDict::sort
void sort()
Definition: sortdict.h:188
SEARCH_INDEX_PAGES
#define SEARCH_INDEX_PAGES
Definition: searchindex.h:134
MemberDef::isEnumValue
virtual bool isEnumValue() const =0
Doxygen::pageSDict
static PageSDict * pageSDict
Definition: doxygen.h:97
Definition::name
virtual QCString name() const =0
GrowBuf
Class representing a string buffer optimised for growing.
Definition: growbuf.h:11
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: util.cpp:4606
MemberDef::isSequence
virtual bool isSequence() const =0
endl
QTextStream & endl(QTextStream &s)
Definition: qtextstream.cpp:2030
Translator::trNoMatches
virtual QCString trNoMatches()=0
Doxygen::namespaceSDict
static NamespaceSDict * namespaceSDict
Definition: doxygen.h:113
searchindex.h
Doxygen::functionNameLinkedMap
static MemberNameLinkedMap * functionNameLinkedMap
Definition: doxygen.h:109
SearchIndexList
Definition: searchindex.h:149
IndexWord
Definition: searchindex.h:57
MemberDef::isEnumerate
virtual bool isEnumerate() const =0
externalRef
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:7691
ClassDef::templateMaster
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
SearchIndex
Definition: searchindex.h:84
SearchIndexList::~SearchIndexList
~SearchIndexList()
Definition: searchindex.cpp:1307
util.h
Copyright (C) 1997-2015 by Dimitri van Heesch.
SearchIndexExternal::Private
Definition: searchindex.cpp:424
Definition::getBodyDef
virtual FileDef * getBodyDef() const =0
Definition::qualifiedName
virtual QCString qualifiedName() const =0
MemberDef::isForeign
virtual bool isForeign() const =0
SDict::find
T * find(const char *key)
Definition: sortdict.h:232
QString
QString member functions.
Definition: qstring.h:351
SEARCH_INDEX_PROPERTIES
#define SEARCH_INDEX_PROPERTIES
Definition: searchindex.h:129
QList::getFirst
type * getFirst() const
Definition: qlist.h:95
addMemberToSearchIndex
static void addMemberToSearchIndex(const MemberDef *md)
Definition: searchindex.cpp:586
URL
Definition: searchindex.h:42
QCString::sprintf
QCString & sprintf(const char *format,...)
Copyright (C) 1997-2015 by Dimitri van Heesch.
Definition: qcstring.cpp:28
SearchIndexExternal::Private::current
SearchDocEntry * current
Definition: searchindex.cpp:427
QFile
The QFile class is an I/O device that operates on files.
Definition: qfile.h:51
SEARCH_INDEX_ALL
#define SEARCH_INDEX_ALL
Definition: searchindex.h:115
MemberDef::argsString
virtual const char * argsString() const =0
getDoxygenVersion
char * getDoxygenVersion(void)
Copyright (C) 1997-2015 by Dimitri van Heesch.
QRegExp::match
int match(const QCString &str, int index=0, int *len=0, bool indexIsStart=TRUE) const
Definition: qregexp.cpp:649
Translator::trFunctions
virtual QCString trFunctions()=0
DefinitionIntf::TypeNamespace
@ TypeNamespace
Definition: definition.h:82
SearchDefinitionList
Definition: searchindex.h:138