1 /******************************************************************************
6 * Copyright (C) 1997-2012 by Dimitri van Heesch.
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.
14 * Documents produced by Doxygen are derivative works derived from the
15 * input used in their production; they are not affected by this license.
19 #include "xmldocvisitor.h"
20 #include "docparser.h"
23 #include "outputgen.h"
28 #include <qfileinfo.h>
29 #include "parserintf.h"
31 XmlDocVisitor::XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci)
32 : DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE)
36 //--------------------------------------
37 // visitor functions for leaf nodes
38 //--------------------------------------
40 void XmlDocVisitor::visit(DocWord *w)
46 void XmlDocVisitor::visit(DocLinkedWord *w)
49 startLink(w->ref(),w->file(),w->anchor());
54 void XmlDocVisitor::visit(DocWhiteSpace *w)
67 void XmlDocVisitor::visit(DocSymbol *s)
72 case DocSymbol::BSlash: m_t << "\\"; break;
73 case DocSymbol::At: m_t << "@"; break;
74 case DocSymbol::Less: m_t << "<"; break;
75 case DocSymbol::Greater: m_t << ">"; break;
76 case DocSymbol::Amp: m_t << "&"; break;
77 case DocSymbol::Dollar: m_t << "$"; break;
78 case DocSymbol::Hash: m_t << "#"; break;
79 case DocSymbol::DoubleColon: m_t << "::"; break;
80 case DocSymbol::Percent: m_t << "%"; break;
81 case DocSymbol::Pipe: m_t << "|"; break;
82 case DocSymbol::Copy: m_t << "<copy/>"; break;
83 case DocSymbol::Tm: m_t << "<trademark/>"; break;
84 case DocSymbol::Reg: m_t << "<registered/>"; break;
85 case DocSymbol::Apos: m_t << "'"; break;
86 case DocSymbol::Quot: m_t << "\""; break;
87 case DocSymbol::Lsquo: m_t << "<lsquo/>"; break;
88 case DocSymbol::Rsquo: m_t << "<rsquo/>"; break;
89 case DocSymbol::Ldquo: m_t << "<ldquo/>"; break;
90 case DocSymbol::Rdquo: m_t << "<rdquo/>"; break;
91 case DocSymbol::Ndash: m_t << "<ndash/>"; break;
92 case DocSymbol::Mdash: m_t << "<mdash/>"; break;
93 case DocSymbol::Uml: m_t << "<umlaut char=\"" << s->letter() << "\"/>"; break;
94 case DocSymbol::Acute: m_t << "<acute char=\"" << s->letter() << "\"/>"; break;
95 case DocSymbol::Grave: m_t << "<grave char=\"" << s->letter() << "\"/>"; break;
96 case DocSymbol::Circ: m_t << "<circ char=\"" << s->letter() << "\"/>"; break;
97 case DocSymbol::Tilde: m_t << "<tilde char=\"" << s->letter() << "\"/>"; break;
98 case DocSymbol::Szlig: m_t << "<szlig/>"; break;
99 case DocSymbol::Cedil: m_t << "<cedil char=\"" << s->letter() << "\"/>"; break;
100 case DocSymbol::Ring: m_t << "<ring char=\"" << s->letter() << "\"/>"; break;
101 case DocSymbol::Slash: m_t << "<slash char=\"" << s->letter() << "\"/>"; break;
102 case DocSymbol::Nbsp: m_t << "<nonbreakablespace/>"; break;
103 case DocSymbol::Aelig: m_t << "<aelig/>"; break;
104 case DocSymbol::AElig: m_t << "<AElig/>"; break;
105 case DocSymbol::GrkGamma: m_t << "<Gamma>"; break;
106 case DocSymbol::GrkDelta: m_t << "<Delta>"; break;
107 case DocSymbol::GrkTheta: m_t << "<Theta>"; break;
108 case DocSymbol::GrkLambda: m_t << "<Lambda>"; break;
109 case DocSymbol::GrkXi: m_t << "<Xi>"; break;
110 case DocSymbol::GrkPi: m_t << "<Pi>"; break;
111 case DocSymbol::GrkSigma: m_t << "<Sigma>"; break;
112 case DocSymbol::GrkUpsilon: m_t << "<Upsilon>"; break;
113 case DocSymbol::GrkPhi: m_t << "<Phi>"; break;
114 case DocSymbol::GrkPsi: m_t << "<Psi>"; break;
115 case DocSymbol::GrkOmega: m_t << "<Omega>"; break;
116 case DocSymbol::Grkalpha: m_t << "<alpha>"; break;
117 case DocSymbol::Grkbeta: m_t << "<beta>"; break;
118 case DocSymbol::Grkgamma: m_t << "<gamma>"; break;
119 case DocSymbol::Grkdelta: m_t << "<delta>"; break;
120 case DocSymbol::Grkepsilon: m_t << "<epsilon>"; break;
121 case DocSymbol::Grkzeta: m_t << "<zeta>"; break;
122 case DocSymbol::Grketa: m_t << "<eta>"; break;
123 case DocSymbol::Grktheta: m_t << "<theta>"; break;
124 case DocSymbol::Grkiota: m_t << "<iota>"; break;
125 case DocSymbol::Grkkappa: m_t << "<kappa>"; break;
126 case DocSymbol::Grklambda: m_t << "<lambda>"; break;
127 case DocSymbol::Grkmu: m_t << "<mu>"; break;
128 case DocSymbol::Grknu: m_t << "<nu>"; break;
129 case DocSymbol::Grkxi: m_t << "<xi>"; break;
130 case DocSymbol::Grkpi: m_t << "<pi>"; break;
131 case DocSymbol::Grkrho: m_t << "<rho>"; break;
132 case DocSymbol::Grksigma: m_t << "<sigma>"; break;
133 case DocSymbol::Grktau: m_t << "<tau>"; break;
134 case DocSymbol::Grkupsilon: m_t << "<upsilon>"; break;
135 case DocSymbol::Grkphi: m_t << "<phi>"; break;
136 case DocSymbol::Grkchi: m_t << "<chi>"; break;
137 case DocSymbol::Grkpsi: m_t << "<psi>"; break;
138 case DocSymbol::Grkomega: m_t << "<omega>"; break;
139 case DocSymbol::Grkvarsigma: m_t << "<sigmaf>"; break;
140 case DocSymbol::Section: m_t << "<sect>"; break;
141 case DocSymbol::Degree: m_t << "<deg>"; break;
142 case DocSymbol::Prime: m_t << "<prime>"; break;
143 case DocSymbol::DoublePrime: m_t << "<Prime>"; break;
144 case DocSymbol::Infinity: m_t << "<infin>"; break;
145 case DocSymbol::EmptySet: m_t << "<empty>"; break;
146 case DocSymbol::PlusMinus: m_t << "<plusmn>"; break;
147 case DocSymbol::Times: m_t << "<times>"; break;
148 case DocSymbol::Minus: m_t << "<minus>"; break;
149 case DocSymbol::CenterDot: m_t << "<sdot>"; break;
150 case DocSymbol::Partial: m_t << "<part>"; break;
151 case DocSymbol::Nabla: m_t << "<nabla>"; break;
152 case DocSymbol::SquareRoot: m_t << "<radic>"; break;
153 case DocSymbol::Perpendicular: m_t << "<perp>"; break;
154 case DocSymbol::Sum: m_t << "<sum>"; break;
155 case DocSymbol::Integral: m_t << "<int>"; break;
156 case DocSymbol::Product: m_t << "<prod>"; break;
157 case DocSymbol::Similar: m_t << "<sim>"; break;
158 case DocSymbol::Approx: m_t << "<asymp>"; break;
159 case DocSymbol::NotEqual: m_t << "<ne>"; break;
160 case DocSymbol::Equivalent: m_t << "<equiv>"; break;
161 case DocSymbol::Proportional: m_t << "<prop>"; break;
162 case DocSymbol::LessEqual: m_t << "<le>"; break;
163 case DocSymbol::GreaterEqual: m_t << "<ge>"; break;
164 case DocSymbol::LeftArrow: m_t << "<larr>"; break;
165 case DocSymbol::RightArrow: m_t << "<rarr>"; break;
166 case DocSymbol::SetIn: m_t << "<isin>"; break;
167 case DocSymbol::SetNotIn: m_t << "<notin>"; break;
168 case DocSymbol::LeftCeil: m_t << "<lceil>"; break;
169 case DocSymbol::RightCeil: m_t << "<rceil>"; break;
170 case DocSymbol::LeftFloor: m_t << "<lfloor>"; break;
171 case DocSymbol::RightFloor: m_t << "<rfloor>"; break;
173 err("error: unknown symbol found\n");
177 void XmlDocVisitor::visit(DocURL *u)
180 m_t << "<ulink url=\"";
181 if (u->isEmail()) m_t << "mailto:";
188 void XmlDocVisitor::visit(DocLineBreak *)
191 m_t << "<linebreak/>\n";
194 void XmlDocVisitor::visit(DocHorRuler *)
197 m_t << "<hruler/>\n";
200 void XmlDocVisitor::visit(DocStyleChange *s)
205 case DocStyleChange::Bold:
206 if (s->enable()) m_t << "<bold>"; else m_t << "</bold>";
208 case DocStyleChange::Italic:
209 if (s->enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
211 case DocStyleChange::Code:
212 if (s->enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
214 case DocStyleChange::Subscript:
215 if (s->enable()) m_t << "<subscript>"; else m_t << "</subscript>";
217 case DocStyleChange::Superscript:
218 if (s->enable()) m_t << "<superscript>"; else m_t << "</superscript>";
220 case DocStyleChange::Center:
221 if (s->enable()) m_t << "<center>"; else m_t << "</center>";
223 case DocStyleChange::Small:
224 if (s->enable()) m_t << "<small>"; else m_t << "</small>";
226 case DocStyleChange::Preformatted:
229 m_t << "<preformatted>";
234 m_t << "</preformatted>";
238 case DocStyleChange::Div: /* HTML only */ break;
239 case DocStyleChange::Span: /* HTML only */ break;
243 void XmlDocVisitor::visit(DocVerbatim *s)
248 case DocVerbatim::Code: // fall though
249 m_t << "<programlisting>";
250 Doxygen::parserManager->getParser(m_langExt)
251 ->parseCode(m_ci,s->context(),s->text(),
252 s->isExample(),s->exampleFile());
253 m_t << "</programlisting>";
255 case DocVerbatim::Verbatim:
258 m_t << "</verbatim>";
260 case DocVerbatim::HtmlOnly:
263 m_t << "</htmlonly>";
265 case DocVerbatim::RtfOnly:
270 case DocVerbatim::ManOnly:
275 case DocVerbatim::LatexOnly:
276 m_t << "<latexonly>";
278 m_t << "</latexonly>";
280 case DocVerbatim::XmlOnly:
283 case DocVerbatim::Dot:
288 case DocVerbatim::Msc:
296 void XmlDocVisitor::visit(DocAnchor *anc)
299 m_t << "<anchor id=\"" << anc->file() << "_1" << anc->anchor() << "\"/>";
302 void XmlDocVisitor::visit(DocInclude *inc)
307 case DocInclude::IncWithLines:
309 m_t << "<programlisting>";
310 QFileInfo cfi( inc->file() );
311 FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
312 Doxygen::parserManager->getParser(inc->extension())
313 ->parseCode(m_ci,inc->context(),
316 inc->exampleFile(), &fd);
317 m_t << "</programlisting>";
320 case DocInclude::Include:
321 m_t << "<programlisting>";
322 Doxygen::parserManager->getParser(inc->extension())
323 ->parseCode(m_ci,inc->context(),
327 m_t << "</programlisting>";
329 case DocInclude::DontInclude:
331 case DocInclude::HtmlInclude:
334 m_t << "</htmlonly>";
336 case DocInclude::VerbInclude:
339 m_t << "</verbatim>";
341 case DocInclude::Snippet:
342 m_t << "<programlisting>";
343 Doxygen::parserManager->getParser(inc->extension())
346 extractBlock(inc->text(),inc->blockId()),
350 m_t << "</programlisting>";
355 void XmlDocVisitor::visit(DocIncOperator *op)
357 //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
358 // op->type(),op->isFirst(),op->isLast(),op->text().data());
363 m_t << "<programlisting>";
368 if (op->type()!=DocIncOperator::Skip)
373 Doxygen::parserManager->getParser(m_langExt)
374 ->parseCode(m_ci,op->context(),
375 op->text(),op->isExample(),
384 if (!m_hide) m_t << "</programlisting>";
388 if (!m_hide) m_t << endl;
392 void XmlDocVisitor::visit(DocFormula *f)
395 m_t << "<formula id=\"" << f->id() << "\">";
400 void XmlDocVisitor::visit(DocIndexEntry *ie)
403 m_t << "<indexentry>"
406 m_t << "</primaryie>"
407 "<secondaryie></secondaryie>"
411 void XmlDocVisitor::visit(DocSimpleSectSep *)
413 m_t << "<simplesectsep/>";
416 void XmlDocVisitor::visit(DocCite *cite)
419 if (!cite->file().isEmpty()) startLink(cite->ref(),cite->file(),cite->anchor());
420 filter(cite->text());
421 if (!cite->file().isEmpty()) endLink();
424 //--------------------------------------
425 // visitor functions for compound nodes
426 //--------------------------------------
428 void XmlDocVisitor::visitPre(DocAutoList *l)
433 m_t << "<orderedlist>\n";
437 m_t << "<itemizedlist>\n";
441 void XmlDocVisitor::visitPost(DocAutoList *l)
446 m_t << "</orderedlist>\n";
450 m_t << "</itemizedlist>\n";
454 void XmlDocVisitor::visitPre(DocAutoListItem *)
460 void XmlDocVisitor::visitPost(DocAutoListItem *)
463 m_t << "</listitem>";
466 void XmlDocVisitor::visitPre(DocPara *)
472 void XmlDocVisitor::visitPost(DocPara *)
478 void XmlDocVisitor::visitPre(DocRoot *)
480 //m_t << "<hr><h4><font color=\"red\">New parser:</font></h4>\n";
483 void XmlDocVisitor::visitPost(DocRoot *)
485 //m_t << "<hr><h4><font color=\"red\">Old parser:</font></h4>\n";
488 void XmlDocVisitor::visitPre(DocSimpleSect *s)
491 m_t << "<simplesect kind=\"";
494 case DocSimpleSect::See:
496 case DocSimpleSect::Return:
497 m_t << "return"; break;
498 case DocSimpleSect::Author:
499 m_t << "author"; break;
500 case DocSimpleSect::Authors:
501 m_t << "authors"; break;
502 case DocSimpleSect::Version:
503 m_t << "version"; break;
504 case DocSimpleSect::Since:
505 m_t << "since"; break;
506 case DocSimpleSect::Date:
507 m_t << "date"; break;
508 case DocSimpleSect::Note:
509 m_t << "note"; break;
510 case DocSimpleSect::Warning:
511 m_t << "warning"; break;
512 case DocSimpleSect::Pre:
514 case DocSimpleSect::Post:
515 m_t << "post"; break;
516 case DocSimpleSect::Copyright:
517 m_t << "copyright"; break;
518 case DocSimpleSect::Invar:
519 m_t << "invariant"; break;
520 case DocSimpleSect::Remark:
521 m_t << "remark"; break;
522 case DocSimpleSect::Attention:
523 m_t << "attention"; break;
524 case DocSimpleSect::User:
526 case DocSimpleSect::Rcs:
528 case DocSimpleSect::Unknown: break;
533 void XmlDocVisitor::visitPost(DocSimpleSect *)
536 m_t << "</simplesect>\n";
539 void XmlDocVisitor::visitPre(DocTitle *)
545 void XmlDocVisitor::visitPost(DocTitle *)
551 void XmlDocVisitor::visitPre(DocSimpleList *)
554 m_t << "<itemizedlist>\n";
557 void XmlDocVisitor::visitPost(DocSimpleList *)
560 m_t << "</itemizedlist>\n";
563 void XmlDocVisitor::visitPre(DocSimpleListItem *)
569 void XmlDocVisitor::visitPost(DocSimpleListItem *)
572 m_t << "</listitem>\n";
575 void XmlDocVisitor::visitPre(DocSection *s)
578 m_t << "<sect" << s->level() << " id=\"" << s->file();
579 if (!s->anchor().isEmpty()) m_t << "_1" << s->anchor();
580 m_t << "\">" << endl;
583 m_t << "</title>" << endl;
586 void XmlDocVisitor::visitPost(DocSection *s)
588 m_t << "</sect" << s->level() << ">\n";
591 void XmlDocVisitor::visitPre(DocHtmlList *s)
594 if (s->type()==DocHtmlList::Ordered)
595 m_t << "<orderedlist>\n";
597 m_t << "<itemizedlist>\n";
600 void XmlDocVisitor::visitPost(DocHtmlList *s)
603 if (s->type()==DocHtmlList::Ordered)
604 m_t << "</orderedlist>\n";
606 m_t << "</itemizedlist>\n";
609 void XmlDocVisitor::visitPre(DocHtmlListItem *)
612 m_t << "<listitem>\n";
615 void XmlDocVisitor::visitPost(DocHtmlListItem *)
618 m_t << "</listitem>\n";
621 void XmlDocVisitor::visitPre(DocHtmlDescList *)
624 m_t << "<variablelist>\n";
627 void XmlDocVisitor::visitPost(DocHtmlDescList *)
630 m_t << "</variablelist>\n";
633 void XmlDocVisitor::visitPre(DocHtmlDescTitle *)
636 m_t << "<varlistentry><term>";
639 void XmlDocVisitor::visitPost(DocHtmlDescTitle *)
642 m_t << "</term></varlistentry>\n";
645 void XmlDocVisitor::visitPre(DocHtmlDescData *)
651 void XmlDocVisitor::visitPost(DocHtmlDescData *)
654 m_t << "</listitem>\n";
657 void XmlDocVisitor::visitPre(DocHtmlTable *t)
660 m_t << "<table rows=\"" << t->numRows()
661 << "\" cols=\"" << t->numColumns() << "\">" ;
664 void XmlDocVisitor::visitPost(DocHtmlTable *)
670 void XmlDocVisitor::visitPre(DocHtmlRow *)
676 void XmlDocVisitor::visitPost(DocHtmlRow *)
682 void XmlDocVisitor::visitPre(DocHtmlCell *c)
685 if (c->isHeading()) m_t << "<entry thead=\"yes\">"; else m_t << "<entry thead=\"no\">";
688 void XmlDocVisitor::visitPost(DocHtmlCell *)
694 void XmlDocVisitor::visitPre(DocHtmlCaption *)
700 void XmlDocVisitor::visitPost(DocHtmlCaption *)
703 m_t << "</caption>\n";
706 void XmlDocVisitor::visitPre(DocInternal *)
712 void XmlDocVisitor::visitPost(DocInternal *)
715 m_t << "</internal>" << endl;
718 void XmlDocVisitor::visitPre(DocHRef *href)
721 m_t << "<ulink url=\"" << href->url() << "\">";
724 void XmlDocVisitor::visitPost(DocHRef *)
730 void XmlDocVisitor::visitPre(DocHtmlHeader *header)
733 m_t << "<heading level=\"" << header->level() << "\">";
736 void XmlDocVisitor::visitPost(DocHtmlHeader *)
739 m_t << "</heading>\n";
742 void XmlDocVisitor::visitPre(DocImage *img)
745 m_t << "<image type=\"";
748 case DocImage::Html: m_t << "html"; break;
749 case DocImage::Latex: m_t << "latex"; break;
750 case DocImage::Rtf: m_t << "rtf"; break;
754 QCString baseName=img->name();
756 if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
758 baseName=baseName.right(baseName.length()-i-1);
760 m_t << " name=\"" << baseName << "\"";
761 if (!img->width().isEmpty())
764 filter(img->width());
767 else if (!img->height().isEmpty())
770 filter(img->height());
775 // copy the image to the output dir
776 QFile inImage(img->name());
777 QFile outImage(Config_getString("XML_OUTPUT")+"/"+baseName.data());
778 if (inImage.open(IO_ReadOnly))
780 if (outImage.open(IO_WriteOnly))
782 char *buffer = new char[inImage.size()];
783 inImage.readBlock(buffer,inImage.size());
784 outImage.writeBlock(buffer,inImage.size());
791 void XmlDocVisitor::visitPost(DocImage *)
794 m_t << "</image>" << endl;
797 void XmlDocVisitor::visitPre(DocDotFile *df)
800 m_t << "<dotfile name=\"" << df->file() << "\">";
803 void XmlDocVisitor::visitPost(DocDotFile *)
806 m_t << "</dotfile>" << endl;
809 void XmlDocVisitor::visitPre(DocMscFile *df)
812 m_t << "<mscfile name=\"" << df->file() << "\">";
815 void XmlDocVisitor::visitPost(DocMscFile *)
818 m_t << "</mscfile>" << endl;
820 void XmlDocVisitor::visitPre(DocLink *lnk)
823 startLink(lnk->ref(),lnk->file(),lnk->anchor());
826 void XmlDocVisitor::visitPost(DocLink *)
832 void XmlDocVisitor::visitPre(DocRef *ref)
835 if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor());
836 if (!ref->hasLinkText()) filter(ref->targetTitle());
839 void XmlDocVisitor::visitPost(DocRef *ref)
842 if (!ref->file().isEmpty()) endLink();
846 void XmlDocVisitor::visitPre(DocSecRefItem *ref)
849 m_t << "<tocitem id=\"" << ref->file() << "_1" << ref->anchor() << "\">";
852 void XmlDocVisitor::visitPost(DocSecRefItem *)
855 m_t << "</tocitem>" << endl;
858 void XmlDocVisitor::visitPre(DocSecRefList *)
861 m_t << "<toclist>" << endl;
864 void XmlDocVisitor::visitPost(DocSecRefList *)
867 m_t << "</toclist>" << endl;
870 //void XmlDocVisitor::visitPre(DocLanguage *l)
872 // if (m_hide) return;
873 // m_t << "<language langid=\"" << l->id() << "\">";
876 //void XmlDocVisitor::visitPost(DocLanguage *)
878 // if (m_hide) return;
879 // m_t << "</language>" << endl;
882 void XmlDocVisitor::visitPre(DocParamSect *s)
885 m_t << "<parameterlist kind=\"";
888 case DocParamSect::Param:
889 m_t << "param"; break;
890 case DocParamSect::RetVal:
891 m_t << "retval"; break;
892 case DocParamSect::Exception:
893 m_t << "exception"; break;
894 case DocParamSect::TemplateParam:
895 m_t << "templateparam"; break;
902 void XmlDocVisitor::visitPost(DocParamSect *)
905 m_t << "</parameterlist>" << endl;
908 void XmlDocVisitor::visitPre(DocParamList *pl)
911 m_t << "<parameteritem>" << endl;
912 m_t << "<parameternamelist>" << endl;
913 //QStrListIterator li(pl->parameters());
915 QListIterator<DocNode> li(pl->parameters());
917 for (li.toFirst();(param=li.current());++li)
919 if (pl->paramTypes().count()>0)
921 QListIterator<DocNode> li(pl->paramTypes());
923 for (li.toFirst();(type=li.current());++li)
925 m_t << "<parametertype>";
926 if (type->kind()==DocNode::Kind_Word)
928 visit((DocWord*)type);
930 else if (type->kind()==DocNode::Kind_LinkedWord)
932 visit((DocLinkedWord*)type);
934 m_t << "</parametertype>" << endl;
937 m_t << "<parametername";
938 if (pl->direction()!=DocParamSect::Unspecified)
940 m_t << " direction=\"";
941 if (pl->direction()==DocParamSect::In)
945 else if (pl->direction()==DocParamSect::Out)
949 else if (pl->direction()==DocParamSect::InOut)
956 if (param->kind()==DocNode::Kind_Word)
958 visit((DocWord*)param);
960 else if (param->kind()==DocNode::Kind_LinkedWord)
962 visit((DocLinkedWord*)param);
964 m_t << "</parametername>" << endl;
966 m_t << "</parameternamelist>" << endl;
967 m_t << "<parameterdescription>" << endl;
970 void XmlDocVisitor::visitPost(DocParamList *)
973 m_t << "</parameterdescription>" << endl;
974 m_t << "</parameteritem>" << endl;
977 void XmlDocVisitor::visitPre(DocXRefItem *x)
980 m_t << "<xrefsect id=\"";
981 m_t << x->file() << "_1" << x->anchor();
983 m_t << "<xreftitle>";
985 m_t << "</xreftitle>";
986 m_t << "<xrefdescription>";
989 void XmlDocVisitor::visitPost(DocXRefItem *)
992 m_t << "</xrefdescription>";
993 m_t << "</xrefsect>";
996 void XmlDocVisitor::visitPre(DocInternalRef *ref)
999 startLink(0,ref->file(),ref->anchor());
1002 void XmlDocVisitor::visitPost(DocInternalRef *)
1009 void XmlDocVisitor::visitPre(DocCopy *c)
1012 m_t << "<copydoc link=\"" << convertToXML(c->link()) << "\">";
1015 void XmlDocVisitor::visitPost(DocCopy *)
1018 m_t << "</copydoc>" << endl;
1021 void XmlDocVisitor::visitPre(DocText *)
1025 void XmlDocVisitor::visitPost(DocText *)
1029 void XmlDocVisitor::visitPre(DocHtmlBlockQuote *)
1032 m_t << "<blockquote>";
1035 void XmlDocVisitor::visitPost(DocHtmlBlockQuote *)
1038 m_t << "</blockquote>";
1042 void XmlDocVisitor::filter(const char *str)
1044 m_t << convertToXML(str);
1047 void XmlDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor)
1049 m_t << "<ref refid=\"" << file;
1050 if (!anchor.isEmpty()) m_t << "_1" << anchor;
1051 m_t << "\" kindref=\"";
1052 if (!anchor.isEmpty()) m_t << "member"; else m_t << "compound";
1054 if (!ref.isEmpty()) m_t << " external=\"" << ref << "\"";
1058 void XmlDocVisitor::endLink()
1063 void XmlDocVisitor::pushEnabled()
1065 m_enabled.push(new bool(m_hide));
1068 void XmlDocVisitor::popEnabled()
1070 bool *v=m_enabled.pop();