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

Concrete visitor implementation for XML output. More...

#include <src/xmldocvisitor.h>

Inheritance diagram for XmlDocVisitor:
Collaboration diagram for XmlDocVisitor:

Public Member Functions

 XmlDocVisitor (TextStream &t, OutputCodeList &ci, const QCString &langExt)
void operator() (const DocWord &)
void operator() (const DocLinkedWord &)
void operator() (const DocWhiteSpace &)
void operator() (const DocSymbol &)
void operator() (const DocEmoji &)
void operator() (const DocURL &)
void operator() (const DocLineBreak &)
void operator() (const DocHorRuler &)
void operator() (const DocStyleChange &)
void operator() (const DocVerbatim &)
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 &)
void operator() (const DocAutoList &)
void operator() (const DocAutoListItem &)
void operator() (const DocPara &)
void operator() (const DocRoot &)
void operator() (const DocSimpleSect &)
void operator() (const DocTitle &)
void operator() (const DocSimpleList &)
void operator() (const DocSimpleListItem &)
void operator() (const DocSection &)
void operator() (const DocHtmlList &)
void operator() (const DocHtmlListItem &)
void operator() (const DocHtmlDescList &)
void operator() (const DocHtmlDescTitle &)
void operator() (const DocHtmlDescData &)
void operator() (const DocHtmlTable &)
void operator() (const DocHtmlRow &)
void operator() (const DocHtmlCell &)
void operator() (const DocHtmlCaption &)
void operator() (const DocInternal &)
void operator() (const DocHRef &)
void operator() (const DocHtmlSummary &)
void operator() (const DocHtmlDetails &)
void operator() (const DocHtmlHeader &)
void operator() (const DocImage &)
void operator() (const DocDotFile &)
void operator() (const DocMscFile &)
void operator() (const DocDiaFile &)
void operator() (const DocPlantUmlFile &)
void operator() (const DocLink &)
void operator() (const DocRef &)
void operator() (const DocSecRefItem &)
void operator() (const DocSecRefList &)
void operator() (const DocParamSect &)
void operator() (const DocParamList &)
void operator() (const DocXRefItem &)
void operator() (const DocInternalRef &)
void operator() (const DocText &)
void operator() (const DocHtmlBlockQuote &)
void operator() (const DocVhdlFlow &)
void operator() (const DocParBlock &)
Public Member Functions inherited from DocVisitor
 DocVisitor ()
virtual ~DocVisitor ()
CodeParserInterfacegetCodeParser (const QCString &langExt)
void pushHidden (bool hide)
bool popHidden ()

Private Member Functions

template<class T>
void visitChildren (const T &t)
void filter (const QCString &str)
void startLink (const QCString &ref, const QCString &file, const QCString &anchor)
void endLink ()

Private Attributes

TextStreamm_t
OutputCodeListm_ci
bool m_insidePre = false
bool m_hide = false
QCString m_langExt
int m_sectionLevel

Detailed Description

Concrete visitor implementation for XML output.

Definition at line 33 of file xmldocvisitor.h.

Constructor & Destructor Documentation

◆ XmlDocVisitor()

XmlDocVisitor::XmlDocVisitor ( TextStream & t,
OutputCodeList & ci,
const QCString & langExt )

Definition at line 150 of file xmldocvisitor.cpp.

151 : m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE),
152 m_langExt(langExt), m_sectionLevel(0)
153{
154}
OutputCodeList & m_ci
TextStream & m_t
QCString m_langExt
#define FALSE
Definition qcstring.h:34

References FALSE, m_ci, m_hide, m_insidePre, m_langExt, m_sectionLevel, and m_t.

Member Function Documentation

◆ endLink()

void XmlDocVisitor::endLink ( )
private

Definition at line 1183 of file xmldocvisitor.cpp.

1184{
1185 m_t << "</ref>";
1186}

References m_t.

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

◆ filter()

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

Definition at line 1166 of file xmldocvisitor.cpp.

1167{
1168 m_t << convertToXML(str);
1169}
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4428

References convertToXML(), and m_t.

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

◆ operator()() [1/58]

void XmlDocVisitor::operator() ( const DocAnchor & anc)

Definition at line 395 of file xmldocvisitor.cpp.

396{
397 if (m_hide) return;
398 m_t << "<anchor id=\"" << anc.file() << "_1" << anc.anchor() << "\"/>";
399}
QCString anchor() const
Definition docnode.h:231
QCString file() const
Definition docnode.h:232

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

◆ operator()() [2/58]

void XmlDocVisitor::operator() ( const DocAutoList & l)

Definition at line 601 of file xmldocvisitor.cpp.

602{
603 if (m_hide) return;
604 if (l.isEnumList())
605 {
606 m_t << "<orderedlist>\n";
607 }
608 else
609 {
610 m_t << "<itemizedlist>\n";
611 }
612 visitChildren(l);
613 if (l.isEnumList())
614 {
615 m_t << "</orderedlist>\n";
616 }
617 else
618 {
619 m_t << "</itemizedlist>\n";
620 }
621}
bool isEnumList() const
Definition docnode.h:576
void visitChildren(const T &t)

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

◆ operator()() [3/58]

void XmlDocVisitor::operator() ( const DocAutoListItem & li)

Definition at line 623 of file xmldocvisitor.cpp.

624{
625 if (m_hide) return;
626 switch (li.itemNumber())
627 {
628 case DocAutoList::Unchecked: // unchecked
629 m_t << "<listitem override=\"unchecked\">";
630 break;
631 case DocAutoList::Checked_x: // checked with x
632 case DocAutoList::Checked_X: // checked with X
633 m_t << "<listitem override=\"checked\">";
634 break;
635 default:
636 m_t << "<listitem>";
637 break;
638 }
639 visitChildren(li);
640 m_t << "</listitem>";
641}
int itemNumber() const
Definition docnode.h:594

References DocAutoList::Checked_X, DocAutoList::Checked_x, DocAutoListItem::itemNumber(), m_hide, m_t, DocAutoList::Unchecked, and visitChildren().

◆ operator()() [4/58]

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

Definition at line 589 of file xmldocvisitor.cpp.

590{
591 if (m_hide) return;
592 if (!cite.file().isEmpty()) startLink(cite.ref(),cite.file(),cite.anchor());
593 filter(cite.text());
594 if (!cite.file().isEmpty()) endLink();
595}
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString ref() const
Definition docnode.h:249
QCString file() const
Definition docnode.h:247
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
void filter(const QCString &str)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)

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

◆ operator()() [5/58]

void XmlDocVisitor::operator() ( const DocDiaFile & df)

Definition at line 981 of file xmldocvisitor.cpp.

982{
983 if (m_hide) return;
984 copyFile(df.file(),Config_getString(XML_OUTPUT)+"/"+stripPath(df.file()));
985 visitPreStart(m_t, "diafile", FALSE, *this, df.children(), stripPath(df.file()), FALSE, DocImage::Html, df.width(), df.height());
986 visitChildren(df);
987 visitPostEnd(m_t, "diafile");
988}
DocNodeList & children()
Definition docnode.h:142
QCString height() const
Definition docnode.h:684
QCString file() const
Definition docnode.h:680
QCString width() const
Definition docnode.h:683
#define Config_getString(name)
Definition config.h:32
static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)
static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
QCString stripPath(const QCString &s)
Definition util.cpp:5464
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:6336

References DocCompoundNode::children(), Config_getString, copyFile(), FALSE, DocDiagramFileBase::file(), DocDiagramFileBase::height(), DocImage::Html, m_hide, m_t, stripPath(), visitChildren(), visitPostEnd(), visitPreStart(), and DocDiagramFileBase::width().

◆ operator()() [6/58]

void XmlDocVisitor::operator() ( const DocDotFile & df)

◆ operator()() [7/58]

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

Definition at line 201 of file xmldocvisitor.cpp.

202{
203 if (m_hide) return;
204 const char *res = EmojiEntityMapper::instance().name(s.index());
205 if (res)
206 {
207 QCString name=res;
208 name = name.mid(1,name.length()-2);
209 m_t << "<emoji name=\"" << name << "\" unicode=\"";
211 m_t << "\"/>";
212 }
213 else
214 {
215 m_t << s.name();
216 }
217}
int index() const
Definition docnode.h:341
QCString name() const
Definition docnode.h:340
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2026
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
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

References filter(), DocEmoji::index(), EmojiEntityMapper::instance(), QCString::length(), m_hide, m_t, QCString::mid(), DocEmoji::name(), and EmojiEntityMapper::name().

◆ operator()() [8/58]

void XmlDocVisitor::operator() ( const DocFormula & f)

Definition at line 560 of file xmldocvisitor.cpp.

561{
562 if (m_hide) return;
563 m_t << "<formula id=\"" << f.id() << "\">";
564 filter(f.text());
565 m_t << "</formula>";
566}
QCString text() const
Definition docnode.h:529
int id() const
Definition docnode.h:531

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

◆ operator()() [9/58]

void XmlDocVisitor::operator() ( const DocHorRuler & )

Definition at line 236 of file xmldocvisitor.cpp.

237{
238 if (m_hide) return;
239 m_t << "<hruler/>\n";
240}

References m_hide, and m_t.

◆ operator()() [10/58]

void XmlDocVisitor::operator() ( const DocHRef & href)

Definition at line 893 of file xmldocvisitor.cpp.

894{
895 if (m_hide) return;
896 m_t << "<ulink url=\"" << convertToXML(href.url(), TRUE) << "\">";
897 visitChildren(href);
898 m_t << "</ulink>";
899}
QCString url() const
Definition docnode.h:825
#define TRUE
Definition qcstring.h:37

References convertToXML(), m_hide, m_t, TRUE, DocHRef::url(), and visitChildren().

◆ operator()() [11/58]

void XmlDocVisitor::operator() ( const DocHtmlBlockQuote & q)

Definition at line 1145 of file xmldocvisitor.cpp.

1146{
1147 if (m_hide) return;
1148 m_t << "<blockquote>";
1149 visitChildren(q);
1150 m_t << "</blockquote>";
1151}

References m_hide, m_t, and visitChildren().

◆ operator()() [12/58]

void XmlDocVisitor::operator() ( const DocHtmlCaption & c)

Definition at line 872 of file xmldocvisitor.cpp.

873{
874 if (m_hide) return;
875 m_t << "<caption";
876 if (!c.file().isEmpty())
877 {
878 m_t << " id=\"" << stripPath(c.file()) << "_1" << c.anchor() << "\"";
879 }
880 m_t << ">";
881 visitChildren(c);
882 m_t << "</caption>\n";
883}
QCString anchor() const
Definition docnode.h:1230
QCString file() const
Definition docnode.h:1229

References DocHtmlCaption::anchor(), DocHtmlCaption::file(), QCString::isEmpty(), m_hide, m_t, stripPath(), and visitChildren().

◆ operator()() [13/58]

void XmlDocVisitor::operator() ( const DocHtmlCell & c)

Definition at line 819 of file xmldocvisitor.cpp.

820{
821 if (m_hide) return;
822 if (c.isHeading()) m_t << "<entry thead=\"yes\""; else m_t << "<entry thead=\"no\"";
823 for (const auto &opt : c.attribs())
824 {
825 if (opt.name=="colspan" || opt.name=="rowspan")
826 {
827 m_t << " " << opt.name << "=\"" << opt.value.toInt() << "\"";
828 }
829 else if (opt.name=="align" &&
830 (opt.value=="right" || opt.value=="left" || opt.value=="center"))
831 {
832 m_t << " align=\"" << opt.value << "\"";
833 }
834 else if (opt.name=="valign" &&
835 (opt.value == "bottom" || opt.value == "top" || opt.value == "middle"))
836 {
837 m_t << " valign=\"" << opt.value << "\"";
838 }
839 else if (opt.name=="width")
840 {
841 m_t << " width=\"" << opt.value << "\"";
842 }
843 else if (opt.name=="class") // handle markdown generated attributes
844 {
845 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
846 {
847 if (opt.value.endsWith("Right"))
848 {
849 m_t << " align='right'";
850 }
851 else if (opt.value.endsWith("Left"))
852 {
853 m_t << " align='left'";
854 }
855 else if (opt.value.endsWith("Center"))
856 {
857 m_t << " align='center'";
858 }
859 // skip 'markdownTable*' value ending with "None"
860 }
861 else if (!opt.value.isEmpty())
862 {
863 m_t << " class=\"" << convertToXML(opt.value) << "\"";
864 }
865 }
866 }
867 m_t << ">";
868 visitChildren(c);
869 m_t << "</entry>";
870}
bool isHeading() const
Definition docnode.h:1195
const HtmlAttribList & attribs() const
Definition docnode.h:1200

References DocHtmlCell::attribs(), convertToXML(), DocHtmlCell::isHeading(), m_hide, m_t, and visitChildren().

◆ operator()() [14/58]

void XmlDocVisitor::operator() ( const DocHtmlDescData & dd)

Definition at line 782 of file xmldocvisitor.cpp.

783{
784 if (m_hide) return;
785 m_t << "<listitem>";
786 visitChildren(dd);
787 m_t << "</listitem>\n";
788}

References m_hide, m_t, and visitChildren().

◆ operator()() [15/58]

void XmlDocVisitor::operator() ( const DocHtmlDescList & dl)

Definition at line 766 of file xmldocvisitor.cpp.

767{
768 if (m_hide) return;
769 m_t << "<variablelist>\n";
770 visitChildren(dl);
771 m_t << "</variablelist>\n";
772}

References m_hide, m_t, and visitChildren().

◆ operator()() [16/58]

void XmlDocVisitor::operator() ( const DocHtmlDescTitle & dt)

Definition at line 774 of file xmldocvisitor.cpp.

775{
776 if (m_hide) return;
777 m_t << "<varlistentry><term>";
778 visitChildren(dt);
779 m_t << "</term></varlistentry>\n";
780}

References m_hide, m_t, and visitChildren().

◆ operator()() [17/58]

void XmlDocVisitor::operator() ( const DocHtmlDetails & d)

Definition at line 909 of file xmldocvisitor.cpp.

910{
911 if (m_hide) return;
912 m_t << "<details>";
913 auto summary = d.summary();
914 if (summary)
915 {
916 std::visit(*this,*summary);
917 }
918 visitChildren(d);
919 m_t << "</details>";
920}
const DocNodeVariant * summary() const
Definition docnode.h:859

References m_hide, m_t, DocHtmlDetails::summary(), and visitChildren().

◆ operator()() [18/58]

void XmlDocVisitor::operator() ( const DocHtmlHeader & header)

Definition at line 922 of file xmldocvisitor.cpp.

923{
924 if (m_hide) return;
925 m_t << "<heading level=\"" << header.level() << "\">";
926 visitChildren(header);
927 m_t << "</heading>\n";
928}
int level() const
Definition docnode.h:872

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

◆ operator()() [19/58]

void XmlDocVisitor::operator() ( const DocHtmlList & s)

Definition at line 723 of file xmldocvisitor.cpp.

724{
725 if (m_hide) return;
726 if (s.type()==DocHtmlList::Ordered)
727 {
728 m_t << "<orderedlist";
729 for (const auto &opt : s.attribs())
730 {
731 m_t << " " << opt.name << "=\"" << opt.value << "\"";
732 }
733 m_t << ">\n";
734 }
735 else
736 {
737 m_t << "<itemizedlist>\n";
738 }
739 visitChildren(s);
740 if (s.type()==DocHtmlList::Ordered)
741 {
742 m_t << "</orderedlist>\n";
743 }
744 else
745 {
746 m_t << "</itemizedlist>\n";
747 }
748}
const HtmlAttribList & attribs() const
Definition docnode.h:1001
Type type() const
Definition docnode.h:1000

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

◆ operator()() [20/58]

void XmlDocVisitor::operator() ( const DocHtmlListItem & l)

Definition at line 750 of file xmldocvisitor.cpp.

751{
752 if (m_hide) return;
753 m_t << "<listitem";
754 for (const auto &opt : l.attribs())
755 {
756 if (opt.name=="value")
757 {
758 m_t << " " << opt.name << "=\"" << opt.value << "\"";
759 }
760 }
761 m_t << ">\n";
762 visitChildren(l);
763 m_t << "</listitem>\n";
764}
const HtmlAttribList & attribs() const
Definition docnode.h:1165

References DocHtmlListItem::attribs(), m_hide, m_t, and visitChildren().

◆ operator()() [21/58]

void XmlDocVisitor::operator() ( const DocHtmlRow & r)

Definition at line 811 of file xmldocvisitor.cpp.

812{
813 if (m_hide) return;
814 m_t << "<row>\n";
815 visitChildren(r);
816 m_t << "</row>\n";
817}

References m_hide, m_t, and visitChildren().

◆ operator()() [22/58]

void XmlDocVisitor::operator() ( const DocHtmlSummary & s)

Definition at line 901 of file xmldocvisitor.cpp.

902{
903 if (m_hide) return;
904 m_t << "<summary>";
905 visitChildren(s);
906 m_t << "</summary>";
907}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

void XmlDocVisitor::operator() ( const DocHtmlTable & t)

Definition at line 790 of file xmldocvisitor.cpp.

791{
792 if (m_hide) return;
793 m_t << "<table rows=\"" << t.numRows()
794 << "\" cols=\"" << t.numColumns() << "\"" ;
795 for (const auto &opt : t.attribs())
796 {
797 if (opt.name=="width")
798 {
799 m_t << " " << opt.name << "=\"" << opt.value << "\"";
800 }
801 }
802 m_t << ">";
803 if (t.caption())
804 {
805 std::visit(*this,*t.caption());
806 }
807 visitChildren(t);
808 m_t << "</table>\n";
809}
size_t numRows() const
Definition docnode.h:1268
size_t numColumns() const
Definition docnode.h:1273
const DocNodeVariant * caption() const
Definition docnode.cpp:2044
const HtmlAttribList & attribs() const
Definition docnode.h:1270

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

◆ operator()() [24/58]

void XmlDocVisitor::operator() ( const DocImage & img)

Definition at line 930 of file xmldocvisitor.cpp.

931{
932 if (m_hide) return;
933
934 QCString url = img.url();
935 QCString baseName;
936 if (url.isEmpty())
937 {
938 baseName = img.relPath()+img.name();
939 }
940 else
941 {
942 baseName = correctURL(url,img.relPath());
943 }
944 HtmlAttribList attribs = img.attribs();
945 auto it = std::find_if(attribs.begin(),attribs.end(),
946 [](const auto &att) { return att.name=="alt"; });
947 QCString altValue = it!=attribs.end() ? it->value : "";
948 visitPreStart(m_t, "image", FALSE, *this, img.children(), baseName, TRUE,
949 img.type(), img.width(), img.height(), QCString(),
950 altValue, img.isInlineImage());
951
952 // copy the image to the output dir
953 FileDef *fd = nullptr;
954 bool ambig;
955 if (url.isEmpty() && (fd=findFileDef(Doxygen::imageNameLinkedMap,img.name(),ambig)))
956 {
957 copyFile(fd->absFilePath(),Config_getString(XML_OUTPUT)+"/"+baseName);
958 }
959 visitChildren(img);
960 visitPostEnd(m_t, "image");
961}
const HtmlAttribList & attribs() const
Definition docnode.h:651
QCString relPath() const
Definition docnode.h:647
QCString name() const
Definition docnode.h:643
QCString url() const
Definition docnode.h:648
QCString height() const
Definition docnode.h:646
Type type() const
Definition docnode.h:642
QCString width() const
Definition docnode.h:645
bool isInlineImage() const
Definition docnode.h:649
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:106
virtual QCString absFilePath() const =0
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:6404
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3415

References FileDef::absFilePath(), DocImage::attribs(), DocCompoundNode::children(), Config_getString, copyFile(), correctURL(), FALSE, findFileDef(), DocImage::height(), Doxygen::imageNameLinkedMap, QCString::isEmpty(), DocImage::isInlineImage(), m_hide, m_t, DocImage::name(), DocImage::relPath(), TRUE, DocImage::type(), DocImage::url(), visitChildren(), visitPostEnd(), visitPreStart(), and DocImage::width().

◆ operator()() [25/58]

void XmlDocVisitor::operator() ( const DocInclude & inc)

Definition at line 401 of file xmldocvisitor.cpp.

402{
403 if (m_hide) return;
405 //printf("XMLDocVisitor: DocInclude type=%d trimleft=%d\n",inc.type(),inc.trimLeft());
406 switch(inc.type())
407 {
409 {
410 m_t << "<programlisting filename=\"" << inc.file() << "\">";
411 FileInfo cfi( inc.file().str() );
412 auto fd = createFileDef( cfi.dirPath(), cfi.fileName());
414 inc.text(),
415 langExt,
416 inc.stripCodeComments(),
417 inc.isExample(),
418 inc.exampleFile(),
419 fd.get(), // fileDef,
420 -1, // start line
421 -1, // end line
422 FALSE, // inline fragment
423 nullptr, // memberDef
424 TRUE // show line numbers
425 );
426 m_t << "</programlisting>";
427 }
428 break;
430 m_t << "<programlisting filename=\"" << inc.file() << "\">";
432 inc.text(),
433 langExt,
434 inc.stripCodeComments(),
435 inc.isExample(),
436 inc.exampleFile(),
437 nullptr, // fileDef
438 -1, // startLine
439 -1, // endLine
440 TRUE, // inlineFragment
441 nullptr, // memberDef
442 FALSE // show line numbers
443 );
444 m_t << "</programlisting>";
445 break;
448 break;
450 if (inc.isBlock())
451 {
452 m_t << "<htmlonly block=\"yes\">";
453 }
454 else
455 {
456 m_t << "<htmlonly>";
457 }
458 filter(inc.text());
459 m_t << "</htmlonly>";
460 break;
462 m_t << "<latexonly>";
463 filter(inc.text());
464 m_t << "</latexonly>";
465 break;
467 m_t << "<rtfonly>";
468 filter(inc.text());
469 m_t << "</rtfonly>";
470 break;
472 m_t << "<manonly>";
473 filter(inc.text());
474 m_t << "</manonly>";
475 break;
477 filter(inc.text());
478 break;
480 m_t << "<docbookonly>";
481 filter(inc.text());
482 m_t << "</docbookonly>";
483 break;
485 m_t << "<verbatim>";
486 filter(inc.text());
487 m_t << "</verbatim>";
488 break;
491 m_t << "<programlisting filename=\"" << inc.file() << "\">";
493 inc.file(),
494 inc.blockId(),
495 inc.context(),
497 inc.trimLeft(),
499 );
500 m_t << "</programlisting>";
501 break;
502 }
503}
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
QCString blockId() const
Definition docnode.h:450
QCString extension() const
Definition docnode.h:446
bool isBlock() const
Definition docnode.h:454
bool stripCodeComments() const
Definition docnode.h:451
@ LatexInclude
Definition docnode.h:433
@ SnippetWithLines
Definition docnode.h:434
@ DontIncWithLines
Definition docnode.h:435
@ IncWithLines
Definition docnode.h:434
@ HtmlInclude
Definition docnode.h:433
@ VerbInclude
Definition docnode.h:433
@ DontInclude
Definition docnode.h:433
@ DocbookInclude
Definition docnode.h:435
Type type() const
Definition docnode.h:447
QCString exampleFile() const
Definition docnode.h:453
QCString text() const
Definition docnode.h:448
QCString file() const
Definition docnode.h:445
bool trimLeft() const
Definition docnode.h:455
bool isExample() const
Definition docnode.h:452
QCString context() const
Definition docnode.h:449
CodeParserInterface & getCodeParser(const QCString &langExt)
const std::string & str() const
Definition qcstring.h:537
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5721

References DocInclude::blockId(), DocInclude::context(), createFileDef(), FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile(), DocInclude::extension(), FALSE, DocInclude::file(), FileInfo::fileName(), filter(), DocVisitor::getCodeParser(), getLanguageFromFileName(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance(), DocInclude::isBlock(), DocInclude::isExample(), DocInclude::LatexInclude, m_ci, m_hide, m_t, DocInclude::ManInclude, CodeParserInterface::parseCode(), CodeFragmentManager::parseCodeFragment(), DocInclude::RtfInclude, DocInclude::Snippet, DocInclude::SnippetWithLines, QCString::str(), DocInclude::stripCodeComments(), DocInclude::text(), DocInclude::trimLeft(), TRUE, DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/58]

void XmlDocVisitor::operator() ( const DocIncOperator & op)

Definition at line 505 of file xmldocvisitor.cpp.

506{
507 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
508 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
509 if (op.isFirst())
510 {
511 if (!m_hide)
512 {
513 m_t << "<programlisting filename=\"" << op.includeFileName() << "\">";
514 }
516 m_hide = TRUE;
517 }
518 QCString locLangExt = getFileNameExtension(op.includeFileName());
519 if (locLangExt.isEmpty()) locLangExt = m_langExt;
520 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
521 if (op.type()!=DocIncOperator::Skip)
522 {
523 m_hide = popHidden();
524 if (!m_hide)
525 {
526 std::unique_ptr<FileDef> fd;
527 if (!op.includeFileName().isEmpty())
528 {
529 FileInfo cfi( op.includeFileName().str() );
530 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
531 }
532
533 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
534 op.text(),langExt,
536 op.isExample(),
537 op.exampleFile(),
538 fd.get(), // fileDef
539 op.line(), // startLine
540 -1, // endLine
541 FALSE, // inline fragment
542 nullptr, // memberDef
543 op.showLineNo() // show line numbers
544 );
545 }
547 m_hide=TRUE;
548 }
549 if (op.isLast())
550 {
551 m_hide = popHidden();
552 if (!m_hide) m_t << "</programlisting>";
553 }
554 else
555 {
556 if (!m_hide) m_t << "\n";
557 }
558}
bool stripCodeComments() const
Definition docnode.h:502
bool isLast() const
Definition docnode.h:499
QCString includeFileName() const
Definition docnode.h:505
QCString text() const
Definition docnode.h:495
QCString context() const
Definition docnode.h:497
QCString exampleFile() const
Definition docnode.h:504
int line() const
Definition docnode.h:493
Type type() const
Definition docnode.h:481
bool isFirst() const
Definition docnode.h:498
bool showLineNo() const
Definition docnode.h:494
bool isExample() const
Definition docnode.h:503
void pushHidden(bool hide)
bool popHidden()
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5763

References DocIncOperator::context(), createFileDef(), FileInfo::dirPath(), DocIncOperator::exampleFile(), FALSE, FileInfo::fileName(), DocVisitor::getCodeParser(), getFileNameExtension(), getLanguageFromFileName(), DocIncOperator::includeFileName(), QCString::isEmpty(), DocIncOperator::isExample(), DocIncOperator::isFirst(), DocIncOperator::isLast(), DocIncOperator::line(), m_ci, m_hide, m_langExt, m_t, CodeParserInterface::parseCode(), DocVisitor::popHidden(), DocVisitor::pushHidden(), DocIncOperator::showLineNo(), DocIncOperator::Skip, QCString::str(), DocIncOperator::stripCodeComments(), DocIncOperator::text(), TRUE, and DocIncOperator::type().

◆ operator()() [27/58]

void XmlDocVisitor::operator() ( const DocIndexEntry & ie)

Definition at line 568 of file xmldocvisitor.cpp.

569{
570 if (m_hide) return;
571 m_t << "<indexentry>"
572 "<primaryie>";
573 filter(ie.entry());
574 m_t << "</primaryie>"
575 "<secondaryie></secondaryie>"
576 "</indexentry>";
577}
QCString entry() const
Definition docnode.h:555

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

◆ operator()() [28/58]

void XmlDocVisitor::operator() ( const DocInternal & i)

Definition at line 885 of file xmldocvisitor.cpp.

886{
887 if (m_hide) return;
888 m_t << "<internal>";
889 visitChildren(i);
890 m_t << "</internal>\n";
891}

References m_hide, m_t, and visitChildren().

◆ operator()() [29/58]

void XmlDocVisitor::operator() ( const DocInternalRef & ref)

Definition at line 1131 of file xmldocvisitor.cpp.

1132{
1133 if (m_hide) return;
1134 startLink(QCString(),ref.file(),ref.anchor());
1135 visitChildren(ref);
1136 endLink();
1137 m_t << " ";
1138}
QCString file() const
Definition docnode.h:806
QCString anchor() const
Definition docnode.h:808

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

◆ operator()() [30/58]

void XmlDocVisitor::operator() ( const DocLineBreak & )

Definition at line 230 of file xmldocvisitor.cpp.

231{
232 if (m_hide) return;
233 m_t << "<linebreak/>\n";
234}

References m_hide, and m_t.

◆ operator()() [31/58]

void XmlDocVisitor::operator() ( const DocLink & lnk)

Definition at line 999 of file xmldocvisitor.cpp.

1000{
1001 if (m_hide) return;
1002 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1003 visitChildren(lnk);
1004 endLink();
1005}

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

◆ operator()() [32/58]

void XmlDocVisitor::operator() ( const DocLinkedWord & w)

Definition at line 166 of file xmldocvisitor.cpp.

167{
168 if (m_hide) return;
169 startLink(w.ref(),w.file(),w.anchor());
170 filter(w.word());
171 endLink();
172}
QCString file() const
Definition docnode.h:170
QCString ref() const
Definition docnode.h:172
QCString word() const
Definition docnode.h:169
QCString anchor() const
Definition docnode.h:173

References DocLinkedWord::anchor(), endLink(), DocLinkedWord::file(), filter(), m_hide, DocLinkedWord::ref(), startLink(), and DocLinkedWord::word().

◆ operator()() [33/58]

void XmlDocVisitor::operator() ( const DocMscFile & df)

◆ operator()() [34/58]

void XmlDocVisitor::operator() ( const DocPara & p)

Definition at line 643 of file xmldocvisitor.cpp.

644{
645 if (m_hide) return;
646 m_t << "<para>";
647 visitChildren(p);
648 m_t << "</para>\n";
649}

References m_hide, m_t, and visitChildren().

◆ operator()() [35/58]

void XmlDocVisitor::operator() ( const DocParamList & pl)

Definition at line 1066 of file xmldocvisitor.cpp.

1067{
1068 if (m_hide) return;
1069 m_t << "<parameteritem>\n";
1070 m_t << "<parameternamelist>\n";
1071 for (const auto &param : pl.parameters())
1072 {
1073 if (!pl.paramTypes().empty())
1074 {
1075 m_t << "<parametertype>";
1076 for (const auto &type : pl.paramTypes())
1077 {
1078 std::visit(*this,type);
1079 }
1080 m_t << "</parametertype>\n";
1081 }
1082 m_t << "<parametername";
1084 {
1085 m_t << " direction=\"";
1086 if (pl.direction()==DocParamSect::In)
1087 {
1088 m_t << "in";
1089 }
1090 else if (pl.direction()==DocParamSect::Out)
1091 {
1092 m_t << "out";
1093 }
1094 else if (pl.direction()==DocParamSect::InOut)
1095 {
1096 m_t << "inout";
1097 }
1098 m_t << "\"";
1099 }
1100 m_t << ">";
1101 std::visit(*this,param);
1102 m_t << "</parametername>\n";
1103 }
1104 m_t << "</parameternamelist>\n";
1105 m_t << "<parameterdescription>\n";
1106 for (const auto &par : pl.paragraphs())
1107 {
1108 std::visit(*this,par);
1109 }
1110 m_t << "</parameterdescription>\n";
1111 m_t << "</parameteritem>\n";
1112}
const DocNodeList & parameters() const
Definition docnode.h:1124
const DocNodeList & paramTypes() const
Definition docnode.h:1125
DocParamSect::Direction direction() const
Definition docnode.h:1128
const DocNodeList & paragraphs() const
Definition docnode.h:1126
bool empty() const
checks whether the container is empty
Definition growvector.h:140

References DocParamList::direction(), GrowVector< T >::empty(), DocParamSect::In, DocParamSect::InOut, m_hide, m_t, DocParamSect::Out, DocParamList::paragraphs(), DocParamList::parameters(), DocParamList::paramTypes(), and DocParamSect::Unspecified.

◆ operator()() [36/58]

void XmlDocVisitor::operator() ( const DocParamSect & s)

Definition at line 1038 of file xmldocvisitor.cpp.

1039{
1040 if (m_hide) return;
1041 m_t << "<parameterlist kind=\"";
1042 switch(s.type())
1043 {
1045 m_t << "param"; break;
1047 m_t << "retval"; break;
1049 m_t << "exception"; break;
1051 m_t << "templateparam"; break;
1052 default:
1053 ASSERT(0);
1054 }
1055 m_t << "\">";
1056 visitChildren(s);
1057 m_t << "</parameterlist>\n";
1058}
Type type() const
Definition docnode.h:1063
#define ASSERT(x)
Definition qcstring.h:39

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

◆ operator()() [37/58]

void XmlDocVisitor::operator() ( const DocParBlock & pb)

Definition at line 1157 of file xmldocvisitor.cpp.

1158{
1159 if (m_hide) return;
1160 m_t << "<parblock>";
1161 visitChildren(pb);
1162 m_t << "</parblock>";
1163}

References m_hide, m_t, and visitChildren().

◆ operator()() [38/58]

void XmlDocVisitor::operator() ( const DocPlantUmlFile & df)

◆ operator()() [39/58]

void XmlDocVisitor::operator() ( const DocRef & ref)

Definition at line 1007 of file xmldocvisitor.cpp.

1008{
1009 if (m_hide) return;
1010 if (!ref.file().isEmpty())
1011 {
1012 startLink(ref.ref(),ref.file(),ref.isSubPage() ? QCString() : ref.anchor());
1013 }
1014 if (!ref.hasLinkText()) filter(ref.targetTitle());
1015 visitChildren(ref);
1016 if (!ref.file().isEmpty()) endLink();
1017}
QCString anchor() const
Definition docnode.h:780
QCString targetTitle() const
Definition docnode.h:781
bool isSubPage() const
Definition docnode.h:787
QCString file() const
Definition docnode.h:777
QCString ref() const
Definition docnode.h:779
bool hasLinkText() const
Definition docnode.h:783

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

◆ operator()() [40/58]

void XmlDocVisitor::operator() ( const DocRoot & r)

Definition at line 651 of file xmldocvisitor.cpp.

652{
653 visitChildren(r);
654}

References visitChildren().

◆ operator()() [41/58]

void XmlDocVisitor::operator() ( const DocSecRefItem & ref)

Definition at line 1019 of file xmldocvisitor.cpp.

1020{
1021 if (m_hide) return;
1022 m_t << "<tocitem id=\"" << ref.file();
1023 if (!ref.anchor().isEmpty()) m_t << "_1" << ref.anchor();
1024 m_t << "\"";
1025 m_t << ">";
1026 visitChildren(ref);
1027 m_t << "</tocitem>\n";
1028}
QCString file() const
Definition docnode.h:934
QCString anchor() const
Definition docnode.h:935

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

◆ operator()() [42/58]

void XmlDocVisitor::operator() ( const DocSecRefList & l)

Definition at line 1030 of file xmldocvisitor.cpp.

1031{
1032 if (m_hide) return;
1033 m_t << "<toclist>\n";
1034 visitChildren(l);
1035 m_t << "</toclist>\n";
1036}

References m_hide, m_t, and visitChildren().

◆ operator()() [43/58]

void XmlDocVisitor::operator() ( const DocSection & s)

Definition at line 695 of file xmldocvisitor.cpp.

696{
697 if (m_hide) return;
698 int orgSectionLevel = m_sectionLevel;
699 QCString sectId = s.file();
700 if (!s.anchor().isEmpty()) sectId += "_1"+s.anchor();
701 while (m_sectionLevel+1<s.level()) // fix missing intermediate levels
702 {
704 m_t << "<sect" << m_sectionLevel << " id=\"" << sectId << "_1s" << m_sectionLevel << "\">";
705 }
707 m_t << "<sect" << s.level() << " id=\"" << sectId << "\">\n";
708 if (s.title())
709 {
710 std::visit(*this,*s.title());
711 }
712 visitChildren(s);
713 m_t << "</sect" << s.level() << ">";
715 while (orgSectionLevel<m_sectionLevel) // fix missing intermediate levels
716 {
717 m_t << "</sect" << m_sectionLevel << ">";
719 }
720 m_t << "\n";
721}
QCString file() const
Definition docnode.h:917
int level() const
Definition docnode.h:913
QCString anchor() const
Definition docnode.h:915
const DocNodeVariant * title() const
Definition docnode.h:914

References DocSection::anchor(), DocSection::file(), QCString::isEmpty(), DocSection::level(), m_hide, m_sectionLevel, m_t, DocSection::title(), and visitChildren().

◆ operator()() [44/58]

void XmlDocVisitor::operator() ( const DocSeparator & )

Definition at line 1060 of file xmldocvisitor.cpp.

1061{
1062 m_t << "</parametertype>\n";
1063 m_t << "<parametertype>";
1064}

References m_t.

◆ operator()() [45/58]

void XmlDocVisitor::operator() ( const DocSimpleList & l)

Definition at line 676 of file xmldocvisitor.cpp.

677{
678 if (m_hide) return;
679 m_t << "<itemizedlist>\n";
680 visitChildren(l);
681 m_t << "</itemizedlist>\n";
682}

References m_hide, m_t, and visitChildren().

◆ operator()() [46/58]

void XmlDocVisitor::operator() ( const DocSimpleListItem & li)

Definition at line 684 of file xmldocvisitor.cpp.

685{
686 if (m_hide) return;
687 m_t << "<listitem>";
688 if (li.paragraph())
689 {
690 std::visit(*this,*li.paragraph());
691 }
692 m_t << "</listitem>\n";
693}
const DocNodeVariant * paragraph() const
Definition docnode.h:1152

References m_hide, m_t, and DocSimpleListItem::paragraph().

◆ operator()() [47/58]

void XmlDocVisitor::operator() ( const DocSimpleSect & s)

Definition at line 656 of file xmldocvisitor.cpp.

657{
658 if (m_hide) return;
660 if (s.title())
661 {
662 std::visit(*this,*s.title());
663 }
664 visitChildren(s);
666}
const DocNodeVariant * title() const
Definition docnode.h:1028
static void endSimpleSect(TextStream &t, const DocSimpleSect &)
static void startSimpleSect(TextStream &t, const DocSimpleSect &s)

References endSimpleSect(), m_hide, m_t, startSimpleSect(), DocSimpleSect::title(), and visitChildren().

◆ operator()() [48/58]

void XmlDocVisitor::operator() ( const DocSimpleSectSep & sep)

Definition at line 579 of file xmldocvisitor.cpp.

580{
581 const DocSimpleSect *sect = std::get_if<DocSimpleSect>(sep.parent());
582 if (sect)
583 {
584 endSimpleSect(m_t,*sect);
585 startSimpleSect(m_t,*sect);
586 }
587}
DocNodeVariant * parent()
Definition docnode.h:89

References endSimpleSect(), m_t, DocNode::parent(), and startSimpleSect().

◆ operator()() [49/58]

void XmlDocVisitor::operator() ( const DocStyleChange & s)

Definition at line 242 of file xmldocvisitor.cpp.

243{
244 if (m_hide) return;
245 switch (s.style())
246 {
248 if (s.enable()) m_t << "<bold>"; else m_t << "</bold>";
249 break;
251 if (s.enable()) m_t << "<s>"; else m_t << "</s>";
252 break;
254 if (s.enable()) m_t << "<strike>"; else m_t << "</strike>";
255 break;
257 if (s.enable()) m_t << "<del>"; else m_t << "</del>";
258 break;
260 if (s.enable()) m_t << "<underline>"; else m_t << "</underline>";
261 break;
263 if (s.enable()) m_t << "<ins>"; else m_t << "</ins>";
264 break;
266 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
267 break;
271 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
272 break;
274 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
275 break;
277 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
278 break;
280 if (s.enable()) m_t << "<center>"; else m_t << "</center>";
281 break;
283 if (s.enable()) m_t << "<small>"; else m_t << "</small>";
284 break;
286 if (s.enable()) m_t << "<cite>"; else m_t << "</cite>";
287 break;
289 if (s.enable())
290 {
291 m_t << "<preformatted>";
293 }
294 else
295 {
296 m_t << "</preformatted>";
298 }
299 break;
300 case DocStyleChange::Div: /* HTML only */ break;
301 case DocStyleChange::Span: /* HTML only */ break;
302 }
303}
Style style() const
Definition docnode.h:303
bool enable() const
Definition docnode.h:305

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable(), FALSE, DocStyleChange::Ins, DocStyleChange::Italic, DocStyleChange::Kbd, m_hide, m_insidePre, m_t, DocStyleChange::Preformatted, DocStyleChange::S, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::style(), DocStyleChange::Subscript, DocStyleChange::Superscript, TRUE, DocStyleChange::Typewriter, and DocStyleChange::Underline.

◆ operator()() [50/58]

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

Definition at line 187 of file xmldocvisitor.cpp.

188{
189 if (m_hide) return;
190 const char *res = HtmlEntityMapper::instance().xml(s.symbol());
191 if (res)
192 {
193 m_t << res;
194 }
195 else
196 {
197 err("XML: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
198 }
199}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:328
const char * xml(SymType symb) const
Access routine to the XML code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
#define err(fmt,...)
Definition message.h:127

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

◆ operator()() [51/58]

void XmlDocVisitor::operator() ( const DocText & t)

Definition at line 1140 of file xmldocvisitor.cpp.

1141{
1142 visitChildren(t);
1143}

References visitChildren().

◆ operator()() [52/58]

void XmlDocVisitor::operator() ( const DocTitle & t)

Definition at line 668 of file xmldocvisitor.cpp.

669{
670 if (m_hide) return;
671 m_t << "<title>";
672 visitChildren(t);
673 m_t << "</title>";
674}

References m_hide, m_t, and visitChildren().

◆ operator()() [53/58]

void XmlDocVisitor::operator() ( const DocURL & u)

Definition at line 219 of file xmldocvisitor.cpp.

220{
221 if (m_hide) return;
222 m_t << "<ulink url=\"";
223 if (u.isEmail()) m_t << "mailto:";
224 filter(u.url());
225 m_t << "\">";
226 filter(u.url());
227 m_t << "</ulink>";
228}
QCString url() const
Definition docnode.h:191
bool isEmail() const
Definition docnode.h:192

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

◆ operator()() [54/58]

void XmlDocVisitor::operator() ( const DocVerbatim & s)

Definition at line 305 of file xmldocvisitor.cpp.

306{
307 if (m_hide) return;
308 QCString lang = m_langExt;
309 if (!s.language().isEmpty()) // explicit language setting
310 {
311 lang = s.language();
312 }
313 SrcLangExt langExt = getLanguageFromCodeLang(lang);
314 switch(s.type())
315 {
317 m_t << "<programlisting";
318 if (!s.language().isEmpty())
319 m_t << " filename=\"" << lang << "\">";
320 else
321 m_t << ">";
322 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
323 Config_getBool(STRIP_CODE_COMMENTS),
324 s.isExample(),s.exampleFile());
325 m_t << "</programlisting>";
326 break;
328 m_t << "<javadocliteral>";
329 filter(s.text());
330 m_t << "</javadocliteral>";
331 break;
333 m_t << "<javadoccode>";
334 filter(s.text());
335 m_t << "</javadoccode>";
336 break;
338 m_t << "<verbatim>";
339 filter(s.text());
340 m_t << "</verbatim>";
341 break;
343 if (s.isBlock())
344 {
345 m_t << "<htmlonly block=\"yes\">";
346 }
347 else
348 {
349 m_t << "<htmlonly>";
350 }
351 filter(s.text());
352 m_t << "</htmlonly>";
353 break;
355 m_t << "<rtfonly>";
356 filter(s.text());
357 m_t << "</rtfonly>";
358 break;
360 m_t << "<manonly>";
361 filter(s.text());
362 m_t << "</manonly>";
363 break;
365 m_t << "<latexonly>";
366 filter(s.text());
367 m_t << "</latexonly>";
368 break;
370 m_t << "<docbookonly>";
371 filter(s.text());
372 m_t << "</docbookonly>";
373 break;
375 m_t << s.text();
376 break;
377 case DocVerbatim::Dot:
378 visitPreStart(m_t, "dot", s.hasCaption(), *this, s.children(), QCString(""), FALSE, DocImage::Html, s.width(), s.height());
379 filter(s.text());
380 visitPostEnd(m_t, "dot");
381 break;
382 case DocVerbatim::Msc:
383 visitPreStart(m_t, "msc", s.hasCaption(), *this, s.children(), QCString(""), FALSE, DocImage::Html, s.width(), s.height());
384 filter(s.text());
385 visitPostEnd(m_t, "msc");
386 break;
388 visitPreStart(m_t, "plantuml", s.hasCaption(), *this, s.children(), QCString(""), FALSE, DocImage::Html, s.width(), s.height(), s.engine());
389 filter(s.text());
390 visitPostEnd(m_t, "plantuml");
391 break;
392 }
393}
QCString height() const
Definition docnode.h:388
bool hasCaption() const
Definition docnode.h:386
QCString language() const
Definition docnode.h:384
const DocNodeList & children() const
Definition docnode.h:391
bool isBlock() const
Definition docnode.h:385
bool isExample() const
Definition docnode.h:381
QCString context() const
Definition docnode.h:380
Type type() const
Definition docnode.h:378
QCString text() const
Definition docnode.h:379
QCString exampleFile() const
Definition docnode.h:382
QCString engine() const
Definition docnode.h:389
@ JavaDocLiteral
Definition docnode.h:374
QCString width() const
Definition docnode.h:387
#define Config_getBool(name)
Definition config.h:33
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5739

References DocVerbatim::children(), DocVerbatim::Code, Config_getBool, DocVerbatim::context(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::engine(), DocVerbatim::exampleFile(), FALSE, filter(), DocVisitor::getCodeParser(), getLanguageFromCodeLang(), DocVerbatim::hasCaption(), DocVerbatim::height(), DocImage::Html, DocVerbatim::HtmlOnly, DocVerbatim::isBlock(), QCString::isEmpty(), DocVerbatim::isExample(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language(), DocVerbatim::LatexOnly, m_ci, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, CodeParserInterface::parseCode(), DocVerbatim::PlantUML, DocVerbatim::RtfOnly, DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::Verbatim, visitPostEnd(), visitPreStart(), DocVerbatim::width(), and DocVerbatim::XmlOnly.

◆ operator()() [55/58]

void XmlDocVisitor::operator() ( const DocVhdlFlow & )

Definition at line 1153 of file xmldocvisitor.cpp.

1154{
1155}

◆ operator()() [56/58]

void XmlDocVisitor::operator() ( const DocWhiteSpace & w)

Definition at line 174 of file xmldocvisitor.cpp.

175{
176 if (m_hide) return;
177 if (m_insidePre)
178 {
179 m_t << w.chars();
180 }
181 else
182 {
183 m_t << " ";
184 }
185}
QCString chars() const
Definition docnode.h:354

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

◆ operator()() [57/58]

void XmlDocVisitor::operator() ( const DocWord & w)

Definition at line 160 of file xmldocvisitor.cpp.

161{
162 if (m_hide) return;
163 filter(w.word());
164}
QCString word() const
Definition docnode.h:155

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

◆ operator()() [58/58]

void XmlDocVisitor::operator() ( const DocXRefItem & x)

Definition at line 1114 of file xmldocvisitor.cpp.

1115{
1116 if (m_hide) return;
1117 if (x.title().isEmpty()) return;
1118 m_t << "<xrefsect id=\"";
1119 m_t << x.file() << "_1" << x.anchor();
1120 m_t << "\">";
1121 m_t << "<xreftitle>";
1122 filter(x.title());
1123 m_t << "</xreftitle>";
1124 m_t << "<xrefdescription>";
1125 visitChildren(x);
1126 if (x.title().isEmpty()) return;
1127 m_t << "</xrefdescription>";
1128 m_t << "</xrefsect>";
1129}
QCString anchor() const
Definition docnode.h:620
QCString file() const
Definition docnode.h:619
QCString title() const
Definition docnode.h:621

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

◆ startLink()

void XmlDocVisitor::startLink ( const QCString & ref,
const QCString & file,
const QCString & anchor )
private

Definition at line 1171 of file xmldocvisitor.cpp.

1172{
1173 //printf("XmlDocVisitor: file=%s anchor=%s\n",qPrint(file),qPrint(anchor));
1174 m_t << "<ref refid=\"" << file;
1175 if (!anchor.isEmpty()) m_t << "_1" << anchor;
1176 m_t << "\" kindref=\"";
1177 if (!anchor.isEmpty()) m_t << "member"; else m_t << "compound";
1178 m_t << "\"";
1179 if (!ref.isEmpty()) m_t << " external=\"" << ref << "\"";
1180 m_t << ">";
1181}

References QCString::isEmpty(), and m_t.

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

◆ visitChildren()

Member Data Documentation

◆ m_ci

OutputCodeList& XmlDocVisitor::m_ci
private

Definition at line 130 of file xmldocvisitor.h.

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

◆ m_hide

◆ m_insidePre

bool XmlDocVisitor::m_insidePre = false
private

Definition at line 131 of file xmldocvisitor.h.

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

◆ m_langExt

QCString XmlDocVisitor::m_langExt
private

Definition at line 133 of file xmldocvisitor.h.

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

◆ m_sectionLevel

int XmlDocVisitor::m_sectionLevel
private

Definition at line 134 of file xmldocvisitor.h.

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

◆ m_t


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