My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XmlDocVisitor Class Reference

Concrete visitor implementation for XML output. More...

#include <xmldocvisitor.h>

Inheritance diagram for XmlDocVisitor:
DocVisitor

Public Member Functions

 XmlDocVisitor (FTextStream &t, CodeOutputInterface &ci)
 
void visit (DocWord *)
 
void visit (DocLinkedWord *)
 
void visit (DocWhiteSpace *)
 
void visit (DocSymbol *)
 
void visit (DocURL *)
 
void visit (DocLineBreak *)
 
void visit (DocHorRuler *)
 
void visit (DocStyleChange *)
 
void visit (DocVerbatim *)
 
void visit (DocAnchor *)
 
void visit (DocInclude *)
 
void visit (DocIncOperator *)
 
void visit (DocFormula *)
 
void visit (DocIndexEntry *)
 
void visit (DocSimpleSectSep *)
 
void visit (DocCite *)
 
void visitPre (DocAutoList *)
 
void visitPost (DocAutoList *)
 
void visitPre (DocAutoListItem *)
 
void visitPost (DocAutoListItem *)
 
void visitPre (DocPara *)
 
void visitPost (DocPara *)
 
void visitPre (DocRoot *)
 
void visitPost (DocRoot *)
 
void visitPre (DocSimpleSect *)
 
void visitPost (DocSimpleSect *)
 
void visitPre (DocTitle *)
 
void visitPost (DocTitle *)
 
void visitPre (DocSimpleList *)
 
void visitPost (DocSimpleList *)
 
void visitPre (DocSimpleListItem *)
 
void visitPost (DocSimpleListItem *)
 
void visitPre (DocSection *)
 
void visitPost (DocSection *)
 
void visitPre (DocHtmlList *)
 
void visitPost (DocHtmlList *)
 
void visitPre (DocHtmlListItem *)
 
void visitPost (DocHtmlListItem *)
 
void visitPre (DocHtmlDescList *)
 
void visitPost (DocHtmlDescList *)
 
void visitPre (DocHtmlDescTitle *)
 
void visitPost (DocHtmlDescTitle *)
 
void visitPre (DocHtmlDescData *)
 
void visitPost (DocHtmlDescData *)
 
void visitPre (DocHtmlTable *)
 
void visitPost (DocHtmlTable *)
 
void visitPre (DocHtmlRow *)
 
void visitPost (DocHtmlRow *)
 
void visitPre (DocHtmlCell *)
 
void visitPost (DocHtmlCell *)
 
void visitPre (DocHtmlCaption *)
 
void visitPost (DocHtmlCaption *)
 
void visitPre (DocInternal *)
 
void visitPost (DocInternal *)
 
void visitPre (DocHRef *)
 
void visitPost (DocHRef *)
 
void visitPre (DocHtmlHeader *)
 
void visitPost (DocHtmlHeader *)
 
void visitPre (DocImage *)
 
void visitPost (DocImage *)
 
void visitPre (DocDotFile *)
 
void visitPost (DocDotFile *)
 
void visitPre (DocMscFile *)
 
void visitPost (DocMscFile *)
 
void visitPre (DocDiaFile *)
 
void visitPost (DocDiaFile *)
 
void visitPre (DocLink *)
 
void visitPost (DocLink *)
 
void visitPre (DocRef *)
 
void visitPost (DocRef *)
 
void visitPre (DocSecRefItem *)
 
void visitPost (DocSecRefItem *)
 
void visitPre (DocSecRefList *)
 
void visitPost (DocSecRefList *)
 
void visitPre (DocParamSect *)
 
void visitPost (DocParamSect *)
 
void visitPre (DocParamList *)
 
void visitPost (DocParamList *)
 
void visitPre (DocXRefItem *)
 
void visitPost (DocXRefItem *)
 
void visitPre (DocInternalRef *)
 
void visitPost (DocInternalRef *)
 
void visitPre (DocCopy *)
 
void visitPost (DocCopy *)
 
void visitPre (DocText *)
 
void visitPost (DocText *)
 
void visitPre (DocHtmlBlockQuote *)
 
void visitPost (DocHtmlBlockQuote *)
 
void visitPre (DocVhdlFlow *)
 
void visitPost (DocVhdlFlow *)
 
void visitPre (DocParBlock *)
 
void visitPost (DocParBlock *)
 
- Public Member Functions inherited from DocVisitor
 DocVisitor (int id)
 
virtual ~DocVisitor ()
 
int id () const
 

Private Member Functions

void filter (const char *str)
 
void startLink (const QCString &ref, const QCString &file, const QCString &anchor)
 
void endLink ()
 
void pushEnabled ()
 
void popEnabled ()
 

Private Attributes

FTextStreamm_t
 
CodeOutputInterfacem_ci
 
bool m_insidePre
 
bool m_hide
 
QStack< bool > m_enabled
 
QCString m_langExt
 

Detailed Description

Concrete visitor implementation for XML output.

Definition at line 31 of file xmldocvisitor.h.

Constructor & Destructor Documentation

XmlDocVisitor::XmlDocVisitor ( FTextStream t,
CodeOutputInterface ci 
)

Definition at line 86 of file xmldocvisitor.cpp.

: DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE)
{
}

Member Function Documentation

void XmlDocVisitor::endLink ( )
private

Definition at line 1068 of file xmldocvisitor.cpp.

References m_t.

Referenced by visit(), and visitPost().

{
m_t << "</ref>";
}
void XmlDocVisitor::filter ( const char *  str)
private

Definition at line 1051 of file xmldocvisitor.cpp.

References convertToXML(), and m_t.

Referenced by visit(), and visitPre().

{
m_t << convertToXML(str);
}
void XmlDocVisitor::popEnabled ( )
private

Definition at line 1078 of file xmldocvisitor.cpp.

References m_enabled, and m_hide.

Referenced by visit().

{
bool *v=m_enabled.pop();
ASSERT(v!=0);
m_hide = *v;
delete v;
}
void XmlDocVisitor::pushEnabled ( )
private

Definition at line 1073 of file xmldocvisitor.cpp.

References m_enabled, and m_hide.

Referenced by visit().

{
m_enabled.push(new bool(m_hide));
}
void XmlDocVisitor::startLink ( const QCString &  ref,
const QCString &  file,
const QCString &  anchor 
)
private

Definition at line 1056 of file xmldocvisitor.cpp.

References m_t.

Referenced by visit(), and visitPre().

{
//printf("XmlDocVisitor: file=%s anchor=%s\n",file.data(),anchor.data());
m_t << "<ref refid=\"" << file;
if (!anchor.isEmpty()) m_t << "_1" << anchor;
m_t << "\" kindref=\"";
if (!anchor.isEmpty()) m_t << "member"; else m_t << "compound";
m_t << "\"";
if (!ref.isEmpty()) m_t << " external=\"" << ref << "\"";
m_t << ">";
}
void XmlDocVisitor::visit ( DocWord w)
virtual

Implements DocVisitor.

Definition at line 95 of file xmldocvisitor.cpp.

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

Referenced by visitPre().

{
if (m_hide) return;
filter(w->word());
}
void XmlDocVisitor::visit ( DocLinkedWord w)
virtual
void XmlDocVisitor::visit ( DocWhiteSpace w)
virtual

Implements DocVisitor.

Definition at line 109 of file xmldocvisitor.cpp.

References DocWhiteSpace::chars(), m_hide, m_insidePre, and m_t.

{
if (m_hide) return;
{
m_t << w->chars();
}
else
{
m_t << " ";
}
}
void XmlDocVisitor::visit ( DocSymbol s)
virtual

Implements DocVisitor.

Definition at line 122 of file xmldocvisitor.cpp.

References err(), HtmlEntityMapper::instance(), m_hide, m_t, DocSymbol::symbol(), and HtmlEntityMapper::xml().

{
if (m_hide) return;
const char *res = HtmlEntityMapper::instance()->xml(s->symbol());
if (res)
{
m_t << res;
}
else
{
err("XML: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE));
}
}
void XmlDocVisitor::visit ( DocURL u)
virtual

Implements DocVisitor.

Definition at line 136 of file xmldocvisitor.cpp.

References filter(), DocURL::isEmail(), m_hide, m_t, and DocURL::url().

{
if (m_hide) return;
m_t << "<ulink url=\"";
if (u->isEmail()) m_t << "mailto:";
filter(u->url());
m_t << "\">";
filter(u->url());
m_t << "</ulink>";
}
void XmlDocVisitor::visit ( DocLineBreak )
virtual

Implements DocVisitor.

Definition at line 147 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<linebreak/>\n";
}
void XmlDocVisitor::visit ( DocHorRuler )
virtual

Implements DocVisitor.

Definition at line 153 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<hruler/>\n";
}
void XmlDocVisitor::visit ( DocStyleChange s)
virtual

Implements DocVisitor.

Definition at line 159 of file xmldocvisitor.cpp.

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Code, DocStyleChange::Div, DocStyleChange::enable(), DocStyleChange::Italic, m_hide, m_insidePre, m_t, DocStyleChange::Preformatted, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::style(), DocStyleChange::Subscript, and DocStyleChange::Superscript.

{
if (m_hide) return;
switch (s->style())
{
if (s->enable()) m_t << "<bold>"; else m_t << "</bold>";
break;
if (s->enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
break;
if (s->enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
break;
if (s->enable()) m_t << "<subscript>"; else m_t << "</subscript>";
break;
if (s->enable()) m_t << "<superscript>"; else m_t << "</superscript>";
break;
if (s->enable()) m_t << "<center>"; else m_t << "</center>";
break;
if (s->enable()) m_t << "<small>"; else m_t << "</small>";
break;
if (s->enable())
{
m_t << "<preformatted>";
}
else
{
m_t << "</preformatted>";
m_insidePre=FALSE;
}
break;
case DocStyleChange::Div: /* HTML only */ break;
case DocStyleChange::Span: /* HTML only */ break;
}
}
void XmlDocVisitor::visit ( DocVerbatim s)
virtual

Implements DocVisitor.

Definition at line 202 of file xmldocvisitor.cpp.

References DocVerbatim::children(), DocVerbatim::Code, DocVerbatim::context(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::exampleFile(), filter(), getLanguageFromFileName(), ParserManager::getParser(), DocVerbatim::hasCaption(), DocVerbatim::height(), DocImage::Html, DocVerbatim::HtmlOnly, DocVerbatim::isExample(), DocVerbatim::language(), DocVerbatim::LatexOnly, m_ci, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, ParserInterface::parseCode(), Doxygen::parserManager, DocVerbatim::PlantUML, DocVerbatim::RtfOnly, DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::Verbatim, visitPostEnd(), visitPreStart(), DocVerbatim::width(), and DocVerbatim::XmlOnly.

{
if (m_hide) return;
QCString lang = m_langExt;
if (!s->language().isEmpty()) // explicit language setting
{
lang = s->language();
}
switch(s->type())
{
case DocVerbatim::Code: // fall though
m_t << "<programlisting>";
->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile());
m_t << "</programlisting>";
break;
m_t << "<verbatim>";
filter(s->text());
m_t << "</verbatim>";
break;
/* nothing */
break;
m_t << s->text();
break;
visitPreStart(m_t, "dot", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height());
filter(s->text());
visitPostEnd(m_t, "dot");
break;
visitPreStart(m_t, "msc", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height());
filter(s->text());
visitPostEnd(m_t, "msc");
break;
visitPreStart(m_t, "plantuml", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height());
filter(s->text());
visitPostEnd(m_t, "plantuml");
break;
}
}
void XmlDocVisitor::visit ( DocAnchor anc)
virtual

Implements DocVisitor.

Definition at line 253 of file xmldocvisitor.cpp.

References DocAnchor::anchor(), DocAnchor::file(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<anchor id=\"" << anc->file() << "_1" << anc->anchor() << "\"/>";
}
void XmlDocVisitor::visit ( DocInclude inc)
virtual

Implements DocVisitor.

Definition at line 259 of file xmldocvisitor.cpp.

References DocInclude::blockId(), DocInclude::context(), DocInclude::DontInclude, err(), DocInclude::exampleFile(), DocInclude::extension(), extractBlock(), DocInclude::file(), filter(), getLanguageFromFileName(), ParserManager::getParser(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncludeDoc, DocInclude::IncWithLines, DocInclude::isExample(), DocInclude::LatexInclude, m_ci, m_hide, m_t, parseCode(), Doxygen::parserManager, DocInclude::Snippet, DocInclude::SnippetDoc, DocInclude::text(), DocInclude::type(), and DocInclude::VerbInclude.

{
if (m_hide) return;
switch(inc->type())
{
{
m_t << "<programlisting>";
QFileInfo cfi( inc->file() );
FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
inc->text(),
langExt,
inc->isExample(),
inc->exampleFile(),
&fd, // fileDef,
-1, // start line
-1, // end line
FALSE, // inline fragment
0, // memberDef
TRUE // show line numbers
);
m_t << "</programlisting>";
}
break;
m_t << "<programlisting>";
inc->text(),
langExt,
inc->isExample(),
inc->exampleFile(),
0, // fileDef
-1, // startLine
-1, // endLine
TRUE, // inlineFragment
0, // memberDef
FALSE // show line numbers
);
m_t << "</programlisting>";
break;
break;
m_t << "<htmlonly>";
filter(inc->text());
m_t << "</htmlonly>";
break;
m_t << "<latexonly>";
filter(inc->text());
m_t << "</latexonly>";
break;
m_t << "<verbatim>";
filter(inc->text());
m_t << "</verbatim>";
break;
m_t << "<programlisting>";
inc->context(),
extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(),
inc->exampleFile()
);
m_t << "</programlisting>";
break;
err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
"Please create a bug report\n",__FILE__);
break;
}
}
void XmlDocVisitor::visit ( DocIncOperator op)
virtual

Implements DocVisitor.

Definition at line 340 of file xmldocvisitor.cpp.

References DocIncOperator::context(), endl(), DocIncOperator::exampleFile(), getLanguageFromFileName(), ParserManager::getParser(), DocIncOperator::isExample(), DocIncOperator::isFirst(), DocIncOperator::isLast(), m_ci, m_hide, m_langExt, m_t, ParserInterface::parseCode(), Doxygen::parserManager, popEnabled(), pushEnabled(), DocIncOperator::Skip, DocIncOperator::text(), and DocIncOperator::type().

{
//printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
// op->type(),op->isFirst(),op->isLast(),op->text().data());
if (op->isFirst())
{
if (!m_hide)
{
m_t << "<programlisting>";
}
m_hide = TRUE;
}
{
if (!m_hide)
{
op->text(),langExt,op->isExample(),
op->exampleFile());
}
m_hide=TRUE;
}
if (op->isLast())
{
if (!m_hide) m_t << "</programlisting>";
}
else
{
if (!m_hide) m_t << endl;
}
}
void XmlDocVisitor::visit ( DocFormula f)
virtual

Implements DocVisitor.

Definition at line 378 of file xmldocvisitor.cpp.

References filter(), DocFormula::id(), m_hide, m_t, and DocFormula::text().

{
if (m_hide) return;
m_t << "<formula id=\"" << f->id() << "\">";
filter(f->text());
m_t << "</formula>";
}
void XmlDocVisitor::visit ( DocIndexEntry ie)
virtual

Implements DocVisitor.

Definition at line 386 of file xmldocvisitor.cpp.

References DocIndexEntry::entry(), filter(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<indexentry>"
"<primaryie>";
filter(ie->entry());
m_t << "</primaryie>"
"<secondaryie></secondaryie>"
"</indexentry>";
}
void XmlDocVisitor::visit ( DocSimpleSectSep sep)
virtual

Implements DocVisitor.

Definition at line 397 of file xmldocvisitor.cpp.

References DocNode::kind(), DocNode::Kind_SimpleSect, DocNode::parent(), visitPost(), and visitPre().

{
if (sep->parent() && sep->parent()->kind()==DocNode::Kind_SimpleSect)
{
visitPost((DocSimpleSect*)sep->parent()); // end current section
visitPre((DocSimpleSect*)sep->parent()); // start new section
}
}
void XmlDocVisitor::visit ( DocCite cite)
virtual

Implements DocVisitor.

Definition at line 406 of file xmldocvisitor.cpp.

References DocCite::anchor(), endLink(), DocCite::file(), filter(), m_hide, DocCite::ref(), startLink(), and DocCite::text().

{
if (m_hide) return;
if (!cite->file().isEmpty()) startLink(cite->ref(),cite->file(),cite->anchor());
filter(cite->text());
if (!cite->file().isEmpty()) endLink();
}
void XmlDocVisitor::visitPost ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 431 of file xmldocvisitor.cpp.

References DocAutoList::isEnumList(), m_hide, and m_t.

Referenced by visit().

{
if (m_hide) return;
if (l->isEnumList())
{
m_t << "</orderedlist>\n";
}
else
{
m_t << "</itemizedlist>\n";
}
}
void XmlDocVisitor::visitPost ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 450 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</listitem>";
}
void XmlDocVisitor::visitPost ( DocPara )
virtual

Implements DocVisitor.

Definition at line 462 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</para>";
}
void XmlDocVisitor::visitPost ( DocRoot )
virtual

Implements DocVisitor.

Definition at line 473 of file xmldocvisitor.cpp.

{
//m_t << "<hr><h4><font color=\"red\">Old parser:</font></h4>\n";
}
void XmlDocVisitor::visitPost ( DocSimpleSect )
virtual

Implements DocVisitor.

Definition at line 523 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</simplesect>\n";
}
void XmlDocVisitor::visitPost ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 535 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</title>";
}
void XmlDocVisitor::visitPost ( DocSimpleList )
virtual

Implements DocVisitor.

Definition at line 547 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</itemizedlist>\n";
}
void XmlDocVisitor::visitPost ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 559 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</listitem>\n";
}
void XmlDocVisitor::visitPost ( DocSection s)
virtual

Implements DocVisitor.

Definition at line 576 of file xmldocvisitor.cpp.

References DocSection::level(), and m_t.

{
m_t << "</sect" << s->level() << ">\n";
}
void XmlDocVisitor::visitPost ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 590 of file xmldocvisitor.cpp.

References m_hide, m_t, DocHtmlList::Ordered, and DocHtmlList::type().

{
if (m_hide) return;
m_t << "</orderedlist>\n";
else
m_t << "</itemizedlist>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 605 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</listitem>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlDescList )
virtual

Implements DocVisitor.

Definition at line 617 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</variablelist>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 629 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</term></varlistentry>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 641 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</listitem>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlTable )
virtual

Implements DocVisitor.

Definition at line 654 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</table>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlRow )
virtual

Implements DocVisitor.

Definition at line 666 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</row>\n";
}
void XmlDocVisitor::visitPost ( DocHtmlCell )
virtual

Implements DocVisitor.

Definition at line 678 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</entry>";
}
void XmlDocVisitor::visitPost ( DocHtmlCaption )
virtual

Implements DocVisitor.

Definition at line 690 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</caption>\n";
}
void XmlDocVisitor::visitPost ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 702 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</internal>" << endl;
}
void XmlDocVisitor::visitPost ( DocHRef )
virtual

Implements DocVisitor.

Definition at line 716 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</ulink>";
}
void XmlDocVisitor::visitPost ( DocHtmlHeader )
virtual

Implements DocVisitor.

Definition at line 728 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</heading>\n";
}
void XmlDocVisitor::visitPost ( DocImage )
virtual

Implements DocVisitor.

Definition at line 762 of file xmldocvisitor.cpp.

References m_hide, m_t, and visitPostEnd().

{
if (m_hide) return;
visitPostEnd(m_t, "image");
}
void XmlDocVisitor::visitPost ( DocDotFile )
virtual

Implements DocVisitor.

Definition at line 774 of file xmldocvisitor.cpp.

References m_hide, m_t, and visitPostEnd().

{
if (m_hide) return;
visitPostEnd(m_t, "dotfile");
}
void XmlDocVisitor::visitPost ( DocMscFile )
virtual

Implements DocVisitor.

Definition at line 786 of file xmldocvisitor.cpp.

References m_hide, m_t, and visitPostEnd().

{
if (m_hide) return;
visitPostEnd(m_t, "mscfile");
}
void XmlDocVisitor::visitPost ( DocDiaFile )
virtual

Implements DocVisitor.

Definition at line 798 of file xmldocvisitor.cpp.

References m_hide, m_t, and visitPostEnd().

{
if (m_hide) return;
visitPostEnd(m_t, "diafile");
}
void XmlDocVisitor::visitPost ( DocLink )
virtual

Implements DocVisitor.

Definition at line 810 of file xmldocvisitor.cpp.

References endLink(), and m_hide.

{
if (m_hide) return;
}
void XmlDocVisitor::visitPost ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 826 of file xmldocvisitor.cpp.

References endLink(), DocRef::file(), and m_hide.

{
if (m_hide) return;
if (!ref->file().isEmpty()) endLink();
//m_t << " ";
}
void XmlDocVisitor::visitPost ( DocSecRefItem )
virtual

Implements DocVisitor.

Definition at line 839 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</tocitem>" << endl;
}
void XmlDocVisitor::visitPost ( DocSecRefList )
virtual

Implements DocVisitor.

Definition at line 851 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</toclist>" << endl;
}
void XmlDocVisitor::visitPost ( DocParamSect )
virtual

Implements DocVisitor.

Definition at line 889 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</parameterlist>" << endl;
}
void XmlDocVisitor::visitPost ( DocParamList )
virtual

Implements DocVisitor.

Definition at line 957 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</parameterdescription>" << endl;
m_t << "</parameteritem>" << endl;
}
void XmlDocVisitor::visitPost ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 977 of file xmldocvisitor.cpp.

References m_hide, m_t, and DocXRefItem::title().

{
if (m_hide) return;
if (x->title().isEmpty()) return;
m_t << "</xrefdescription>";
m_t << "</xrefsect>";
}
void XmlDocVisitor::visitPost ( DocInternalRef )
virtual

Implements DocVisitor.

Definition at line 991 of file xmldocvisitor.cpp.

References endLink(), m_hide, and m_t.

{
if (m_hide) return;
m_t << " ";
}
void XmlDocVisitor::visitPost ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1004 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</copydoc>" << endl;
}
void XmlDocVisitor::visitPost ( DocText )
virtual

Implements DocVisitor.

Definition at line 1014 of file xmldocvisitor.cpp.

{
}
void XmlDocVisitor::visitPost ( DocHtmlBlockQuote )
virtual

Implements DocVisitor.

Definition at line 1024 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</blockquote>";
}
void XmlDocVisitor::visitPost ( DocVhdlFlow )
virtual

Implements DocVisitor.

Definition at line 1034 of file xmldocvisitor.cpp.

{
}
void XmlDocVisitor::visitPost ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1044 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</parblock>";
}
void XmlDocVisitor::visitPre ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 418 of file xmldocvisitor.cpp.

References DocAutoList::isEnumList(), m_hide, and m_t.

Referenced by visit().

{
if (m_hide) return;
if (l->isEnumList())
{
m_t << "<orderedlist>\n";
}
else
{
m_t << "<itemizedlist>\n";
}
}
void XmlDocVisitor::visitPre ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 444 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<listitem>";
}
void XmlDocVisitor::visitPre ( DocPara )
virtual

Implements DocVisitor.

Definition at line 456 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<para>";
}
void XmlDocVisitor::visitPre ( DocRoot )
virtual

Implements DocVisitor.

Definition at line 468 of file xmldocvisitor.cpp.

{
//m_t << "<hr><h4><font color=\"red\">New parser:</font></h4>\n";
}
void XmlDocVisitor::visitPre ( DocSimpleSect s)
virtual

Implements DocVisitor.

Definition at line 478 of file xmldocvisitor.cpp.

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, DocSimpleSect::Invar, m_hide, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, DocSimpleSect::See, DocSimpleSect::Since, DocSimpleSect::type(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, and DocSimpleSect::Warning.

{
if (m_hide) return;
m_t << "<simplesect kind=\"";
switch(s->type())
{
m_t << "see"; break;
m_t << "return"; break;
m_t << "author"; break;
m_t << "authors"; break;
m_t << "version"; break;
m_t << "since"; break;
m_t << "date"; break;
m_t << "note"; break;
m_t << "warning"; break;
m_t << "pre"; break;
m_t << "post"; break;
m_t << "copyright"; break;
m_t << "invariant"; break;
m_t << "remark"; break;
m_t << "attention"; break;
m_t << "par"; break;
m_t << "rcs"; break;
}
m_t << "\">";
}
void XmlDocVisitor::visitPre ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 529 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<title>";
}
void XmlDocVisitor::visitPre ( DocSimpleList )
virtual

Implements DocVisitor.

Definition at line 541 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<itemizedlist>\n";
}
void XmlDocVisitor::visitPre ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 553 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<listitem>";
}
void XmlDocVisitor::visitPre ( DocSection s)
virtual

Implements DocVisitor.

Definition at line 565 of file xmldocvisitor.cpp.

References DocSection::anchor(), convertCharEntitiesToUTF8(), endl(), DocSection::file(), filter(), DocSection::level(), m_hide, m_t, and DocSection::title().

{
if (m_hide) return;
m_t << "<sect" << s->level() << " id=\"" << s->file();
if (!s->anchor().isEmpty()) m_t << "_1" << s->anchor();
m_t << "\">" << endl;
m_t << "<title>";
m_t << "</title>" << endl;
}
void XmlDocVisitor::visitPre ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 581 of file xmldocvisitor.cpp.

References m_hide, m_t, DocHtmlList::Ordered, and DocHtmlList::type().

{
if (m_hide) return;
m_t << "<orderedlist>\n";
else
m_t << "<itemizedlist>\n";
}
void XmlDocVisitor::visitPre ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 599 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<listitem>\n";
}
void XmlDocVisitor::visitPre ( DocHtmlDescList )
virtual

Implements DocVisitor.

Definition at line 611 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<variablelist>\n";
}
void XmlDocVisitor::visitPre ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 623 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<varlistentry><term>";
}
void XmlDocVisitor::visitPre ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 635 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<listitem>";
}
void XmlDocVisitor::visitPre ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 647 of file xmldocvisitor.cpp.

References m_hide, m_t, DocHtmlTable::numColumns(), and DocHtmlTable::numRows().

{
if (m_hide) return;
m_t << "<table rows=\"" << t->numRows()
<< "\" cols=\"" << t->numColumns() << "\">" ;
}
void XmlDocVisitor::visitPre ( DocHtmlRow )
virtual

Implements DocVisitor.

Definition at line 660 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<row>\n";
}
void XmlDocVisitor::visitPre ( DocHtmlCell c)
virtual

Implements DocVisitor.

Definition at line 672 of file xmldocvisitor.cpp.

References DocHtmlCell::isHeading(), m_hide, and m_t.

{
if (m_hide) return;
if (c->isHeading()) m_t << "<entry thead=\"yes\">"; else m_t << "<entry thead=\"no\">";
}
void XmlDocVisitor::visitPre ( DocHtmlCaption )
virtual

Implements DocVisitor.

Definition at line 684 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<caption>";
}
void XmlDocVisitor::visitPre ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 696 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<internal>";
}
void XmlDocVisitor::visitPre ( DocHRef href)
virtual

Implements DocVisitor.

Definition at line 708 of file xmldocvisitor.cpp.

References filter(), m_hide, m_t, and DocHRef::url().

{
if (m_hide) return;
m_t << "<ulink url=\"";
filter(href->url());
m_t << "\">";
}
void XmlDocVisitor::visitPre ( DocHtmlHeader header)
virtual

Implements DocVisitor.

Definition at line 722 of file xmldocvisitor.cpp.

References DocHtmlHeader::level(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<heading level=\"" << header->level() << "\">";
}
void XmlDocVisitor::visitPre ( DocImage img)
virtual

Implements DocVisitor.

Definition at line 734 of file xmldocvisitor.cpp.

References CompAccept< T >::children(), Config_getString, DocImage::height(), m_hide, m_t, DocImage::name(), DocImage::type(), visitPreStart(), and DocImage::width().

{
if (m_hide) return;
QCString baseName=img->name();
int i;
if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
{
baseName=baseName.right(baseName.length()-i-1);
}
visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height());
// copy the image to the output dir
QFile inImage(img->name());
QFile outImage(Config_getString(XML_OUTPUT)+"/"+baseName.data());
if (inImage.open(IO_ReadOnly))
{
if (outImage.open(IO_WriteOnly))
{
char *buffer = new char[inImage.size()];
inImage.readBlock(buffer,inImage.size());
outImage.writeBlock(buffer,inImage.size());
outImage.flush();
delete[] buffer;
}
}
}
void XmlDocVisitor::visitPre ( DocDotFile df)
virtual

Implements DocVisitor.

Definition at line 768 of file xmldocvisitor.cpp.

References CompAccept< T >::children(), DocDotFile::file(), DocDotFile::height(), DocImage::Html, m_hide, m_t, visitPreStart(), and DocDotFile::width().

{
if (m_hide) return;
visitPreStart(m_t, "dotfile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height());
}
void XmlDocVisitor::visitPre ( DocMscFile df)
virtual

Implements DocVisitor.

Definition at line 780 of file xmldocvisitor.cpp.

References CompAccept< T >::children(), DocMscFile::file(), DocMscFile::height(), DocImage::Html, m_hide, m_t, visitPreStart(), and DocMscFile::width().

{
if (m_hide) return;
visitPreStart(m_t, "mscfile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height());
}
void XmlDocVisitor::visitPre ( DocDiaFile df)
virtual

Implements DocVisitor.

Definition at line 792 of file xmldocvisitor.cpp.

References CompAccept< T >::children(), DocDiaFile::file(), DocDiaFile::height(), DocImage::Html, m_hide, m_t, visitPreStart(), and DocDiaFile::width().

{
if (m_hide) return;
visitPreStart(m_t, "diafile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height());
}
void XmlDocVisitor::visitPre ( DocLink lnk)
virtual

Implements DocVisitor.

Definition at line 804 of file xmldocvisitor.cpp.

References DocLink::anchor(), DocLink::file(), m_hide, DocLink::ref(), and startLink().

{
if (m_hide) return;
startLink(lnk->ref(),lnk->file(),lnk->anchor());
}
void XmlDocVisitor::visitPre ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 816 of file xmldocvisitor.cpp.

References DocRef::anchor(), DocRef::file(), filter(), DocRef::hasLinkText(), DocRef::isSubPage(), m_hide, DocRef::ref(), startLink(), and DocRef::targetTitle().

{
if (m_hide) return;
if (!ref->file().isEmpty())
{
startLink(ref->ref(),ref->file(),ref->isSubPage() ? QCString() : ref->anchor());
}
if (!ref->hasLinkText()) filter(ref->targetTitle());
}
void XmlDocVisitor::visitPre ( DocSecRefItem ref)
virtual

Implements DocVisitor.

Definition at line 833 of file xmldocvisitor.cpp.

References DocSecRefItem::anchor(), DocSecRefItem::file(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<tocitem id=\"" << ref->file() << "_1" << ref->anchor() << "\">";
}
void XmlDocVisitor::visitPre ( DocSecRefList )
virtual

Implements DocVisitor.

Definition at line 845 of file xmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<toclist>" << endl;
}
void XmlDocVisitor::visitPre ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 869 of file xmldocvisitor.cpp.

References DocParamSect::Exception, m_hide, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, and DocParamSect::type().

{
if (m_hide) return;
m_t << "<parameterlist kind=\"";
switch(s->type())
{
m_t << "param"; break;
m_t << "retval"; break;
m_t << "exception"; break;
m_t << "templateparam"; break;
default:
ASSERT(0);
}
m_t << "\">";
}
void XmlDocVisitor::visitPre ( DocParamList pl)
virtual

Implements DocVisitor.

Definition at line 895 of file xmldocvisitor.cpp.

References DocParamList::direction(), endl(), DocParamSect::In, DocParamSect::InOut, DocNode::Kind_LinkedWord, DocNode::Kind_Word, m_hide, m_t, DocParamSect::Out, DocParamList::parameters(), DocParamList::paramTypes(), DocParamSect::Unspecified, and visit().

{
if (m_hide) return;
m_t << "<parameteritem>" << endl;
m_t << "<parameternamelist>" << endl;
//QStrListIterator li(pl->parameters());
//const char *s;
QListIterator<DocNode> li(pl->parameters());
DocNode *param;
for (li.toFirst();(param=li.current());++li)
{
if (pl->paramTypes().count()>0)
{
QListIterator<DocNode> li(pl->paramTypes());
DocNode *type;
for (li.toFirst();(type=li.current());++li)
{
m_t << "<parametertype>";
if (type->kind()==DocNode::Kind_Word)
{
visit((DocWord*)type);
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
visit((DocLinkedWord*)type);
}
m_t << "</parametertype>" << endl;
}
}
m_t << "<parametername";
{
m_t << " direction=\"";
{
m_t << "in";
}
else if (pl->direction()==DocParamSect::Out)
{
m_t << "out";
}
else if (pl->direction()==DocParamSect::InOut)
{
m_t << "inout";
}
m_t << "\"";
}
m_t << ">";
if (param->kind()==DocNode::Kind_Word)
{
visit((DocWord*)param);
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
visit((DocLinkedWord*)param);
}
m_t << "</parametername>" << endl;
}
m_t << "</parameternamelist>" << endl;
m_t << "<parameterdescription>" << endl;
}
void XmlDocVisitor::visitPre ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 964 of file xmldocvisitor.cpp.

References DocXRefItem::anchor(), DocXRefItem::file(), filter(), m_hide, m_t, and DocXRefItem::title().

{
if (m_hide) return;
if (x->title().isEmpty()) return;
m_t << "<xrefsect id=\"";
m_t << x->file() << "_1" << x->anchor();
m_t << "\">";
m_t << "<xreftitle>";
filter(x->title());
m_t << "</xreftitle>";
m_t << "<xrefdescription>";
}
void XmlDocVisitor::visitPre ( DocInternalRef ref)
virtual

Implements DocVisitor.

Definition at line 985 of file xmldocvisitor.cpp.

References DocInternalRef::anchor(), DocInternalRef::file(), m_hide, and startLink().

{
if (m_hide) return;
startLink(0,ref->file(),ref->anchor());
}
void XmlDocVisitor::visitPre ( DocCopy c)
virtual

Implements DocVisitor.

Definition at line 998 of file xmldocvisitor.cpp.

References convertToXML(), DocCopy::link(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<copydoc link=\"" << convertToXML(c->link()) << "\">";
}
void XmlDocVisitor::visitPre ( DocText )
virtual

Implements DocVisitor.

Definition at line 1010 of file xmldocvisitor.cpp.

{
}
void XmlDocVisitor::visitPre ( DocHtmlBlockQuote )
virtual

Implements DocVisitor.

Definition at line 1018 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<blockquote>";
}
void XmlDocVisitor::visitPre ( DocVhdlFlow )
virtual

Implements DocVisitor.

Definition at line 1030 of file xmldocvisitor.cpp.

{
}
void XmlDocVisitor::visitPre ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1038 of file xmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<parblock>";
}

Member Data Documentation

CodeOutputInterface& XmlDocVisitor::m_ci
private

Definition at line 162 of file xmldocvisitor.h.

Referenced by visit().

QStack<bool> XmlDocVisitor::m_enabled
private

Definition at line 165 of file xmldocvisitor.h.

Referenced by popEnabled(), and pushEnabled().

bool XmlDocVisitor::m_hide
private

Definition at line 164 of file xmldocvisitor.h.

Referenced by popEnabled(), pushEnabled(), visit(), visitPost(), and visitPre().

bool XmlDocVisitor::m_insidePre
private

Definition at line 163 of file xmldocvisitor.h.

Referenced by visit().

QCString XmlDocVisitor::m_langExt
private

Definition at line 166 of file xmldocvisitor.h.

Referenced by visit().

FTextStream& XmlDocVisitor::m_t
private

Definition at line 161 of file xmldocvisitor.h.

Referenced by endLink(), filter(), startLink(), visit(), visitPost(), and visitPre().


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