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 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
 
bool m_hide
 
QCString m_langExt
 

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)
153{
154}
OutputCodeList & m_ci
TextStream & m_t
QCString m_langExt
#define FALSE
Definition qcstring.h:34

Member Function Documentation

◆ endLink()

void XmlDocVisitor::endLink ( )
private

Definition at line 1152 of file xmldocvisitor.cpp.

1153{
1154 m_t << "</ref>";
1155}

References m_t.

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

◆ filter()

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

Definition at line 1135 of file xmldocvisitor.cpp.

1136{
1137 m_t << convertToXML(str);
1138}
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4205

References convertToXML(), and m_t.

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

◆ operator()() [1/57]

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

Definition at line 392 of file xmldocvisitor.cpp.

393{
394 if (m_hide) return;
395 m_t << "<anchor id=\"" << anc.file() << "_1" << anc.anchor() << "\"/>";
396}
QCString anchor() const
Definition docnode.h:230
QCString file() const
Definition docnode.h:231

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

◆ operator()() [2/57]

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

Definition at line 593 of file xmldocvisitor.cpp.

594{
595 if (m_hide) return;
596 if (l.isEnumList())
597 {
598 m_t << "<orderedlist>\n";
599 }
600 else
601 {
602 m_t << "<itemizedlist>\n";
603 }
604 visitChildren(l);
605 if (l.isEnumList())
606 {
607 m_t << "</orderedlist>\n";
608 }
609 else
610 {
611 m_t << "</itemizedlist>\n";
612 }
613}
bool isEnumList() const
Definition docnode.h:552
void visitChildren(const T &t)

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

◆ operator()() [3/57]

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

Definition at line 615 of file xmldocvisitor.cpp.

616{
617 if (m_hide) return;
618 switch (li.itemNumber())
619 {
620 case DocAutoList::Unchecked: // unchecked
621 m_t << "<listitem override=\"unchecked\">";
622 break;
623 case DocAutoList::Checked_x: // checked with x
624 case DocAutoList::Checked_X: // checked with X
625 m_t << "<listitem override=\"checked\">";
626 break;
627 default:
628 m_t << "<listitem>";
629 break;
630 }
631 visitChildren(li);
632 m_t << "</listitem>";
633}
int itemNumber() const
Definition docnode.h:570

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

◆ operator()() [4/57]

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

Definition at line 581 of file xmldocvisitor.cpp.

582{
583 if (m_hide) return;
584 if (!cite.file().isEmpty()) startLink(cite.ref(),cite.file(),cite.anchor());
585 filter(cite.text());
586 if (!cite.file().isEmpty()) endLink();
587}
QCString text() const
Definition docnode.h:250
QCString anchor() const
Definition docnode.h:249
QCString ref() const
Definition docnode.h:248
QCString file() const
Definition docnode.h:246
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:143
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/57]

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

Definition at line 959 of file xmldocvisitor.cpp.

960{
961 if (m_hide) return;
962 copyFile(df.file(),Config_getString(XML_OUTPUT)+"/"+stripPath(df.file()));
963 visitPreStart(m_t, "diafile", FALSE, *this, df.children(), stripPath(df.file()), FALSE, DocImage::Html, df.width(), df.height());
964 visitChildren(df);
965 visitPostEnd(m_t, "diafile");
966}
DocNodeList & children()
Definition docnode.h:141
QCString height() const
Definition docnode.h:660
QCString file() const
Definition docnode.h:656
QCString width() const
Definition docnode.h:659
#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:5216
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:6092

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/57]

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

◆ operator()() [7/57]

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:324
QCString name() const
Definition docnode.h:323
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:1968
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1920
This is an alternative implementation of QCString.
Definition qcstring.h:94
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:146
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:219

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

◆ operator()() [8/57]

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

Definition at line 552 of file xmldocvisitor.cpp.

553{
554 if (m_hide) return;
555 m_t << "<formula id=\"" << f.id() << "\">";
556 filter(f.text());
557 m_t << "</formula>";
558}
QCString text() const
Definition docnode.h:505
int id() const
Definition docnode.h:507

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

◆ operator()() [9/57]

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/57]

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

Definition at line 871 of file xmldocvisitor.cpp.

872{
873 if (m_hide) return;
874 m_t << "<ulink url=\"" << convertToXML(href.url(), TRUE) << "\">";
875 visitChildren(href);
876 m_t << "</ulink>";
877}
QCString url() const
Definition docnode.h:792
#define TRUE
Definition qcstring.h:37

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

◆ operator()() [11/57]

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

Definition at line 1114 of file xmldocvisitor.cpp.

1115{
1116 if (m_hide) return;
1117 m_t << "<blockquote>";
1118 visitChildren(q);
1119 m_t << "</blockquote>";
1120}

References m_hide, m_t, and visitChildren().

◆ operator()() [12/57]

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

Definition at line 850 of file xmldocvisitor.cpp.

851{
852 if (m_hide) return;
853 m_t << "<caption";
854 if (!c.file().isEmpty())
855 {
856 m_t << " id=\"" << stripPath(c.file()) << "_1" << c.anchor() << "\"";
857 }
858 m_t << ">";
859 visitChildren(c);
860 m_t << "</caption>\n";
861}
QCString anchor() const
Definition docnode.h:1197
QCString file() const
Definition docnode.h:1196

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

◆ operator()() [13/57]

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

Definition at line 797 of file xmldocvisitor.cpp.

798{
799 if (m_hide) return;
800 if (c.isHeading()) m_t << "<entry thead=\"yes\""; else m_t << "<entry thead=\"no\"";
801 for (const auto &opt : c.attribs())
802 {
803 if (opt.name=="colspan" || opt.name=="rowspan")
804 {
805 m_t << " " << opt.name << "=\"" << opt.value.toInt() << "\"";
806 }
807 else if (opt.name=="align" &&
808 (opt.value=="right" || opt.value=="left" || opt.value=="center"))
809 {
810 m_t << " align=\"" << opt.value << "\"";
811 }
812 else if (opt.name=="valign" &&
813 (opt.value == "bottom" || opt.value == "top" || opt.value == "middle"))
814 {
815 m_t << " valign=\"" << opt.value << "\"";
816 }
817 else if (opt.name=="width")
818 {
819 m_t << " width=\"" << opt.value << "\"";
820 }
821 else if (opt.name=="class") // handle markdown generated attributes
822 {
823 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
824 {
825 if (opt.value.endsWith("Right"))
826 {
827 m_t << " align='right'";
828 }
829 else if (opt.value.endsWith("Left"))
830 {
831 m_t << " align='left'";
832 }
833 else if (opt.value.endsWith("Center"))
834 {
835 m_t << " align='center'";
836 }
837 // skip 'markdownTable*' value ending with "None"
838 }
839 else if (!opt.value.isEmpty())
840 {
841 m_t << " class=\"" << convertToXML(opt.value) << "\"";
842 }
843 }
844 }
845 m_t << ">";
846 visitChildren(c);
847 m_t << "</entry>";
848}
bool isHeading() const
Definition docnode.h:1162

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

◆ operator()() [14/57]

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

Definition at line 760 of file xmldocvisitor.cpp.

761{
762 if (m_hide) return;
763 m_t << "<listitem>";
764 visitChildren(dd);
765 m_t << "</listitem>\n";
766}

References m_hide, m_t, and visitChildren().

◆ operator()() [15/57]

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

Definition at line 744 of file xmldocvisitor.cpp.

745{
746 if (m_hide) return;
747 m_t << "<variablelist>\n";
748 visitChildren(dl);
749 m_t << "</variablelist>\n";
750}

References m_hide, m_t, and visitChildren().

◆ operator()() [16/57]

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

Definition at line 752 of file xmldocvisitor.cpp.

753{
754 if (m_hide) return;
755 m_t << "<varlistentry><term>";
756 visitChildren(dt);
757 m_t << "</term></varlistentry>\n";
758}

References m_hide, m_t, and visitChildren().

◆ operator()() [17/57]

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

Definition at line 887 of file xmldocvisitor.cpp.

888{
889 if (m_hide) return;
890 m_t << "<details>";
891 auto summary = d.summary();
892 if (summary)
893 {
894 std::visit(*this,*summary);
895 }
896 visitChildren(d);
897 m_t << "</details>";
898}
const DocNodeVariant * summary() const
Definition docnode.h:826

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

◆ operator()() [18/57]

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

Definition at line 900 of file xmldocvisitor.cpp.

901{
902 if (m_hide) return;
903 m_t << "<heading level=\"" << header.level() << "\">";
904 visitChildren(header);
905 m_t << "</heading>\n";
906}
int level() const
Definition docnode.h:839

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

◆ operator()() [19/57]

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

Definition at line 701 of file xmldocvisitor.cpp.

702{
703 if (m_hide) return;
704 if (s.type()==DocHtmlList::Ordered)
705 {
706 m_t << "<orderedlist";
707 for (const auto &opt : s.attribs())
708 {
709 m_t << " " << opt.name << "=\"" << opt.value << "\"";
710 }
711 m_t << ">\n";
712 }
713 else
714 {
715 m_t << "<itemizedlist>\n";
716 }
717 visitChildren(s);
718 if (s.type()==DocHtmlList::Ordered)
719 {
720 m_t << "</orderedlist>\n";
721 }
722 else
723 {
724 m_t << "</itemizedlist>\n";
725 }
726}
Type type() const
Definition docnode.h:967

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

◆ operator()() [20/57]

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

Definition at line 728 of file xmldocvisitor.cpp.

729{
730 if (m_hide) return;
731 m_t << "<listitem";
732 for (const auto &opt : l.attribs())
733 {
734 if (opt.name=="value")
735 {
736 m_t << " " << opt.name << "=\"" << opt.value << "\"";
737 }
738 }
739 m_t << ">\n";
740 visitChildren(l);
741 m_t << "</listitem>\n";
742}

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

◆ operator()() [21/57]

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

Definition at line 789 of file xmldocvisitor.cpp.

790{
791 if (m_hide) return;
792 m_t << "<row>\n";
793 visitChildren(r);
794 m_t << "</row>\n";
795}

References m_hide, m_t, and visitChildren().

◆ operator()() [22/57]

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

Definition at line 879 of file xmldocvisitor.cpp.

880{
881 if (m_hide) return;
882 m_t << "<summary>";
883 visitChildren(s);
884 m_t << "</summary>";
885}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/57]

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

Definition at line 768 of file xmldocvisitor.cpp.

769{
770 if (m_hide) return;
771 m_t << "<table rows=\"" << t.numRows()
772 << "\" cols=\"" << t.numColumns() << "\"" ;
773 for (const auto &opt : t.attribs())
774 {
775 if (opt.name=="width")
776 {
777 m_t << " " << opt.name << "=\"" << opt.value << "\"";
778 }
779 }
780 m_t << ">";
781 if (t.caption())
782 {
783 std::visit(*this,*t.caption());
784 }
785 visitChildren(t);
786 m_t << "</table>\n";
787}
size_t numRows() const
Definition docnode.h:1235
size_t numColumns() const
Definition docnode.h:1240
const DocNodeVariant * caption() const
Definition docnode.cpp:1949

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

◆ operator()() [24/57]

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

Definition at line 908 of file xmldocvisitor.cpp.

909{
910 if (m_hide) return;
911
912 QCString url = img.url();
913 QCString baseName;
914 if (url.isEmpty())
915 {
916 baseName = img.relPath()+img.name();
917 }
918 else
919 {
920 baseName = correctURL(url,img.relPath());
921 }
922 HtmlAttribList attribs = img.attribs();
923 auto it = std::find_if(attribs.begin(),attribs.end(),
924 [](const auto &att) { return att.name=="alt"; });
925 QCString altValue = it!=attribs.end() ? it->value : "";
926 visitPreStart(m_t, "image", FALSE, *this, img.children(), baseName, TRUE,
927 img.type(), img.width(), img.height(), QCString(),
928 altValue, img.isInlineImage());
929
930 // copy the image to the output dir
931 FileDef *fd = nullptr;
932 bool ambig;
933 if (url.isEmpty() && (fd=findFileDef(Doxygen::imageNameLinkedMap,img.name(),ambig)))
934 {
935 copyFile(fd->absFilePath(),Config_getString(XML_OUTPUT)+"/"+baseName);
936 }
937 visitChildren(img);
938 visitPostEnd(m_t, "image");
939}
const HtmlAttribList & attribs() const
Definition docnode.h:627
QCString relPath() const
Definition docnode.h:623
QCString name() const
Definition docnode.h:619
QCString url() const
Definition docnode.h:624
QCString height() const
Definition docnode.h:622
Type type() const
Definition docnode.h:618
QCString width() const
Definition docnode.h:621
bool isInlineImage() const
Definition docnode.h:625
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:97
A model of a file symbol.
Definition filedef.h:99
virtual QCString absFilePath() const =0
Class representing a list of HTML attributes.
Definition htmlattrib.h:31
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:6180
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3222

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/57]

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

Definition at line 398 of file xmldocvisitor.cpp.

399{
400 if (m_hide) return;
402 switch(inc.type())
403 {
405 {
406 m_t << "<programlisting filename=\"" << inc.file() << "\">";
407 FileInfo cfi( inc.file().str() );
408 auto fd = createFileDef( cfi.dirPath(), cfi.fileName());
410 inc.text(),
411 langExt,
412 inc.isExample(),
413 inc.exampleFile(),
414 fd.get(), // fileDef,
415 -1, // start line
416 -1, // end line
417 FALSE, // inline fragment
418 nullptr, // memberDef
419 TRUE // show line numbers
420 );
421 m_t << "</programlisting>";
422 }
423 break;
425 m_t << "<programlisting filename=\"" << inc.file() << "\">";
427 inc.text(),
428 langExt,
429 inc.isExample(),
430 inc.exampleFile(),
431 nullptr, // fileDef
432 -1, // startLine
433 -1, // endLine
434 TRUE, // inlineFragment
435 nullptr, // memberDef
436 FALSE // show line numbers
437 );
438 m_t << "</programlisting>";
439 break;
442 break;
444 if (inc.isBlock())
445 {
446 m_t << "<htmlonly block=\"yes\">";
447 }
448 else
449 {
450 m_t << "<htmlonly>";
451 }
452 filter(inc.text());
453 m_t << "</htmlonly>";
454 break;
456 m_t << "<latexonly>";
457 filter(inc.text());
458 m_t << "</latexonly>";
459 break;
461 m_t << "<rtfonly>";
462 filter(inc.text());
463 m_t << "</rtfonly>";
464 break;
466 m_t << "<manonly>";
467 filter(inc.text());
468 m_t << "</manonly>";
469 break;
471 filter(inc.text());
472 break;
474 m_t << "<docbookonly>";
475 filter(inc.text());
476 m_t << "</docbookonly>";
477 break;
479 m_t << "<verbatim>";
480 filter(inc.text());
481 m_t << "</verbatim>";
482 break;
486 m_t << "<programlisting filename=\"" << inc.file() << "\">";
488 inc.file(),
489 inc.blockId(),
490 inc.context(),
493 );
494 m_t << "</programlisting>";
495 break;
496 }
497}
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, 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:432
QCString extension() const
Definition docnode.h:428
bool isBlock() const
Definition docnode.h:435
@ LatexInclude
Definition docnode.h:416
@ SnippetTrimLeft
Definition docnode.h:419
@ SnippetWithLines
Definition docnode.h:417
@ DontIncWithLines
Definition docnode.h:418
@ IncWithLines
Definition docnode.h:417
@ HtmlInclude
Definition docnode.h:416
@ VerbInclude
Definition docnode.h:416
@ DontInclude
Definition docnode.h:416
@ DocbookInclude
Definition docnode.h:418
Type type() const
Definition docnode.h:429
QCString exampleFile() const
Definition docnode.h:434
QCString text() const
Definition docnode.h:430
QCString file() const
Definition docnode.h:427
bool isExample() const
Definition docnode.h:433
QCString context() const
Definition docnode.h:431
CodeParserInterface & getCodeParser(const QCString &langExt)
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
const std::string & str() const
Definition qcstring.h:517
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:263
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5472

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::SnippetTrimLeft, DocInclude::SnippetWithLines, QCString::str(), DocInclude::text(), TRUE, DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/57]

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

Definition at line 499 of file xmldocvisitor.cpp.

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

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::text(), TRUE, and DocIncOperator::type().

◆ operator()() [27/57]

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

Definition at line 560 of file xmldocvisitor.cpp.

561{
562 if (m_hide) return;
563 m_t << "<indexentry>"
564 "<primaryie>";
565 filter(ie.entry());
566 m_t << "</primaryie>"
567 "<secondaryie></secondaryie>"
568 "</indexentry>";
569}
QCString entry() const
Definition docnode.h:531

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

◆ operator()() [28/57]

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

Definition at line 863 of file xmldocvisitor.cpp.

864{
865 if (m_hide) return;
866 m_t << "<internal>";
867 visitChildren(i);
868 m_t << "</internal>\n";
869}

References m_hide, m_t, and visitChildren().

◆ operator()() [29/57]

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

Definition at line 1100 of file xmldocvisitor.cpp.

1101{
1102 if (m_hide) return;
1103 startLink(QCString(),ref.file(),ref.anchor());
1104 visitChildren(ref);
1105 endLink();
1106 m_t << " ";
1107}
QCString file() const
Definition docnode.h:773
QCString anchor() const
Definition docnode.h:775

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

◆ operator()() [30/57]

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/57]

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

Definition at line 968 of file xmldocvisitor.cpp.

969{
970 if (m_hide) return;
971 startLink(lnk.ref(),lnk.file(),lnk.anchor());
972 visitChildren(lnk);
973 endLink();
974}

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

◆ operator()() [32/57]

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:169
QCString ref() const
Definition docnode.h:171
QCString word() const
Definition docnode.h:168
QCString anchor() const
Definition docnode.h:172

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

◆ operator()() [33/57]

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

◆ operator()() [34/57]

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

Definition at line 635 of file xmldocvisitor.cpp.

636{
637 if (m_hide) return;
638 m_t << "<para>";
639 visitChildren(p);
640 m_t << "</para>\n";
641}

References m_hide, m_t, and visitChildren().

◆ operator()() [35/57]

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

Definition at line 1035 of file xmldocvisitor.cpp.

1036{
1037 if (m_hide) return;
1038 m_t << "<parameteritem>\n";
1039 m_t << "<parameternamelist>\n";
1040 for (const auto &param : pl.parameters())
1041 {
1042 if (!pl.paramTypes().empty())
1043 {
1044 m_t << "<parametertype>";
1045 for (const auto &type : pl.paramTypes())
1046 {
1047 std::visit(*this,type);
1048 }
1049 m_t << "</parametertype>\n";
1050 }
1051 m_t << "<parametername";
1053 {
1054 m_t << " direction=\"";
1055 if (pl.direction()==DocParamSect::In)
1056 {
1057 m_t << "in";
1058 }
1059 else if (pl.direction()==DocParamSect::Out)
1060 {
1061 m_t << "out";
1062 }
1063 else if (pl.direction()==DocParamSect::InOut)
1064 {
1065 m_t << "inout";
1066 }
1067 m_t << "\"";
1068 }
1069 m_t << ">";
1070 std::visit(*this,param);
1071 m_t << "</parametername>\n";
1072 }
1073 m_t << "</parameternamelist>\n";
1074 m_t << "<parameterdescription>\n";
1075 for (const auto &par : pl.paragraphs())
1076 {
1077 std::visit(*this,par);
1078 }
1079 m_t << "</parameterdescription>\n";
1080 m_t << "</parameteritem>\n";
1081}
const DocNodeList & paramTypes() const
Definition docnode.h:1092
DocParamSect::Direction direction() const
Definition docnode.h:1095
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/57]

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

Definition at line 1007 of file xmldocvisitor.cpp.

1008{
1009 if (m_hide) return;
1010 m_t << "<parameterlist kind=\"";
1011 switch(s.type())
1012 {
1014 m_t << "param"; break;
1016 m_t << "retval"; break;
1018 m_t << "exception"; break;
1020 m_t << "templateparam"; break;
1021 default:
1022 ASSERT(0);
1023 }
1024 m_t << "\">";
1025 visitChildren(s);
1026 m_t << "</parameterlist>\n";
1027}
Type type() const
Definition docnode.h:1030
#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/57]

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

Definition at line 1126 of file xmldocvisitor.cpp.

1127{
1128 if (m_hide) return;
1129 m_t << "<parblock>";
1130 visitChildren(pb);
1131 m_t << "</parblock>";
1132}

References m_hide, m_t, and visitChildren().

◆ operator()() [38/57]

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

Definition at line 976 of file xmldocvisitor.cpp.

977{
978 if (m_hide) return;
979 if (!ref.file().isEmpty())
980 {
981 startLink(ref.ref(),ref.file(),ref.isSubPage() ? QCString() : ref.anchor());
982 }
983 if (!ref.hasLinkText()) filter(ref.targetTitle());
984 visitChildren(ref);
985 if (!ref.file().isEmpty()) endLink();
986}
QCString targetTitle() const
Definition docnode.h:748
bool isSubPage() const
Definition docnode.h:754
QCString file() const
Definition docnode.h:744
QCString ref() const
Definition docnode.h:746
bool hasLinkText() const
Definition docnode.h:750

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

◆ operator()() [39/57]

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

Definition at line 643 of file xmldocvisitor.cpp.

644{
645 visitChildren(r);
646}

References visitChildren().

◆ operator()() [40/57]

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

Definition at line 988 of file xmldocvisitor.cpp.

989{
990 if (m_hide) return;
991 m_t << "<tocitem id=\"" << ref.file();
992 if (!ref.anchor().isEmpty()) m_t << "_1" << ref.anchor();
993 m_t << "\"";
994 m_t << ">";
995 visitChildren(ref);
996 m_t << "</tocitem>\n";
997}
QCString file() const
Definition docnode.h:901
QCString anchor() const
Definition docnode.h:902

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

◆ operator()() [41/57]

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

Definition at line 999 of file xmldocvisitor.cpp.

1000{
1001 if (m_hide) return;
1002 m_t << "<toclist>\n";
1003 visitChildren(l);
1004 m_t << "</toclist>\n";
1005}

References m_hide, m_t, and visitChildren().

◆ operator()() [42/57]

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

Definition at line 687 of file xmldocvisitor.cpp.

688{
689 if (m_hide) return;
690 m_t << "<sect" << s.level() << " id=\"" << s.file();
691 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
692 m_t << "\">\n";
693 if (s.title())
694 {
695 std::visit(*this,*s.title());
696 }
697 visitChildren(s);
698 m_t << "</sect" << s.level() << ">\n";
699}
QCString file() const
Definition docnode.h:884
int level() const
Definition docnode.h:880
QCString anchor() const
Definition docnode.h:882
const DocNodeVariant * title() const
Definition docnode.h:881

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

◆ operator()() [43/57]

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

Definition at line 1029 of file xmldocvisitor.cpp.

1030{
1031 m_t << "</parametertype>\n";
1032 m_t << "<parametertype>";
1033}

References m_t.

◆ operator()() [44/57]

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

Definition at line 668 of file xmldocvisitor.cpp.

669{
670 if (m_hide) return;
671 m_t << "<itemizedlist>\n";
672 visitChildren(l);
673 m_t << "</itemizedlist>\n";
674}

References m_hide, m_t, and visitChildren().

◆ operator()() [45/57]

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

Definition at line 676 of file xmldocvisitor.cpp.

677{
678 if (m_hide) return;
679 m_t << "<listitem>";
680 if (li.paragraph())
681 {
682 std::visit(*this,*li.paragraph());
683 }
684 m_t << "</listitem>\n";
685}
const DocNodeVariant * paragraph() const
Definition docnode.h:1119

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

◆ operator()() [46/57]

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

Definition at line 648 of file xmldocvisitor.cpp.

649{
650 if (m_hide) return;
652 if (s.title())
653 {
654 std::visit(*this,*s.title());
655 }
656 visitChildren(s);
658}
const DocNodeVariant * title() const
Definition docnode.h:995
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()() [47/57]

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

Definition at line 571 of file xmldocvisitor.cpp.

572{
573 const DocSimpleSect *sect = std::get_if<DocSimpleSect>(sep.parent());
574 if (sect)
575 {
576 endSimpleSect(m_t,*sect);
577 startSimpleSect(m_t,*sect);
578 }
579}
DocNodeVariant * parent()
Definition docnode.h:88
Node representing a simple section.
Definition docnode.h:979

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

◆ operator()() [48/57]

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;
269 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
270 break;
272 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
273 break;
275 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
276 break;
278 if (s.enable()) m_t << "<center>"; else m_t << "</center>";
279 break;
281 if (s.enable()) m_t << "<small>"; else m_t << "</small>";
282 break;
284 if (s.enable()) m_t << "<cite>"; else m_t << "</cite>";
285 break;
287 if (s.enable())
288 {
289 m_t << "<preformatted>";
291 }
292 else
293 {
294 m_t << "</preformatted>";
296 }
297 break;
298 case DocStyleChange::Div: /* HTML only */ break;
299 case DocStyleChange::Span: /* HTML only */ break;
300 }
301}
Style style() const
Definition docnode.h:290
bool enable() const
Definition docnode.h:292

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable(), FALSE, DocStyleChange::Ins, DocStyleChange::Italic, 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()() [49/57]

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:311
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()() [50/57]

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

Definition at line 1109 of file xmldocvisitor.cpp.

1110{
1111 visitChildren(t);
1112}

References visitChildren().

◆ operator()() [51/57]

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

Definition at line 660 of file xmldocvisitor.cpp.

661{
662 if (m_hide) return;
663 m_t << "<title>";
664 visitChildren(t);
665 m_t << "</title>";
666}

References m_hide, m_t, and visitChildren().

◆ operator()() [52/57]

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:190
bool isEmail() const
Definition docnode.h:191

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

◆ operator()() [53/57]

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

Definition at line 303 of file xmldocvisitor.cpp.

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

References DocVerbatim::children(), DocVerbatim::Code, 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()() [54/57]

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

Definition at line 1122 of file xmldocvisitor.cpp.

1123{
1124}

◆ operator()() [55/57]

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:337

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

◆ operator()() [56/57]

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:154

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

◆ operator()() [57/57]

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

Definition at line 1083 of file xmldocvisitor.cpp.

1084{
1085 if (m_hide) return;
1086 if (x.title().isEmpty()) return;
1087 m_t << "<xrefsect id=\"";
1088 m_t << x.file() << "_1" << x.anchor();
1089 m_t << "\">";
1090 m_t << "<xreftitle>";
1091 filter(x.title());
1092 m_t << "</xreftitle>";
1093 m_t << "<xrefdescription>";
1094 visitChildren(x);
1095 if (x.title().isEmpty()) return;
1096 m_t << "</xrefdescription>";
1097 m_t << "</xrefsect>";
1098}
QCString anchor() const
Definition docnode.h:596
QCString file() const
Definition docnode.h:595
QCString title() const
Definition docnode.h:597

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

1141{
1142 //printf("XmlDocVisitor: file=%s anchor=%s\n",qPrint(file),qPrint(anchor));
1143 m_t << "<ref refid=\"" << file;
1144 if (!anchor.isEmpty()) m_t << "_1" << anchor;
1145 m_t << "\" kindref=\"";
1146 if (!anchor.isEmpty()) m_t << "member"; else m_t << "compound";
1147 m_t << "\"";
1148 if (!ref.isEmpty()) m_t << " external=\"" << ref << "\"";
1149 m_t << ">";
1150}

References QCString::isEmpty(), and m_t.

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

◆ visitChildren()

template<class T >
void XmlDocVisitor::visitChildren ( const T & t)
inlineprivate

Member Data Documentation

◆ m_ci

OutputCodeList& XmlDocVisitor::m_ci
private

Definition at line 129 of file xmldocvisitor.h.

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

◆ m_hide

◆ m_insidePre

bool XmlDocVisitor::m_insidePre
private

Definition at line 130 of file xmldocvisitor.h.

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

◆ m_langExt

QCString XmlDocVisitor::m_langExt
private

Definition at line 132 of file xmldocvisitor.h.

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

◆ m_t


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