Doxygen
Loading...
Searching...
No Matches
TextDocVisitor Class Reference

Concrete visitor implementation for TEXT output. More...

#include <src/textdocvisitor.h>

+ Inheritance diagram for TextDocVisitor:
+ Collaboration diagram for TextDocVisitor:

Public Member Functions

 TextDocVisitor (TextStream &t)
 
void operator() (const DocWord &w)
 
void operator() (const DocLinkedWord &w)
 
void operator() (const DocWhiteSpace &)
 
void operator() (const DocSymbol &)
 
void operator() (const DocEmoji &)
 
void operator() (const DocURL &u)
 
void operator() (const DocLineBreak &)
 
void operator() (const DocHorRuler &)
 
void operator() (const DocStyleChange &)
 
void operator() (const DocVerbatim &s)
 
void operator() (const DocAnchor &)
 
void operator() (const DocInclude &)
 
void operator() (const DocIncOperator &)
 
void operator() (const DocFormula &)
 
void operator() (const DocIndexEntry &)
 
void operator() (const DocSimpleSectSep &)
 
void operator() (const DocCite &)
 
void operator() (const DocSeparator &)
 
template<class T>
void visitChildren (const T &t)
 
void operator() (const DocAutoList &l)
 
void operator() (const DocAutoListItem &li)
 
void operator() (const DocPara &p)
 
void operator() (const DocRoot &r)
 
void operator() (const DocSimpleSect &s)
 
void operator() (const DocTitle &t)
 
void operator() (const DocSimpleList &l)
 
void operator() (const DocSimpleListItem &)
 
void operator() (const DocSection &s)
 
void operator() (const DocHtmlList &l)
 
void operator() (const DocHtmlListItem &li)
 
void operator() (const DocHtmlDescList &dl)
 
void operator() (const DocHtmlDescTitle &dt)
 
void operator() (const DocHtmlDescData &dd)
 
void operator() (const DocHtmlTable &t)
 
void operator() (const DocHtmlRow &r)
 
void operator() (const DocHtmlCell &c)
 
void operator() (const DocHtmlCaption &c)
 
void operator() (const DocInternal &i)
 
void operator() (const DocHRef &h)
 
void operator() (const DocHtmlSummary &s)
 
void operator() (const DocHtmlDetails &d)
 
void operator() (const DocHtmlHeader &h)
 
void operator() (const DocImage &i)
 
void operator() (const DocDotFile &df)
 
void operator() (const DocMscFile &df)
 
void operator() (const DocDiaFile &df)
 
void operator() (const DocPlantUmlFile &df)
 
void operator() (const DocLink &l)
 
void operator() (const DocRef &r)
 
void operator() (const DocSecRefItem &s)
 
void operator() (const DocSecRefList &l)
 
void operator() (const DocParamSect &s)
 
void operator() (const DocParamList &)
 
void operator() (const DocXRefItem &x)
 
void operator() (const DocInternalRef &r)
 
void operator() (const DocText &t)
 
void operator() (const DocHtmlBlockQuote &q)
 
void operator() (const DocVhdlFlow &)
 
void operator() (const DocParBlock &pb)
 
- Public Member Functions inherited from DocVisitor
 DocVisitor ()
 
virtual ~DocVisitor ()
 
CodeParserInterfacegetCodeParser (const QCString &langExt)
 
void pushHidden (bool hide)
 
bool popHidden ()
 

Private Member Functions

void filter (const QCString &str)
 

Private Attributes

TextStreamm_t
 

Detailed Description

Concrete visitor implementation for TEXT output.

Definition at line 28 of file textdocvisitor.h.

Constructor & Destructor Documentation

◆ TextDocVisitor()

TextDocVisitor::TextDocVisitor ( TextStream & t)
inline

Definition at line 31 of file textdocvisitor.h.

31: m_t(t) {}
TextStream & m_t

References m_t.

Member Function Documentation

◆ filter()

void TextDocVisitor::filter ( const QCString & str)
private

Definition at line 88 of file textdocvisitor.cpp.

89{
90 if (str.isEmpty()) return;
91 //printf("TextDocVisitor::filter(%s)\n",str);
92 const char *p=str.data();
93 while (*p)
94 {
95 char c = *p++;
96 if (c=='\n') c=' ';
97 else m_t << c;
98 }
99}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
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:159

References QCString::data(), QCString::isEmpty(), and m_t.

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ operator()() [1/58]

void TextDocVisitor::operator() ( const DocAnchor & )
inline

Definition at line 47 of file textdocvisitor.h.

47{}

◆ operator()() [2/58]

void TextDocVisitor::operator() ( const DocAutoList & l)
inline

Definition at line 68 of file textdocvisitor.h.

68{ visitChildren(l); }
void visitChildren(const T &t)

References visitChildren().

◆ operator()() [3/58]

void TextDocVisitor::operator() ( const DocAutoListItem & li)
inline

Definition at line 69 of file textdocvisitor.h.

69{ visitChildren(li); }

References visitChildren().

◆ operator()() [4/58]

void TextDocVisitor::operator() ( const DocCite & cite)

Definition at line 73 of file textdocvisitor.cpp.

74{
75 if (!cite.file().isEmpty())
76 {
77 QCString anchor = cite.anchor();
78 QCString anchorPrefix = CitationManager::instance().anchorPrefix();
79 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
80 m_t << anchor;
81 }
82 else
83 {
84 filter(cite.text());
85 }
86}
QCString anchorPrefix() const
Definition cite.cpp:122
static CitationManager & instance()
Definition cite.cpp:80
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:247
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
void filter(const QCString &str)

References DocCite::anchor(), CitationManager::anchorPrefix(), DocCite::file(), filter(), CitationManager::instance(), QCString::isEmpty(), QCString::length(), m_t, QCString::mid(), and DocCite::text().

◆ operator()() [5/58]

void TextDocVisitor::operator() ( const DocDiaFile & df)
inline

Definition at line 94 of file textdocvisitor.h.

94{ visitChildren(df); }

References visitChildren().

◆ operator()() [6/58]

void TextDocVisitor::operator() ( const DocDotFile & df)
inline

Definition at line 92 of file textdocvisitor.h.

92{ visitChildren(df); }

References visitChildren().

◆ operator()() [7/58]

void TextDocVisitor::operator() ( const DocEmoji & s)

Definition at line 41 of file textdocvisitor.cpp.

42{
43 // the TextDocVisitor is only invoked for the JS part of the HTML output
44 const char *res = EmojiEntityMapper::instance().unicode(s.index());
45 if (res)
46 {
47 const char *p = res;
48 while (*p)
49 {
50 switch(*p)
51 {
52 case '&': case '#':
53 break;
54 case 'x':
55 m_t << "\\u{";
56 break;
57 case ';':
58 m_t << "}";
59 break;
60 default:
61 m_t << *p;
62 break;
63 }
64 p++;
65 }
66 }
67 else
68 {
69 filter(s.name());
70 }
71}
int index() const
Definition docnode.h:340
QCString name() const
Definition docnode.h:339
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:2016
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978

References filter(), DocEmoji::index(), EmojiEntityMapper::instance(), m_t, DocEmoji::name(), and EmojiEntityMapper::unicode().

◆ operator()() [8/58]

void TextDocVisitor::operator() ( const DocFormula & )
inline

Definition at line 50 of file textdocvisitor.h.

50{}

◆ operator()() [9/58]

void TextDocVisitor::operator() ( const DocHorRuler & )
inline

Definition at line 44 of file textdocvisitor.h.

44{}

◆ operator()() [10/58]

void TextDocVisitor::operator() ( const DocHRef & h)
inline

Definition at line 87 of file textdocvisitor.h.

87{ visitChildren(h); }

References visitChildren().

◆ operator()() [11/58]

void TextDocVisitor::operator() ( const DocHtmlBlockQuote & q)
inline

Definition at line 105 of file textdocvisitor.h.

105{ visitChildren(q); }

References visitChildren().

◆ operator()() [12/58]

void TextDocVisitor::operator() ( const DocHtmlCaption & c)
inline

Definition at line 85 of file textdocvisitor.h.

85{ visitChildren(c); }

References visitChildren().

◆ operator()() [13/58]

void TextDocVisitor::operator() ( const DocHtmlCell & c)
inline

Definition at line 84 of file textdocvisitor.h.

84{ visitChildren(c); }

References visitChildren().

◆ operator()() [14/58]

void TextDocVisitor::operator() ( const DocHtmlDescData & dd)
inline

Definition at line 81 of file textdocvisitor.h.

81{ visitChildren(dd); }

References visitChildren().

◆ operator()() [15/58]

void TextDocVisitor::operator() ( const DocHtmlDescList & dl)
inline

Definition at line 79 of file textdocvisitor.h.

79{ visitChildren(dl); }

References visitChildren().

◆ operator()() [16/58]

void TextDocVisitor::operator() ( const DocHtmlDescTitle & dt)
inline

Definition at line 80 of file textdocvisitor.h.

80{ visitChildren(dt); }

References visitChildren().

◆ operator()() [17/58]

void TextDocVisitor::operator() ( const DocHtmlDetails & d)
inline

Definition at line 89 of file textdocvisitor.h.

89{ visitChildren(d); }

References visitChildren().

◆ operator()() [18/58]

void TextDocVisitor::operator() ( const DocHtmlHeader & h)
inline

Definition at line 90 of file textdocvisitor.h.

90{ visitChildren(h); }

References visitChildren().

◆ operator()() [19/58]

void TextDocVisitor::operator() ( const DocHtmlList & l)
inline

Definition at line 77 of file textdocvisitor.h.

77{ visitChildren(l); }

References visitChildren().

◆ operator()() [20/58]

void TextDocVisitor::operator() ( const DocHtmlListItem & li)
inline

Definition at line 78 of file textdocvisitor.h.

78{ visitChildren(li); }

References visitChildren().

◆ operator()() [21/58]

void TextDocVisitor::operator() ( const DocHtmlRow & r)
inline

Definition at line 83 of file textdocvisitor.h.

83{ visitChildren(r); }

References visitChildren().

◆ operator()() [22/58]

void TextDocVisitor::operator() ( const DocHtmlSummary & s)
inline

Definition at line 88 of file textdocvisitor.h.

88{ visitChildren(s); }

References visitChildren().

◆ operator()() [23/58]

void TextDocVisitor::operator() ( const DocHtmlTable & t)
inline

Definition at line 82 of file textdocvisitor.h.

82{ visitChildren(t); }

References visitChildren().

◆ operator()() [24/58]

void TextDocVisitor::operator() ( const DocImage & i)
inline

Definition at line 91 of file textdocvisitor.h.

91{ visitChildren(i); }

References visitChildren().

◆ operator()() [25/58]

void TextDocVisitor::operator() ( const DocInclude & )
inline

Definition at line 48 of file textdocvisitor.h.

48{}

◆ operator()() [26/58]

void TextDocVisitor::operator() ( const DocIncOperator & )
inline

Definition at line 49 of file textdocvisitor.h.

49{}

◆ operator()() [27/58]

void TextDocVisitor::operator() ( const DocIndexEntry & )
inline

Definition at line 51 of file textdocvisitor.h.

51{}

◆ operator()() [28/58]

void TextDocVisitor::operator() ( const DocInternal & i)
inline

Definition at line 86 of file textdocvisitor.h.

86{ visitChildren(i); }

References visitChildren().

◆ operator()() [29/58]

void TextDocVisitor::operator() ( const DocInternalRef & r)
inline

Definition at line 103 of file textdocvisitor.h.

103{ visitChildren(r); }

References visitChildren().

◆ operator()() [30/58]

void TextDocVisitor::operator() ( const DocLineBreak & )
inline

Definition at line 43 of file textdocvisitor.h.

43{ m_t << " "; }

References m_t.

◆ operator()() [31/58]

void TextDocVisitor::operator() ( const DocLink & l)
inline

Definition at line 96 of file textdocvisitor.h.

96{ visitChildren(l); }

References visitChildren().

◆ operator()() [32/58]

void TextDocVisitor::operator() ( const DocLinkedWord & w)
inline

Definition at line 38 of file textdocvisitor.h.

38{ filter(w.word()); }
QCString word() const
Definition docnode.h:169

References filter(), and DocLinkedWord::word().

◆ operator()() [33/58]

void TextDocVisitor::operator() ( const DocMscFile & df)
inline

Definition at line 93 of file textdocvisitor.h.

93{ visitChildren(df); }

References visitChildren().

◆ operator()() [34/58]

void TextDocVisitor::operator() ( const DocPara & p)
inline

Definition at line 70 of file textdocvisitor.h.

70{ visitChildren(p); }

References visitChildren().

◆ operator()() [35/58]

void TextDocVisitor::operator() ( const DocParamList & )
inline

Definition at line 101 of file textdocvisitor.h.

101{ }

◆ operator()() [36/58]

void TextDocVisitor::operator() ( const DocParamSect & s)
inline

Definition at line 100 of file textdocvisitor.h.

100{ visitChildren(s); }

References visitChildren().

◆ operator()() [37/58]

void TextDocVisitor::operator() ( const DocParBlock & pb)
inline

Definition at line 107 of file textdocvisitor.h.

107{ visitChildren(pb); }

References visitChildren().

◆ operator()() [38/58]

void TextDocVisitor::operator() ( const DocPlantUmlFile & df)
inline

Definition at line 95 of file textdocvisitor.h.

95{ visitChildren(df); }

References visitChildren().

◆ operator()() [39/58]

void TextDocVisitor::operator() ( const DocRef & r)
inline

Definition at line 97 of file textdocvisitor.h.

97{ visitChildren(r); }

References visitChildren().

◆ operator()() [40/58]

void TextDocVisitor::operator() ( const DocRoot & r)
inline

Definition at line 71 of file textdocvisitor.h.

71{ visitChildren(r); }

References visitChildren().

◆ operator()() [41/58]

void TextDocVisitor::operator() ( const DocSecRefItem & s)
inline

Definition at line 98 of file textdocvisitor.h.

98{ visitChildren(s); }

References visitChildren().

◆ operator()() [42/58]

void TextDocVisitor::operator() ( const DocSecRefList & l)
inline

Definition at line 99 of file textdocvisitor.h.

99{ visitChildren(l); }

References visitChildren().

◆ operator()() [43/58]

void TextDocVisitor::operator() ( const DocSection & s)
inline

Definition at line 76 of file textdocvisitor.h.

76{ visitChildren(s); }

References visitChildren().

◆ operator()() [44/58]

void TextDocVisitor::operator() ( const DocSeparator & )
inline

Definition at line 54 of file textdocvisitor.h.

54{ m_t << " "; }

References m_t.

◆ operator()() [45/58]

void TextDocVisitor::operator() ( const DocSimpleList & l)
inline

Definition at line 74 of file textdocvisitor.h.

74{ visitChildren(l); }

References visitChildren().

◆ operator()() [46/58]

void TextDocVisitor::operator() ( const DocSimpleListItem & )
inline

Definition at line 75 of file textdocvisitor.h.

75{ }

◆ operator()() [47/58]

void TextDocVisitor::operator() ( const DocSimpleSect & s)
inline

Definition at line 72 of file textdocvisitor.h.

72{ visitChildren(s); }

References visitChildren().

◆ operator()() [48/58]

void TextDocVisitor::operator() ( const DocSimpleSectSep & )
inline

Definition at line 52 of file textdocvisitor.h.

52{}

◆ operator()() [49/58]

void TextDocVisitor::operator() ( const DocStyleChange & )
inline

Definition at line 45 of file textdocvisitor.h.

45{}

◆ operator()() [50/58]

void TextDocVisitor::operator() ( const DocSymbol & s)

Definition at line 28 of file textdocvisitor.cpp.

29{
30 const char *res = HtmlEntityMapper::instance().html(s.symbol());
31 if (res)
32 {
33 m_t << res;
34 }
35 else
36 {
37 err("text: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
38 }
39}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:327
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * html(SymType symb, bool useInPrintf=FALSE) const
Access routine to the html code of the HTML entity.
#define err(fmt,...)
Definition message.h:84
#define TRUE
Definition qcstring.h:37

References err, HtmlEntityMapper::html(), HtmlEntityMapper::instance(), m_t, DocSymbol::symbol(), and TRUE.

◆ operator()() [51/58]

void TextDocVisitor::operator() ( const DocText & t)
inline

Definition at line 104 of file textdocvisitor.h.

104{ visitChildren(t); }

References visitChildren().

◆ operator()() [52/58]

void TextDocVisitor::operator() ( const DocTitle & t)
inline

Definition at line 73 of file textdocvisitor.h.

73{ visitChildren(t); }

References visitChildren().

◆ operator()() [53/58]

void TextDocVisitor::operator() ( const DocURL & u)
inline

Definition at line 42 of file textdocvisitor.h.

42{ filter(u.url()); }
QCString url() const
Definition docnode.h:191

References filter(), and DocURL::url().

◆ operator()() [54/58]

void TextDocVisitor::operator() ( const DocVerbatim & s)
inline

Definition at line 46 of file textdocvisitor.h.

46{ filter(s.text()); }
QCString text() const
Definition docnode.h:378

References filter(), and DocVerbatim::text().

◆ operator()() [55/58]

void TextDocVisitor::operator() ( const DocVhdlFlow & )
inline

Definition at line 106 of file textdocvisitor.h.

106{ }

◆ operator()() [56/58]

void TextDocVisitor::operator() ( const DocWhiteSpace & )
inline

Definition at line 39 of file textdocvisitor.h.

39{ m_t << " "; }

References m_t.

◆ operator()() [57/58]

void TextDocVisitor::operator() ( const DocWord & w)
inline

Definition at line 37 of file textdocvisitor.h.

37{ filter(w.word()); }
QCString word() const
Definition docnode.h:155

References filter(), and DocWord::word().

◆ operator()() [58/58]

void TextDocVisitor::operator() ( const DocXRefItem & x)
inline

Definition at line 102 of file textdocvisitor.h.

102{ visitChildren(x); }

References visitChildren().

◆ visitChildren()

Member Data Documentation

◆ m_t

TextStream& TextDocVisitor::m_t
private

The documentation for this class was generated from the following files: