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

Concrete visitor implementation for Docbook output. More...

#include <src/docbookvisitor.h>

+ Inheritance diagram for DocbookDocVisitor:
+ Collaboration diagram for DocbookDocVisitor:

Public Member Functions

 DocbookDocVisitor (TextStream &t, OutputCodeList &ci, const QCString &langExt)
 
template<class T >
void visitChildren (const T &t)
 
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

void filter (const QCString &str, const bool retainNewLine=false)
 
void startLink (const QCString &file, const QCString &anchor)
 
void endLink ()
 
void startMscFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
 
void endMscFile (bool hasCaption)
 
void writeMscFile (const QCString &fileName, const DocVerbatim &s)
 
void startDiaFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
 
void endDiaFile (bool hasCaption)
 
void writeDiaFile (const QCString &fileName, const DocVerbatim &s)
 
void startDotFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
 
void endDotFile (bool hasCaption)
 
void writeDotFile (const QCString &fileName, const DocVerbatim &s)
 
void writePlantUMLFile (const QCString &fileName, const DocVerbatim &s)
 
void startPlantUmlFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
 
void endPlantUmlFile (bool hasCaption)
 
void visitPreStart (TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
 
void visitPostEnd (TextStream &t, bool hasCaption, bool inlineImage=FALSE)
 
void visitCaption (const DocNodeList &children)
 

Private Attributes

TextStreamm_t
 
OutputCodeListm_ci
 
bool m_insidePre = false
 
bool m_hide = false
 
BoolStack m_enabled
 
QCString m_langExt
 
int m_colCnt = 0
 
BoolStack m_bodySet
 

Detailed Description

Concrete visitor implementation for Docbook output.

Definition at line 31 of file docbookvisitor.h.

Constructor & Destructor Documentation

◆ DocbookDocVisitor()

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

Definition at line 178 of file docbookvisitor.cpp.

179 : m_t(t), m_ci(ci),m_langExt(langExt)
180{
182 // m_t << "<section>\n";
183}
OutputCodeList & m_ci
#define DB_VIS_C

References DB_VIS_C, m_ci, m_langExt, and m_t.

Member Function Documentation

◆ endDiaFile()

void DocbookDocVisitor::endDiaFile ( bool hasCaption)
private

Definition at line 1638 of file docbookvisitor.cpp.

1639{
1641 if (m_hide) return;
1642 visitPostEnd(m_t, hasCaption);
1643 m_t << "</para>\n";
1644}
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)

References DB_VIS_C, m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endDotFile()

void DocbookDocVisitor::endDotFile ( bool hasCaption)
private

Definition at line 1677 of file docbookvisitor.cpp.

1678{
1680 if (m_hide) return;
1681 m_t << "\n";
1682 visitPostEnd(m_t, hasCaption);
1683 m_t << "</para>\n";
1684}

References DB_VIS_C, m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endLink()

void DocbookDocVisitor::endLink ( )
private

Definition at line 1523 of file docbookvisitor.cpp.

1524{
1526 m_t << "</link>";
1527}

References DB_VIS_C, and m_t.

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

◆ endMscFile()

void DocbookDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 1600 of file docbookvisitor.cpp.

1601{
1603 if (m_hide) return;
1604 visitPostEnd(m_t, hasCaption);
1605 m_t << "</para>\n";
1606}

References DB_VIS_C, m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void DocbookDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 1572 of file docbookvisitor.cpp.

1573{
1575 if (m_hide) return;
1576 m_t << "\n";
1577 visitPostEnd(m_t, hasCaption);
1578 m_t << "</para>\n";
1579}

References DB_VIS_C, m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ filter()

void DocbookDocVisitor::filter ( const QCString & str,
const bool retainNewLine = false )
private

Definition at line 1505 of file docbookvisitor.cpp.

1506{
1508 m_t << convertToDocBook(str, retainNewLine);
1509}
QCString convertToDocBook(const QCString &s, const bool retainNewline)

References convertToDocBook(), DB_VIS_C, and m_t.

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

◆ operator()() [1/58]

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

Definition at line 446 of file docbookvisitor.cpp.

447{
449 if (m_hide) return;
450 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
451}
QCString anchor() const
Definition docnode.h:231
QCString file() const
Definition docnode.h:232
static QCString filterId(const QCString &s)
QCString stripPath(const QCString &s)
Definition util.cpp:5292

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

◆ operator()() [2/58]

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

Definition at line 613 of file docbookvisitor.cpp.

614{
616 if (m_hide) return;
617 if (l.isEnumList())
618 {
619 m_t << "<orderedlist>\n";
620 }
621 else
622 {
623 m_t << "<itemizedlist>\n";
624 }
625 visitChildren(l);
626 if (l.isEnumList())
627 {
628 m_t << "</orderedlist>\n";
629 }
630 else
631 {
632 m_t << "</itemizedlist>\n";
633 }
634}
bool isEnumList() const
Definition docnode.h:561
void visitChildren(const T &t)

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

◆ operator()() [3/58]

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

Definition at line 636 of file docbookvisitor.cpp.

637{
639 if (m_hide) return;
640 switch (li.itemNumber())
641 {
642 case DocAutoList::Unchecked: // unchecked
643 m_t << "<listitem override=\"unchecked\">";
644 break;
645 case DocAutoList::Checked_x: // checked with x
646 case DocAutoList::Checked_X: // checked with X
647 m_t << "<listitem override=\"checked\">";
648 break;
649 default:
650 m_t << "<listitem>";
651 break;
652 }
653 visitChildren(li);
654 m_t << "</listitem>";
655}
int itemNumber() const
Definition docnode.h:579

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

◆ operator()() [4/58]

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

Definition at line 600 of file docbookvisitor.cpp.

601{
603 if (m_hide) return;
604 if (!cite.file().isEmpty()) startLink(cite.file(),filterId(cite.anchor()));
605 filter(cite.text());
606 if (!cite.file().isEmpty()) endLink();
607}
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:247
void filter(const QCString &str, const bool retainNewLine=false)
void startLink(const QCString &file, const QCString &anchor)
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150

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

◆ operator()() [5/58]

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

Definition at line 1267 of file docbookvisitor.cpp.

1268{
1270 if (m_hide) return;
1271 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1272 startDiaFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1273 visitChildren(df);
1274 endDiaFile(df.hasCaption());
1275}
DocNodeList & children()
Definition docnode.h:142
QCString relPath() const
Definition docnode.h:666
QCString height() const
Definition docnode.h:669
QCString srcFile() const
Definition docnode.h:671
QCString file() const
Definition docnode.h:665
int srcLine() const
Definition docnode.h:672
bool hasCaption() const
Definition docnode.h:667
QCString width() const
Definition docnode.h:668
void endDiaFile(bool hasCaption)
void startDiaFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
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:6169

References DocCompoundNode::children(), Config_getBool, Config_getString, copyFile(), DB_VIS_C, endDiaFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startDiaFile(), stripPath(), visitChildren(), and DocDiagramFileBase::width().

◆ operator()() [6/58]

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

Definition at line 1247 of file docbookvisitor.cpp.

1248{
1250 if (m_hide) return;
1251 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1252 startDotFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1253 visitChildren(df);
1254 endDotFile(df.hasCaption());
1255}
void startDotFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void endDotFile(bool hasCaption)

References DocCompoundNode::children(), Config_getBool, Config_getString, copyFile(), DB_VIS_C, endDotFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startDotFile(), stripPath(), visitChildren(), and DocDiagramFileBase::width().

◆ operator()() [7/58]

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

Definition at line 234 of file docbookvisitor.cpp.

235{
237 if (m_hide) return;
238 const char *res = EmojiEntityMapper::instance().unicode(s.index());
239 if (res)
240 {
241 m_t << res;
242 }
243 else
244 {
245 m_t << s.name();
246 }
247}
int index() const
Definition docnode.h:326
QCString name() const
Definition docnode.h:325
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:2016
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978

References DB_VIS_C, DocEmoji::index(), EmojiEntityMapper::instance(), m_hide, m_t, DocEmoji::name(), and EmojiEntityMapper::unicode().

◆ operator()() [8/58]

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

Definition at line 570 of file docbookvisitor.cpp.

571{
573 if (m_hide) return;
574
575 if (f.isInline()) m_t << "<inlinemediaobject>\n";
576 else m_t << " <mediaobject>\n";
577 m_t << " <imageobject>\n";
578 m_t << " <imagedata ";
579 m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.relPath() << f.name() << ".png\"/>\n";
580 m_t << " </imageobject>\n";
581 if (f.isInline()) m_t << "</inlinemediaobject>\n";
582 else m_t << " </mediaobject>\n";
583}
QCString name() const
Definition docnode.h:513
bool isInline() const
Definition docnode.h:517
QCString relPath() const
Definition docnode.h:515

References DB_VIS_C, DocFormula::isInline(), m_hide, m_t, DocFormula::name(), and DocFormula::relPath().

◆ operator()() [9/58]

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

Definition at line 270 of file docbookvisitor.cpp.

271{
273 if (m_hide) return;
274 m_t << "<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
275 m_t << "</entry></row></tbody></tgroup></informaltable>\n";
276}

References DB_VIS_C, m_hide, and m_t.

◆ operator()() [10/58]

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

Definition at line 1172 of file docbookvisitor.cpp.

1173{
1175 if (m_hide) return;
1176 if (href.url().at(0) != '#')
1177 {
1178 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1179 }
1180 else
1181 {
1182 startLink(href.file(),filterId(href.url().mid(1)));
1183 }
1184 visitChildren(href);
1185 m_t << "</link>";
1186}
QCString url() const
Definition docnode.h:810
QCString file() const
Definition docnode.h:811
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:567

References QCString::at(), convertToDocBook(), DB_VIS_C, DocHRef::file(), filterId(), m_hide, m_t, QCString::mid(), startLink(), DocHRef::url(), and visitChildren().

◆ operator()() [11/58]

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

Definition at line 1482 of file docbookvisitor.cpp.

1483{
1485 if (m_hide) return;
1486 m_t << "<blockquote>";
1487 visitChildren(q);
1488 m_t << "</blockquote>";
1489}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [12/58]

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

Definition at line 1152 of file docbookvisitor.cpp.

1153{
1155 if (m_hide) return;
1156 m_t << "<caption>";
1157 if (!c.file().isEmpty())
1158 {
1159 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1160 }
1161 visitChildren(c);
1162 m_t << "</caption>\n";
1163}
QCString anchor() const
Definition docnode.h:1215
QCString file() const
Definition docnode.h:1214

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

◆ operator()() [13/58]

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

Definition at line 1097 of file docbookvisitor.cpp.

1098{
1100 m_colCnt++;
1101 if (m_hide) return;
1102 m_t << "<entry";
1103
1104 for (const auto &opt : c.attribs())
1105 {
1106 if (opt.name=="colspan")
1107 {
1108 m_t << " namest='c" << m_colCnt << "'";
1109 int cols = opt.value.toInt();
1110 m_colCnt += (cols - 1);
1111 m_t << " nameend='c" << m_colCnt << "'";
1112 }
1113 else if (opt.name=="rowspan")
1114 {
1115 int extraRows = opt.value.toInt() - 1;
1116 m_t << " morerows='" << extraRows << "'";
1117 }
1118 else if (opt.name=="class")
1119 {
1120 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1121 {
1122 if (opt.value.endsWith("Right"))
1123 {
1124 m_t << " align='right'";
1125 }
1126 else if (opt.value.endsWith("Left"))
1127 {
1128 m_t << " align='left'";
1129 }
1130 else if (opt.value.endsWith("Center"))
1131 {
1132 m_t << " align='center'";
1133 }
1134 // skip 'markdownTable*' value ending with "None"
1135 }
1136 else
1137 {
1138 m_t << " class='" << convertToDocBook(opt.value) << "'";
1139 }
1140 }
1141 else if (supportedHtmlAttribute(opt.name))
1142 {
1143 // process supported attributes only
1144 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1145 }
1146 }
1147 m_t << ">";
1148 visitChildren(c);
1149 m_t << "</entry>";
1150}
const HtmlAttribList & attribs() const
Definition docnode.h:1185
static bool supportedHtmlAttribute(const QCString &name)

References DocHtmlCell::attribs(), convertToDocBook(), DB_VIS_C, m_colCnt, m_hide, m_t, supportedHtmlAttribute(), and visitChildren().

◆ operator()() [14/58]

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

Definition at line 1027 of file docbookvisitor.cpp.

1028{
1030 if (m_hide) return;
1031 m_t << "<listitem>";
1032 visitChildren(dd);
1033 m_t << "</listitem>\n";
1034}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [15/58]

void DocbookDocVisitor::operator() ( const DocHtmlDescList & l)

Definition at line 1009 of file docbookvisitor.cpp.

1010{
1012 if (m_hide) return;
1013 m_t << "<variablelist>\n";
1014 visitChildren(l);
1015 m_t << "</variablelist>\n";
1016}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [16/58]

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

Definition at line 1018 of file docbookvisitor.cpp.

1019{
1021 if (m_hide) return;
1022 m_t << "<varlistentry><term>";
1023 visitChildren(dt);
1024 m_t << "</term></varlistentry>\n";
1025}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [17/58]

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

Definition at line 1197 of file docbookvisitor.cpp.

1198{
1200 if (m_hide) return;
1201 m_t << "\n";
1202 auto summary = d.summary();
1203 if (summary)
1204 {
1205 std::visit(*this,*summary);
1206 }
1207 m_t << "<para>";
1208 visitChildren(d);
1209 m_t << "</para>";
1210 m_t << "\n";
1211}
const DocNodeVariant * summary() const
Definition docnode.h:844

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

◆ operator()() [18/58]

void DocbookDocVisitor::operator() ( const DocHtmlHeader & h)

Definition at line 1213 of file docbookvisitor.cpp.

1214{
1216 if (m_hide) return;
1217 m_t << "<formalpara><title>";
1218 visitChildren(h);
1219 m_t << "</title></formalpara>\n";
1220}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [19/58]

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

Definition at line 930 of file docbookvisitor.cpp.

931{
933 if (m_hide) return;
934 if (s.children().empty()) return;
935 // opening tag for ordered list will be handled in DocHtmlListItem
936 // due to (re-)numbering possibilities
937 if (s.type()!=DocHtmlList::Ordered)
938 m_t << "<itemizedlist>\n";
939 visitChildren(s);
940 if (s.type()==DocHtmlList::Ordered)
941 m_t << "</orderedlist>\n";
942 else
943 m_t << "</itemizedlist>\n";
944}
Type type() const
Definition docnode.h:985
bool empty() const
checks whether the container is empty
Definition growvector.h:140

References DocCompoundNode::children(), DB_VIS_C, GrowVector< T >::empty(), m_hide, m_t, DocHtmlList::Ordered, DocHtmlList::type(), and visitChildren().

◆ operator()() [20/58]

void DocbookDocVisitor::operator() ( const DocHtmlListItem & s)

Definition at line 946 of file docbookvisitor.cpp.

947{
949 if (m_hide) return;
950 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
951 if (l->type()==DocHtmlList::Ordered)
952 {
953 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
954 int value = 0;
955 QCString type;
956 for (const auto &opt : s.attribs())
957 {
958 if (opt.name=="value")
959 {
960 bool ok = false;
961 int val = opt.value.toInt(&ok);
962 if (ok) value = val;
963 }
964 }
965
966 if (value>0 || isFirst)
967 {
968 for (const auto &opt : l->attribs())
969 {
970 if (opt.name=="type")
971 {
972 if (opt.value=="1")
973 type = " numeration=\"arabic\"";
974 else if (opt.value=="a")
975 type = " numeration=\"loweralpha\"";
976 else if (opt.value=="A")
977 type = " numeration=\"upperalpha\"";
978 else if (opt.value=="i")
979 type = " numeration=\"lowerroman\"";
980 else if (opt.value=="I")
981 type = " numeration=\"upperroman\"";
982 }
983 else if (value==0 && opt.name=="start")
984 {
985 bool ok = false;
986 int val = opt.value.toInt(&ok);
987 if (ok) value = val;
988 }
989 }
990 }
991
992 if (value>0 && !isFirst)
993 {
994 m_t << "</orderedlist>\n";
995 }
996 if (value>0 || isFirst)
997 {
998 m_t << "<orderedlist";
999 if (!type.isEmpty()) m_t << type.data();
1000 if (value>0) m_t << " startingnumber=\"" << value << "\"";
1001 m_t << ">\n";
1002 }
1003 }
1004 m_t << "<listitem>\n";
1005 visitChildren(s);
1006 m_t << "</listitem>\n";
1007}
const HtmlAttribList & attribs() const
Definition docnode.h:986
const HtmlAttribList & attribs() const
Definition docnode.h:1150
DocNodeVariant * parent()
Definition docnode.h:89
T & front()
access the first element
Definition growvector.h:130
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159

References DocHtmlList::attribs(), DocHtmlListItem::attribs(), DocCompoundNode::children(), QCString::data(), DB_VIS_C, GrowVector< T >::front(), QCString::isEmpty(), m_hide, m_t, DocHtmlList::Ordered, DocNode::parent(), DocHtmlList::type(), and visitChildren().

◆ operator()() [21/58]

void DocbookDocVisitor::operator() ( const DocHtmlRow & tr)

Definition at line 1059 of file docbookvisitor.cpp.

1060{
1062 m_colCnt = 0;
1063 if (m_hide) return;
1064
1065 if (tr.isHeading())
1066 {
1067 if (m_bodySet.top()) m_t << "</tbody>\n";
1068 m_bodySet.top() = false;
1069 m_t << "<thead>\n";
1070 }
1071 else if (!m_bodySet.top())
1072 {
1073 m_bodySet.top() = true;
1074 m_t << "<tbody>\n";
1075 }
1076
1077 m_t << " <row ";
1078
1079 for (const auto &opt : tr.attribs())
1080 {
1081 if (supportedHtmlAttribute(opt.name))
1082 {
1083 // process supported attributes only
1084 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1085 }
1086 }
1087 m_t << ">\n";
1088 visitChildren(tr);
1089 m_t << "</row>\n";
1090 if (tr.isHeading())
1091 {
1092 m_t << "</thead><tbody>\n";
1093 m_bodySet.top() = true;
1094 }
1095}
bool isHeading() const
Definition docnode.cpp:1881
const HtmlAttribList & attribs() const
Definition docnode.h:1232

References DocHtmlRow::attribs(), convertToDocBook(), DB_VIS_C, DocHtmlRow::isHeading(), m_bodySet, m_colCnt, m_hide, m_t, supportedHtmlAttribute(), and visitChildren().

◆ operator()() [22/58]

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

Definition at line 1188 of file docbookvisitor.cpp.

1189{
1191 if (m_hide) return;
1192 m_t << "<para><emphasis role=\"bold\">";
1193 visitChildren(s);
1194 m_t << "</emphasis></para>";
1195}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1036 of file docbookvisitor.cpp.

1037{
1039 m_bodySet.push(false);
1040 if (m_hide) return;
1041 m_t << "<informaltable frame=\"all\">\n";
1042 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1043 for (uint32_t i = 0; i <t.numColumns(); i++)
1044 {
1045 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1046 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1047 }
1048 if (t.caption())
1049 {
1050 std::visit(*this,*t.caption());
1051 }
1052 visitChildren(t);
1053 if (m_bodySet.top()) m_t << " </tbody>\n";
1054 m_bodySet.pop();
1055 m_t << " </tgroup>\n";
1056 m_t << "</informaltable>\n";
1057}
size_t numColumns() const
Definition docnode.h:1258
const DocNodeVariant * caption() const
Definition docnode.cpp:2027

References DocHtmlTable::caption(), DB_VIS_C, m_bodySet, m_hide, m_t, DocHtmlTable::numColumns(), and visitChildren().

◆ operator()() [24/58]

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

Definition at line 1222 of file docbookvisitor.cpp.

1223{
1225 if (img.type()==DocImage::DocBook)
1226 {
1227 if (m_hide) return;
1228 m_t << "\n";
1229 QCString baseName=makeShortName(img.name());
1230 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1231 visitChildren(img);
1233 QCString file;
1234 bool ambig = false;
1235 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1236 if (fd)
1237 {
1238 file=fd->absFilePath();
1239 }
1240 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1241 }
1242 else // skip other formats
1243 {
1244 }
1245}
QCString relPath() const
Definition docnode.h:632
QCString name() const
Definition docnode.h:628
QCString height() const
Definition docnode.h:631
Type type() const
Definition docnode.h:627
QCString width() const
Definition docnode.h:630
@ DocBook
Definition docnode.h:624
bool isInlineImage() const
Definition docnode.h:634
bool hasCaption() const
Definition docnode.h:629
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:106
virtual QCString absFilePath() const =0
static QCString makeShortName(const QCString &baseName)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3262

References FileDef::absFilePath(), DocCompoundNode::children(), Config_getString, copyFile(), DB_VIS_C, DocImage::DocBook, findFileDef(), DocImage::hasCaption(), DocImage::height(), Doxygen::imageNameLinkedMap, DocImage::isInlineImage(), m_hide, m_t, makeShortName(), DocImage::name(), DocImage::relPath(), DocImage::type(), visitChildren(), visitPostEnd(), visitPreStart(), and DocImage::width().

◆ operator()() [25/58]

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

Definition at line 453 of file docbookvisitor.cpp.

454{
456 if (m_hide) return;
458 switch(inc.type())
459 {
461 {
462 m_t << "<literallayout><computeroutput>";
463 FileInfo cfi( inc.file().str() );
464 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
466 inc.text(),
467 langExt,
468 inc.stripCodeComments(),
469 inc.isExample(),
470 inc.exampleFile(), fd.get());
471 m_t << "</computeroutput></literallayout>";
472 }
473 break;
475 m_t << "<literallayout><computeroutput>";
477 inc.text(),
478 langExt,
479 inc.stripCodeComments(),
480 inc.isExample(),
481 inc.exampleFile());
482 m_t << "</computeroutput></literallayout>";
483 break;
491 break;
493 m_t << inc.text();
494 break;
496 m_t << "<literallayout>";
497 filter(inc.text());
498 m_t << "</literallayout>";
499 break;
502 m_t << "<literallayout><computeroutput>";
504 inc.file(),
505 inc.blockId(),
506 inc.context(),
508 inc.trimLeft(),
510 );
511 m_t << "</computeroutput></literallayout>";
512 break;
513 }
514}
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:435
QCString extension() const
Definition docnode.h:431
bool stripCodeComments() const
Definition docnode.h:436
@ LatexInclude
Definition docnode.h:418
@ SnippetWithLines
Definition docnode.h:419
@ DontIncWithLines
Definition docnode.h:420
@ IncWithLines
Definition docnode.h:419
@ HtmlInclude
Definition docnode.h:418
@ VerbInclude
Definition docnode.h:418
@ DontInclude
Definition docnode.h:418
@ DocbookInclude
Definition docnode.h:420
Type type() const
Definition docnode.h:432
QCString exampleFile() const
Definition docnode.h:438
QCString text() const
Definition docnode.h:433
QCString file() const
Definition docnode.h:430
bool trimLeft() const
Definition docnode.h:440
bool isExample() const
Definition docnode.h:437
QCString context() const
Definition docnode.h:434
CodeParserInterface & getCodeParser(const QCString &langExt)
const std::string & str() const
Definition qcstring.h:526
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:265
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(), DB_VIS_C, FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile(), DocInclude::extension(), DocInclude::file(), FileInfo::fileName(), filter(), DocVisitor::getCodeParser(), getLanguageFromFileName(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance(), 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(), DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/58]

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

Definition at line 516 of file docbookvisitor.cpp.

517{
519 if (op.isFirst())
520 {
521 if (!m_hide)
522 {
523 m_t << "<programlisting linenumbering=\"unnumbered\">";
524 }
526 m_hide = TRUE;
527 }
528 QCString locLangExt = getFileNameExtension(op.includeFileName());
529 if (locLangExt.isEmpty()) locLangExt = m_langExt;
530 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
531 if (op.type()!=DocIncOperator::Skip)
532 {
533 m_hide = popHidden();
534 if (!m_hide)
535 {
536 std::unique_ptr<FileDef> fd;
537 if (!op.includeFileName().isEmpty())
538 {
539 FileInfo cfi( op.includeFileName().str() );
540 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
541 }
542
543 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
544 op.text(),langExt,
546 op.isExample(),
547 op.exampleFile(),
548 fd.get(), // fileDef
549 op.line(), // startLine
550 -1, // endLine
551 FALSE, // inline fragment
552 nullptr, // memberDef
553 op.showLineNo() // show line numbers
554 );
555 }
557 m_hide=TRUE;
558 }
559 if (op.isLast())
560 {
561 m_hide = popHidden();
562 if (!m_hide) m_t << "</programlisting>";
563 }
564 else
565 {
566 if (!m_hide) m_t << "\n";
567 }
568}
bool stripCodeComments() const
Definition docnode.h:487
bool isLast() const
Definition docnode.h:484
QCString includeFileName() const
Definition docnode.h:490
QCString text() const
Definition docnode.h:480
QCString context() const
Definition docnode.h:482
QCString exampleFile() const
Definition docnode.h:489
int line() const
Definition docnode.h:478
Type type() const
Definition docnode.h:466
bool isFirst() const
Definition docnode.h:483
bool showLineNo() const
Definition docnode.h:479
bool isExample() const
Definition docnode.h:488
void pushHidden(bool hide)
bool popHidden()
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5591

References DocIncOperator::context(), createFileDef(), DB_VIS_C, 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 DocbookDocVisitor::operator() ( const DocIndexEntry & ie)

Definition at line 585 of file docbookvisitor.cpp.

586{
588 if (m_hide) return;
589 m_t << "<indexterm><primary>";
590 filter(ie.entry());
591 m_t << "</primary></indexterm>\n";
592}
QCString entry() const
Definition docnode.h:540

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

◆ operator()() [28/58]

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

Definition at line 1165 of file docbookvisitor.cpp.

1166{
1168 if (m_hide) return;
1169 visitChildren(i);
1170}

References DB_VIS_C, m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1465 of file docbookvisitor.cpp.

1466{
1468 if (m_hide) return;
1469 startLink(ref.file(),ref.anchor());
1470 visitChildren(ref);
1471 endLink();
1472 m_t << " ";
1473}
QCString file() const
Definition docnode.h:791
QCString anchor() const
Definition docnode.h:793

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

◆ operator()() [30/58]

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

Definition at line 261 of file docbookvisitor.cpp.

262{
264 if (m_hide) return;
265 m_t << "<?linebreak?>";
266 // gives nicer results but gives problems as it is not allowed in <pare> and also problems with dblatex
267 // m_t << "\n" << "<sbr/>\n";
268}

References DB_VIS_C, m_hide, and m_t.

◆ operator()() [31/58]

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

Definition at line 1287 of file docbookvisitor.cpp.

1288{
1290 if (m_hide) return;
1291 startLink(lnk.file(),lnk.anchor());
1292 visitChildren(lnk);
1293 endLink();
1294}

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

◆ operator()() [32/58]

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

Definition at line 196 of file docbookvisitor.cpp.

197{
199 if (m_hide) return;
200 startLink(w.file(),w.anchor());
201 filter(w.word());
202 endLink();
203}
QCString file() const
Definition docnode.h:170
QCString word() const
Definition docnode.h:169
QCString anchor() const
Definition docnode.h:173

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

◆ operator()() [33/58]

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

Definition at line 1257 of file docbookvisitor.cpp.

1258{
1260 if (m_hide) return;
1261 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1262 startMscFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1263 visitChildren(df);
1264 endMscFile(df.hasCaption());
1265}
void startMscFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void endMscFile(bool hasCaption)

References DocCompoundNode::children(), Config_getBool, Config_getString, copyFile(), DB_VIS_C, endMscFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startMscFile(), stripPath(), visitChildren(), and DocDiagramFileBase::width().

◆ operator()() [34/58]

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

Definition at line 657 of file docbookvisitor.cpp.

658{
660 if (m_hide) return;
661 m_t << "\n";
662 m_t << "<para>";
663 visitChildren(p);
664 m_t << "</para>";
665 m_t << "\n";
666}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [35/58]

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

Definition at line 1383 of file docbookvisitor.cpp.

1384{
1386 if (m_hide) return;
1387 m_t << " <row>\n";
1388
1389 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1390 if (sect && sect->hasInOutSpecifier())
1391 {
1392 m_t << "<entry>";
1394 {
1395 if (pl.direction()==DocParamSect::In)
1396 {
1397 m_t << "in";
1398 }
1399 else if (pl.direction()==DocParamSect::Out)
1400 {
1401 m_t << "out";
1402 }
1403 else if (pl.direction()==DocParamSect::InOut)
1404 {
1405 m_t << "in,out";
1406 }
1407 }
1408 m_t << "</entry>";
1409 }
1410
1411 if (sect && sect->hasTypeSpecifier())
1412 {
1413 m_t << "<entry>";
1414 for (const auto &type : pl.paramTypes())
1415 {
1416 std::visit(*this,type);
1417 }
1418 m_t << "</entry>";
1419 }
1420
1421 if (pl.parameters().empty())
1422 {
1423 m_t << "<entry></entry>\n";
1424 }
1425 else
1426 {
1427 m_t << "<entry>";
1428 int cnt = 0;
1429 for (const auto &param : pl.parameters())
1430 {
1431 if (cnt)
1432 {
1433 m_t << ", ";
1434 }
1435 std::visit(*this,param);
1436 cnt++;
1437 }
1438 m_t << "</entry>";
1439 }
1440 m_t << "<entry>";
1441 for (const auto &par : pl.paragraphs())
1442 {
1443 std::visit(*this,par);
1444 }
1445 m_t << "</entry>\n";
1446 m_t << " </row>\n";
1447}
const DocNodeList & parameters() const
Definition docnode.h:1109
const DocNodeList & paramTypes() const
Definition docnode.h:1110
DocParamSect::Direction direction() const
Definition docnode.h:1113
const DocNodeList & paragraphs() const
Definition docnode.h:1111
bool hasInOutSpecifier() const
Definition docnode.h:1049
bool hasTypeSpecifier() const
Definition docnode.h:1050

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

◆ operator()() [36/58]

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

Definition at line 1333 of file docbookvisitor.cpp.

1334{
1336 if (m_hide) return;
1337 m_t << "\n";
1338 m_t << " <formalpara>\n";
1339 m_t << " <title>\n";
1340 switch(s.type())
1341 {
1346 default:
1347 ASSERT(0);
1348 }
1349 m_t << "</title>\n";
1350 m_t << " <para>\n";
1351 m_t << " <table frame=\"all\">\n";
1352 int ncols = 2;
1353 if (s.type() == DocParamSect::Param)
1354 {
1355 bool hasInOutSpecs = s.hasInOutSpecifier();
1356 bool hasTypeSpecs = s.hasTypeSpecifier();
1357 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1358 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1359 }
1360 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1361 for (int i = 1; i <= ncols; i++)
1362 {
1363 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1364 else m_t << " <colspec colwidth=\"1*\"/>\n";
1365 }
1366 m_t << " <tbody>\n";
1367 visitChildren(s);
1368 m_t << " </tbody>\n";
1369 m_t << " </tgroup>\n";
1370 m_t << " </table>\n";
1371 m_t << " </para>\n";
1372 m_t << " </formalpara>\n";
1373 m_t << " ";
1374}
Type type() const
Definition docnode.h:1048
virtual QCString trExceptions()=0
virtual QCString trParameters()=0
virtual QCString trTemplateParameters()=0
virtual QCString trReturnValues()=0
Translator * theTranslator
Definition language.cpp:71
#define ASSERT(x)
Definition qcstring.h:39

References ASSERT, DB_VIS_C, DocParamSect::Exception, DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), m_hide, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, Translator::trExceptions(), Translator::trParameters(), Translator::trReturnValues(), Translator::trTemplateParameters(), DocParamSect::type(), and visitChildren().

◆ operator()() [37/58]

void DocbookDocVisitor::operator() ( const DocParBlock & b)

Definition at line 1497 of file docbookvisitor.cpp.

1498{
1500 if (m_hide) return;
1501 visitChildren(b);
1502}

References DB_VIS_C, m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1277 of file docbookvisitor.cpp.

1278{
1280 if (m_hide) return;
1281 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1282 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1283 visitChildren(df);
1285}
void endPlantUmlFile(bool hasCaption)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)

References DocCompoundNode::children(), Config_getBool, Config_getString, copyFile(), DB_VIS_C, endPlantUmlFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startPlantUmlFile(), stripPath(), visitChildren(), and DocDiagramFileBase::width().

◆ operator()() [39/58]

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

Definition at line 1296 of file docbookvisitor.cpp.

1297{
1299 if (m_hide) return;
1300 if (ref.isSubPage())
1301 {
1302 startLink(QCString(),ref.anchor());
1303 }
1304 else
1305 {
1306 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1307 }
1308
1309 if (!ref.hasLinkText()) filter(ref.targetTitle());
1310 visitChildren(ref);
1311 if (!ref.file().isEmpty()) endLink();
1312}
QCString anchor() const
Definition docnode.h:765
QCString targetTitle() const
Definition docnode.h:766
bool isSubPage() const
Definition docnode.h:772
QCString file() const
Definition docnode.h:762
bool hasLinkText() const
Definition docnode.h:768

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

◆ operator()() [40/58]

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

Definition at line 668 of file docbookvisitor.cpp.

669{
671 visitChildren(r);
672}

References DB_VIS_C, and visitChildren().

◆ operator()() [41/58]

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

Definition at line 1314 of file docbookvisitor.cpp.

1315{
1317 if (m_hide) return;
1318 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1319 m_t << "<tocentry>";
1320 visitChildren(ref);
1321 m_t << "</tocentry>\n";
1322}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [42/58]

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

Definition at line 1324 of file docbookvisitor.cpp.

1325{
1327 if (m_hide) return;
1328 m_t << "<toc>\n";
1329 visitChildren(l);
1330 m_t << "</toc>\n";
1331}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [43/58]

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

Definition at line 915 of file docbookvisitor.cpp.

916{
918 if (m_hide) return;
919 m_t << "<section xml:id=\"_" << stripPath(s.file());
920 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
921 m_t << "\">\n";
922 if (s.title())
923 {
924 std::visit(*this,*s.title());
925 }
926 visitChildren(s);
927 m_t << "</section>\n";
928}
QCString file() const
Definition docnode.h:902
QCString anchor() const
Definition docnode.h:900
const DocNodeVariant * title() const
Definition docnode.h:899

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

◆ operator()() [44/58]

void DocbookDocVisitor::operator() ( const DocSeparator & sep)

Definition at line 1376 of file docbookvisitor.cpp.

1377{
1379 if (m_hide) return;
1380 m_t << " " << sep.chars() << " ";
1381}
QCString chars() const
Definition docnode.h:350

References DocSeparator::chars(), DB_VIS_C, m_hide, and m_t.

◆ operator()() [45/58]

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

Definition at line 894 of file docbookvisitor.cpp.

895{
897 if (m_hide) return;
898 m_t << "<itemizedlist>\n";
899 visitChildren(l);
900 m_t << "</itemizedlist>\n";
901}

References DB_VIS_C, m_hide, m_t, and visitChildren().

◆ operator()() [46/58]

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

Definition at line 903 of file docbookvisitor.cpp.

904{
906 if (m_hide) return;
907 m_t << "<listitem>";
908 if (li.paragraph())
909 {
910 visit(*this,*li.paragraph());
911 }
912 m_t << "</listitem>\n";
913}
const DocNodeVariant * paragraph() const
Definition docnode.h:1137

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

◆ operator()() [47/58]

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

Definition at line 674 of file docbookvisitor.cpp.

675{
677 if (m_hide) return;
678 switch(s.type())
679 {
681 if (m_insidePre)
682 {
683 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
684 }
685 else
686 {
687 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
688 }
689 break;
691 if (m_insidePre)
692 {
693 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
694 }
695 else
696 {
697 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
698 }
699 break;
701 if (m_insidePre)
702 {
703 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
704 }
705 else
706 {
707 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
708 }
709 break;
711 if (m_insidePre)
712 {
713 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
714 }
715 else
716 {
717 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
718 }
719 break;
721 if (m_insidePre)
722 {
723 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
724 }
725 else
726 {
727 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
728 }
729 break;
731 if (m_insidePre)
732 {
733 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
734 }
735 else
736 {
737 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
738 }
739 break;
741 if (m_insidePre)
742 {
743 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
744 }
745 else
746 {
747 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
748 }
749 break;
751 if (m_insidePre)
752 {
753 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
754 }
755 else
756 {
757 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
758 }
759 break;
761 if (m_insidePre)
762 {
763 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
764 }
765 else
766 {
767 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
768 }
769 break;
771 if (m_insidePre)
772 {
773 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
774 }
775 else
776 {
777 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
778 }
779 break;
781 if (m_insidePre)
782 {
783 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
784 }
785 else
786 {
787 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
788 }
789 break;
791 if (m_insidePre)
792 {
793 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
794 }
795 else
796 {
797 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
798 }
799 break;
801 if (m_insidePre)
802 {
803 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
804 }
805 else
806 {
807 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
808 }
809 break;
811 // <remark> is miising the <title> possibility
812 if (m_insidePre)
813 {
814 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
815 }
816 else
817 {
818 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
819 }
820 break;
822 if (m_insidePre)
823 {
824 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
825 }
826 else
827 {
828 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
829 }
830 break;
832 if (m_insidePre)
833 {
834 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
835 }
836 else
837 {
838 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
839 }
840 break;
844 if (s.hasTitle())
845 m_t << "<formalpara>\n";
846 else
847 m_t << "<para>\n";
848 break;
849 }
850
851 if (s.title())
852 {
853 std::visit(*this,*s.title());
854 }
855 visitChildren(s);
856
857 switch(s.type())
858 {
862 if (s.hasTitle())
863 m_t << "</formalpara>\n";
864 else
865 m_t << "</para>\n";
866 break;
868 m_t << "</note>\n";
869 break;
871 m_t << "</caution>\n";
872 break;
874 m_t << "</important>\n";
875 break;
877 m_t << "</warning>\n";
878 break;
879 default:
880 m_t << "</formalpara>\n";
881 break;
882 }
883}
Type type() const
Definition docnode.h:1006
const DocNodeVariant * title() const
Definition docnode.h:1013
bool hasTitle() const
Definition docnode.cpp:2891
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trVersion()=0
virtual QCString trReturns()=0
virtual QCString trRemarks()=0
virtual QCString trNote()=0
virtual QCString trPostcondition()=0
virtual QCString trAttention()=0
virtual QCString trCopyright()=0
virtual QCString trDate()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
virtual QCString trSeeAlso()=0
virtual QCString trImportant()=0
virtual QCString trInvariant()=0

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, convertToDocBook(), DocSimpleSect::Copyright, DocSimpleSect::Date, DB_VIS_C, FALSE, DocSimpleSect::hasTitle(), DocSimpleSect::Important, DocSimpleSect::Invar, m_hide, m_insidePre, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, DocSimpleSect::See, DocSimpleSect::Since, theTranslator, DocSimpleSect::title(), Translator::trAttention(), Translator::trAuthor(), Translator::trCopyright(), Translator::trDate(), Translator::trImportant(), Translator::trInvariant(), Translator::trNote(), Translator::trPostcondition(), Translator::trPrecondition(), Translator::trRemarks(), Translator::trReturns(), Translator::trSeeAlso(), Translator::trSince(), TRUE, Translator::trVersion(), Translator::trWarning(), DocSimpleSect::type(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [48/58]

void DocbookDocVisitor::operator() ( const DocSimpleSectSep & )

Definition at line 594 of file docbookvisitor.cpp.

595{
597 // m_t << "<simplesect/>";
598}

References DB_VIS_C.

◆ operator()() [49/58]

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

Definition at line 278 of file docbookvisitor.cpp.

279{
281 if (m_hide) return;
282 switch (s.style())
283 {
285 if (s.enable()) m_t << "<emphasis role=\"bold\">"; else m_t << "</emphasis>";
286 break;
288 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
289 break;
292 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
293 break;
295 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
296 break;
298 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
299 break;
301 if (s.enable()) m_t << "<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
302 else m_t << "</entry></row></tbody></tgroup></informaltable>";
303 break;
305 if (s.enable())
306 {
307 m_t << "<literallayout>";
309 }
310 else
311 {
312 m_t << "</literallayout>";
314 }
315 break;
316 /* There is no equivalent Docbook tag for rendering Small text */
317 case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
318 /* HTML only */
319 case DocStyleChange::Cite: break;
320 case DocStyleChange::S: break;
321 case DocStyleChange::Strike: break;
322 case DocStyleChange::Del: break;
323 case DocStyleChange::Underline: break;
324 case DocStyleChange::Ins: break;
325 case DocStyleChange::Div: /* HTML only */ break;
326 case DocStyleChange::Span: /* HTML only */ break;
327 }
328}
Style style() const
Definition docnode.h:292
bool enable() const
Definition docnode.h:294

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DB_VIS_C, 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 DocbookDocVisitor::operator() ( const DocSymbol & s)

Definition at line 219 of file docbookvisitor.cpp.

220{
222 if (m_hide) return;
223 const char *res = HtmlEntityMapper::instance().docbook(s.symbol());
224 if (res)
225 {
226 m_t << res;
227 }
228 else
229 {
230 err("DocBook: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
231 }
232}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:313
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * docbook(SymType symb) const
Access routine to the docbook code of the HTML entity.
#define err(fmt,...)
Definition message.h:84

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

◆ operator()() [51/58]

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

Definition at line 1475 of file docbookvisitor.cpp.

1476{
1478 visitChildren(t);
1479}

References DB_VIS_C, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 885 of file docbookvisitor.cpp.

886{
888 if (m_hide) return;
889 if (t.hasTitle()) m_t << "<title>";
890 visitChildren(t);
891 if (t.hasTitle()) m_t << "</title>";
892}
bool hasTitle() const
Definition docnode.h:594

References DB_VIS_C, DocTitle::hasTitle(), m_hide, m_t, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 249 of file docbookvisitor.cpp.

250{
252 if (m_hide) return;
253 m_t << "<link xlink:href=\"";
254 if (u.isEmail()) m_t << "mailto:";
255 filter(u.url());
256 m_t << "\">";
257 filter(u.url());
258 m_t << "</link>";
259}
QCString url() const
Definition docnode.h:191
bool isEmail() const
Definition docnode.h:192

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

◆ operator()() [54/58]

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

Definition at line 330 of file docbookvisitor.cpp.

331{
333 if (m_hide) return;
334 QCString lang = m_langExt;
335 if (!s.language().isEmpty()) // explicit language setting
336 {
337 lang = s.language();
338 }
339 SrcLangExt langExt = getLanguageFromCodeLang(lang);
340 switch(s.type())
341 {
343 m_t << "<literallayout><computeroutput>";
345 s.text(),
346 langExt,
347 Config_getBool(STRIP_CODE_COMMENTS),
348 s.isExample(),
349 s.exampleFile());
350 m_t << "</computeroutput></literallayout>";
351 break;
353 m_t << "<literallayout><computeroutput>";
354 filter(s.text());
355 m_t << "</computeroutput></literallayout>";
356 break;
358 filter(s.text(), true);
359 break;
361 m_t << "<computeroutput>";
362 filter(s.text(), true);
363 m_t << "</computeroutput>";
364 break;
366 break;
368 break;
370 break;
372 break;
374 break;
376 m_t << s.text();
377 break;
378 case DocVerbatim::Dot:
379 {
380 static int dotindex = 1;
381 QCString baseName(4096, QCString::ExplicitSize);
382 QCString name;
383 QCString stext = s.text();
384 m_t << "<para>\n";
385 name.sprintf("%s%d", "dot_inline_dotgraph_", dotindex);
386 baseName.sprintf("%s%d",
387 qPrint(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_"),
388 dotindex++
389 );
390 QCString fileName = baseName+".dot";
391 std::ofstream file = Portable::openOutputStream(fileName);
392 if (!file.is_open())
393 {
394 err("Could not open file %s for writing\n",qPrint(fileName));
395 }
396 file.write( stext.data(), stext.length() );
397 file.close();
398 writeDotFile(baseName, s);
399 m_t << "</para>\n";
400 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
401 }
402 break;
403 case DocVerbatim::Msc:
404 {
405 static int mscindex = 1;
406 QCString baseName(4096, QCString::ExplicitSize);
407 QCString name;
408 QCString stext = s.text();
409 m_t << "<para>\n";
410 name.sprintf("%s%d", "msc_inline_mscgraph_", mscindex);
411 baseName.sprintf("%s%d",
412 (Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_").data(),
413 mscindex++
414 );
415 QCString fileName = baseName+".msc";
416 std::ofstream file = Portable::openOutputStream(fileName);
417 if (!file.is_open())
418 {
419 err("Could not open file %s for writing\n",qPrint(fileName));
420 }
421 QCString text = "msc {";
422 text+=stext;
423 text+="}";
424 file.write( text.data(), text.length() );
425 file.close();
426 writeMscFile(baseName,s);
427 m_t << "</para>\n";
428 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
429 }
430 break;
432 {
433 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
434 QCString baseName = PlantumlManager::instance().writePlantUMLSource(docbookOutput,
436 s.engine(),s.srcFile(),s.srcLine(),true);
437 QCString shortName = makeShortName(baseName);
438 m_t << "<para>\n";
439 writePlantUMLFile(baseName,s);
440 m_t << "</para>\n";
441 }
442 break;
443 }
444}
QCString srcFile() const
Definition docnode.h:378
int srcLine() const
Definition docnode.h:379
QCString language() const
Definition docnode.h:369
bool isExample() const
Definition docnode.h:366
QCString context() const
Definition docnode.h:365
Type type() const
Definition docnode.h:363
QCString text() const
Definition docnode.h:364
QCString exampleFile() const
Definition docnode.h:367
QCString engine() const
Definition docnode.h:374
@ JavaDocLiteral
Definition docnode.h:359
void writeDotFile(const QCString &fileName, const DocVerbatim &s)
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
QCString writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:27
static PlantumlManager & instance()
Definition plantuml.cpp:156
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:133
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
const char * qPrint(const char *s)
Definition qcstring.h:661
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5567

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), QCString::data(), DB_VIS_C, DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::engine(), err, DocVerbatim::exampleFile(), QCString::ExplicitSize, filter(), DocVisitor::getCodeParser(), getLanguageFromCodeLang(), DocVerbatim::HtmlOnly, PlantumlManager::instance(), QCString::isEmpty(), DocVerbatim::isExample(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language(), DocVerbatim::LatexOnly, QCString::length(), m_ci, m_hide, m_langExt, m_t, makeShortName(), DocVerbatim::ManOnly, DocVerbatim::Msc, Portable::openOutputStream(), CodeParserInterface::parseCode(), DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, qPrint(), DocVerbatim::RtfOnly, QCString::sprintf(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), QCString::str(), DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::Verbatim, writeDotFile(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [55/58]

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

Definition at line 1491 of file docbookvisitor.cpp.

1492{
1494 // TODO: to be implemented
1495}

References DB_VIS_C.

◆ operator()() [56/58]

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

Definition at line 205 of file docbookvisitor.cpp.

206{
208 if (m_hide) return;
209 if (m_insidePre)
210 {
211 m_t << w.chars();
212 }
213 else
214 {
215 m_t << " ";
216 }
217}
QCString chars() const
Definition docnode.h:339

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

◆ operator()() [57/58]

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

Definition at line 189 of file docbookvisitor.cpp.

190{
192 if (m_hide) return;
193 filter(w.word());
194}
QCString word() const
Definition docnode.h:155

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

◆ operator()() [58/58]

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

Definition at line 1449 of file docbookvisitor.cpp.

1450{
1452 if (m_hide) return;
1453 if (x.title().isEmpty()) return;
1454 m_t << "<para><link linkend=\"_";
1455 m_t << stripPath(x.file()) << "_1" << x.anchor();
1456 m_t << "\">";
1457 filter(x.title());
1458 m_t << "</link>";
1459 m_t << " ";
1460 visitChildren(x);
1461 if (x.title().isEmpty()) return;
1462 m_t << "</para>";
1463}
QCString anchor() const
Definition docnode.h:605
QCString file() const
Definition docnode.h:604
QCString title() const
Definition docnode.h:606

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

◆ startDiaFile()

void DocbookDocVisitor::startDiaFile ( const QCString & fileName,
const QCString & relPath,
const QCString & width,
const QCString & height,
bool hasCaption,
const DocNodeList & children,
const QCString & srcFile,
int srcLine )
private

Definition at line 1619 of file docbookvisitor.cpp.

1628{
1630 QCString baseName=makeBaseName(fileName);
1631 baseName.prepend("dia_");
1632 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1633 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1634 m_t << "<para>\n";
1635 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1636}
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
static QCString makeBaseName(const QCString &name)

References BITMAP, Config_getString, DB_VIS_C, m_t, makeBaseName(), visitPreStart(), and writeDiaGraphFromFile().

Referenced by operator()().

◆ startDotFile()

void DocbookDocVisitor::startDotFile ( const QCString & fileName,
const QCString & relPath,
const QCString & width,
const QCString & height,
bool hasCaption,
const DocNodeList & children,
const QCString & srcFile,
int srcLine )
private

Definition at line 1657 of file docbookvisitor.cpp.

1666{
1668 QCString baseName=makeBaseName(fileName);
1669 baseName.prepend("dot_");
1670 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1671 QCString imgExt = getDotImageExtension();
1672 writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1673 m_t << "<para>\n";
1674 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1675}
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
QCString getDotImageExtension()
Definition util.cpp:6616

References BITMAP, Config_getString, DB_VIS_C, getDotImageExtension(), m_t, makeBaseName(), visitPreStart(), and writeDotGraphFromFile().

Referenced by operator()().

◆ startLink()

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

Definition at line 1511 of file docbookvisitor.cpp.

1512{
1514 m_t << "<link linkend=\"_" << stripPath(file);
1515 if (!anchor.isEmpty())
1516 {
1517 if (!file.isEmpty()) m_t << "_1";
1518 m_t << anchor;
1519 }
1520 m_t << "\">";
1521}

References DB_VIS_C, QCString::isEmpty(), m_t, and stripPath().

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

◆ startMscFile()

void DocbookDocVisitor::startMscFile ( const QCString & fileName,
const QCString & relPath,
const QCString & width,
const QCString & height,
bool hasCaption,
const DocNodeList & children,
const QCString & srcFile,
int srcLine )
private

Definition at line 1581 of file docbookvisitor.cpp.

1590{
1592 QCString baseName=makeBaseName(fileName);
1593 baseName.prepend("msc_");
1594 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1595 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1596 m_t << "<para>\n";
1597 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1598}
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:156

References BITMAP, Config_getString, DB_VIS_C, m_t, makeBaseName(), visitPreStart(), and writeMscGraphFromFile().

Referenced by operator()().

◆ startPlantUmlFile()

void DocbookDocVisitor::startPlantUmlFile ( const QCString & fileName,
const QCString & relPath,
const QCString & width,
const QCString & height,
bool hasCaption,
const DocNodeList & children,
const QCString & srcFile,
int srcLine )
private

Definition at line 1550 of file docbookvisitor.cpp.

1559{
1561 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1562 std::string inBuf;
1563 readInputFile(fileName,inBuf);
1564 QCString baseName = PlantumlManager::instance().writePlantUMLSource(outDir,
1565 QCString(),inBuf.c_str(),PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1566 baseName=makeBaseName(baseName);
1568 m_t << "<para>\n";
1569 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1570}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:127
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:5841

References Config_getString, DB_VIS_C, PlantumlManager::generatePlantUMLOutput(), PlantumlManager::instance(), m_t, makeBaseName(), PlantumlManager::PUML_BITMAP, readInputFile(), visitPreStart(), and PlantumlManager::writePlantUMLSource().

Referenced by operator()().

◆ visitCaption()

void DocbookDocVisitor::visitCaption ( const DocNodeList & children)
private

Definition at line 109 of file docbookvisitor.cpp.

110{
111 for (const auto &n : children)
112 {
113 std::visit(*this,n);
114 }
115}

Referenced by visitPreStart(), writeDiaFile(), writeDotFile(), writeMscFile(), and writePlantUMLFile().

◆ visitChildren()

◆ visitPostEnd()

void DocbookDocVisitor::visitPostEnd ( TextStream & t,
bool hasCaption,
bool inlineImage = FALSE )
private

Definition at line 160 of file docbookvisitor.cpp.

161{
162 t << "\n";
163 if (hasCaption && !inlineImage)
164 {
165 t << " -->\n"; // Needed for general formatting with title for other formats
166 }
167 t << " </mediaobject>\n";
168 if (hasCaption && !inlineImage)
169 {
170 t << " </figure>\n";
171 }
172 else
173 {
174 t << " </informalfigure>\n";
175 }
176}

Referenced by endDiaFile(), endDotFile(), endMscFile(), endPlantUmlFile(), operator()(), writeDiaFile(), writeDotFile(), writeMscFile(), and writePlantUMLFile().

◆ visitPreStart()

void DocbookDocVisitor::visitPreStart ( TextStream & t,
const DocNodeList & children,
bool hasCaption,
const QCString & name,
const QCString & width,
const QCString & height,
bool inlineImage = FALSE )
private

Definition at line 117 of file docbookvisitor.cpp.

124{
125 if (hasCaption && !inlineImage)
126 {
127 t << " <figure>\n";
128 t << " <title>\n";
129 visitCaption(children);
130 t << " </title>\n";
131 }
132 else
133 {
134 t << " <informalfigure>\n";
135 }
136 t << " <mediaobject>\n";
137 t << " <imageobject>\n";
138 t << " <imagedata";
139 if (!width.isEmpty())
140 {
141 t << " width=\"" << convertToDocBook(width) << "\"";
142 }
143 else
144 {
145 if (!height.isEmpty() && !inlineImage) t << " width=\"50%\"";
146 }
147 if (!height.isEmpty())
148 {
149 t << " depth=\"" << convertToDocBook(height) << "\"";
150 }
151 t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">";
152 t << "</imagedata>\n";
153 t << " </imageobject>\n";
154 if (hasCaption && !inlineImage)
155 {
156 t << " <!--\n"; // Needed for general formatting with title for other formats
157 }
158}
void visitCaption(const DocNodeList &children)

References convertToDocBook(), QCString::isEmpty(), and visitCaption().

Referenced by operator()(), startDiaFile(), startDotFile(), startMscFile(), startPlantUmlFile(), writeDiaFile(), writeDotFile(), writeMscFile(), and writePlantUMLFile().

◆ writeDiaFile()

void DocbookDocVisitor::writeDiaFile ( const QCString & fileName,
const DocVerbatim & s )
private

Definition at line 1608 of file docbookvisitor.cpp.

1609{
1611 QCString shortName = makeShortName(baseName);
1612 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1613 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1614 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1617}
QCString height() const
Definition docnode.h:373
bool hasCaption() const
Definition docnode.h:371
const DocNodeList & children() const
Definition docnode.h:376
QCString width() const
Definition docnode.h:372

References BITMAP, DocVerbatim::children(), Config_getString, DB_VIS_C, DocVerbatim::hasCaption(), DocVerbatim::height(), m_t, makeShortName(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), visitCaption(), visitPostEnd(), visitPreStart(), DocVerbatim::width(), and writeDiaGraphFromFile().

◆ writeDotFile()

void DocbookDocVisitor::writeDotFile ( const QCString & fileName,
const DocVerbatim & s )
private

◆ writeMscFile()

void DocbookDocVisitor::writeMscFile ( const QCString & fileName,
const DocVerbatim & s )
private

Definition at line 1529 of file docbookvisitor.cpp.

1530{
1532 QCString shortName = makeShortName(baseName);
1533 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1534 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1535 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1538}

References BITMAP, DocVerbatim::children(), Config_getString, DB_VIS_C, DocVerbatim::hasCaption(), DocVerbatim::height(), m_t, makeShortName(), DocVerbatim::relPath(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), visitCaption(), visitPostEnd(), visitPreStart(), DocVerbatim::width(), and writeMscGraphFromFile().

Referenced by operator()().

◆ writePlantUMLFile()

void DocbookDocVisitor::writePlantUMLFile ( const QCString & fileName,
const DocVerbatim & s )
private

Member Data Documentation

◆ m_bodySet

BoolStack DocbookDocVisitor::m_bodySet
private

Definition at line 156 of file docbookvisitor.h.

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

◆ m_ci

OutputCodeList& DocbookDocVisitor::m_ci
private

Definition at line 150 of file docbookvisitor.h.

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

◆ m_colCnt

int DocbookDocVisitor::m_colCnt = 0
private

Definition at line 155 of file docbookvisitor.h.

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

◆ m_enabled

BoolStack DocbookDocVisitor::m_enabled
private

Definition at line 153 of file docbookvisitor.h.

◆ m_hide

◆ m_insidePre

bool DocbookDocVisitor::m_insidePre = false
private

Definition at line 151 of file docbookvisitor.h.

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

◆ m_langExt

QCString DocbookDocVisitor::m_langExt
private

Definition at line 154 of file docbookvisitor.h.

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

◆ m_t


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