doxygen
xmldocvisitor.h
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 #ifndef XMLDOCVISITOR_H
20 #define XMLDOCVISITOR_H
21 
22 #include <iostream>
23 
24 #include "qcstring.h"
25 #include "docvisitor.h"
26 #include "docnode.h"
27 #include "textstream.h"
28 
29 class OutputCodeList;
30 class QCString;
31 
33 class XmlDocVisitor : public DocVisitor
34 {
35  public:
36  XmlDocVisitor(TextStream &t,OutputCodeList &ci,const QCString &langExt);
37 
38  //--------------------------------------
39  // visitor functions for leaf nodes
40  //--------------------------------------
41 
42  void operator()(const DocWord &);
43  void operator()(const DocLinkedWord &);
44  void operator()(const DocWhiteSpace &);
45  void operator()(const DocSymbol &);
46  void operator()(const DocEmoji &);
47  void operator()(const DocURL &);
48  void operator()(const DocLineBreak &);
49  void operator()(const DocHorRuler &);
50  void operator()(const DocStyleChange &);
51  void operator()(const DocVerbatim &);
52  void operator()(const DocAnchor &);
53  void operator()(const DocInclude &);
54  void operator()(const DocIncOperator &);
55  void operator()(const DocFormula &);
56  void operator()(const DocIndexEntry &);
57  void operator()(const DocSimpleSectSep &);
58  void operator()(const DocCite &);
59  void operator()(const DocSeparator &);
60 
61  //--------------------------------------
62  // visitor functions for compound nodes
63  //--------------------------------------
64 
65  void operator()(const DocAutoList &);
66  void operator()(const DocAutoListItem &);
67  void operator()(const DocPara &) ;
68  void operator()(const DocRoot &);
69  void operator()(const DocSimpleSect &);
70  void operator()(const DocTitle &);
71  void operator()(const DocSimpleList &);
72  void operator()(const DocSimpleListItem &);
73  void operator()(const DocSection &);
74  void operator()(const DocHtmlList &);
75  void operator()(const DocHtmlListItem &);
76  void operator()(const DocHtmlDescList &);
77  void operator()(const DocHtmlDescTitle &);
78  void operator()(const DocHtmlDescData &);
79  void operator()(const DocHtmlTable &);
80  void operator()(const DocHtmlRow &);
81  void operator()(const DocHtmlCell &);
82  void operator()(const DocHtmlCaption &);
83  void operator()(const DocInternal &);
84  void operator()(const DocHRef &);
85  void operator()(const DocHtmlSummary &);
86  void operator()(const DocHtmlDetails &);
87  void operator()(const DocHtmlHeader &);
88  void operator()(const DocImage &);
89  void operator()(const DocDotFile &);
90  void operator()(const DocMscFile &);
91  void operator()(const DocDiaFile &);
92  void operator()(const DocLink &);
93  void operator()(const DocRef &);
94  void operator()(const DocSecRefItem &);
95  void operator()(const DocSecRefList &);
96  void operator()(const DocParamSect &);
97  void operator()(const DocParamList &);
98  void operator()(const DocXRefItem &);
99  void operator()(const DocInternalRef &);
100  void operator()(const DocText &);
101  void operator()(const DocHtmlBlockQuote &);
102  void operator()(const DocVhdlFlow &);
103  void operator()(const DocParBlock &);
104 
105  private:
106  template<class T>
107  void visitChildren(const T &t)
108  {
109  for (const auto &child : t.children())
110  {
111  std::visit(*this, child);
112  }
113  }
114 
115  //--------------------------------------
116  // helper functions
117  //--------------------------------------
118 
119  void filter(const QCString &str);
120  void startLink(const QCString &ref,const QCString &file,
121  const QCString &anchor);
122  void endLink();
123 
124  //--------------------------------------
125  // state variables
126  //--------------------------------------
127 
128  TextStream &m_t;
129  OutputCodeList &m_ci;
130  bool m_insidePre;
131  bool m_hide;
132  QCString m_langExt;
133 };
134 
135 #endif
Node representing a separator.
Definition: docnode.h:347
Node representing an HTML blockquote.
Definition: docnode.h:1248
Node representing a URL (or email address)
Definition: docnode.h:189
Node representing a word.
Definition: docnode.h:154
Node representing some amount of white space.
Definition: docnode.h:336
Node representing a Hypertext reference.
Definition: docnode.h:780
Root node of a text fragment.
Definition: docnode.h:1261
Node representing a horizontal ruler.
Definition: docnode.h:217
Node representing a simple section title.
Definition: docnode.h:575
Node representing a reference to some item.
Definition: docnode.h:735
Node representing a style change.
Definition: docnode.h:266
Node representing an auto List.
Definition: docnode.h:546
Node representing an emoji.
Definition: docnode.h:323
Node representing a citation of some bibliographic reference.
Definition: docnode.h:246
Text streaming class that buffers data.
Definition: textstream.h:34
Node representing a HTML table caption.
Definition: docnode.h:1185
Root node of documentation tree.
Definition: docnode.h:1270
Node representing a HTML table cell.
Definition: docnode.h:1150
Node representing an entry in the index.
Definition: docnode.h:527
Node representing a simple section.
Definition: docnode.h:974
Node representing a paragraph in the documentation tree.
Definition: docnode.h:1037
Node representing a special symbol.
Definition: docnode.h:310
Helper base class for functionality shared by all visitors.
Definition: docvisitor.h:27
Node Html details.
Definition: docnode.h:814
Node representing a VHDL flow chart.
Definition: docnode.h:706
Node representing a Html description list.
Definition: docnode.h:858
Node representing a HTML list item.
Definition: docnode.h:1122
Node representing a msc file.
Definition: docnode.h:688
Node representing a verbatim, unparsed text fragment.
Definition: docnode.h:358
Node representing a Html description item.
Definition: docnode.h:845
Node Html heading.
Definition: docnode.h:830
Node representing a HTML table.
Definition: docnode.h:1226
Node representing a dia file.
Definition: docnode.h:697
Node representing a HTML table row.
Definition: docnode.h:1203
Concrete visitor implementation for XML output.
Definition: xmldocvisitor.h:33
Node representing a line break.
Definition: docnode.h:203
Node representing a list of section references.
Definition: docnode.h:916
Class representing a list of different code generators.
Definition: outputlist.h:199
Node representing a reference to a section.
Definition: docnode.h:892
Node representing an item of a cross-referenced list.
Definition: docnode.h:504
Node representing a parameter section.
Definition: docnode.h:1010
Node representing an image.
Definition: docnode.h:608
Node representing a parameter list.
Definition: docnode.h:1082
Node representing a normal section.
Definition: docnode.h:871
Node representing a Html list.
Definition: docnode.h:957
Node representing an internal reference to some item.
Definition: docnode.h:764
Node representing an included text block from file.
Definition: docnode.h:417
Node representing an block of paragraphs.
Definition: docnode.h:936
Node representing an anchor.
Definition: docnode.h:230
Node representing a separator between two simple sections of the same type.
Definition: docnode.h:1001
Node representing a simple list item.
Definition: docnode.h:1110
Node representing a HTML description data.
Definition: docnode.h:1138
This is an alternative implementation of QCString.
Definition: qcstring.h:93
Node representing a word that can be linked to something.
Definition: docnode.h:166
Node representing a simple list.
Definition: docnode.h:947
Node representing a dot file.
Definition: docnode.h:679
Node representing an item of a auto list.
Definition: docnode.h:562
Node representing an internal section of documentation.
Definition: docnode.h:926
Node representing an item of a cross-referenced list.
Definition: docnode.h:587
Node representing a include/dontinclude operator block.
Definition: docnode.h:454
Node Html summary.
Definition: docnode.h:801