My Project
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
printdocvisitor.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 _PRINTDOCVISITOR_H
20
#define _PRINTDOCVISITOR_H
21
22
#include <qglobal.h>
23
#include "
docvisitor.h
"
24
#include "
htmlentity.h
"
25
#include "
message.h
"
26
28
class
PrintDocVisitor
:
public
DocVisitor
29
{
30
public
:
31
PrintDocVisitor
() :
DocVisitor
(
DocVisitor_Other
),
m_indent
(0),
32
m_needsEnter
(FALSE),
m_insidePre
(FALSE) {}
33
34
//--------------------------------------
35
36
void
visit
(
DocWord
*w)
37
{
38
indent_leaf
();
39
printf(
"%s"
,w->
word
().data());
40
}
41
void
visit
(
DocLinkedWord
*w)
42
{
43
indent_leaf
();
44
printf(
"%s"
,w->
word
().data());
45
}
46
void
visit
(
DocWhiteSpace
*w)
47
{
48
indent_leaf
();
49
if
(
m_insidePre
)
50
{
51
printf(
"%s"
,w->
chars
().data());
52
}
53
else
54
{
55
printf(
" "
);
56
}
57
}
58
void
visit
(
DocSymbol
*s)
59
{
60
indent_leaf
();
61
const
char
*res =
HtmlEntityMapper::instance
()->
utf8
(s->
symbol
(),TRUE);
62
if
(res)
63
{
64
printf(
"%s"
,res);
65
}
66
else
67
{
68
printf(
"print: non supported HTML-entity found: %s\n"
,
HtmlEntityMapper::instance
()->html(s->
symbol
(),TRUE));
69
}
70
}
71
void
visit
(
DocURL
*u)
72
{
73
indent_leaf
();
74
printf(
"%s"
,u->
url
().data());
75
}
76
void
visit
(
DocLineBreak
*)
77
{
78
indent_leaf
();
79
printf(
"<br/>"
);
80
}
81
void
visit
(
DocHorRuler
*)
82
{
83
indent_leaf
();
84
printf(
"<hr>"
);
85
}
86
void
visit
(
DocStyleChange
*s)
87
{
88
indent_leaf
();
89
switch
(s->
style
())
90
{
91
case
DocStyleChange::Bold
:
92
if
(s->
enable
()) printf(
"<bold>"
);
else
printf(
"</bold>"
);
93
break
;
94
case
DocStyleChange::Italic
:
95
if
(s->
enable
()) printf(
"<italic>"
);
else
printf(
"</italic>"
);
96
break
;
97
case
DocStyleChange::Code
:
98
if
(s->
enable
()) printf(
"<code>"
);
else
printf(
"</code>"
);
99
break
;
100
case
DocStyleChange::Subscript
:
101
if
(s->
enable
()) printf(
"<sub>"
);
else
printf(
"</sub>"
);
102
break
;
103
case
DocStyleChange::Superscript
:
104
if
(s->
enable
()) printf(
"<sup>"
);
else
printf(
"</sup>"
);
105
break
;
106
case
DocStyleChange::Center
:
107
if
(s->
enable
()) printf(
"<center>"
);
else
printf(
"</center>"
);
108
break
;
109
case
DocStyleChange::Small
:
110
if
(s->
enable
()) printf(
"<small>"
);
else
printf(
"</small>"
);
111
break
;
112
case
DocStyleChange::Preformatted
:
113
if
(s->
enable
()) printf(
"<pre>"
);
else
printf(
"</pre>"
);
114
break
;
115
case
DocStyleChange::Div
:
116
if
(s->
enable
()) printf(
"<div>"
);
else
printf(
"</div>"
);
117
break
;
118
case
DocStyleChange::Span
:
119
if
(s->
enable
()) printf(
"<span>"
);
else
printf(
"</span>"
);
120
break
;
121
}
122
}
123
void
visit
(
DocVerbatim
*s)
124
{
125
indent_leaf
();
126
switch
(s->
type
())
127
{
128
case
DocVerbatim::Code
: printf(
"<code>"
);
break
;
129
case
DocVerbatim::Verbatim
: printf(
"<verbatim>"
);
break
;
130
case
DocVerbatim::HtmlOnly
: printf(
"<htmlonly>"
);
break
;
131
case
DocVerbatim::RtfOnly
: printf(
"<rtfonly>"
);
break
;
132
case
DocVerbatim::ManOnly
: printf(
"<manonly>"
);
break
;
133
case
DocVerbatim::LatexOnly
: printf(
"<latexonly>"
);
break
;
134
case
DocVerbatim::XmlOnly
: printf(
"<xmlonly>"
);
break
;
135
case
DocVerbatim::DocbookOnly
: printf(
"<docbookonly>"
);
break
;
136
case
DocVerbatim::Dot
: printf(
"<dot>"
);
break
;
137
case
DocVerbatim::Msc
: printf(
"<msc>"
);
break
;
138
case
DocVerbatim::PlantUML
: printf(
"<plantuml>"
);
break
;
139
}
140
printf(
"%s"
,s->
text
().data());
141
switch
(s->
type
())
142
{
143
case
DocVerbatim::Code
: printf(
"</code>"
);
break
;
144
case
DocVerbatim::Verbatim
: printf(
"</verbatim>"
);
break
;
145
case
DocVerbatim::HtmlOnly
: printf(
"</htmlonly>"
);
break
;
146
case
DocVerbatim::RtfOnly
: printf(
"</rtfonly>"
);
break
;
147
case
DocVerbatim::ManOnly
: printf(
"</manonly>"
);
break
;
148
case
DocVerbatim::LatexOnly
: printf(
"</latexonly>"
);
break
;
149
case
DocVerbatim::XmlOnly
: printf(
"</xmlonly>"
);
break
;
150
case
DocVerbatim::DocbookOnly
: printf(
"</docbookonly>"
);
break
;
151
case
DocVerbatim::Dot
: printf(
"</dot>"
);
break
;
152
case
DocVerbatim::Msc
: printf(
"</msc>"
);
break
;
153
case
DocVerbatim::PlantUML
: printf(
"</plantuml>"
);
break
;
154
}
155
}
156
void
visit
(
DocAnchor
*a)
157
{
158
indent_leaf
();
159
printf(
"<anchor name=\"%s\"/>"
,a->
anchor
().data());
160
}
161
void
visit
(
DocInclude
*inc)
162
{
163
indent_leaf
();
164
printf(
"<include file=\"%s\" type=\""
,inc->
file
().data());
165
switch
(inc->
type
())
166
{
167
case
DocInclude::Include
: printf(
"include"
);
break
;
168
case
DocInclude::IncWithLines
: printf(
"incwithlines"
);
break
;
169
case
DocInclude::DontInclude
: printf(
"dontinclude"
);
break
;
170
case
DocInclude::HtmlInclude
: printf(
"htmlinclude"
);
break
;
171
case
DocInclude::LatexInclude
: printf(
"latexinclude"
);
break
;
172
case
DocInclude::VerbInclude
: printf(
"verbinclude"
);
break
;
173
case
DocInclude::Snippet
: printf(
"snippet"
);
break
;
174
case
DocInclude::SnippetDoc
:
175
case
DocInclude::IncludeDoc
:
176
err
(
"Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
177
"Please create a bug report\n"
,__FILE__);
178
break
;
179
}
180
printf(
"\"/>"
);
181
}
182
void
visit
(
DocIncOperator
*op)
183
{
184
indent_leaf
();
185
printf(
"<incoperator pattern=\"%s\" type=\""
,op->
pattern
().data());
186
switch
(op->
type
())
187
{
188
case
DocIncOperator::Line
: printf(
"line"
);
break
;
189
case
DocIncOperator::Skip
: printf(
"skip"
);
break
;
190
case
DocIncOperator::SkipLine
: printf(
"skipline"
);
break
;
191
case
DocIncOperator::Until
: printf(
"until"
);
break
;
192
}
193
printf(
"\"/>"
);
194
}
195
void
visit
(
DocFormula
*f)
196
{
197
indent_leaf
();
198
printf(
"<formula name=%s text=%s/>"
,f->
name
().data(),f->
text
().data());
199
}
200
void
visit
(
DocIndexEntry
*i)
201
{
202
indent_leaf
();
203
printf(
"<indexentry>%s</indexentry\n"
,i->
entry
().data());
204
}
205
void
visit
(
DocSimpleSectSep
*)
206
{
207
indent_leaf
();
208
printf(
"<simplesectsep/>"
);
209
}
210
void
visit
(
DocCite
*cite)
211
{
212
indent_leaf
();
213
printf(
"<cite ref=\"%s\" file=\"%s\" "
214
"anchor=\"%s\" text=\"%s\""
215
"/>\n"
,
216
cite->
ref
().data(),cite->
file
().data(),cite->
anchor
().data(),
217
cite->
text
().data());
218
}
219
220
//--------------------------------------
221
222
void
visitPre
(
DocAutoList
*l)
223
{
224
indent_pre
();
225
if
(l->
isEnumList
())
226
{
227
printf(
"<ol>\n"
);
228
}
229
else
230
{
231
printf(
"<ul>\n"
);
232
}
233
}
234
void
visitPost
(
DocAutoList
*l)
235
{
236
indent_post
();
237
if
(l->
isEnumList
())
238
{
239
printf(
"</ol>\n"
);
240
}
241
else
242
{
243
printf(
"</ul>\n"
);
244
}
245
}
246
void
visitPre
(
DocAutoListItem
*)
247
{
248
indent_pre
();
249
printf(
"<li>\n"
);
250
}
251
void
visitPost
(
DocAutoListItem
*)
252
{
253
indent_post
();
254
printf(
"</li>\n"
);
255
}
256
void
visitPre
(
DocPara
*)
257
{
258
indent_pre
();
259
printf(
"<para>\n"
);
260
}
261
void
visitPost
(
DocPara
*)
262
{
263
indent_post
();
264
printf(
"</para>\n"
);
265
}
266
void
visitPre
(
DocRoot
*)
267
{
268
indent_pre
();
269
printf(
"<root>\n"
);
270
}
271
void
visitPost
(
DocRoot
*)
272
{
273
indent_post
();
274
printf(
"</root>\n"
);
275
}
276
void
visitPre
(
DocSimpleSect
*s)
277
{
278
indent_pre
();
279
printf(
"<simplesect type="
);
280
switch
(s->
type
())
281
{
282
case
DocSimpleSect::See
: printf(
"see"
);
break
;
283
case
DocSimpleSect::Return
: printf(
"return"
);
break
;
284
case
DocSimpleSect::Author
: printf(
"author"
);
break
;
285
case
DocSimpleSect::Authors
: printf(
"authors"
);
break
;
286
case
DocSimpleSect::Version
: printf(
"version"
);
break
;
287
case
DocSimpleSect::Since
: printf(
"since"
);
break
;
288
case
DocSimpleSect::Date
: printf(
"date"
);
break
;
289
case
DocSimpleSect::Note
: printf(
"note"
);
break
;
290
case
DocSimpleSect::Warning
: printf(
"warning"
);
break
;
291
case
DocSimpleSect::Pre
: printf(
"pre"
);
break
;
292
case
DocSimpleSect::Post
: printf(
"post"
);
break
;
293
case
DocSimpleSect::Copyright
: printf(
"copyright"
);
break
;
294
case
DocSimpleSect::Invar
: printf(
"invar"
);
break
;
295
case
DocSimpleSect::Remark
: printf(
"remark"
);
break
;
296
case
DocSimpleSect::Attention
: printf(
"attention"
);
break
;
297
case
DocSimpleSect::User
: printf(
"user"
);
break
;
298
case
DocSimpleSect::Rcs
: printf(
"rcs"
);
break
;
299
case
DocSimpleSect::Unknown
: printf(
"unknown"
);
break
;
300
}
301
printf(
">\n"
);
302
}
303
void
visitPost
(
DocSimpleSect
*)
304
{
305
indent_post
();
306
printf(
"</simplesect>\n"
);
307
}
308
void
visitPre
(
DocTitle
*)
309
{
310
indent_pre
();
311
printf(
"<title>\n"
);
312
}
313
void
visitPost
(
DocTitle
*)
314
{
315
indent_post
();
316
printf(
"</title>\n"
);
317
}
318
void
visitPre
(
DocSimpleList
*)
319
{
320
indent_pre
();
321
printf(
"<ul>\n"
);
322
}
323
void
visitPost
(
DocSimpleList
*)
324
{
325
indent_post
();
326
printf(
"</ul>\n"
);
327
}
328
void
visitPre
(
DocSimpleListItem
*)
329
{
330
indent_pre
();
331
printf(
"<li>\n"
);
332
}
333
void
visitPost
(
DocSimpleListItem
*)
334
{
335
indent_post
();
336
printf(
"</li>\n"
);
337
}
338
void
visitPre
(
DocSection
*s)
339
{
340
indent_pre
();
341
printf(
"<sect%d>\n"
,s->
level
());
342
}
343
void
visitPost
(
DocSection
*s)
344
{
345
indent_post
();
346
printf(
"</sect%d>\n"
,s->
level
());
347
}
348
void
visitPre
(
DocHtmlList
*s)
349
{
350
indent_pre
();
351
if
(s->
type
()==
DocHtmlList::Ordered
) printf(
"<ol>\n"
);
else
printf(
"<ul>\n"
);
352
}
353
void
visitPost
(
DocHtmlList
*s)
354
{
355
indent_post
();
356
if
(s->
type
()==
DocHtmlList::Ordered
) printf(
"</ol>\n"
);
else
printf(
"</ul>\n"
);
357
}
358
void
visitPre
(
DocHtmlListItem
*)
359
{
360
indent_pre
();
361
printf(
"<li>\n"
);
362
}
363
void
visitPost
(
DocHtmlListItem
*)
364
{
365
indent_post
();
366
printf(
"</li>\n"
);
367
}
368
//void visitPre(DocHtmlPre *)
369
//{
370
// indent_pre();
371
// printf("<pre>\n");
372
// m_insidePre=TRUE;
373
//}
374
//void visitPost(DocHtmlPre *)
375
//{
376
// m_insidePre=FALSE;
377
// indent_post();
378
// printf("</pre>\n");
379
//}
380
void
visitPre
(
DocHtmlDescList
*)
381
{
382
indent_pre
();
383
printf(
"<dl>\n"
);
384
}
385
void
visitPost
(
DocHtmlDescList
*)
386
{
387
indent_post
();
388
printf(
"</dl>\n"
);
389
}
390
void
visitPre
(
DocHtmlDescTitle
*)
391
{
392
indent_pre
();
393
printf(
"<dt>\n"
);
394
}
395
void
visitPost
(
DocHtmlDescTitle
*)
396
{
397
indent_post
();
398
printf(
"</dt>\n"
);
399
}
400
void
visitPre
(
DocHtmlDescData
*)
401
{
402
indent_pre
();
403
printf(
"<dd>\n"
);
404
}
405
void
visitPost
(
DocHtmlDescData
*)
406
{
407
indent_post
();
408
printf(
"</dd>\n"
);
409
}
410
void
visitPre
(
DocHtmlTable
*t)
411
{
412
indent_pre
();
413
printf(
"<table rows=\"%d\" cols=\"%d\">\n"
,
414
t->
numRows
(),t->
numColumns
());
415
}
416
void
visitPost
(
DocHtmlTable
*)
417
{
418
indent_post
();
419
printf(
"</table>\n"
);
420
}
421
void
visitPre
(
DocHtmlRow
*)
422
{
423
indent_pre
();
424
printf(
"<tr>\n"
);
425
}
426
void
visitPost
(
DocHtmlRow
*)
427
{
428
indent_post
();
429
printf(
"</tr>\n"
);
430
}
431
void
visitPre
(
DocHtmlCell
*c)
432
{
433
indent_pre
();
434
printf(
"<t%c>\n"
,c->
isHeading
()?
'h'
:
'd'
);
435
}
436
void
visitPost
(
DocHtmlCell
*c)
437
{
438
indent_post
();
439
printf(
"</t%c>\n"
,c->
isHeading
()?
'h'
:
'd'
);
440
}
441
void
visitPre
(
DocHtmlCaption
*)
442
{
443
indent_pre
();
444
printf(
"<caption>\n"
);
445
}
446
void
visitPost
(
DocHtmlCaption
*)
447
{
448
indent_post
();
449
printf(
"</caption>\n"
);
450
}
451
void
visitPre
(
DocInternal
*)
452
{
453
indent_pre
();
454
printf(
"<internal>\n"
);
455
}
456
void
visitPost
(
DocInternal
*)
457
{
458
indent_post
();
459
printf(
"</internal>\n"
);
460
}
461
void
visitPre
(
DocHRef
*href)
462
{
463
indent_pre
();
464
printf(
"<a url=\"%s\">\n"
,href->
url
().data());
465
}
466
void
visitPost
(
DocHRef
*)
467
{
468
indent_post
();
469
printf(
"</a>\n"
);
470
}
471
void
visitPre
(
DocHtmlHeader
*header)
472
{
473
indent_pre
();
474
printf(
"<h%d>\n"
,header->
level
());
475
}
476
void
visitPost
(
DocHtmlHeader
*header)
477
{
478
indent_post
();
479
printf(
"</h%d>\n"
,header->
level
());
480
}
481
void
visitPre
(
DocImage
*img)
482
{
483
indent_pre
();
484
printf(
"<image src=\"%s\" type=\""
,img->
name
().data());
485
switch
(img->
type
())
486
{
487
case
DocImage::Html
: printf(
"html"
);
break
;
488
case
DocImage::Latex
: printf(
"latex"
);
break
;
489
case
DocImage::Rtf
: printf(
"rtf"
);
break
;
490
case
DocImage::DocBook
: printf(
"docbook"
);
break
;
491
}
492
printf(
"\" %s %s>\n"
,img->
width
().data(),img->
height
().data());
493
}
494
void
visitPost
(
DocImage
*)
495
{
496
indent_post
();
497
printf(
"</image>\n"
);
498
}
499
void
visitPre
(
DocDotFile
*df)
500
{
501
indent_pre
();
502
printf(
"<dotfile src=\"%s\">\n"
,df->
name
().data());
503
}
504
void
visitPost
(
DocDotFile
*)
505
{
506
indent_post
();
507
printf(
"</dotfile>\n"
);
508
}
509
void
visitPre
(
DocMscFile
*df)
510
{
511
indent_pre
();
512
printf(
"<mscfile src=\"%s\">\n"
,df->
name
().data());
513
}
514
void
visitPost
(
DocMscFile
*)
515
{
516
indent_post
();
517
printf(
"</mscfile>\n"
);
518
}
519
void
visitPre
(
DocDiaFile
*df)
520
{
521
indent_pre
();
522
printf(
"<diafile src=\"%s\">\n"
,df->
name
().data());
523
}
524
void
visitPost
(
DocDiaFile
*)
525
{
526
indent_post
();
527
printf(
"</diafile>\n"
);
528
}
529
void
visitPre
(
DocLink
*lnk)
530
{
531
indent_pre
();
532
printf(
"<link ref=\"%s\" file=\"%s\" anchor=\"%s\">\n"
,
533
lnk->
ref
().data(),lnk->
file
().data(),lnk->
anchor
().data());
534
}
535
void
visitPost
(
DocLink
*)
536
{
537
indent_post
();
538
printf(
"</link>\n"
);
539
}
540
void
visitPre
(
DocRef
*ref)
541
{
542
indent_pre
();
543
printf(
"<ref ref=\"%s\" file=\"%s\" "
544
"anchor=\"%s\" targetTitle=\"%s\""
545
" hasLinkText=\"%s\" refToAnchor=\"%s\" refToSection=\"%s\" refToTable=\"%s\">\n"
,
546
ref->
ref
().data(),ref->
file
().data(),ref->
anchor
().data(),
547
ref->
targetTitle
().data(),ref->
hasLinkText
()?
"yes"
:
"no"
,
548
ref->
refToAnchor
()?
"yes"
:
"no"
, ref->
refToSection
()?
"yes"
:
"no"
,
549
ref->
refToTable
()?
"yes"
:
"no"
);
550
}
551
void
visitPost
(
DocRef
*)
552
{
553
indent_post
();
554
printf(
"</ref>\n"
);
555
}
556
void
visitPre
(
DocSecRefItem
*ref)
557
{
558
indent_pre
();
559
printf(
"<secrefitem target=\"%s\">\n"
,ref->
target
().data());
560
}
561
void
visitPost
(
DocSecRefItem
*)
562
{
563
indent_post
();
564
printf(
"</secrefitem>\n"
);
565
}
566
void
visitPre
(
DocSecRefList
*)
567
{
568
indent_pre
();
569
printf(
"<secreflist>\n"
);
570
}
571
void
visitPost
(
DocSecRefList
*)
572
{
573
indent_post
();
574
printf(
"</secreflist>\n"
);
575
}
576
//void visitPre(DocLanguage *l)
577
//{
578
// indent_pre();
579
// printf("<language id=%s>\n",l->id().data());
580
//}
581
//void visitPost(DocLanguage *)
582
//{
583
// indent_post();
584
// printf("</language>\n");
585
//}
586
void
visitPre
(
DocParamList
*pl)
587
{
588
indent_pre
();
589
//QStrListIterator sli(pl->parameters());
590
QListIterator<DocNode> sli(pl->
parameters
());
591
//const char *s;
592
DocNode
*param;
593
printf(
"<parameters>"
);
594
for
(sli.toFirst();(param=sli.current());++sli)
595
{
596
printf(
"<param>"
);
597
if
(param->kind()==
DocNode::Kind_Word
)
598
{
599
visit
((
DocWord
*)param);
600
}
601
else
if
(param->kind()==
DocNode::Kind_LinkedWord
)
602
{
603
visit
((
DocLinkedWord
*)param);
604
}
605
printf(
"</param>"
);
606
}
607
printf(
"\n"
);
608
}
609
void
visitPost
(
DocParamList
*)
610
{
611
indent_post
();
612
printf(
"</parameters>\n"
);
613
}
614
void
visitPre
(
DocParamSect
*ps)
615
{
616
indent_pre
();
617
printf(
"<paramsect type="
);
618
switch
(ps->
type
())
619
{
620
case
DocParamSect::Param
: printf(
"param"
);
break
;
621
case
DocParamSect::RetVal
: printf(
"retval"
);
break
;
622
case
DocParamSect::Exception
: printf(
"exception"
);
break
;
623
case
DocParamSect::TemplateParam
: printf(
"templateparam"
);
break
;
624
case
DocParamSect::Unknown
: printf(
"unknown"
);
break
;
625
}
626
printf(
">\n"
);
627
}
628
void
visitPost
(
DocParamSect
*)
629
{
630
indent_post
();
631
printf(
"</paramsect>\n"
);
632
}
633
void
visitPre
(
DocXRefItem
*x)
634
{
635
indent_pre
();
636
printf(
"<xrefitem file=\"%s\" anchor=\"%s\" title=\"%s\"/>\n"
,
637
x->
file
().data(),x->
anchor
().data(),x->
title
().data());
638
}
639
void
visitPost
(
DocXRefItem
*)
640
{
641
indent_post
();
642
printf(
"<xrefitem/>\n"
);
643
}
644
void
visitPre
(
DocInternalRef
*r)
645
{
646
indent_pre
();
647
printf(
"<internalref file=%s anchor=%s>\n"
,r->
file
().data(),r->
anchor
().data());
648
}
649
void
visitPost
(
DocInternalRef
*)
650
{
651
indent_post
();
652
printf(
"</internalref>\n"
);
653
}
654
void
visitPre
(
DocCopy
*c)
655
{
656
indent_pre
();
657
printf(
"<copy link=\"%s\">\n"
,c->
link
().data());
658
}
659
void
visitPost
(
DocCopy
*)
660
{
661
indent_post
();
662
printf(
"</copy>\n"
);
663
}
664
void
visitPre
(
DocText
*)
665
{
666
indent_pre
();
667
printf(
"<text>\n"
);
668
}
669
void
visitPost
(
DocText
*)
670
{
671
indent_post
();
672
printf(
"</text>\n"
);
673
}
674
void
visitPre
(
DocHtmlBlockQuote
*)
675
{
676
indent_pre
();
677
printf(
"<blockquote>\n"
);
678
}
679
void
visitPost
(
DocHtmlBlockQuote
*)
680
{
681
indent_post
();
682
printf(
"</blockquote>\n"
);
683
}
684
void
visitPre
(
DocVhdlFlow
*)
685
{
686
indent_pre
();
687
printf(
"<vhdlflow>\n"
);
688
}
689
void
visitPost
(
DocVhdlFlow
*)
690
{
691
indent_post
();
692
printf(
"</vhdlflow>\n"
);
693
}
694
void
visitPre
(
DocParBlock
*)
695
{
696
indent_pre
();
697
printf(
"<parblock>\n"
);
698
}
699
void
visitPost
(
DocParBlock
*)
700
{
701
indent_post
();
702
printf(
"</parblock>\n"
);
703
}
704
705
private
:
706
// helper functions
707
void
indent
()
708
{
709
if
(
m_needsEnter
) printf(
"\n"
);
710
for
(
int
i=0;i<
m_indent
;i++) printf(
"."
);
711
m_needsEnter
=FALSE;
712
}
713
void
indent_leaf
()
714
{
715
if
(!
m_needsEnter
)
indent
();
716
m_needsEnter
=TRUE;
717
}
718
void
indent_pre
()
719
{
720
indent
();
721
m_indent
++;
722
}
723
void
indent_post
()
724
{
725
m_indent
--;
726
indent
();
727
}
728
729
// member variables
730
int
m_indent
;
731
bool
m_needsEnter
;
732
bool
m_insidePre
;
733
};
734
735
#endif