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 1182 of file xmldocvisitor.cpp.

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

References m_t.

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

◆ filter()

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

Definition at line 1165 of file xmldocvisitor.cpp.

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

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 394 of file xmldocvisitor.cpp.

395{
396 if (m_hide) return;
397 m_t << "<anchor id=\"" << anc.file() << "_1" << anc.anchor() << "\"/>";
398}
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 600 of file xmldocvisitor.cpp.

601{
602 if (m_hide) return;
603 if (l.isEnumList())
604 {
605 m_t << "<orderedlist>\n";
606 }
607 else
608 {
609 m_t << "<itemizedlist>\n";
610 }
611 visitChildren(l);
612 if (l.isEnumList())
613 {
614 m_t << "</orderedlist>\n";
615 }
616 else
617 {
618 m_t << "</itemizedlist>\n";
619 }
620}
bool isEnumList() const
Definition docnode.h:575
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 622 of file xmldocvisitor.cpp.

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

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 588 of file xmldocvisitor.cpp.

589{
590 if (m_hide) return;
591 if (!cite.file().isEmpty()) startLink(cite.ref(),cite.file(),cite.anchor());
592 filter(cite.text());
593 if (!cite.file().isEmpty()) endLink();
594}
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 980 of file xmldocvisitor.cpp.

981{
982 if (m_hide) return;
983 copyFile(df.file(),Config_getString(XML_OUTPUT)+"/"+stripPath(df.file()));
984 visitPreStart(m_t, "diafile", FALSE, *this, df.children(), stripPath(df.file()), FALSE, DocImage::Html, df.width(), df.height());
985 visitChildren(df);
986 visitPostEnd(m_t, "diafile");
987}
DocNodeList & children()
Definition docnode.h:142
QCString height() const
Definition docnode.h:683
QCString file() const
Definition docnode.h:679
QCString width() const
Definition docnode.h:682
#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:5292
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:6170

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:340
QCString name() const
Definition docnode.h:339
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 559 of file xmldocvisitor.cpp.

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

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 892 of file xmldocvisitor.cpp.

893{
894 if (m_hide) return;
895 m_t << "<ulink url=\"" << convertToXML(href.url(), TRUE) << "\">";
896 visitChildren(href);
897 m_t << "</ulink>";
898}
QCString url() const
Definition docnode.h:824
#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 1144 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [12/58]

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

Definition at line 871 of file xmldocvisitor.cpp.

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

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 818 of file xmldocvisitor.cpp.

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

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

◆ operator()() [14/58]

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

Definition at line 781 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [15/58]

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

Definition at line 765 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [16/58]

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

Definition at line 773 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [17/58]

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

Definition at line 908 of file xmldocvisitor.cpp.

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

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

◆ operator()() [18/58]

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

Definition at line 921 of file xmldocvisitor.cpp.

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

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

◆ operator()() [19/58]

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

Definition at line 722 of file xmldocvisitor.cpp.

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

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 749 of file xmldocvisitor.cpp.

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

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

◆ operator()() [21/58]

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

Definition at line 810 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [22/58]

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

Definition at line 900 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 789 of file xmldocvisitor.cpp.

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

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 929 of file xmldocvisitor.cpp.

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

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 400 of file xmldocvisitor.cpp.

401{
402 if (m_hide) return;
404 //printf("XMLDocVisitor: DocInclude type=%d trimleft=%d\n",inc.type(),inc.trimLeft());
405 switch(inc.type())
406 {
408 {
409 m_t << "<programlisting filename=\"" << inc.file() << "\">";
410 FileInfo cfi( inc.file().str() );
411 auto fd = createFileDef( cfi.dirPath(), cfi.fileName());
413 inc.text(),
414 langExt,
415 inc.stripCodeComments(),
416 inc.isExample(),
417 inc.exampleFile(),
418 fd.get(), // fileDef,
419 -1, // start line
420 -1, // end line
421 FALSE, // inline fragment
422 nullptr, // memberDef
423 TRUE // show line numbers
424 );
425 m_t << "</programlisting>";
426 }
427 break;
429 m_t << "<programlisting filename=\"" << inc.file() << "\">";
431 inc.text(),
432 langExt,
433 inc.stripCodeComments(),
434 inc.isExample(),
435 inc.exampleFile(),
436 nullptr, // fileDef
437 -1, // startLine
438 -1, // endLine
439 TRUE, // inlineFragment
440 nullptr, // memberDef
441 FALSE // show line numbers
442 );
443 m_t << "</programlisting>";
444 break;
447 break;
449 if (inc.isBlock())
450 {
451 m_t << "<htmlonly block=\"yes\">";
452 }
453 else
454 {
455 m_t << "<htmlonly>";
456 }
457 filter(inc.text());
458 m_t << "</htmlonly>";
459 break;
461 m_t << "<latexonly>";
462 filter(inc.text());
463 m_t << "</latexonly>";
464 break;
466 m_t << "<rtfonly>";
467 filter(inc.text());
468 m_t << "</rtfonly>";
469 break;
471 m_t << "<manonly>";
472 filter(inc.text());
473 m_t << "</manonly>";
474 break;
476 filter(inc.text());
477 break;
479 m_t << "<docbookonly>";
480 filter(inc.text());
481 m_t << "</docbookonly>";
482 break;
484 m_t << "<verbatim>";
485 filter(inc.text());
486 m_t << "</verbatim>";
487 break;
490 m_t << "<programlisting filename=\"" << inc.file() << "\">";
492 inc.file(),
493 inc.blockId(),
494 inc.context(),
496 inc.trimLeft(),
498 );
499 m_t << "</programlisting>";
500 break;
501 }
502}
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:449
QCString extension() const
Definition docnode.h:445
bool isBlock() const
Definition docnode.h:453
bool stripCodeComments() const
Definition docnode.h:450
@ LatexInclude
Definition docnode.h:432
@ SnippetWithLines
Definition docnode.h:433
@ DontIncWithLines
Definition docnode.h:434
@ IncWithLines
Definition docnode.h:433
@ HtmlInclude
Definition docnode.h:432
@ VerbInclude
Definition docnode.h:432
@ DontInclude
Definition docnode.h:432
@ DocbookInclude
Definition docnode.h:434
Type type() const
Definition docnode.h:446
QCString exampleFile() const
Definition docnode.h:452
QCString text() const
Definition docnode.h:447
QCString file() const
Definition docnode.h:444
bool trimLeft() const
Definition docnode.h:454
bool isExample() const
Definition docnode.h:451
QCString context() const
Definition docnode.h:448
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:267
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549

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 504 of file xmldocvisitor.cpp.

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

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 567 of file xmldocvisitor.cpp.

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

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

◆ operator()() [28/58]

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

Definition at line 884 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1130 of file xmldocvisitor.cpp.

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

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 998 of file xmldocvisitor.cpp.

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

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 642 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [35/58]

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

Definition at line 1065 of file xmldocvisitor.cpp.

1066{
1067 if (m_hide) return;
1068 m_t << "<parameteritem>\n";
1069 m_t << "<parameternamelist>\n";
1070 for (const auto &param : pl.parameters())
1071 {
1072 if (!pl.paramTypes().empty())
1073 {
1074 m_t << "<parametertype>";
1075 for (const auto &type : pl.paramTypes())
1076 {
1077 std::visit(*this,type);
1078 }
1079 m_t << "</parametertype>\n";
1080 }
1081 m_t << "<parametername";
1083 {
1084 m_t << " direction=\"";
1085 if (pl.direction()==DocParamSect::In)
1086 {
1087 m_t << "in";
1088 }
1089 else if (pl.direction()==DocParamSect::Out)
1090 {
1091 m_t << "out";
1092 }
1093 else if (pl.direction()==DocParamSect::InOut)
1094 {
1095 m_t << "inout";
1096 }
1097 m_t << "\"";
1098 }
1099 m_t << ">";
1100 std::visit(*this,param);
1101 m_t << "</parametername>\n";
1102 }
1103 m_t << "</parameternamelist>\n";
1104 m_t << "<parameterdescription>\n";
1105 for (const auto &par : pl.paragraphs())
1106 {
1107 std::visit(*this,par);
1108 }
1109 m_t << "</parameterdescription>\n";
1110 m_t << "</parameteritem>\n";
1111}
const DocNodeList & parameters() const
Definition docnode.h:1123
const DocNodeList & paramTypes() const
Definition docnode.h:1124
DocParamSect::Direction direction() const
Definition docnode.h:1127
const DocNodeList & paragraphs() const
Definition docnode.h:1125
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 1037 of file xmldocvisitor.cpp.

1038{
1039 if (m_hide) return;
1040 m_t << "<parameterlist kind=\"";
1041 switch(s.type())
1042 {
1044 m_t << "param"; break;
1046 m_t << "retval"; break;
1048 m_t << "exception"; break;
1050 m_t << "templateparam"; break;
1051 default:
1052 ASSERT(0);
1053 }
1054 m_t << "\">";
1055 visitChildren(s);
1056 m_t << "</parameterlist>\n";
1057}
Type type() const
Definition docnode.h:1062
#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 1156 of file xmldocvisitor.cpp.

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

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 1006 of file xmldocvisitor.cpp.

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

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 650 of file xmldocvisitor.cpp.

651{
652 visitChildren(r);
653}

References visitChildren().

◆ operator()() [41/58]

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

Definition at line 1018 of file xmldocvisitor.cpp.

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

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 1029 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [43/58]

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

Definition at line 694 of file xmldocvisitor.cpp.

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

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 1059 of file xmldocvisitor.cpp.

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

References m_t.

◆ operator()() [45/58]

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

Definition at line 675 of file xmldocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [46/58]

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

Definition at line 683 of file xmldocvisitor.cpp.

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

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

◆ operator()() [47/58]

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

Definition at line 655 of file xmldocvisitor.cpp.

656{
657 if (m_hide) return;
659 if (s.title())
660 {
661 std::visit(*this,*s.title());
662 }
663 visitChildren(s);
665}
const DocNodeVariant * title() const
Definition docnode.h:1027
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 578 of file xmldocvisitor.cpp.

579{
580 const DocSimpleSect *sect = std::get_if<DocSimpleSect>(sep.parent());
581 if (sect)
582 {
583 endSimpleSect(m_t,*sect);
584 startSimpleSect(m_t,*sect);
585 }
586}
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;
270 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
271 break;
273 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
274 break;
276 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
277 break;
279 if (s.enable()) m_t << "<center>"; else m_t << "</center>";
280 break;
282 if (s.enable()) m_t << "<small>"; else m_t << "</small>";
283 break;
285 if (s.enable()) m_t << "<cite>"; else m_t << "</cite>";
286 break;
288 if (s.enable())
289 {
290 m_t << "<preformatted>";
292 }
293 else
294 {
295 m_t << "</preformatted>";
297 }
298 break;
299 case DocStyleChange::Div: /* HTML only */ break;
300 case DocStyleChange::Span: /* HTML only */ break;
301 }
302}
Style style() const
Definition docnode.h:302
bool enable() const
Definition docnode.h:304

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, 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: %s\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
198 }
199}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:327
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:84

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 1139 of file xmldocvisitor.cpp.

1140{
1141 visitChildren(t);
1142}

References visitChildren().

◆ operator()() [52/58]

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

Definition at line 667 of file xmldocvisitor.cpp.

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

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 304 of file xmldocvisitor.cpp.

305{
306 if (m_hide) return;
307 QCString lang = m_langExt;
308 if (!s.language().isEmpty()) // explicit language setting
309 {
310 lang = s.language();
311 }
312 SrcLangExt langExt = getLanguageFromCodeLang(lang);
313 switch(s.type())
314 {
316 m_t << "<programlisting";
317 if (!s.language().isEmpty())
318 m_t << " filename=\"" << lang << "\">";
319 else
320 m_t << ">";
321 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
322 Config_getBool(STRIP_CODE_COMMENTS),
323 s.isExample(),s.exampleFile());
324 m_t << "</programlisting>";
325 break;
327 m_t << "<javadocliteral>";
328 filter(s.text());
329 m_t << "</javadocliteral>";
330 break;
332 m_t << "<javadoccode>";
333 filter(s.text());
334 m_t << "</javadoccode>";
335 break;
337 m_t << "<verbatim>";
338 filter(s.text());
339 m_t << "</verbatim>";
340 break;
342 if (s.isBlock())
343 {
344 m_t << "<htmlonly block=\"yes\">";
345 }
346 else
347 {
348 m_t << "<htmlonly>";
349 }
350 filter(s.text());
351 m_t << "</htmlonly>";
352 break;
354 m_t << "<rtfonly>";
355 filter(s.text());
356 m_t << "</rtfonly>";
357 break;
359 m_t << "<manonly>";
360 filter(s.text());
361 m_t << "</manonly>";
362 break;
364 m_t << "<latexonly>";
365 filter(s.text());
366 m_t << "</latexonly>";
367 break;
369 m_t << "<docbookonly>";
370 filter(s.text());
371 m_t << "</docbookonly>";
372 break;
374 m_t << s.text();
375 break;
376 case DocVerbatim::Dot:
377 visitPreStart(m_t, "dot", s.hasCaption(), *this, s.children(), QCString(""), FALSE, DocImage::Html, s.width(), s.height());
378 filter(s.text());
379 visitPostEnd(m_t, "dot");
380 break;
381 case DocVerbatim::Msc:
382 visitPreStart(m_t, "msc", s.hasCaption(), *this, s.children(), QCString(""), FALSE, DocImage::Html, s.width(), s.height());
383 filter(s.text());
384 visitPostEnd(m_t, "msc");
385 break;
387 visitPreStart(m_t, "plantuml", s.hasCaption(), *this, s.children(), QCString(""), FALSE, DocImage::Html, s.width(), s.height(), s.engine());
388 filter(s.text());
389 visitPostEnd(m_t, "plantuml");
390 break;
391 }
392}
QCString height() const
Definition docnode.h:387
bool hasCaption() const
Definition docnode.h:385
QCString language() const
Definition docnode.h:383
const DocNodeList & children() const
Definition docnode.h:390
bool isBlock() const
Definition docnode.h:384
bool isExample() const
Definition docnode.h:380
QCString context() const
Definition docnode.h:379
Type type() const
Definition docnode.h:377
QCString text() const
Definition docnode.h:378
QCString exampleFile() const
Definition docnode.h:381
QCString engine() const
Definition docnode.h:388
@ JavaDocLiteral
Definition docnode.h:373
QCString width() const
Definition docnode.h:386
#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:5567

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 1152 of file xmldocvisitor.cpp.

1153{
1154}

◆ 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:353

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 1113 of file xmldocvisitor.cpp.

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

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 1170 of file xmldocvisitor.cpp.

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

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: