Doxygen
Loading...
Searching...
No Matches
textdocvisitor.h
Go to the documentation of this file.
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 TEXTDOCVISITOR_H
20#define TEXTDOCVISITOR_H
21
22#include "qcstring.h"
23#include "docvisitor.h"
24#include "docnode.h"
25#include "textstream.h"
26
27/*! @brief Concrete visitor implementation for TEXT output. */
29{
30 public:
32
33 //--------------------------------------
34 // visitor functions for leaf nodes
35 //--------------------------------------
36
37 void operator()(const DocWord &w) { filter(w.word()); }
38 void operator()(const DocLinkedWord &w) { filter(w.word()); }
39 void operator()(const DocWhiteSpace &) { m_t << " "; }
40 void operator()(const DocSymbol &);
41 void operator()(const DocEmoji &);
42 void operator()(const DocURL &u) { filter(u.url()); }
43 void operator()(const DocLineBreak &) { m_t << " "; }
44 void operator()(const DocHorRuler &) {}
45 void operator()(const DocStyleChange &) {}
46 void operator()(const DocVerbatim &s) { filter(s.text()); }
47 void operator()(const DocAnchor &) {}
48 void operator()(const DocInclude &) {}
49 void operator()(const DocIncOperator &) {}
50 void operator()(const DocFormula &) {}
51 void operator()(const DocIndexEntry &) {}
53 void operator()(const DocCite &);
54 void operator()(const DocSeparator &) { m_t << " "; }
55
56 //--------------------------------------
57 // visitor functions for compound nodes
58 //--------------------------------------
59
60 template<class T>
61 void visitChildren(const T &t)
62 {
63 for (const auto &child : t.children())
64 {
65 std::visit(*this, child);
66 }
67 }
68 void operator()(const DocAutoList &l) { visitChildren(l); }
69 void operator()(const DocAutoListItem &li) { visitChildren(li); }
70 void operator()(const DocPara &p) { visitChildren(p); }
71 void operator()(const DocRoot &r) { visitChildren(r); }
72 void operator()(const DocSimpleSect &s) { visitChildren(s); }
73 void operator()(const DocTitle &t) { visitChildren(t); }
74 void operator()(const DocSimpleList &l) { visitChildren(l); }
75 void operator()(const DocSimpleListItem &) { }
76 void operator()(const DocSection &s) { visitChildren(s); }
77 void operator()(const DocHtmlList &l) { visitChildren(l); }
78 void operator()(const DocHtmlListItem &li) { visitChildren(li); }
79 void operator()(const DocHtmlDescList &dl) { visitChildren(dl); }
80 void operator()(const DocHtmlDescTitle &dt) { visitChildren(dt); }
81 void operator()(const DocHtmlDescData &dd) { visitChildren(dd); }
82 void operator()(const DocHtmlTable &t) { visitChildren(t); }
83 void operator()(const DocHtmlRow &r) { visitChildren(r); }
84 void operator()(const DocHtmlCell &c) { visitChildren(c); }
86 void operator()(const DocInternal &i) { visitChildren(i); }
87 void operator()(const DocHRef &h) { visitChildren(h); }
90 void operator()(const DocHtmlHeader &h) { visitChildren(h); }
91 void operator()(const DocImage &i) { visitChildren(i); }
92 void operator()(const DocDotFile &df) { visitChildren(df); }
93 void operator()(const DocMscFile &df) { visitChildren(df); }
94 void operator()(const DocDiaFile &df) { visitChildren(df); }
95 void operator()(const DocPlantUmlFile &df) { visitChildren(df); }
96 void operator()(const DocLink &l) { visitChildren(l); }
97 void operator()(const DocRef &r) { visitChildren(r); }
98 void operator()(const DocSecRefItem &s) { visitChildren(s); }
99 void operator()(const DocSecRefList &l) { visitChildren(l); }
100 void operator()(const DocParamSect &s) { visitChildren(s); }
101 void operator()(const DocParamList &) { }
102 void operator()(const DocXRefItem &x) { visitChildren(x); }
104 void operator()(const DocText &t) { visitChildren(t); }
106 void operator()(const DocVhdlFlow &) { }
107 void operator()(const DocParBlock &pb) { visitChildren(pb); }
108
109 private:
110
111 void filter(const QCString &str);
112
114};
115
116#endif
Node representing an anchor.
Definition docnode.h:228
Node representing an auto List.
Definition docnode.h:566
Node representing an item of a auto list.
Definition docnode.h:590
Node representing a citation of some bibliographic reference.
Definition docnode.h:244
Node representing a dia file.
Definition docnode.h:725
Node representing a dot file.
Definition docnode.h:707
Node representing an emoji.
Definition docnode.h:336
Node representing an item of a cross-referenced list.
Definition docnode.h:524
Node representing a Hypertext reference.
Definition docnode.h:817
Node representing a horizontal ruler.
Definition docnode.h:215
Node representing an HTML blockquote.
Definition docnode.h:1285
Node representing a HTML table caption.
Definition docnode.h:1222
Node representing a HTML table cell.
Definition docnode.h:1187
Node representing a HTML description data.
Definition docnode.h:1175
Node representing a Html description list.
Definition docnode.h:895
Node representing a Html description item.
Definition docnode.h:882
Node Html details.
Definition docnode.h:851
Node Html heading.
Definition docnode.h:867
Node representing a Html list.
Definition docnode.h:994
Node representing a HTML list item.
Definition docnode.h:1159
Node representing a HTML table row.
Definition docnode.h:1240
Node Html summary.
Definition docnode.h:838
Node representing a HTML table.
Definition docnode.h:1263
Node representing an image.
Definition docnode.h:636
Node representing a include/dontinclude operator block.
Definition docnode.h:472
Node representing an included text block from file.
Definition docnode.h:430
Node representing an entry in the index.
Definition docnode.h:547
Node representing an internal section of documentation.
Definition docnode.h:963
Node representing an internal reference to some item.
Definition docnode.h:801
Node representing a line break.
Definition docnode.h:201
Node representing a word that can be linked to something.
Definition docnode.h:164
QCString word() const
Definition docnode.h:169
Node representing a msc file.
Definition docnode.h:716
Node representing an block of paragraphs.
Definition docnode.h:973
Node representing a paragraph in the documentation tree.
Definition docnode.h:1074
Node representing a parameter list.
Definition docnode.h:1119
Node representing a parameter section.
Definition docnode.h:1047
Node representing a uml file.
Definition docnode.h:734
Node representing a reference to some item.
Definition docnode.h:772
Root node of documentation tree.
Definition docnode.h:1307
Node representing a reference to a section.
Definition docnode.h:929
Node representing a list of section references.
Definition docnode.h:953
Node representing a normal section.
Definition docnode.h:908
Node representing a separator.
Definition docnode.h:360
Node representing a simple list.
Definition docnode.h:984
Node representing a simple list item.
Definition docnode.h:1147
Node representing a simple section.
Definition docnode.h:1011
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1038
Node representing a style change.
Definition docnode.h:264
Node representing a special symbol.
Definition docnode.h:323
Root node of a text fragment.
Definition docnode.h:1298
Node representing a simple section title.
Definition docnode.h:603
Node representing a URL (or email address)
Definition docnode.h:187
QCString url() const
Definition docnode.h:191
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:371
QCString text() const
Definition docnode.h:378
Node representing a VHDL flow chart.
Definition docnode.h:743
Node representing some amount of white space.
Definition docnode.h:349
Node representing a word.
Definition docnode.h:152
QCString word() const
Definition docnode.h:155
Node representing an item of a cross-referenced list.
Definition docnode.h:615
This is an alternative implementation of QCString.
Definition qcstring.h:101
void operator()(const DocHtmlBlockQuote &q)
void operator()(const DocHtmlDescTitle &dt)
void operator()(const DocParamSect &s)
void operator()(const DocInclude &)
void operator()(const DocHtmlDetails &d)
void operator()(const DocPlantUmlFile &df)
void operator()(const DocPara &p)
void operator()(const DocAutoListItem &li)
void operator()(const DocSimpleSect &s)
void operator()(const DocURL &u)
void operator()(const DocHtmlCell &c)
void operator()(const DocIndexEntry &)
void operator()(const DocLink &l)
void operator()(const DocHtmlSummary &s)
void filter(const QCString &str)
void operator()(const DocXRefItem &x)
void operator()(const DocStyleChange &)
void operator()(const DocWhiteSpace &)
void operator()(const DocDotFile &df)
void operator()(const DocLineBreak &)
void operator()(const DocAutoList &l)
void operator()(const DocSeparator &)
void operator()(const DocInternal &i)
void operator()(const DocHtmlList &l)
void operator()(const DocParamList &)
void operator()(const DocIncOperator &)
void operator()(const DocFormula &)
TextStream & m_t
void operator()(const DocTitle &t)
TextDocVisitor(TextStream &t)
void operator()(const DocSimpleListItem &)
void visitChildren(const T &t)
void operator()(const DocVerbatim &s)
void operator()(const DocHtmlHeader &h)
void operator()(const DocSecRefList &l)
void operator()(const DocHtmlRow &r)
void operator()(const DocSection &s)
void operator()(const DocMscFile &df)
void operator()(const DocInternalRef &r)
void operator()(const DocHtmlListItem &li)
void operator()(const DocDiaFile &df)
void operator()(const DocRef &r)
void operator()(const DocHorRuler &)
void operator()(const DocSimpleList &l)
void operator()(const DocHtmlCaption &c)
void operator()(const DocParBlock &pb)
void operator()(const DocHtmlDescData &dd)
void operator()(const DocWord &w)
void operator()(const DocVhdlFlow &)
void operator()(const DocAnchor &)
void operator()(const DocRoot &r)
void operator()(const DocSimpleSectSep &)
void operator()(const DocHRef &h)
void operator()(const DocText &t)
void operator()(const DocLinkedWord &w)
void operator()(const DocHtmlTable &t)
void operator()(const DocHtmlDescList &dl)
void operator()(const DocSecRefItem &s)
void operator()(const DocImage &i)
Text streaming class that buffers data.
Definition textstream.h:36