Doxygen
tagreader.cpp
浏览该文件的文档.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #include "tagreader.h"
20 
21 #include <map>
22 #include <functional>
23 #include <utility>
24 #include <algorithm>
25 
26 #include <assert.h>
27 #include <stdio.h>
28 #include <stdarg.h>
29 
30 #include "xml.h"
31 #include "entry.h"
32 #include "doxygen.h"
33 #include "util.h"
34 #include "message.h"
35 #include "defargs.h"
36 #include "arguments.h"
37 #include "filedef.h"
38 #include "filename.h"
39 #include "section.h"
40 #include "containers.h"
41 #include "debug.h"
42 
43 /** Information about an linkable anchor */
45 {
46  public:
47  TagAnchorInfo(const QCString &f,
48  const QCString &l,
49  const QCString &t=QCString())
50  : label(l), fileName(f), title(t) {}
54 };
55 
56 /** Container for enum values that are scoped within an enum */
58 {
59  public:
64 };
65 
66 /** Container for include info that can be read from a tagfile */
68 {
69  public:
73  bool isLocal;
74  bool isImported;
75 };
76 
77 /** Container for member specific info that can be read from a tagfile */
79 {
80  public:
88  std::vector<TagAnchorInfo> docAnchors;
91  bool isStatic = false;
92  std::vector<TagEnumValueInfo> enumValues;
93  int lineNr;
94 };
95 
96 /** Base class for all compound types */
98 {
99  public:
101  explicit TagCompoundInfo(CompoundType type) : m_type(type) {}
102  virtual ~TagCompoundInfo() {}
103  CompoundType compoundType() const { return m_type; }
104  std::vector<TagMemberInfo> members;
107  std::vector<TagAnchorInfo> docAnchors;
108  int lineNr;
109  private:
111 };
112 
113 /** Container for class specific info that can be read from a tagfile */
115 {
116  public:
121  std::vector<BaseInfo> bases;
125  bool isObjC = false;
126  static TagClassInfo *get(std::unique_ptr<TagCompoundInfo> &t)
127  {
128  return dynamic_cast<TagClassInfo*>(t.get());
129  }
130  static const TagClassInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
131  {
132  return dynamic_cast<const TagClassInfo*>(t.get());
133  }
134 };
135 
136 /** Container for concept specific info that can be read from a tagfile */
138 {
139  public:
142  static TagConceptInfo *get(std::unique_ptr<TagCompoundInfo> &t)
143  {
144  return dynamic_cast<TagConceptInfo*>(t.get());
145  }
146  static const TagConceptInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
147  {
148  return dynamic_cast<const TagConceptInfo*>(t.get());
149  }
150 };
151 
152 /** Container for namespace specific info that can be read from a tagfile */
154 {
155  public:
161  static TagNamespaceInfo *get(std::unique_ptr<TagCompoundInfo> &t)
162  {
163  return dynamic_cast<TagNamespaceInfo*>(t.get());
164  }
165  static const TagNamespaceInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
166  {
167  return dynamic_cast<const TagNamespaceInfo*>(t.get());
168  }
169 };
170 
171 /** Container for package specific info that can be read from a tagfile */
173 {
174  public:
177  static TagPackageInfo *get(std::unique_ptr<TagCompoundInfo> &t)
178  {
179  return dynamic_cast<TagPackageInfo*>(t.get());
180  }
181  static const TagPackageInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
182  {
183  return dynamic_cast<const TagPackageInfo*>(t.get());
184  }
185 };
186 
187 /** Container for file specific info that can be read from a tagfile */
189 {
190  public:
196  std::vector<TagIncludeInfo> includes;
197  static TagFileInfo *get(std::unique_ptr<TagCompoundInfo> &t)
198  {
199  return dynamic_cast<TagFileInfo*>(t.get());
200  }
201  static const TagFileInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
202  {
203  return dynamic_cast<const TagFileInfo*>(t.get());
204  }
205 };
206 
207 /** Container for group specific info that can be read from a tagfile */
209 {
210  public:
220  static TagGroupInfo *get(std::unique_ptr<TagCompoundInfo> &t)
221  {
222  return dynamic_cast<TagGroupInfo*>(t.get());
223  }
224  static const TagGroupInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
225  {
226  return dynamic_cast<const TagGroupInfo*>(t.get());
227  }
228 };
229 
230 /** Container for page specific info that can be read from a tagfile */
232 {
233  public:
236  static TagPageInfo *get(std::unique_ptr<TagCompoundInfo> &t)
237  {
238  return dynamic_cast<TagPageInfo*>(t.get());
239  }
240  static const TagPageInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
241  {
242  return dynamic_cast<const TagPageInfo*>(t.get());
243  }
244 };
245 
246 /** Container for directory specific info that can be read from a tagfile */
248 {
249  public:
254  static TagDirInfo *get(std::unique_ptr<TagCompoundInfo> &t)
255  {
256  return dynamic_cast<TagDirInfo*>(t.get());
257  }
258  static const TagDirInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
259  {
260  return dynamic_cast<const TagDirInfo*>(t.get());
261  }
262 };
263 
264 /** Tag file parser.
265  *
266  * Reads an XML-structured tagfile and builds up the structure in
267  * memory. The method buildLists() is used to transfer/translate
268  * the structures to the doxygen engine.
269  */
271 {
272  public:
273  TagFileParser(const char *tagName) : m_tagName(tagName) {}
274 
275  void setDocumentLocator ( const XMLLocator * locator )
276  {
277  m_locator = locator;
278  }
279 
281  {
282  m_state = Invalid;
283  }
284 
285  void startElement( const QCString &name, const XMLHandlers::Attributes& attrib );
286  void endElement( const QCString &name );
287  void characters ( const QCString & ch ) { m_curString+=ch; }
288  void error( const QCString &fileName,int lineNr,const QCString &msg)
289  {
290  ::warn(fileName,lineNr,"%s",qPrint(msg));
291  }
292 
293  void dump();
294  void buildLists(const std::shared_ptr<Entry> &root);
295  void addIncludes();
296  void startCompound( const XMLHandlers::Attributes& attrib );
297 
298  void endCompound()
299  {
300  switch (m_state)
301  {
302  case InClass:
303  case InConcept:
304  case InFile:
305  case InNamespace:
306  case InGroup:
307  case InPage:
308  case InDir:
309  case InPackage:
310  m_tagFileCompounds.push_back(std::move(m_curCompound));
311  break;
312  default:
313  warn("tag 'compound' was not expected!");
314  break;
315  }
316  }
317 
319  {
321  m_curMember.kind = XMLHandlers::value(attrib,"kind");
322  QCString protStr = XMLHandlers::value(attrib,"protection");
323  QCString virtStr = XMLHandlers::value(attrib,"virtualness");
324  QCString staticStr = XMLHandlers::value(attrib,"static");
326  if (protStr=="protected")
327  {
329  }
330  else if (protStr=="private")
331  {
333  }
334  if (virtStr=="virtual")
335  {
337  }
338  else if (virtStr=="pure")
339  {
341  }
342  if (staticStr=="yes")
343  {
345  }
346  m_stateStack.push(m_state);
347  m_state = InMember;
348  }
349 
350  void endMember()
351  {
352  m_state = m_stateStack.top();
353  m_stateStack.pop();
354  switch(m_state)
355  {
356  case InClass:
357  case InFile:
358  case InNamespace:
359  case InGroup:
360  case InPackage:
361  m_curCompound->members.push_back(m_curMember);
362  break;
363  default:
364  warn("Unexpected tag 'member' found");
365  break;
366  }
367  }
368 
370  {
371  if (m_state==InMember)
372  {
373  m_curString = "";
375  m_curEnumValue.file = XMLHandlers::value(attrib,"file");
376  m_curEnumValue.anchor = XMLHandlers::value(attrib,"anchor");
377  m_curEnumValue.clangid = XMLHandlers::value(attrib,"clangid");
378  m_stateStack.push(m_state);
380  }
381  else
382  {
383  warn("Found 'enumvalue' tag outside of member tag");
384  }
385  }
386 
388  {
390  m_state = m_stateStack.top();
391  m_stateStack.pop();
392  if (m_state==InMember)
393  {
396  }
397  }
398 
400  {
401  // Check whether or not the tag is automatically generate, in that case ignore the tag.
402  switch(m_state)
403  {
404  case InClass:
405  case InConcept:
406  case InFile:
407  case InNamespace:
408  case InGroup:
409  case InPage:
410  case InMember:
411  case InPackage:
412  case InDir:
413  if (m_curString.right(10)=="autotoc_md") return;
414  break;
415  default:
416  warn("Unexpected tag 'docanchor' found");
417  return;
418  }
419  switch(m_state)
420  {
421  case InClass:
422  case InConcept:
423  case InFile:
424  case InNamespace:
425  case InGroup:
426  case InPage:
427  case InPackage:
428  case InDir:
429  m_curCompound->docAnchors.push_back(TagAnchorInfo(m_fileName,m_curString,m_title));
430  break;
431  case InMember:
433  break;
434  default: break; // will not be reached
435  }
436  }
437 
438  void endClass()
439  {
440  switch(m_state)
441  {
442  case InClass:
444  break;
445  case InFile:
447  break;
448  case InNamespace:
450  break;
451  case InGroup:
453  break;
454  case InPackage:
456  break;
457  default:
458  warn("Unexpected tag 'class' found");
459  break;
460  }
461  }
462 
463  void endConcept()
464  {
465  switch(m_state)
466  {
467  case InNamespace:
469  break;
470  case InFile:
472  break;
473  case InGroup:
475  break;
476  default:
477  warn("Unexpected tag 'concept' found");
478  break;
479  }
480  }
481 
483  {
484  switch(m_state)
485  {
486  case InNamespace:
488  break;
489  case InFile:
491  break;
492  case InGroup:
494  break;
495  default:
496  warn("Unexpected tag 'namespace' found");
497  break;
498  }
499  }
500 
501  void endFile()
502  {
503  switch(m_state)
504  {
505  case InGroup:
507  break;
508  case InDir:
510  break;
511  default:
512  warn("Unexpected tag 'file' found");
513  break;
514  }
515  }
516 
517  void endPage()
518  {
519  switch(m_state)
520  {
521  case InGroup:
523  break;
524  default:
525  warn("Unexpected tag 'page' found");
526  break;
527  }
528  }
529 
530  void endDir()
531  {
532  switch(m_state)
533  {
534  case InDir:
536  break;
537  default:
538  warn("Unexpected tag 'dir' found");
539  break;
540  }
541  }
542 
544  {
545  m_curString = "";
546  }
547 
549  {
550  m_fileName = XMLHandlers::value(attrib,"file");
551  m_title = XMLHandlers::value(attrib,"title");
552  m_curString = "";
553  }
554 
555  void endType()
556  {
557  if (m_state==InMember)
558  {
560  }
561  else
562  {
563  warn("Unexpected tag 'type' found");
564  }
565  }
566 
567  void endName()
568  {
569  switch (m_state)
570  {
571  case InClass:
572  case InConcept:
573  case InFile:
574  case InNamespace:
575  case InGroup:
576  case InPage:
577  case InDir:
578  case InPackage:
579  m_curCompound->name = m_curString;
580  break;
581  case InMember:
583  break;
584  default:
585  warn("Unexpected tag 'name' found");
586  break;
587  }
588  }
589 
590  void startBase(const XMLHandlers::Attributes& attrib )
591  {
592  m_curString="";
593  if (m_state==InClass && m_curCompound)
594  {
595  QCString protStr = XMLHandlers::value(attrib,"protection");
596  QCString virtStr = XMLHandlers::value(attrib,"virtualness");
597  Protection prot = Public;
598  Specifier virt = Normal;
599  if (protStr=="protected")
600  {
601  prot = Protected;
602  }
603  else if (protStr=="private")
604  {
605  prot = Private;
606  }
607  if (virtStr=="virtual")
608  {
609  virt = Virtual;
610  }
611  TagClassInfo::get(m_curCompound)->bases.push_back(BaseInfo(m_curString,prot,virt));
612  }
613  else
614  {
615  warn("Unexpected tag 'base' found");
616  }
617  }
618 
619  void endBase()
620  {
621  if (m_state==InClass && m_curCompound)
622  {
624  }
625  else
626  {
627  warn("Unexpected tag 'base' found");
628  }
629  }
630 
632  {
634  m_curIncludes.id = XMLHandlers::value(attrib,"id");
635  m_curIncludes.name = XMLHandlers::value(attrib,"name");
636  m_curIncludes.isLocal = XMLHandlers::value(attrib,"local")=="yes";
637  m_curIncludes.isImported = XMLHandlers::value(attrib,"imported")=="yes";
638  m_curString="";
639  }
640 
641  void endIncludes()
642  {
644  if (m_state==InFile && m_curCompound)
645  {
647  }
648  else
649  {
650  warn("Unexpected tag 'includes' found");
651  }
652  }
653 
655  {
656  if (m_state==InClass && m_curCompound)
657  {
659  }
660  else
661  {
662  warn("Unexpected tag 'templarg' found");
663  }
664  }
665 
666  void endFilename()
667  {
668  switch (m_state)
669  {
670  case InClass:
671  case InConcept:
672  case InNamespace:
673  case InFile:
674  case InGroup:
675  case InPage:
676  case InPackage:
677  case InDir:
678  m_curCompound->filename = m_curString;
679  break;
680  default:
681  warn("Unexpected tag 'filename' found");
682  break;
683  }
684  }
685 
686  void endPath()
687  {
688  switch (m_state)
689  {
690  case InFile:
692  break;
693  case InDir:
695  break;
696  default:
697  warn("Unexpected tag 'path' found");
698  break;
699  }
700  }
701 
702  void endAnchor()
703  {
704  if (m_state==InMember)
705  {
707  }
708  else if (m_state==InClass)
709  {
711  }
712  else
713  {
714  warn("Unexpected tag 'anchor' found");
715  }
716  }
717 
718  void endClangId()
719  {
720  if (m_state==InMember)
721  {
723  }
724  else if (m_state==InClass)
725  {
727  }
728  else if (m_state==InNamespace)
729  {
731  }
732  else
733  {
734  warn("Unexpected tag 'clangid' found");
735  }
736  }
737 
738 
739 
741  {
742  if (m_state==InMember)
743  {
745  }
746  else
747  {
748  warn("Unexpected tag 'anchorfile' found");
749  }
750  }
751 
752  void endArglist()
753  {
754  if (m_state==InMember)
755  {
757  }
758  else
759  {
760  warn("Unexpected tag 'arglist' found");
761  }
762  }
763 
764  void endTitle()
765  {
766  switch (m_state)
767  {
768  case InGroup:
770  break;
771  case InPage:
773  break;
774  default:
775  warn("Unexpected tag 'title' found");
776  break;
777  }
778  }
779 
780  void endSubgroup()
781  {
782  if (m_state==InGroup)
783  {
785  }
786  else
787  {
788  warn("Unexpected tag 'subgroup' found");
789  }
790  }
791 
793  {
794  }
795 
797  {
798  }
799 
800  void buildMemberList(const std::shared_ptr<Entry> &ce,const std::vector<TagMemberInfo> &members);
801  void addDocAnchors(const std::shared_ptr<Entry> &e,const std::vector<TagAnchorInfo> &l);
802 
803 
804  enum State { Invalid,
816  };
817  private:
818 
819  void warn(const char *fmt)
820  {
821  QCString fileName = m_locator->fileName();
822  ::warn(fileName,m_locator->lineNr(),"%s", fmt);
823  }
824 
825  void warn(const char *fmt,const char *s)
826  {
827  QCString fileName = m_locator->fileName();
828  ::warn(fileName,m_locator->lineNr(),fmt,s);
829  }
830 
831 
832  //------------------------------------
833 
834  std::vector< std::unique_ptr<TagCompoundInfo> > m_tagFileCompounds;
835  std::unique_ptr<TagCompoundInfo> m_curCompound;
836 
840 
846  std::stack<State> m_stateStack;
847  const XMLLocator *m_locator = nullptr;
848 };
849 
850 //---------------------------------------------------------------------------------------------------------------
851 
852 struct ElementCallbacks
853 {
854  using StartCallback = std::function<void(TagFileParser&,const XMLHandlers::Attributes&)>;
855  using EndCallback = std::function<void(TagFileParser&)>;
856 
859 };
860 
862 {
863  return [fn](TagFileParser &parser,const XMLHandlers::Attributes &attr) { (parser.*fn)(attr); };
864 }
865 
867 {
868  return [fn](TagFileParser &parser) { (parser.*fn)(); };
869 }
870 
871 static const std::map< std::string, ElementCallbacks > g_elementHandlers =
872 {
873  // name, start element callback, end element callback
898 };
899 
900 //---------------------------------------------------------------------------------------------------------------
901 
903 {
904  using CreateFunc = std::function<std::unique_ptr<TagCompoundInfo>()>;
908 };
909 
910 static const std::map< std::string, CompoundFactory > g_compoundFactory =
911 {
912  // kind tag state creation function
913  { "class", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Class); } } },
914  { "struct", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Struct); } } },
915  { "union", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Union); } } },
916  { "interface", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Interface); } } },
917  { "enum", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Enum); } } },
918  { "exception", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Exception); } } },
919  { "protocol", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Protocol); } } },
920  { "category", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Category); } } },
921  { "service", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Service); } } },
922  { "singleton", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Singleton); } } },
923  { "file", { TagFileParser::InFile, []() { return std::make_unique<TagFileInfo>(); } } },
924  { "namespace", { TagFileParser::InNamespace, []() { return std::make_unique<TagNamespaceInfo>(); } } },
925  { "concept", { TagFileParser::InConcept, []() { return std::make_unique<TagConceptInfo>(); } } },
926  { "group", { TagFileParser::InGroup, []() { return std::make_unique<TagGroupInfo>(); } } },
927  { "page", { TagFileParser::InPage, []() { return std::make_unique<TagPageInfo>(); } } },
928  { "package", { TagFileParser::InPackage, []() { return std::make_unique<TagPackageInfo>(); } } },
929  { "dir", { TagFileParser::InDir, []() { return std::make_unique<TagDirInfo>(); } } }
930 };
931 
932 //---------------------------------------------------------------------------------------------------------------
933 
935 {
936  //printf("startElement '%s'\n",qPrint(name));
937  auto it = g_elementHandlers.find(name.str());
938  if (it!=std::end(g_elementHandlers))
939  {
940  it->second.startCb(*this,attrib);
941  }
942  else
943  {
944  warn("Unknown start tag '%s' found!",qPrint(name));
945  }
946 }
947 
949 {
950  //printf("endElement '%s'\n",qPrint(name));
951  auto it = g_elementHandlers.find(name.str());
952  if (it!=std::end(g_elementHandlers))
953  {
954  it->second.endCb(*this);
955  }
956  else
957  {
958  warn("Unknown end tag '%s' found!",qPrint(name));
959  }
960 }
961 
963 {
964  m_curString = "";
965  std::string kind = XMLHandlers::value(attrib,"kind");
966  std::string isObjC = XMLHandlers::value(attrib,"objc");
967 
968  auto it = g_compoundFactory.find(kind);
969  if (it!=g_compoundFactory.end())
970  {
971  m_curCompound = it->second.make_instance();
972  m_state = it->second.state;
973  m_curCompound->lineNr = m_locator->lineNr();
974  }
975  else
976  {
977  warn("Unknown compound attribute '%s' found!",kind.c_str());
978  m_state = Invalid;
979  }
980 
981  if (isObjC=="yes" && m_curCompound &&
983  {
985  }
986 }
987 
988 /*! Dumps the internal structures. For debugging only! */
990 {
991  msg("Result:\n");
992  //============== CLASSES
993  for (const auto &comp : m_tagFileCompounds)
994  {
995  if (comp->compoundType()==TagCompoundInfo::CompoundType::Class)
996  {
997  const TagClassInfo *cd = TagClassInfo::get(comp);
998  msg("class '%s'\n",qPrint(cd->name));
999  msg(" filename '%s'\n",qPrint(cd->filename));
1000  for (const BaseInfo &bi : cd->bases)
1001  {
1002  msg( " base: %s \n", bi.name.isEmpty() ? "" : qPrint(bi.name) );
1003  }
1004 
1005  for (const auto &md : cd->members)
1006  {
1007  msg(" member:\n");
1008  msg(" kind: '%s'\n",qPrint(md.kind));
1009  msg(" name: '%s'\n",qPrint(md.name));
1010  msg(" anchor: '%s'\n",qPrint(md.anchor));
1011  msg(" arglist: '%s'\n",qPrint(md.arglist));
1012  }
1013  }
1014  }
1015  //============== CONCEPTS
1016  for (const auto &comp : m_tagFileCompounds)
1017  {
1018  if (comp->compoundType()==TagCompoundInfo::CompoundType::Concept)
1019  {
1020  const TagConceptInfo *cd = TagConceptInfo::get(comp);
1021 
1022  msg("concept '%s'\n",qPrint(cd->name));
1023  msg(" filename '%s'\n",qPrint(cd->filename));
1024  }
1025  }
1026  //============== NAMESPACES
1027  for (const auto &comp : m_tagFileCompounds)
1028  {
1029  if (comp->compoundType()==TagCompoundInfo::CompoundType::Namespace)
1030  {
1031  const TagNamespaceInfo *nd = TagNamespaceInfo::get(comp);
1032 
1033  msg("namespace '%s'\n",qPrint(nd->name));
1034  msg(" filename '%s'\n",qPrint(nd->filename));
1035  for (const auto &cls : nd->classList)
1036  {
1037  msg( " class: %s \n", cls.c_str() );
1038  }
1039 
1040  for (const auto &md : nd->members)
1041  {
1042  msg(" member:\n");
1043  msg(" kind: '%s'\n",qPrint(md.kind));
1044  msg(" name: '%s'\n",qPrint(md.name));
1045  msg(" anchor: '%s'\n",qPrint(md.anchor));
1046  msg(" arglist: '%s'\n",qPrint(md.arglist));
1047  }
1048  }
1049  }
1050 
1051  //============== FILES
1052  for (const auto &comp : m_tagFileCompounds)
1053  {
1054  if (comp->compoundType()==TagCompoundInfo::CompoundType::File)
1055  {
1056  const TagFileInfo *fd = TagFileInfo::get(comp);
1057 
1058  msg("file '%s'\n",qPrint(fd->name));
1059  msg(" filename '%s'\n",qPrint(fd->filename));
1060  for (const auto &ns : fd->namespaceList)
1061  {
1062  msg( " namespace: %s \n", ns.c_str() );
1063  }
1064  for (const auto &cs : fd->classList)
1065  {
1066  msg( " class: %s \n", cs.c_str() );
1067  }
1068 
1069  for (const auto &md : fd->members)
1070  {
1071  msg(" member:\n");
1072  msg(" kind: '%s'\n",qPrint(md.kind));
1073  msg(" name: '%s'\n",qPrint(md.name));
1074  msg(" anchor: '%s'\n",qPrint(md.anchor));
1075  msg(" arglist: '%s'\n",qPrint(md.arglist));
1076  }
1077 
1078  for (const auto &ii : fd->includes)
1079  {
1080  msg(" includes id: %s name: %s\n",qPrint(ii.id),qPrint(ii.name));
1081  }
1082  }
1083  }
1084 
1085  //============== GROUPS
1086  for (const auto &comp : m_tagFileCompounds)
1087  {
1088  if (comp->compoundType()==TagCompoundInfo::CompoundType::Group)
1089  {
1090  const TagGroupInfo *gd = TagGroupInfo::get(comp);
1091  msg("group '%s'\n",qPrint(gd->name));
1092  msg(" filename '%s'\n",qPrint(gd->filename));
1093 
1094  for (const auto &ns : gd->namespaceList)
1095  {
1096  msg( " namespace: %s \n", ns.c_str() );
1097  }
1098  for (const auto &cs : gd->classList)
1099  {
1100  msg( " class: %s \n", cs.c_str() );
1101  }
1102  for (const auto &fi : gd->fileList)
1103  {
1104  msg( " file: %s \n", fi.c_str() );
1105  }
1106  for (const auto &sg : gd->subgroupList)
1107  {
1108  msg( " subgroup: %s \n", sg.c_str() );
1109  }
1110  for (const auto &pg : gd->pageList)
1111  {
1112  msg( " page: %s \n", pg.c_str() );
1113  }
1114 
1115  for (const auto &md : gd->members)
1116  {
1117  msg(" member:\n");
1118  msg(" kind: '%s'\n",qPrint(md.kind));
1119  msg(" name: '%s'\n",qPrint(md.name));
1120  msg(" anchor: '%s'\n",qPrint(md.anchor));
1121  msg(" arglist: '%s'\n",qPrint(md.arglist));
1122  }
1123  }
1124  }
1125 
1126  //============== PAGES
1127  for (const auto &comp : m_tagFileCompounds)
1128  {
1129  if (comp->compoundType()==TagCompoundInfo::CompoundType::Page)
1130  {
1131  const TagPageInfo *pd = TagPageInfo::get(comp);
1132  msg("page '%s'\n",qPrint(pd->name));
1133  msg(" title '%s'\n",qPrint(pd->title));
1134  msg(" filename '%s'\n",qPrint(pd->filename));
1135  }
1136  }
1137 
1138  //============== DIRS
1139  for (const auto &comp : m_tagFileCompounds)
1140  {
1141  if (comp->compoundType()==TagCompoundInfo::CompoundType::Dir)
1142  {
1143  const TagDirInfo *dd = TagDirInfo::get(comp);
1144  {
1145  msg("dir '%s'\n",qPrint(dd->name));
1146  msg(" path '%s'\n",qPrint(dd->path));
1147  for (const auto &fi : dd->fileList)
1148  {
1149  msg( " file: %s \n", fi.c_str() );
1150  }
1151  for (const auto &sd : dd->subdirList)
1152  {
1153  msg( " subdir: %s \n", sd.c_str() );
1154  }
1155  }
1156  }
1157  }
1158 }
1159 
1160 void TagFileParser::addDocAnchors(const std::shared_ptr<Entry> &e,const std::vector<TagAnchorInfo> &l)
1161 {
1162  for (const auto &ta : l)
1163  {
1164  if (SectionManager::instance().find(QCString(ta.label))==0)
1165  {
1166  //printf("New sectionInfo file=%s anchor=%s\n",
1167  // qPrint(ta->fileName),qPrint(ta->label));
1169  ta.label,ta.fileName,-1,ta.title,
1171  e->anchors.push_back(si);
1172  }
1173  else
1174  {
1175  warn("Duplicate anchor %s found",qPrint(ta.label));
1176  }
1177  }
1178 }
1179 
1180 void TagFileParser::buildMemberList(const std::shared_ptr<Entry> &ce,const std::vector<TagMemberInfo> &members)
1181 {
1182  for (const auto &tmi : members)
1183  {
1184  std::shared_ptr<Entry> me = std::make_shared<Entry>();
1185  me->type = tmi.type;
1186  me->name = tmi.name;
1187  me->args = tmi.arglist;
1188  if (!me->args.isEmpty())
1189  {
1190  me->argList = *stringToArgumentList(SrcLangExt_Cpp,me->args);
1191  }
1192  if (tmi.enumValues.size()>0)
1193  {
1194  me->spec |= Entry::Strong;
1195  for (const auto &evi : tmi.enumValues)
1196  {
1197  std::shared_ptr<Entry> ev = std::make_shared<Entry>();
1198  ev->type = "@";
1199  ev->name = evi.name;
1200  ev->id = evi.clangid;
1201  ev->section = Entry::VARIABLE_SEC;
1202  ev->tagInfoData.tagName = m_tagName;
1203  ev->tagInfoData.anchor = evi.anchor;
1204  ev->tagInfoData.fileName = evi.file;
1205  ev->hasTagInfo = TRUE;
1206  me->moveToSubEntryAndKeep(ev);
1207  }
1208  }
1209  me->protection = tmi.prot;
1210  me->virt = tmi.virt;
1211  me->stat = tmi.isStatic;
1212  me->fileName = ce->fileName;
1213  me->id = tmi.clangId;
1214  me->startLine = tmi.lineNr;
1215  if (ce->section == Entry::GROUPDOC_SEC)
1216  {
1217  me->groups.push_back(Grouping(ce->name,Grouping::GROUPING_INGROUP));
1218  }
1219  addDocAnchors(me,tmi.docAnchors);
1220  me->tagInfoData.tagName = m_tagName;
1221  me->tagInfoData.anchor = tmi.anchor;
1222  me->tagInfoData.fileName = tmi.anchorFile;
1223  me->hasTagInfo = TRUE;
1224  if (tmi.kind=="define")
1225  {
1226  me->type="#define";
1227  me->section = Entry::DEFINE_SEC;
1228  }
1229  else if (tmi.kind=="enumvalue")
1230  {
1231  me->section = Entry::VARIABLE_SEC;
1232  me->mtype = Method;
1233  }
1234  else if (tmi.kind=="property")
1235  {
1236  me->section = Entry::VARIABLE_SEC;
1237  me->mtype = Property;
1238  }
1239  else if (tmi.kind=="event")
1240  {
1241  me->section = Entry::VARIABLE_SEC;
1242  me->mtype = Event;
1243  }
1244  else if (tmi.kind=="variable")
1245  {
1246  me->section = Entry::VARIABLE_SEC;
1247  me->mtype = Method;
1248  }
1249  else if (tmi.kind=="typedef")
1250  {
1251  me->section = Entry::VARIABLE_SEC; //Entry::TYPEDEF_SEC;
1252  me->type.prepend("typedef ");
1253  me->mtype = Method;
1254  }
1255  else if (tmi.kind=="enumeration")
1256  {
1257  me->section = Entry::ENUM_SEC;
1258  me->mtype = Method;
1259  }
1260  else if (tmi.kind=="function")
1261  {
1262  me->section = Entry::FUNCTION_SEC;
1263  me->mtype = Method;
1264  }
1265  else if (tmi.kind=="signal")
1266  {
1267  me->section = Entry::FUNCTION_SEC;
1268  me->mtype = Signal;
1269  }
1270  else if (tmi.kind=="prototype")
1271  {
1272  me->section = Entry::FUNCTION_SEC;
1273  me->mtype = Method;
1274  }
1275  else if (tmi.kind=="friend")
1276  {
1277  me->section = Entry::FUNCTION_SEC;
1278  me->type.prepend("friend ");
1279  me->mtype = Method;
1280  }
1281  else if (tmi.kind=="dcop")
1282  {
1283  me->section = Entry::FUNCTION_SEC;
1284  me->mtype = DCOP;
1285  }
1286  else if (tmi.kind=="slot")
1287  {
1288  me->section = Entry::FUNCTION_SEC;
1289  me->mtype = Slot;
1290  }
1291  ce->moveToSubEntryAndKeep(me);
1292  }
1293 }
1294 
1295 /*! Injects the info gathered by the XML parser into the Entry tree.
1296  * This tree contains the information extracted from the input in a
1297  * "unrelated" form.
1298  */
1299 void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
1300 {
1301  // build class list
1302  for (const auto &comp : m_tagFileCompounds)
1303  {
1304  if (comp->compoundType()==TagCompoundInfo::CompoundType::Class)
1305  {
1306  const TagClassInfo *tci = TagClassInfo::get(comp);
1307  std::shared_ptr<Entry> ce = std::make_shared<Entry>();
1308  ce->section = Entry::CLASS_SEC;
1309  switch (tci->kind)
1310  {
1311  case TagClassInfo::Kind::Class: break;
1312  case TagClassInfo::Kind::Struct: ce->spec = Entry::Struct; break;
1313  case TagClassInfo::Kind::Union: ce->spec = Entry::Union; break;
1314  case TagClassInfo::Kind::Interface: ce->spec = Entry::Interface; break;
1315  case TagClassInfo::Kind::Enum: ce->spec = Entry::Enum; break;
1316  case TagClassInfo::Kind::Exception: ce->spec = Entry::Exception; break;
1317  case TagClassInfo::Kind::Protocol: ce->spec = Entry::Protocol; break;
1318  case TagClassInfo::Kind::Category: ce->spec = Entry::Category; break;
1319  case TagClassInfo::Kind::Service: ce->spec = Entry::Service; break;
1320  case TagClassInfo::Kind::Singleton: ce->spec = Entry::Singleton; break;
1321  case TagClassInfo::Kind::None: // should never happen, means not properly initialized
1322  assert(tci->kind != TagClassInfo::Kind::None);
1323  break;
1324  }
1325  ce->name = tci->name;
1327  {
1328  ce->name+="-p";
1329  }
1330  addDocAnchors(ce,tci->docAnchors);
1331  ce->tagInfoData.tagName = m_tagName;
1332  ce->tagInfoData.anchor = tci->anchor;
1333  ce->tagInfoData.fileName = tci->filename;
1334  ce->startLine = tci->lineNr;
1335  ce->hasTagInfo = TRUE;
1336  ce->id = tci->clangId;
1337  ce->lang = tci->isObjC ? SrcLangExt_ObjC : SrcLangExt_Unknown;
1338  // transfer base class list
1339  ce->extends = tci->bases;
1340  if (!tci->templateArguments.empty())
1341  {
1342  ArgumentList al;
1343  for (const auto &argName : tci->templateArguments)
1344  {
1345  Argument a;
1346  a.type = "class";
1347  a.name = argName.c_str();
1348  al.push_back(a);
1349  }
1350  ce->tArgLists.push_back(al);
1351  }
1352 
1353  buildMemberList(ce,tci->members);
1354  root->moveToSubEntryAndKeep(ce);
1355  }
1356  }
1357 
1358  // build file list
1359  for (const auto &comp : m_tagFileCompounds)
1360  {
1361  if (comp->compoundType()==TagCompoundInfo::CompoundType::File)
1362  {
1363  const TagFileInfo *tfi = TagFileInfo::get(comp);
1364 
1365  std::shared_ptr<Entry> fe = std::make_shared<Entry>();
1366  fe->section = guessSection(tfi->name);
1367  fe->name = tfi->name;
1368  addDocAnchors(fe,tfi->docAnchors);
1369  fe->tagInfoData.tagName = m_tagName;
1370  fe->tagInfoData.fileName = tfi->filename;
1371  fe->hasTagInfo = TRUE;
1372 
1373  QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
1374  fe->fileName = fullName;
1375  fe->startLine = tfi->lineNr;
1376  //printf("createFileDef() filename=%s\n",qPrint(tfi->filename));
1377  QCString tagid = m_tagName+":"+tfi->path;
1378  std::unique_ptr<FileDef> fd { createFileDef(tagid,
1379  tfi->name,m_tagName,
1380  tfi->filename) };
1381  FileName *mn;
1382  if ((mn=Doxygen::inputNameLinkedMap->find(tfi->name)))
1383  {
1384  mn->push_back(std::move(fd));
1385  }
1386  else
1387  {
1388  mn = Doxygen::inputNameLinkedMap->add(tfi->name,fullName);
1389  mn->push_back(std::move(fd));
1390  }
1391  buildMemberList(fe,tfi->members);
1392  root->moveToSubEntryAndKeep(fe);
1393  }
1394  }
1395 
1396  // build concept list
1397  for (const auto &comp : m_tagFileCompounds)
1398  {
1399  if (comp->compoundType()==TagCompoundInfo::CompoundType::Concept)
1400  {
1401  const TagConceptInfo *tci = TagConceptInfo::get(comp);
1402 
1403  std::shared_ptr<Entry> ce = std::make_shared<Entry>();
1404  ce->section = Entry::CONCEPT_SEC;
1405  ce->name = tci->name;
1406  addDocAnchors(ce,tci->docAnchors);
1407  ce->tagInfoData.tagName = m_tagName;
1408  ce->tagInfoData.fileName = tci->filename;
1409  ce->startLine = tci->lineNr;
1410  ce->hasTagInfo = TRUE;
1411  ce->id = tci->clangId;
1412 
1413  root->moveToSubEntryAndKeep(ce);
1414  }
1415  }
1416 
1417  // build namespace list
1418  for (const auto &comp : m_tagFileCompounds)
1419  {
1420  if (comp->compoundType()==TagCompoundInfo::CompoundType::Namespace)
1421  {
1422  const TagNamespaceInfo *tni = TagNamespaceInfo::get(comp);
1423 
1424  std::shared_ptr<Entry> ne = std::make_shared<Entry>();
1425  ne->section = Entry::NAMESPACE_SEC;
1426  ne->name = tni->name;
1427  addDocAnchors(ne,tni->docAnchors);
1428  ne->tagInfoData.tagName = m_tagName;
1429  ne->tagInfoData.fileName = tni->filename;
1430  ne->startLine = tni->lineNr;
1431  ne->hasTagInfo = TRUE;
1432  ne->id = tni->clangId;
1433 
1434  buildMemberList(ne,tni->members);
1435  root->moveToSubEntryAndKeep(ne);
1436  }
1437  }
1438 
1439  // build package list
1440  for (const auto &comp : m_tagFileCompounds)
1441  {
1442  if (comp->compoundType()==TagCompoundInfo::CompoundType::Package)
1443  {
1444  const TagPackageInfo *tpgi = TagPackageInfo::get(comp);
1445 
1446  std::shared_ptr<Entry> pe = std::make_shared<Entry>();
1447  pe->section = Entry::PACKAGE_SEC;
1448  pe->name = tpgi->name;
1449  addDocAnchors(pe,tpgi->docAnchors);
1450  pe->tagInfoData.tagName = m_tagName;
1451  pe->tagInfoData.fileName = tpgi->filename;
1452  pe->startLine = tpgi->lineNr;
1453  pe->hasTagInfo = TRUE;
1454 
1455  buildMemberList(pe,tpgi->members);
1456  root->moveToSubEntryAndKeep(pe);
1457  }
1458  }
1459 
1460  // build group list
1461  for (const auto &comp : m_tagFileCompounds)
1462  {
1463  if (comp->compoundType()==TagCompoundInfo::CompoundType::Group)
1464  {
1465  const TagGroupInfo *tgi = TagGroupInfo::get(comp);
1466 
1467  std::shared_ptr<Entry> ge = std::make_shared<Entry>();
1468  ge->section = Entry::GROUPDOC_SEC;
1469  ge->name = tgi->name;
1470  ge->type = tgi->title;
1471  addDocAnchors(ge,tgi->docAnchors);
1472  ge->tagInfoData.tagName = m_tagName;
1473  ge->tagInfoData.fileName = tgi->filename;
1474  ge->startLine = tgi->lineNr;
1475  ge->hasTagInfo = TRUE;
1476 
1477  buildMemberList(ge,tgi->members);
1478  root->moveToSubEntryAndKeep(ge);
1479  }
1480  }
1481 
1482  for (const auto &comp : m_tagFileCompounds)
1483  {
1484  if (comp->compoundType()==TagCompoundInfo::CompoundType::Group)
1485  {
1486  const TagGroupInfo *tgi = TagGroupInfo::get(comp);
1487  // set subgroup relations bug_774118
1488 
1489  for (const auto &sg : tgi->subgroupList)
1490  {
1491  const auto &children = root->children();
1492  auto i = std::find_if(children.begin(),children.end(),
1493  [&](const std::shared_ptr<Entry> &e) { return e->name == sg.c_str(); });
1494  if (i!=children.end())
1495  {
1496  (*i)->groups.push_back(Grouping(tgi->name,Grouping::GROUPING_INGROUP));
1497  }
1498  }
1499  }
1500  }
1501 
1502  // build page list
1503  for (const auto &comp : m_tagFileCompounds)
1504  {
1505  if (comp->compoundType()==TagCompoundInfo::CompoundType::Page)
1506  {
1507  const TagPageInfo *tpi = TagPageInfo::get(comp);
1508 
1509  std::shared_ptr<Entry> pe = std::make_shared<Entry>();
1510  bool isIndex = (stripExtensionGeneral(tpi->filename,getFileNameExtension(tpi->filename))=="index");
1511  pe->section = isIndex ? Entry::MAINPAGEDOC_SEC : Entry::PAGEDOC_SEC;
1512  pe->name = tpi->name;
1513  pe->args = tpi->title;
1514  addDocAnchors(pe,tpi->docAnchors);
1515  pe->tagInfoData.tagName = m_tagName;
1516  pe->tagInfoData.fileName = tpi->filename;
1517  pe->startLine = tpi->lineNr;
1518  pe->hasTagInfo = TRUE;
1519  root->moveToSubEntryAndKeep(pe);
1520  }
1521  }
1522 }
1523 
1525 {
1526  for (const auto &comp : m_tagFileCompounds)
1527  {
1528  if (comp->compoundType()==TagCompoundInfo::CompoundType::File)
1529  {
1530  const TagFileInfo *tfi = TagFileInfo::get(comp);
1531  //printf("tag file tagName=%s path=%s name=%s\n",qPrint(m_tagName),qPrint(tfi->path),qPrint(tfi->name));
1533  if (fn)
1534  {
1535  for (const auto &fd : *fn)
1536  {
1537  //printf("input file path=%s name=%s\n",qPrint(fd->getPath()),qPrint(fd->name()));
1538  if (fd->getPath()==QCString(m_tagName+":"+tfi->path))
1539  {
1540  //printf("found\n");
1541  for (const auto &ii : tfi->includes)
1542  {
1543  //printf("ii->name='%s'\n",qPrint(ii->name));
1544  FileName *ifn = Doxygen::inputNameLinkedMap->find(ii.name);
1545  ASSERT(ifn!=0);
1546  if (ifn)
1547  {
1548  for (const auto &ifd : *ifn)
1549  {
1550  //printf("ifd->getOutputFileBase()=%s ii->id=%s\n",
1551  // qPrint(ifd->getOutputFileBase()),qPrint(ii->id));
1552  if (ifd->getOutputFileBase()==QCString(ii.id))
1553  {
1554  fd->addIncludeDependency(ifd.get(),ii.text,ii.isLocal,ii.isImported);
1555  }
1556  }
1557  }
1558  }
1559  }
1560  }
1561  }
1562  }
1563  }
1564 }
1565 
1566 void parseTagFile(const std::shared_ptr<Entry> &root,const char *fullName)
1567 {
1568  TagFileParser tagFileParser(fullName);
1569  QCString inputStr = fileToString(fullName);
1570  XMLHandlers handlers;
1571  // connect the generic events handlers of the XML parser to the specific handlers of the tagFileParser object
1572  handlers.startDocument = [&tagFileParser]() { tagFileParser.startDocument(); };
1573  handlers.startElement = [&tagFileParser](const std::string &name,const XMLHandlers::Attributes &attrs) { tagFileParser.startElement(QCString(name),attrs); };
1574  handlers.endElement = [&tagFileParser](const std::string &name) { tagFileParser.endElement(QCString(name)); };
1575  handlers.characters = [&tagFileParser](const std::string &chars) { tagFileParser.characters(QCString(chars)); };
1576  handlers.error = [&tagFileParser](const std::string &fileName,int lineNr,const std::string &msg) { tagFileParser.error(QCString(fileName),lineNr,QCString(msg)); };
1577  XMLParser parser(handlers);
1578  tagFileParser.setDocumentLocator(&parser);
1579  parser.parse(fullName,inputStr.data(),Debug::isFlagSet(Debug::Lex));
1580  tagFileParser.buildLists(root);
1581  tagFileParser.addIncludes();
1582  //tagFileParser.dump();
1583 }
TagFileParser::InEnumValue
@ InEnumValue
Definition: tagreader.cpp:812
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
TagFileParser::startElement
void startElement(const QCString &name, const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:934
ElementCallbacks::endCb
EndCallback endCb
Definition: layout.cpp:720
TagClassInfo::Kind::Protocol
@ Protocol
TagClassInfo::classList
StringVector classList
Definition: tagreader.cpp:123
TagPageInfo::get
static TagPageInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:236
SrcLangExt_Unknown
@ SrcLangExt_Unknown
Definition: types.h:43
TagNamespaceInfo
Container for namespace specific info that can be read from a tagfile
Definition: tagreader.cpp:153
TagGroupInfo::get
static TagGroupInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:220
CompoundFactory::make_instance
CreateFunc make_instance
Definition: tagreader.cpp:907
TagPageInfo::TagPageInfo
TagPageInfo()
Definition: tagreader.cpp:234
TagClassInfo::Kind::Union
@ Union
TagFileParser::endDocAnchor
void endDocAnchor()
Definition: tagreader.cpp:399
XMLParser
Definition: xml.h:64
XMLHandlers::startElement
std::function< StartElementType > startElement
handler invoked when an opening tag has been found
Definition: xml.h:52
TagClassInfo::TagClassInfo
TagClassInfo(Kind k)
Definition: tagreader.cpp:118
TagCompoundInfo
Base class for all compound types
Definition: tagreader.cpp:97
TagClassInfo::get
static TagClassInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:126
TagCompoundInfo::docAnchors
std::vector< TagAnchorInfo > docAnchors
Definition: tagreader.cpp:107
ArgumentList::push_back
void push_back(const Argument &a)
Definition: arguments.h:95
Normal
@ Normal
Definition: types.h:29
TagFileParser
Tag file parser.
Definition: tagreader.cpp:270
startCb
ElementCallbacks::StartCallback startCb(void(TagFileParser::*fn)(const XMLHandlers::Attributes &))
Definition: tagreader.cpp:861
TagDirInfo
Container for directory specific info that can be read from a tagfile
Definition: tagreader.cpp:247
Protection
Protection
Protection level of members
Definition: types.h:26
FileName
Class representing all files with a certain base name
Definition: filename.h:28
stripExtensionGeneral
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
Definition: util.cpp:5285
XMLHandlers::Attributes
std::unordered_map< std::string, std::string > Attributes
Definition: xml.h:42
TagNamespaceInfo::clangId
QCString clangId
Definition: tagreader.cpp:157
TagFileParser::endElement
void endElement(const QCString &name)
Definition: tagreader.cpp:948
TagFileParser::Invalid
@ Invalid
Definition: tagreader.cpp:804
TagCompoundInfo::CompoundType::Class
@ Class
TagFileParser::InFile
@ InFile
Definition: tagreader.cpp:807
TagFileParser::endIncludes
void endIncludes()
Definition: tagreader.cpp:641
TagNamespaceInfo::get
static TagNamespaceInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:161
TagClassInfo::templateArguments
StringVector templateArguments
Definition: tagreader.cpp:122
TagFileParser::error
void error(const QCString &fileName, int lineNr, const QCString &msg)
Definition: tagreader.cpp:288
Dir
Class representing a directory in the file system
Definition: dir.h:68
TagFileParser::endPage
void endPage()
Definition: tagreader.cpp:517
Private
@ Private
Definition: types.h:26
ContextTreeType::File
@ File
TagGroupInfo::classList
StringVector classList
Definition: tagreader.cpp:214
TagFileParser::buildMemberList
void buildMemberList(const std::shared_ptr< Entry > &ce, const std::vector< TagMemberInfo > &members)
Definition: tagreader.cpp:1180
XMLLocator::fileName
virtual std::string fileName() const =0
ArgumentList
This class represents an function or template argument list.
Definition: arguments.h:59
TagClassInfo::bases
std::vector< BaseInfo > bases
Definition: tagreader.cpp:121
CodeSymbolType::Property
@ Property
TagMemberInfo::anchorFile
QCString anchorFile
Definition: tagreader.cpp:83
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
TagFileInfo::namespaceList
StringVector namespaceList
Definition: tagreader.cpp:195
TagNamespaceInfo::TagNamespaceInfo
TagNamespaceInfo()
Definition: tagreader.cpp:156
section.h
TagEnumValueInfo::clangid
QCString clangid
Definition: tagreader.cpp:63
TagAnchorInfo::label
QCString label
Definition: tagreader.cpp:67
TagDirInfo::fileList
StringVector fileList
Definition: tagreader.cpp:253
TagPackageInfo::get
static TagPackageInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:177
Entry::ENUM_SEC
@ ENUM_SEC
Definition: entry.h:93
TagFileParser::m_tagName
QCString m_tagName
Definition: tagreader.cpp:842
TagConceptInfo::get
static TagConceptInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:142
TagFileParser::InTempArgList
@ InTempArgList
Definition: tagreader.cpp:815
CodeSymbolType::Slot
@ Slot
LinkedMap::add
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
Definition: linkedmap.h:103
ContextTreeType::Concept
@ Concept
TagFileParser::endClangId
void endClangId()
Definition: tagreader.cpp:718
TagIncludeInfo::isImported
bool isImported
Definition: tagreader.cpp:74
TagFileParser::startDocument
void startDocument()
Definition: tagreader.cpp:280
Entry::CONCEPT_SEC
@ CONCEPT_SEC
Definition: entry.h:69
TagConceptInfo::clangId
QCString clangId
Definition: tagreader.cpp:141
Grouping
Grouping info
Definition: types.h:64
TagFileParser::InPackage
@ InPackage
Definition: tagreader.cpp:813
TagMemberInfo::isStatic
bool isStatic
Definition: tagreader.cpp:91
Debug::Lex
@ Lex
Definition: debug.h:39
Entry::DEFINE_SEC
@ DEFINE_SEC
Definition: entry.h:106
g_elementHandlers
static const std::map< std::string, ElementCallbacks > g_elementHandlers
Definition: tagreader.cpp:871
Virtual
@ Virtual
Definition: types.h:29
QCString::str
std::string str() const
Definition: qcstring.h:442
TagFileParser::InNamespace
@ InNamespace
Definition: tagreader.cpp:808
Specifier
Specifier
Virtualness of a member.
Definition: types.h:29
TagCompoundInfo::CompoundType::Page
@ Page
TagEnumValueInfo::anchor
QCString anchor
Definition: tagreader.cpp:62
TagFileParser::startMember
void startMember(const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:318
TagCompoundInfo::filename
QCString filename
Definition: tagreader.cpp:106
TagFileParser::m_locator
const XMLLocator * m_locator
Definition: tagreader.cpp:847
TagFileParser::endName
void endName()
Definition: tagreader.cpp:567
CompoundFactory::CompoundFactory
CompoundFactory(TagFileParser::State s, CreateFunc f)
Definition: tagreader.cpp:905
Public
@ Public
Definition: types.h:26
Entry::MAINPAGEDOC_SEC
@ MAINPAGEDOC_SEC
Definition: entry.h:109
TagClassInfo::anchor
QCString anchor
Definition: tagreader.cpp:120
Package
@ Package
Definition: types.h:26
TagEnumValueInfo::name
QCString name
Definition: tagreader.cpp:60
TagFileParser::startCompound
void startCompound(const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:962
TagDirInfo::TagDirInfo
TagDirInfo()
Definition: tagreader.cpp:250
TagFileParser::endNamespace
void endNamespace()
Definition: tagreader.cpp:482
TagFileParser::m_curEnumValue
TagEnumValueInfo m_curEnumValue
Definition: tagreader.cpp:838
TagClassInfo::Kind::Class
@ Class
TagFileParser::endMember
void endMember()
Definition: tagreader.cpp:350
TagFileParser::m_curMember
TagMemberInfo m_curMember
Definition: tagreader.cpp:837
filename.h
ElementCallbacks::EndCallback
std::function< void(LayoutParser &)> EndCallback
Definition: layout.cpp:717
TagConceptInfo
Container for concept specific info that can be read from a tagfile
Definition: tagreader.cpp:137
TagMemberInfo::type
QCString type
Definition: tagreader.cpp:81
TagCompoundInfo::CompoundType::File
@ File
xml.h
TagClassInfo::get
static const TagClassInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:130
TagConceptInfo::get
static const TagConceptInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:146
TagFileParser::startIncludes
void startIncludes(const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:631
TagFileParser::endSubgroup
void endSubgroup()
Definition: tagreader.cpp:780
TagEnumValueInfo::file
QCString file
Definition: tagreader.cpp:61
TagIncludeInfo::isLocal
bool isLocal
Definition: tagreader.cpp:73
TagMemberInfo::anchor
QCString anchor
Definition: tagreader.cpp:84
TagGroupInfo::namespaceList
StringVector namespaceList
Definition: tagreader.cpp:216
TagCompoundInfo::~TagCompoundInfo
virtual ~TagCompoundInfo()
Definition: tagreader.cpp:102
Debug::isFlagSet
static bool isFlagSet(DebugMask mask)
Definition: debug.cpp:99
TagCompoundInfo::CompoundType::Group
@ Group
TagClassInfo
Container for class specific info that can be read from a tagfile
Definition: tagreader.cpp:114
CodeSymbolType::Event
@ Event
TagFileParser::m_curIncludes
TagIncludeInfo m_curIncludes
Definition: tagreader.cpp:839
TagGroupInfo::dirList
StringVector dirList
Definition: tagreader.cpp:219
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
CodeSymbolType::DCOP
@ DCOP
TagIncludeInfo::text
QCString text
Definition: tagreader.cpp:72
Doxygen::inputNameLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
Definition: doxygen.h:88
TagFileParser::endIgnoreElement
void endIgnoreElement()
Definition: tagreader.cpp:796
XMLLocator::lineNr
virtual int lineNr() const =0
TagFileParser::TagFileParser
TagFileParser(const char *tagName)
Definition: tagreader.cpp:273
BaseInfo::name
QCString name
the name of the base class
Definition: entry.h:40
Argument::type
QCString type
Definition: arguments.h:50
Entry::NAMESPACE_SEC
@ NAMESPACE_SEC
Definition: entry.h:68
Entry::Union
static const uint64 Union
Definition: entry.h:128
TagFileInfo::TagFileInfo
TagFileInfo()
Definition: tagreader.cpp:191
TagFileParser::endAnchorFile
void endAnchorFile()
Definition: tagreader.cpp:740
XMLHandlers::error
std::function< ErrorType > error
handler invoked when the parser encounters an error
Definition: xml.h:55
TagMemberInfo::clangId
QCString clangId
Definition: tagreader.cpp:87
TagMemberInfo::prot
Protection prot
Definition: tagreader.cpp:89
Entry::Struct
static const uint64 Struct
Definition: entry.h:127
SrcLangExt_ObjC
@ SrcLangExt_ObjC
Definition: types.h:49
Entry::Interface
static const uint64 Interface
Definition: entry.h:126
TagFileParser::startDocAnchor
void startDocAnchor(const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:548
XMLHandlers::endElement
std::function< EndElementType > endElement
handler invoked when a closing tag has been found
Definition: xml.h:53
TagClassInfo::Kind::Singleton
@ Singleton
TagFileParser::startIgnoreElement
void startIgnoreElement(const XMLHandlers::Attributes &)
Definition: tagreader.cpp:792
entry.h
XMLLocator
Definition: xml.h:55
XMLParser::parse
void parse(const char *fileName, const char *inputString, bool debugEnabled)
TagCompoundInfo::compoundType
CompoundType compoundType() const
Definition: tagreader.cpp:103
tagreader.h
TagFileParser::endFilename
void endFilename()
Definition: tagreader.cpp:666
Method
@ Method
Definition: types.h:32
createFileDef
FileDef * createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition: filedef.cpp:190
TagGroupInfo
Container for group specific info that can be read from a tagfile
Definition: tagreader.cpp:208
TagNamespaceInfo::namespaceList
StringVector namespaceList
Definition: tagreader.cpp:160
TagMemberInfo::lineNr
int lineNr
Definition: tagreader.cpp:93
QCString::stripWhiteSpace
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition: qcstring.h:243
TagFileParser::m_fileName
QCString m_fileName
Definition: tagreader.cpp:843
TagFileParser::m_curString
QCString m_curString
Definition: tagreader.cpp:841
TagCompoundInfo::CompoundType::Concept
@ Concept
TagClassInfo::kind
Kind kind
Definition: tagreader.cpp:124
message.h
CompoundFactory::CreateFunc
std::function< std::unique_ptr< TagCompoundInfo >()> CreateFunc
Definition: tagreader.cpp:904
TagFileParser::endFile
void endFile()
Definition: tagreader.cpp:501
Entry::CLASS_SEC
@ CLASS_SEC
Definition: entry.h:67
TagIncludeInfo::name
QCString name
Definition: tagreader.cpp:71
TagClassInfo::Kind
Kind
Definition: tagreader.cpp:117
TagNamespaceInfo::classList
StringVector classList
Definition: tagreader.cpp:158
TagFileParser::setDocumentLocator
void setDocumentLocator(const XMLLocator *locator)
Definition: tagreader.cpp:275
TagFileParser::InDir
@ InDir
Definition: tagreader.cpp:814
arguments.h
TagFileParser::addDocAnchors
void addDocAnchors(const std::shared_ptr< Entry > &e, const std::vector< TagAnchorInfo > &l)
Definition: tagreader.cpp:1160
TagClassInfo::Kind::Enum
@ Enum
TagFileParser::startStringValue
void startStringValue(const XMLHandlers::Attributes &)
Definition: tagreader.cpp:543
TagMemberInfo::kind
QCString kind
Definition: tagreader.cpp:86
SrcLangExt_Cpp
@ SrcLangExt_Cpp
Definition: types.h:50
doxygen.h
TagFileParser::endEnumValue
void endEnumValue()
Definition: tagreader.cpp:387
TagClassInfo::Kind::Service
@ Service
TagIncludeInfo::id
QCString id
Definition: tagreader.cpp:70
ContextTreeType::Page
@ Page
Argument
This class contains the information about the argument of a function or template
Definition: arguments.h:26
TagCompoundInfo::name
QCString name
Definition: tagreader.cpp:105
TagFileParser::warn
void warn(const char *fmt, const char *s)
Definition: tagreader.cpp:825
TagFileParser::InConcept
@ InConcept
Definition: tagreader.cpp:806
stripPath
QCString stripPath(const QCString &s)
Definition: util.cpp:5318
XMLHandlers::characters
std::function< CharsType > characters
handler invoked when content between tags has been found
Definition: xml.h:54
TagMemberInfo::virt
Specifier virt
Definition: tagreader.cpp:90
ElementCallbacks
Definition: layout.cpp:714
defargs.h
fileToString
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition: util.cpp:1394
TagFileParser::InGroup
@ InGroup
Definition: tagreader.cpp:809
TRUE
#define TRUE
Definition: qcstring.h:36
Entry::FUNCTION_SEC
@ FUNCTION_SEC
Definition: entry.h:97
TagDirInfo::get
static const TagDirInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:258
TagFileParser::endClass
void endClass()
Definition: tagreader.cpp:438
TagMemberInfo::enumValues
std::vector< TagEnumValueInfo > enumValues
Definition: tagreader.cpp:92
filedef.h
TagPackageInfo::classList
StringVector classList
Definition: tagreader.cpp:176
Entry::Service
static const uint64 Service
Definition: entry.h:135
TagFileParser::endTemplateArg
void endTemplateArg()
Definition: tagreader.cpp:654
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
TagFileParser::endArglist
void endArglist()
Definition: tagreader.cpp:752
Entry::Protocol
static const uint64 Protocol
Definition: entry.h:130
ElementCallbacks::startCb
StartCallback startCb
Definition: layout.cpp:719
g_compoundFactory
static const std::map< std::string, CompoundFactory > g_compoundFactory
Definition: tagreader.cpp:910
TagCompoundInfo::m_type
CompoundType m_type
Definition: tagreader.cpp:110
TagClassInfo::Kind::Category
@ Category
TagFileParser::characters
void characters(const QCString &ch)
Definition: tagreader.cpp:287
TagIncludeInfo
Container for include info that can be read from a tagfile
Definition: tagreader.cpp:67
TagFileInfo::get
static TagFileInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:197
TagDirInfo::subdirList
StringVector subdirList
Definition: tagreader.cpp:252
SectionManager::add
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
Definition: section.h:135
TagFileParser::m_title
QCString m_title
Definition: tagreader.cpp:844
TagFileParser::endDir
void endDir()
Definition: tagreader.cpp:530
Entry::GROUPDOC_SEC
@ GROUPDOC_SEC
Definition: entry.h:107
TagAnchorInfo::fileName
QCString fileName
Definition: tagreader.cpp:68
TagMemberInfo::docAnchors
std::vector< TagAnchorInfo > docAnchors
Definition: tagreader.cpp:88
TagFileInfo
Container for file specific info that can be read from a tagfile
Definition: tagreader.cpp:188
TagFileParser::endAnchor
void endAnchor()
Definition: tagreader.cpp:702
TagCompoundInfo::CompoundType::Package
@ Package
TagConceptInfo::TagConceptInfo
TagConceptInfo()
Definition: tagreader.cpp:140
TagPackageInfo::get
static const TagPackageInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:181
TagCompoundInfo::CompoundType::Dir
@ Dir
TagFileParser::endTitle
void endTitle()
Definition: tagreader.cpp:764
Entry::Exception
static const uint64 Exception
Definition: entry.h:129
parseTagFile
void parseTagFile(const std::shared_ptr< Entry > &root, const char *fullName)
Definition: tagreader.cpp:1566
containers.h
SectionType::Anchor
@ Anchor
TagFileParser::m_state
State m_state
Definition: tagreader.cpp:845
Protected
@ Protected
Definition: types.h:26
TagAnchorInfo
Information about an linkable anchor
Definition: tagreader.cpp:44
TagAnchorInfo::TagAnchorInfo
TagAnchorInfo(const QCString &f, const QCString &l, const QCString &t=QCString())
Definition: tagreader.cpp:63
TagPackageInfo::TagPackageInfo
TagPackageInfo()
Definition: tagreader.cpp:175
TagDirInfo::get
static TagDirInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:254
TagClassInfo::Kind::Exception
@ Exception
TagPackageInfo
Container for package specific info that can be read from a tagfile
Definition: tagreader.cpp:172
TagFileParser::buildLists
void buildLists(const std::shared_ptr< Entry > &root)
Definition: tagreader.cpp:1299
TagPageInfo::title
QCString title
Definition: tagreader.cpp:235
XMLHandlers
Event handlers that can installed by the client and called while parsing a XML document.
Definition: xml.h:26
Entry::Strong
static const uint64 Strong
Definition: entry.h:169
TagFileParser::addIncludes
void addIncludes()
Definition: tagreader.cpp:1524
TagGroupInfo::conceptList
StringVector conceptList
Definition: tagreader.cpp:215
TagPageInfo::get
static const TagPageInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:240
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
Entry::PAGEDOC_SEC
@ PAGEDOC_SEC
Definition: entry.h:95
TagCompoundInfo::CompoundType
CompoundType
Definition: tagreader.cpp:100
msg
void msg(const char *fmt,...)
Definition: message.cpp:53
TagFileInfo::classList
StringVector classList
Definition: tagreader.cpp:193
TagFileParser::startEnumValue
void startEnumValue(const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:369
Grouping::GROUPING_INGROUP
@ GROUPING_INGROUP
membership in group was defined by @ingroup
Definition: types.h:74
TagGroupInfo::fileList
StringVector fileList
Definition: tagreader.cpp:217
TagMemberInfo::name
QCString name
Definition: tagreader.cpp:82
TagFileParser::endType
void endType()
Definition: tagreader.cpp:555
Entry::Category
static const uint64 Category
Definition: entry.h:131
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
TagFileParser::m_stateStack
std::stack< State > m_stateStack
Definition: tagreader.cpp:846
TagNamespaceInfo::conceptList
StringVector conceptList
Definition: tagreader.cpp:159
TagCompoundInfo::lineNr
int lineNr
Definition: tagreader.cpp:108
TagDirInfo::path
QCString path
Definition: tagreader.cpp:251
TagFileParser::m_curCompound
std::unique_ptr< TagCompoundInfo > m_curCompound
Definition: tagreader.cpp:835
TagCompoundInfo::TagCompoundInfo
TagCompoundInfo(CompoundType type)
Definition: tagreader.cpp:101
SectionInfo
class that provide information about a section.
Definition: section.h:49
Entry::PACKAGE_SEC
@ PACKAGE_SEC
Definition: entry.h:112
TagClassInfo::Kind::Struct
@ Struct
XMLHandlers::startDocument
std::function< StartDocType > startDocument
handler invoked at the start of the document
Definition: xml.h:50
Argument::name
QCString name
Definition: arguments.h:52
TagClassInfo::Kind::Interface
@ Interface
TagGroupInfo::title
QCString title
Definition: tagreader.cpp:212
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
getFileNameExtension
QCString getFileNameExtension(const QCString &fn)
Definition: util.cpp:5621
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
CompoundFactory::state
TagFileParser::State state
Definition: tagreader.cpp:906
TagClassInfo::Kind::None
@ None
TagMemberInfo::arglist
QCString arglist
Definition: tagreader.cpp:85
endCb
ElementCallbacks::EndCallback endCb(void(TagFileParser::*fn)())
Definition: tagreader.cpp:866
BaseInfo
This class stores information about an inheritance relation
Definition: entry.h:35
TagFileParser::warn
void warn(const char *fmt)
Definition: tagreader.cpp:819
TagClassInfo::isObjC
bool isObjC
Definition: tagreader.cpp:125
TagGroupInfo::subgroupList
StringVector subgroupList
Definition: tagreader.cpp:213
TagGroupInfo::TagGroupInfo
TagGroupInfo()
Definition: tagreader.cpp:211
TagAnchorInfo::title
QCString title
Definition: tagreader.cpp:69
Entry::VARIABLE_SEC
@ VARIABLE_SEC
Definition: entry.h:96
TagFileParser::InClass
@ InClass
Definition: tagreader.cpp:805
TagMemberInfo
Container for member specific info that can be read from a tagfile
Definition: tagreader.cpp:78
MemberListContainer::Group
@ Group
TagFileInfo::get
static const TagFileInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:201
TagFileParser::endConcept
void endConcept()
Definition: tagreader.cpp:463
TagFileParser::InPage
@ InPage
Definition: tagreader.cpp:810
TagCompoundInfo::members
std::vector< TagMemberInfo > members
Definition: tagreader.cpp:104
TagFileParser::State
State
Definition: tagreader.cpp:804
TagFileInfo::conceptList
StringVector conceptList
Definition: tagreader.cpp:194
TagFileParser::endPath
void endPath()
Definition: tagreader.cpp:686
TagFileParser::m_tagFileCompounds
std::vector< std::unique_ptr< TagCompoundInfo > > m_tagFileCompounds
Definition: tagreader.cpp:834
ContextTreeType::Namespace
@ Namespace
TagEnumValueInfo
Container for enum values that are scoped within an enum
Definition: tagreader.cpp:57
TagClassInfo::clangId
QCString clangId
Definition: tagreader.cpp:119
TagFileParser::endBase
void endBase()
Definition: tagreader.cpp:619
CompoundFactory
Definition: tagreader.cpp:902
TagGroupInfo::pageList
StringVector pageList
Definition: tagreader.cpp:218
CodeSymbolType::Signal
@ Signal
Entry::Singleton
static const uint64 Singleton
Definition: entry.h:136
TagFileParser::startBase
void startBase(const XMLHandlers::Attributes &attrib)
Definition: tagreader.cpp:590
guessSection
int guessSection(const QCString &name)
Definition: util.cpp:331
util.h
A bunch of utility functions.
TagFileInfo::path
QCString path
Definition: tagreader.cpp:192
TagCompoundInfo::CompoundType::Namespace
@ Namespace
MemberListContainer::Class
@ Class
stringToArgumentList
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
TagPageInfo
Container for page specific info that can be read from a tagfile
Definition: tagreader.cpp:231
TagGroupInfo::get
static const TagGroupInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:224
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
TagFileParser::InMember
@ InMember
Definition: tagreader.cpp:811
TagNamespaceInfo::get
static const TagNamespaceInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
Definition: tagreader.cpp:165
ElementCallbacks::StartCallback
std::function< void(LayoutParser &, const XMLHandlers::Attributes &)> StartCallback
Definition: layout.cpp:716
debug.h
TagFileParser::endCompound
void endCompound()
Definition: tagreader.cpp:298
TagFileInfo::includes
std::vector< TagIncludeInfo > includes
Definition: tagreader.cpp:196
XMLHandlers::value
static std::string value(const Attributes &attrib, const std::string &key)
Definition: xml.h:57
Entry::Enum
static const uint64 Enum
Definition: entry.h:134
TagFileParser::dump
void dump()
Definition: tagreader.cpp:989
Pure
@ Pure
Definition: types.h:29
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108