Skip to main content

The DocbookDocVisitor Class Reference

Concrete visitor implementation for Docbook output. More...

Declaration

class DocbookDocVisitor { ... }

Included Headers

Base class

classDocVisitor

Helper base class for functionality shared by all visitors. More...

Public Constructors Index

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

Public Operators Index

voidoperator() (const DocWord &)
voidoperator() (const DocLinkedWord &)
voidoperator() (const DocWhiteSpace &)
voidoperator() (const DocSymbol &)
voidoperator() (const DocEmoji &)
voidoperator() (const DocURL &)
voidoperator() (const DocLineBreak &)
voidoperator() (const DocHorRuler &)
voidoperator() (const DocStyleChange &)
voidoperator() (const DocVerbatim &)
voidoperator() (const DocAnchor &)
voidoperator() (const DocInclude &)
voidoperator() (const DocIncOperator &)
voidoperator() (const DocFormula &)
voidoperator() (const DocIndexEntry &)
voidoperator() (const DocSimpleSectSep &)
voidoperator() (const DocCite &)
voidoperator() (const DocSeparator &)
voidoperator() (const DocAutoList &)
voidoperator() (const DocAutoListItem &)
voidoperator() (const DocPara &)
voidoperator() (const DocRoot &)
voidoperator() (const DocSimpleSect &)
voidoperator() (const DocTitle &)
voidoperator() (const DocSimpleList &)
voidoperator() (const DocSimpleListItem &)
voidoperator() (const DocSection &)
voidoperator() (const DocHtmlList &)
voidoperator() (const DocHtmlListItem &)
voidoperator() (const DocHtmlDescList &)
voidoperator() (const DocHtmlDescTitle &)
voidoperator() (const DocHtmlDescData &)
voidoperator() (const DocHtmlTable &)
voidoperator() (const DocHtmlRow &)
voidoperator() (const DocHtmlCell &)
voidoperator() (const DocHtmlCaption &)
voidoperator() (const DocInternal &)
voidoperator() (const DocHRef &)
voidoperator() (const DocHtmlSummary &)
voidoperator() (const DocHtmlDetails &)
voidoperator() (const DocHtmlHeader &)
voidoperator() (const DocImage &)
voidoperator() (const DocDotFile &)
voidoperator() (const DocMscFile &)
voidoperator() (const DocDiaFile &)
voidoperator() (const DocPlantUmlFile &)
voidoperator() (const DocLink &)
voidoperator() (const DocRef &)
voidoperator() (const DocSecRefItem &)
voidoperator() (const DocSecRefList &)
voidoperator() (const DocParamSect &)
voidoperator() (const DocParamList &)
voidoperator() (const DocXRefItem &)
voidoperator() (const DocInternalRef &)
voidoperator() (const DocText &)
voidoperator() (const DocHtmlBlockQuote &)
voidoperator() (const DocVhdlFlow &)
voidoperator() (const DocParBlock &)

Public Member Functions Index

template <class T>
voidvisitChildren (const T &t)

Private Member Functions Index

voidfilter (const QCString &str, const bool retainNewLine=false)
voidstartLink (const QCString &file, const QCString &anchor)
voidendLink ()
voidstartMscFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
voidendMscFile (bool hasCaption)
voidwriteMscFile (const QCString &fileName, const DocVerbatim &s)
voidstartDiaFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
voidendDiaFile (bool hasCaption)
voidwriteDiaFile (const QCString &fileName, const DocVerbatim &s)
voidstartDotFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
voidendDotFile (bool hasCaption)
voidwriteDotFile (const QCString &fileName, const DocVerbatim &s)
voidwritePlantUMLFile (const QCString &fileName, const DocVerbatim &s)
voidstartPlantUmlFile (const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
voidendPlantUmlFile (bool hasCaption)
voidvisitPreStart (TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
voidvisitPostEnd (TextStream &t, bool hasCaption, bool inlineImage=FALSE)
voidvisitCaption (const DocNodeList &children)

Private Member Attributes Index

TextStream &m_t
OutputCodeList &m_ci
boolm_insidePre = false
boolm_hide = false
BoolStackm_enabled
QCStringm_langExt
intm_colCnt = 0
BoolStackm_bodySet

Description

Concrete visitor implementation for Docbook output.

Definition at line 31 of file docbookvisitor.h.

Public Constructors

DocbookDocVisitor()

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

Declaration at line 34 of file docbookvisitor.h, definition at line 179 of file docbookvisitor.cpp.

180 : m_t(t), m_ci(ci),m_langExt(langExt)
181{
183 // m_t << "<section>\n";
184}

References DB_VIS_C, m_ci, m_langExt and m_t.

Public Operators

operator()()

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

Declaration at line 47 of file docbookvisitor.h, definition at line 190 of file docbookvisitor.cpp.

191{
193 if (m_hide) return;
194 filter(w.word());
195}

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

operator()()

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

Declaration at line 48 of file docbookvisitor.h, definition at line 197 of file docbookvisitor.cpp.

198{
200 if (m_hide) return;
201 startLink(w.file(),w.anchor());
202 filter(w.word());
203 endLink();
204}

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

operator()()

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

Declaration at line 49 of file docbookvisitor.h, definition at line 206 of file docbookvisitor.cpp.

207{
209 if (m_hide) return;
210 if (m_insidePre)
211 {
212 m_t << w.chars();
213 }
214 else
215 {
216 m_t << " ";
217 }
218}

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

operator()()

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

Declaration at line 50 of file docbookvisitor.h, definition at line 220 of file docbookvisitor.cpp.

221{
223 if (m_hide) return;
224 const char *res = HtmlEntityMapper::instance().docbook(s.symbol());
225 if (res)
226 {
227 m_t << res;
228 }
229 else
230 {
231 err("DocBook: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
232 }
233}

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

operator()()

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

Declaration at line 51 of file docbookvisitor.h, definition at line 235 of file docbookvisitor.cpp.

236{
238 if (m_hide) return;
239 const char *res = EmojiEntityMapper::instance().unicode(s.index());
240 if (res)
241 {
242 m_t << res;
243 }
244 else
245 {
246 m_t << s.name();
247 }
248}

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

operator()()

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

Declaration at line 52 of file docbookvisitor.h, definition at line 250 of file docbookvisitor.cpp.

251{
253 if (m_hide) return;
254 m_t << "<link xlink:href=\"";
255 if (u.isEmail()) m_t << "mailto:";
256 filter(u.url());
257 m_t << "\">";
258 filter(u.url());
259 m_t << "</link>";
260}

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

operator()()

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

Declaration at line 53 of file docbookvisitor.h, definition at line 262 of file docbookvisitor.cpp.

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

References DB_VIS_C, m_hide and m_t.

operator()()

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

Declaration at line 54 of file docbookvisitor.h, definition at line 271 of file docbookvisitor.cpp.

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

References DB_VIS_C, m_hide and m_t.

operator()()

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

Declaration at line 55 of file docbookvisitor.h, definition at line 279 of file docbookvisitor.cpp.

280{
282 if (m_hide) return;
283 switch (s.style())
284 {
286 if (s.enable()) m_t << "<emphasis role=\"bold\">"; else m_t << "</emphasis>";
287 break;
289 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
290 break;
294 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
295 break;
297 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
298 break;
300 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
301 break;
303 if (s.enable()) m_t << "<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
304 else m_t << "</entry></row></tbody></tgroup></informaltable>";
305 break;
307 if (s.enable())
308 {
309 m_t << "<literallayout>";
311 }
312 else
313 {
314 m_t << "</literallayout>";
316 }
317 break;
318 /* There is no equivalent Docbook tag for rendering Small text */
319 case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
320 /* HTML only */
321 case DocStyleChange::Cite: break;
322 case DocStyleChange::S: break;
323 case DocStyleChange::Strike: break;
324 case DocStyleChange::Del: break;
325 case DocStyleChange::Underline: break;
326 case DocStyleChange::Ins: break;
327 case DocStyleChange::Div: /* HTML only */ break;
328 case DocStyleChange::Span: /* HTML only */ break;
329 }
330}

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, DocStyleChange::Typewriter and DocStyleChange::Underline.

operator()()

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

Declaration at line 56 of file docbookvisitor.h, definition at line 332 of file docbookvisitor.cpp.

333{
335 if (m_hide) return;
336 QCString lang = m_langExt;
337 if (!s.language().isEmpty()) // explicit language setting
338 {
339 lang = s.language();
340 }
341 SrcLangExt langExt = getLanguageFromCodeLang(lang);
342 switch(s.type())
343 {
345 m_t << "<literallayout><computeroutput>";
347 s.text(),
348 langExt,
349 Config_getBool(STRIP_CODE_COMMENTS),
350 s.isExample(),
351 s.exampleFile());
352 m_t << "</computeroutput></literallayout>";
353 break;
355 m_t << "<literallayout><computeroutput>";
356 filter(s.text());
357 m_t << "</computeroutput></literallayout>";
358 break;
360 filter(s.text(), true);
361 break;
363 m_t << "<computeroutput>";
364 filter(s.text(), true);
365 m_t << "</computeroutput>";
366 break;
368 break;
370 break;
372 break;
374 break;
376 break;
378 m_t << s.text();
379 break;
381 {
382 static int dotindex = 1;
383 QCString baseName(4096, QCString::ExplicitSize);
384 QCString name;
385 QCString stext = s.text();
386 m_t << "<para>\n";
387 name.sprintf("%s%d", "dot_inline_dotgraph_", dotindex);
388 baseName.sprintf("%s%d",
389 qPrint(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_"),
390 dotindex++
391 );
392 QCString fileName = baseName+".dot";
393 std::ofstream file = Portable::openOutputStream(fileName);
394 if (!file.is_open())
395 {
396 err("Could not open file {} for writing\n",fileName);
397 }
398 file.write( stext.data(), stext.length() );
399 file.close();
400 writeDotFile(baseName, s);
401 m_t << "</para>\n";
402 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
403 }
404 break;
406 {
407 static int mscindex = 1;
408 QCString baseName(4096, QCString::ExplicitSize);
409 QCString name;
410 QCString stext = s.text();
411 m_t << "<para>\n";
412 name.sprintf("%s%d", "msc_inline_mscgraph_", mscindex);
413 baseName.sprintf("%s%d",
414 (Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_").data(),
415 mscindex++
416 );
417 QCString fileName = baseName+".msc";
418 std::ofstream file = Portable::openOutputStream(fileName);
419 if (!file.is_open())
420 {
421 err("Could not open file {} for writing\n",fileName);
422 }
423 QCString text = "msc {";
424 text+=stext;
425 text+="}";
426 file.write( text.data(), text.length() );
427 file.close();
428 writeMscFile(baseName,s);
429 m_t << "</para>\n";
430 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
431 }
432 break;
434 {
435 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
438 s.engine(),s.srcFile(),s.srcLine(),true);
439 QCString shortName = makeShortName(baseName);
440 m_t << "<para>\n";
441 writePlantUMLFile(baseName,s);
442 m_t << "</para>\n";
443 }
444 break;
445 }
446}

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, Dir::remove, 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()()

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

Declaration at line 57 of file docbookvisitor.h, definition at line 448 of file docbookvisitor.cpp.

449{
451 if (m_hide) return;
452 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
453}

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

operator()()

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

Declaration at line 58 of file docbookvisitor.h, definition at line 455 of file docbookvisitor.cpp.

456{
458 if (m_hide) return;
460 switch(inc.type())
461 {
463 {
464 m_t << "<literallayout><computeroutput>";
465 FileInfo cfi( inc.file().str() );
466 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
468 inc.text(),
469 langExt,
471 inc.isExample(),
472 inc.exampleFile(), fd.get());
473 m_t << "</computeroutput></literallayout>";
474 }
475 break;
477 m_t << "<literallayout><computeroutput>";
479 inc.text(),
480 langExt,
482 inc.isExample(),
483 inc.exampleFile());
484 m_t << "</computeroutput></literallayout>";
485 break;
493 break;
495 m_t << inc.text();
496 break;
498 m_t << "<literallayout>";
499 filter(inc.text());
500 m_t << "</literallayout>";
501 break;
504 m_t << "<literallayout><computeroutput>";
506 inc.file(),
507 inc.blockId(),
508 inc.context(),
510 inc.trimLeft(),
512 );
513 m_t << "</computeroutput></literallayout>";
514 break;
515 }
516}

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()()

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

Declaration at line 59 of file docbookvisitor.h, definition at line 518 of file docbookvisitor.cpp.

519{
521 if (op.isFirst())
522 {
523 if (!m_hide)
524 {
525 m_t << "<programlisting linenumbering=\"unnumbered\">";
526 }
528 m_hide = TRUE;
529 }
531 if (locLangExt.isEmpty()) locLangExt = m_langExt;
532 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
533 if (op.type()!=DocIncOperator::Skip)
534 {
535 m_hide = popHidden();
536 if (!m_hide)
537 {
538 std::unique_ptr<FileDef> fd;
539 if (!op.includeFileName().isEmpty())
540 {
541 FileInfo cfi( op.includeFileName().str() );
542 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
543 }
544
545 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
546 op.text(),langExt,
548 op.isExample(),
549 op.exampleFile(),
550 fd.get(), // fileDef
551 op.line(), // startLine
552 -1, // endLine
553 FALSE, // inline fragment
554 nullptr, // memberDef
555 op.showLineNo() // show line numbers
556 );
557 }
560 }
561 if (op.isLast())
562 {
563 m_hide = popHidden();
564 if (!m_hide) m_t << "</programlisting>";
565 }
566 else
567 {
568 if (!m_hide) m_t << "\n";
569 }
570}

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()()

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

Declaration at line 60 of file docbookvisitor.h, definition at line 572 of file docbookvisitor.cpp.

573{
575 if (m_hide) return;
576
577 if (f.isInline()) m_t << "<inlinemediaobject>\n";
578 else m_t << " <mediaobject>\n";
579 m_t << " <imageobject>\n";
580 m_t << " <imagedata ";
581 m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.relPath() << f.name() << ".png\"/>\n";
582 m_t << " </imageobject>\n";
583 if (f.isInline()) m_t << "</inlinemediaobject>\n";
584 else m_t << " </mediaobject>\n";
585}

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

operator()()

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

Declaration at line 61 of file docbookvisitor.h, definition at line 587 of file docbookvisitor.cpp.

588{
590 if (m_hide) return;
591 m_t << "<indexterm><primary>";
592 filter(ie.entry());
593 m_t << "</primary></indexterm>\n";
594}

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

operator()()

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

Declaration at line 62 of file docbookvisitor.h, definition at line 596 of file docbookvisitor.cpp.

597{
599 // m_t << "<simplesect/>";
600}

Reference DB_VIS_C.

operator()()

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

Declaration at line 63 of file docbookvisitor.h, definition at line 602 of file docbookvisitor.cpp.

603{
605 if (m_hide) return;
606 auto opt = cite.option();
607 if (!cite.file().isEmpty())
608 {
609 if (!opt.noCite()) startLink(cite.file(),filterId(cite.anchor()));
610
611 filter(cite.getText());
612
613 if (!opt.noCite()) endLink();
614 }
615 else
616 {
617 if (!opt.noPar()) filter("[");
618 filter(cite.target());
619 if (!opt.noPar()) filter("]");
620
621 }
622
623}

References DocCite::anchor, DB_VIS_C, endLink, DocCite::file, filter, filterId, DocCite::getText, QCString::isEmpty, m_hide, DocCite::option, startLink and DocCite::target.

operator()()

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

Declaration at line 64 of file docbookvisitor.h, definition at line 1392 of file docbookvisitor.cpp.

1393{
1395 if (m_hide) return;
1396 m_t << " " << sep.chars() << " ";
1397}

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

operator()()

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

Declaration at line 68 of file docbookvisitor.h, definition at line 629 of file docbookvisitor.cpp.

630{
632 if (m_hide) return;
633 if (l.isEnumList())
634 {
635 m_t << "<orderedlist>\n";
636 }
637 else
638 {
639 m_t << "<itemizedlist>\n";
640 }
642 if (l.isEnumList())
643 {
644 m_t << "</orderedlist>\n";
645 }
646 else
647 {
648 m_t << "</itemizedlist>\n";
649 }
650}

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

operator()()

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

Declaration at line 69 of file docbookvisitor.h, definition at line 652 of file docbookvisitor.cpp.

653{
655 if (m_hide) return;
656 switch (li.itemNumber())
657 {
658 case DocAutoList::Unchecked: // unchecked
659 m_t << "<listitem override=\"unchecked\">";
660 break;
661 case DocAutoList::Checked_x: // checked with x
662 case DocAutoList::Checked_X: // checked with X
663 m_t << "<listitem override=\"checked\">";
664 break;
665 default:
666 m_t << "<listitem>";
667 break;
668 }
669 visitChildren(li);
670 m_t << "</listitem>";
671}

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

operator()()

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

Declaration at line 70 of file docbookvisitor.h, definition at line 673 of file docbookvisitor.cpp.

674{
676 if (m_hide) return;
677 m_t << "\n";
678 m_t << "<para>";
680 m_t << "</para>";
681 m_t << "\n";
682}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 71 of file docbookvisitor.h, definition at line 684 of file docbookvisitor.cpp.

685{
688}

References DB_VIS_C and visitChildren.

operator()()

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

Declaration at line 72 of file docbookvisitor.h, definition at line 690 of file docbookvisitor.cpp.

691{
693 if (m_hide) return;
694 switch(s.type())
695 {
697 if (m_insidePre)
698 {
699 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
700 }
701 else
702 {
703 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
704 }
705 break;
707 if (m_insidePre)
708 {
709 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
710 }
711 else
712 {
713 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
714 }
715 break;
717 if (m_insidePre)
718 {
719 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
720 }
721 else
722 {
723 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
724 }
725 break;
727 if (m_insidePre)
728 {
729 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
730 }
731 else
732 {
733 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
734 }
735 break;
737 if (m_insidePre)
738 {
739 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
740 }
741 else
742 {
743 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
744 }
745 break;
747 if (m_insidePre)
748 {
749 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
750 }
751 else
752 {
753 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
754 }
755 break;
757 if (m_insidePre)
758 {
759 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
760 }
761 else
762 {
763 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
764 }
765 break;
767 if (m_insidePre)
768 {
769 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
770 }
771 else
772 {
773 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
774 }
775 break;
777 if (m_insidePre)
778 {
779 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
780 }
781 else
782 {
783 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
784 }
785 break;
787 if (m_insidePre)
788 {
789 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
790 }
791 else
792 {
793 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
794 }
795 break;
797 if (m_insidePre)
798 {
799 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
800 }
801 else
802 {
803 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
804 }
805 break;
807 if (m_insidePre)
808 {
809 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
810 }
811 else
812 {
813 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
814 }
815 break;
817 if (m_insidePre)
818 {
819 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
820 }
821 else
822 {
823 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
824 }
825 break;
827 // <remark> is miising the <title> possibility
828 if (m_insidePre)
829 {
830 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
831 }
832 else
833 {
834 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
835 }
836 break;
838 if (m_insidePre)
839 {
840 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
841 }
842 else
843 {
844 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
845 }
846 break;
848 if (m_insidePre)
849 {
850 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
851 }
852 else
853 {
854 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
855 }
856 break;
860 if (s.hasTitle())
861 m_t << "<formalpara>\n";
862 else
863 m_t << "<para>\n";
864 break;
865 }
866
867 if (s.title())
868 {
869 std::visit(*this,*s.title());
870 }
872
873 switch(s.type())
874 {
878 if (s.hasTitle())
879 m_t << "</formalpara>\n";
880 else
881 m_t << "</para>\n";
882 break;
884 m_t << "</note>\n";
885 break;
887 m_t << "</caution>\n";
888 break;
890 m_t << "</important>\n";
891 break;
893 m_t << "</warning>\n";
894 break;
895 default:
896 m_t << "</formalpara>\n";
897 break;
898 }
899}

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, TRUE, DocSimpleSect::type, DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren and DocSimpleSect::Warning.

operator()()

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

Declaration at line 73 of file docbookvisitor.h, definition at line 901 of file docbookvisitor.cpp.

902{
904 if (m_hide) return;
905 if (t.hasTitle()) m_t << "<title>";
907 if (t.hasTitle()) m_t << "</title>";
908}

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

operator()()

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

Declaration at line 74 of file docbookvisitor.h, definition at line 910 of file docbookvisitor.cpp.

911{
913 if (m_hide) return;
914 m_t << "<itemizedlist>\n";
916 m_t << "</itemizedlist>\n";
917}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 75 of file docbookvisitor.h, definition at line 919 of file docbookvisitor.cpp.

920{
922 if (m_hide) return;
923 m_t << "<listitem>";
924 if (li.paragraph())
925 {
926 visit(*this,*li.paragraph());
927 }
928 m_t << "</listitem>\n";
929}

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

operator()()

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

Declaration at line 76 of file docbookvisitor.h, definition at line 931 of file docbookvisitor.cpp.

932{
934 if (m_hide) return;
935 m_t << "<section xml:id=\"_" << stripPath(s.file());
936 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
937 m_t << "\">\n";
938 if (s.title())
939 {
940 std::visit(*this,*s.title());
941 }
943 m_t << "</section>\n";
944}

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

operator()()

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

Declaration at line 77 of file docbookvisitor.h, definition at line 946 of file docbookvisitor.cpp.

947{
949 if (m_hide) return;
950 if (s.children().empty()) return;
951 // opening tag for ordered list will be handled in DocHtmlListItem
952 // due to (re-)numbering possibilities
954 m_t << "<itemizedlist>\n";
957 m_t << "</orderedlist>\n";
958 else
959 m_t << "</itemizedlist>\n";
960}

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

operator()()

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

Declaration at line 78 of file docbookvisitor.h, definition at line 962 of file docbookvisitor.cpp.

963{
965 if (m_hide) return;
966 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
967 if (l->type()==DocHtmlList::Ordered)
968 {
969 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
970 int value = 0;
971 QCString type;
972 for (const auto &opt : s.attribs())
973 {
974 if (opt.name=="value")
975 {
976 bool ok = false;
977 int val = opt.value.toInt(&ok);
978 if (ok) value = val;
979 }
980 }
981
982 if (value>0 || isFirst)
983 {
984 for (const auto &opt : l->attribs())
985 {
986 if (opt.name=="type")
987 {
988 if (opt.value=="1")
989 type = " numeration=\"arabic\"";
990 else if (opt.value=="a")
991 type = " numeration=\"loweralpha\"";
992 else if (opt.value=="A")
993 type = " numeration=\"upperalpha\"";
994 else if (opt.value=="i")
995 type = " numeration=\"lowerroman\"";
996 else if (opt.value=="I")
997 type = " numeration=\"upperroman\"";
998 }
999 else if (value==0 && opt.name=="start")
1000 {
1001 bool ok = false;
1002 int val = opt.value.toInt(&ok);
1003 if (ok) value = val;
1004 }
1005 }
1006 }
1007
1008 if (value>0 && !isFirst)
1009 {
1010 m_t << "</orderedlist>\n";
1011 }
1012 if (value>0 || isFirst)
1013 {
1014 m_t << "<orderedlist";
1015 if (!type.isEmpty()) m_t << type.data();
1016 if (value>0) m_t << " startingnumber=\"" << value << "\"";
1017 m_t << ">\n";
1018 }
1019 }
1020 m_t << "<listitem>\n";
1021 visitChildren(s);
1022 m_t << "</listitem>\n";
1023}

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()()

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

Declaration at line 79 of file docbookvisitor.h, definition at line 1025 of file docbookvisitor.cpp.

1026{
1028 if (m_hide) return;
1029 m_t << "<variablelist>\n";
1030 visitChildren(l);
1031 m_t << "</variablelist>\n";
1032}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 80 of file docbookvisitor.h, definition at line 1034 of file docbookvisitor.cpp.

1035{
1037 if (m_hide) return;
1038 m_t << "<varlistentry><term>";
1039 visitChildren(dt);
1040 m_t << "</term></varlistentry>\n";
1041}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 81 of file docbookvisitor.h, definition at line 1043 of file docbookvisitor.cpp.

1044{
1046 if (m_hide) return;
1047 m_t << "<listitem>";
1048 visitChildren(dd);
1049 m_t << "</listitem>\n";
1050}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 82 of file docbookvisitor.h, definition at line 1052 of file docbookvisitor.cpp.

1053{
1055 m_bodySet.push(false);
1056 if (m_hide) return;
1057 m_t << "<informaltable frame=\"all\">\n";
1058 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1059 for (uint32_t i = 0; i <t.numColumns(); i++)
1060 {
1061 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1062 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1063 }
1064 if (t.caption())
1065 {
1066 std::visit(*this,*t.caption());
1067 }
1068 visitChildren(t);
1069 if (m_bodySet.top()) m_t << " </tbody>\n";
1070 m_bodySet.pop();
1071 m_t << " </tgroup>\n";
1072 m_t << "</informaltable>\n";
1073}

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

operator()()

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

Declaration at line 83 of file docbookvisitor.h, definition at line 1075 of file docbookvisitor.cpp.

1076{
1078 m_colCnt = 0;
1079 if (m_hide) return;
1080
1081 if (tr.isHeading())
1082 {
1083 if (m_bodySet.top()) m_t << "</tbody>\n";
1084 m_bodySet.top() = false;
1085 m_t << "<thead>\n";
1086 }
1087 else if (!m_bodySet.top())
1088 {
1089 m_bodySet.top() = true;
1090 m_t << "<tbody>\n";
1091 }
1092
1093 m_t << " <row ";
1094
1095 for (const auto &opt : tr.attribs())
1096 {
1097 if (supportedHtmlAttribute(opt.name))
1098 {
1099 // process supported attributes only
1100 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1101 }
1102 }
1103 m_t << ">\n";
1104 visitChildren(tr);
1105 m_t << "</row>\n";
1106 if (tr.isHeading())
1107 {
1108 m_t << "</thead><tbody>\n";
1109 m_bodySet.top() = true;
1110 }
1111}

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

operator()()

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

Declaration at line 84 of file docbookvisitor.h, definition at line 1113 of file docbookvisitor.cpp.

1114{
1116 m_colCnt++;
1117 if (m_hide) return;
1118 m_t << "<entry";
1119
1120 for (const auto &opt : c.attribs())
1121 {
1122 if (opt.name=="colspan")
1123 {
1124 m_t << " namest='c" << m_colCnt << "'";
1125 int cols = opt.value.toInt();
1126 m_colCnt += (cols - 1);
1127 m_t << " nameend='c" << m_colCnt << "'";
1128 }
1129 else if (opt.name=="rowspan")
1130 {
1131 int extraRows = opt.value.toInt() - 1;
1132 m_t << " morerows='" << extraRows << "'";
1133 }
1134 else if (opt.name=="class")
1135 {
1136 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1137 {
1138 if (opt.value.endsWith("Right"))
1139 {
1140 m_t << " align='right'";
1141 }
1142 else if (opt.value.endsWith("Left"))
1143 {
1144 m_t << " align='left'";
1145 }
1146 else if (opt.value.endsWith("Center"))
1147 {
1148 m_t << " align='center'";
1149 }
1150 // skip 'markdownTable*' value ending with "None"
1151 }
1152 else
1153 {
1154 m_t << " class='" << convertToDocBook(opt.value) << "'";
1155 }
1156 }
1157 else if (supportedHtmlAttribute(opt.name))
1158 {
1159 // process supported attributes only
1160 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1161 }
1162 }
1163 m_t << ">";
1164 visitChildren(c);
1165 m_t << "</entry>";
1166}

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

operator()()

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

Declaration at line 85 of file docbookvisitor.h, definition at line 1168 of file docbookvisitor.cpp.

1169{
1171 if (m_hide) return;
1172 m_t << "<caption>";
1173 if (!c.file().isEmpty())
1174 {
1175 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1176 }
1177 visitChildren(c);
1178 m_t << "</caption>\n";
1179}

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

operator()()

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

Declaration at line 86 of file docbookvisitor.h, definition at line 1181 of file docbookvisitor.cpp.

1182{
1184 if (m_hide) return;
1185 visitChildren(i);
1186}

References DB_VIS_C, m_hide and visitChildren.

operator()()

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

Declaration at line 87 of file docbookvisitor.h, definition at line 1188 of file docbookvisitor.cpp.

1189{
1191 if (m_hide) return;
1192 if (href.url().at(0) != '#')
1193 {
1194 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1195 }
1196 else
1197 {
1198 startLink(href.file(),filterId(href.url().mid(1)));
1199 }
1200 visitChildren(href);
1201 m_t << "</link>";
1202}

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

operator()()

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

Declaration at line 88 of file docbookvisitor.h, definition at line 1204 of file docbookvisitor.cpp.

1205{
1207 if (m_hide) return;
1208 m_t << "<para><emphasis role=\"bold\">";
1209 visitChildren(s);
1210 m_t << "</emphasis></para>";
1211}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 89 of file docbookvisitor.h, definition at line 1213 of file docbookvisitor.cpp.

1214{
1216 if (m_hide) return;
1217 m_t << "\n";
1218 auto summary = d.summary();
1219 if (summary)
1220 {
1221 std::visit(*this,*summary);
1222 }
1223 m_t << "<para>";
1224 visitChildren(d);
1225 m_t << "</para>";
1226 m_t << "\n";
1227}

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

operator()()

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

Declaration at line 90 of file docbookvisitor.h, definition at line 1229 of file docbookvisitor.cpp.

1230{
1232 if (m_hide) return;
1233 m_t << "<formalpara><title>";
1234 visitChildren(h);
1235 m_t << "</title></formalpara>\n";
1236}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 91 of file docbookvisitor.h, definition at line 1238 of file docbookvisitor.cpp.

1239{
1241 if (img.type()==DocImage::DocBook)
1242 {
1243 if (m_hide) return;
1244 m_t << "\n";
1245 QCString baseName=makeShortName(img.name());
1246 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1247 visitChildren(img);
1249 QCString file;
1250 bool ambig = false;
1251 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1252 if (fd)
1253 {
1254 file=fd->absFilePath();
1255 }
1256 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1257 }
1258 else // skip other formats
1259 {
1260 }
1261}

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()()

operator()()

operator()()

operator()()

operator()()

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

Declaration at line 96 of file docbookvisitor.h, definition at line 1303 of file docbookvisitor.cpp.

1304{
1306 if (m_hide) return;
1307 startLink(lnk.file(),lnk.anchor());
1308 visitChildren(lnk);
1309 endLink();
1310}

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

operator()()

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

Declaration at line 97 of file docbookvisitor.h, definition at line 1312 of file docbookvisitor.cpp.

1313{
1315 if (m_hide) return;
1316 if (ref.isSubPage())
1317 {
1318 startLink(QCString(),ref.anchor());
1319 }
1320 else
1321 {
1322 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1323 }
1324
1325 if (!ref.hasLinkText()) filter(ref.targetTitle());
1326 visitChildren(ref);
1327 if (!ref.file().isEmpty()) endLink();
1328}

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

operator()()

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

Declaration at line 98 of file docbookvisitor.h, definition at line 1330 of file docbookvisitor.cpp.

1331{
1333 if (m_hide) return;
1334 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1335 m_t << "<tocentry>";
1336 visitChildren(ref);
1337 m_t << "</tocentry>\n";
1338}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 99 of file docbookvisitor.h, definition at line 1340 of file docbookvisitor.cpp.

1341{
1343 if (m_hide) return;
1344 m_t << "<toc>\n";
1345 visitChildren(l);
1346 m_t << "</toc>\n";
1347}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 100 of file docbookvisitor.h, definition at line 1349 of file docbookvisitor.cpp.

1350{
1352 if (m_hide) return;
1353 m_t << "\n";
1354 m_t << " <formalpara>\n";
1355 m_t << " <title>\n";
1356 switch(s.type())
1357 {
1358 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1359 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1360 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1361 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1362 default:
1363 ASSERT(0);
1364 }
1365 m_t << "</title>\n";
1366 m_t << " <para>\n";
1367 m_t << " <table frame=\"all\">\n";
1368 int ncols = 2;
1369 if (s.type() == DocParamSect::Param)
1370 {
1371 bool hasInOutSpecs = s.hasInOutSpecifier();
1372 bool hasTypeSpecs = s.hasTypeSpecifier();
1373 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1374 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1375 }
1376 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1377 for (int i = 1; i <= ncols; i++)
1378 {
1379 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1380 else m_t << " <colspec colwidth=\"1*\"/>\n";
1381 }
1382 m_t << " <tbody>\n";
1383 visitChildren(s);
1384 m_t << " </tbody>\n";
1385 m_t << " </tgroup>\n";
1386 m_t << " </table>\n";
1387 m_t << " </para>\n";
1388 m_t << " </formalpara>\n";
1389 m_t << " ";
1390}

References ASSERT, DB_VIS_C, DocParamSect::Exception, DocParamSect::hasInOutSpecifier, DocParamSect::hasTypeSpecifier, m_hide, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, DocParamSect::type and visitChildren.

operator()()

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

Declaration at line 101 of file docbookvisitor.h, definition at line 1399 of file docbookvisitor.cpp.

1400{
1402 if (m_hide) return;
1403 m_t << " <row>\n";
1404
1405 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1406 if (sect && sect->hasInOutSpecifier())
1407 {
1408 m_t << "<entry>";
1410 {
1411 if (pl.direction()==DocParamSect::In)
1412 {
1413 m_t << "in";
1414 }
1415 else if (pl.direction()==DocParamSect::Out)
1416 {
1417 m_t << "out";
1418 }
1419 else if (pl.direction()==DocParamSect::InOut)
1420 {
1421 m_t << "in,out";
1422 }
1423 }
1424 m_t << "</entry>";
1425 }
1426
1427 if (sect && sect->hasTypeSpecifier())
1428 {
1429 m_t << "<entry>";
1430 for (const auto &type : pl.paramTypes())
1431 {
1432 std::visit(*this,type);
1433 }
1434 m_t << "</entry>";
1435 }
1436
1437 if (pl.parameters().empty())
1438 {
1439 m_t << "<entry></entry>\n";
1440 }
1441 else
1442 {
1443 m_t << "<entry>";
1444 int cnt = 0;
1445 for (const auto &param : pl.parameters())
1446 {
1447 if (cnt)
1448 {
1449 m_t << ", ";
1450 }
1451 std::visit(*this,param);
1452 cnt++;
1453 }
1454 m_t << "</entry>";
1455 }
1456 m_t << "<entry>";
1457 for (const auto &par : pl.paragraphs())
1458 {
1459 std::visit(*this,par);
1460 }
1461 m_t << "</entry>\n";
1462 m_t << " </row>\n";
1463}

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()()

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

Declaration at line 102 of file docbookvisitor.h, definition at line 1465 of file docbookvisitor.cpp.

1466{
1468 if (m_hide) return;
1469 if (x.title().isEmpty()) return;
1470 m_t << "<para><link linkend=\"_";
1471 m_t << stripPath(x.file()) << "_1" << x.anchor();
1472 m_t << "\">";
1473 filter(x.title());
1474 m_t << "</link>";
1475 m_t << " ";
1476 visitChildren(x);
1477 if (x.title().isEmpty()) return;
1478 m_t << "</para>";
1479}

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

operator()()

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

Declaration at line 103 of file docbookvisitor.h, definition at line 1481 of file docbookvisitor.cpp.

1482{
1484 if (m_hide) return;
1485 startLink(ref.file(),ref.anchor());
1486 visitChildren(ref);
1487 endLink();
1488 m_t << " ";
1489}

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

operator()()

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

Declaration at line 104 of file docbookvisitor.h, definition at line 1491 of file docbookvisitor.cpp.

1492{
1494 visitChildren(t);
1495}

References DB_VIS_C and visitChildren.

operator()()

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

Declaration at line 105 of file docbookvisitor.h, definition at line 1498 of file docbookvisitor.cpp.

1499{
1501 if (m_hide) return;
1502 m_t << "<blockquote>";
1503 visitChildren(q);
1504 m_t << "</blockquote>";
1505}

References DB_VIS_C, m_hide, m_t and visitChildren.

operator()()

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

Declaration at line 106 of file docbookvisitor.h, definition at line 1507 of file docbookvisitor.cpp.

1508{
1510 // TODO: to be implemented
1511}

Reference DB_VIS_C.

operator()()

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

Declaration at line 107 of file docbookvisitor.h, definition at line 1513 of file docbookvisitor.cpp.

1514{
1516 if (m_hide) return;
1517 visitChildren(b);
1518}

References DB_VIS_C, m_hide and visitChildren.

Public Member Functions

visitChildren()

template <class T>
void DocbookDocVisitor::visitChildren (const T & t)
inline

Private Member Functions

endDiaFile()

void DocbookDocVisitor::endDiaFile (bool hasCaption)

Declaration at line 125 of file docbookvisitor.h, definition at line 1654 of file docbookvisitor.cpp.

1654void DocbookDocVisitor::endDiaFile(bool hasCaption)
1655{
1657 if (m_hide) return;
1658 visitPostEnd(m_t, hasCaption);
1659 m_t << "</para>\n";
1660}

References DB_VIS_C, m_hide, m_t and visitPostEnd.

Referenced by operator().

endDotFile()

void DocbookDocVisitor::endDotFile (bool hasCaption)

Declaration at line 130 of file docbookvisitor.h, definition at line 1693 of file docbookvisitor.cpp.

1693void DocbookDocVisitor::endDotFile(bool hasCaption)
1694{
1696 if (m_hide) return;
1697 m_t << "\n";
1698 visitPostEnd(m_t, hasCaption);
1699 m_t << "</para>\n";
1700}

References DB_VIS_C, m_hide, m_t and visitPostEnd.

Referenced by operator().

endLink()

void DocbookDocVisitor::endLink ()

Declaration at line 116 of file docbookvisitor.h, definition at line 1539 of file docbookvisitor.cpp.

1540{
1542 m_t << "</link>";
1543}

References DB_VIS_C and m_t.

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

endMscFile()

void DocbookDocVisitor::endMscFile (bool hasCaption)

Declaration at line 120 of file docbookvisitor.h, definition at line 1616 of file docbookvisitor.cpp.

1616void DocbookDocVisitor::endMscFile(bool hasCaption)
1617{
1619 if (m_hide) return;
1620 visitPostEnd(m_t, hasCaption);
1621 m_t << "</para>\n";
1622}

References DB_VIS_C, m_hide, m_t and visitPostEnd.

Referenced by operator().

endPlantUmlFile()

void DocbookDocVisitor::endPlantUmlFile (bool hasCaption)

Declaration at line 136 of file docbookvisitor.h, definition at line 1588 of file docbookvisitor.cpp.

1589{
1591 if (m_hide) return;
1592 m_t << "\n";
1593 visitPostEnd(m_t, hasCaption);
1594 m_t << "</para>\n";
1595}

References DB_VIS_C, m_hide, m_t and visitPostEnd.

Referenced by operator().

filter()

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

Declaration at line 113 of file docbookvisitor.h, definition at line 1521 of file docbookvisitor.cpp.

1521void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1522{
1524 m_t << convertToDocBook(str, retainNewLine);
1525}

References convertToDocBook, DB_VIS_C and m_t.

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

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)

Declaration at line 122 of file docbookvisitor.h, definition at line 1635 of file docbookvisitor.cpp.

1636 const QCString &relPath,
1637 const QCString &width,
1638 const QCString &height,
1639 bool hasCaption,
1640 const DocNodeList &children,
1641 const QCString &srcFile,
1642 int srcLine
1643 )
1644{
1646 QCString baseName=makeBaseName(fileName);
1647 baseName.prepend("dia_");
1648 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1649 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1650 m_t << "<para>\n";
1651 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1652}

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)

Declaration at line 127 of file docbookvisitor.h, definition at line 1673 of file docbookvisitor.cpp.

1674 const QCString &relPath,
1675 const QCString &width,
1676 const QCString &height,
1677 bool hasCaption,
1678 const DocNodeList &children,
1679 const QCString &srcFile,
1680 int srcLine
1681 )
1682{
1684 QCString baseName=makeBaseName(fileName);
1685 baseName.prepend("dot_");
1686 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1688 writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1689 m_t << "<para>\n";
1690 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1691}

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)

Declaration at line 114 of file docbookvisitor.h, definition at line 1527 of file docbookvisitor.cpp.

1527void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1528{
1530 m_t << "<link linkend=\"_" << stripPath(file);
1531 if (!anchor.isEmpty())
1532 {
1533 if (!file.isEmpty()) m_t << "_1";
1534 m_t << anchor;
1535 }
1536 m_t << "\">";
1537}

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)

Declaration at line 117 of file docbookvisitor.h, definition at line 1597 of file docbookvisitor.cpp.

1598 const QCString &relPath,
1599 const QCString &width,
1600 const QCString &height,
1601 bool hasCaption,
1602 const DocNodeList &children,
1603 const QCString &srcFile,
1604 int srcLine
1605 )
1606{
1608 QCString baseName=makeBaseName(fileName);
1609 baseName.prepend("msc_");
1610 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1611 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1612 m_t << "<para>\n";
1613 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1614}

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)

Declaration at line 133 of file docbookvisitor.h, definition at line 1566 of file docbookvisitor.cpp.

1567 const QCString &relPath,
1568 const QCString &width,
1569 const QCString &height,
1570 bool hasCaption,
1571 const DocNodeList &children,
1572 const QCString &srcFile,
1573 int srcLine
1574 )
1575{
1577 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1578 std::string inBuf;
1579 readInputFile(fileName,inBuf);
1581 QCString(),inBuf.c_str(),PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1582 baseName=makeBaseName(baseName);
1584 m_t << "<para>\n";
1585 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1586}

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)

Declaration at line 145 of file docbookvisitor.h, definition at line 110 of file docbookvisitor.cpp.

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

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

visitPostEnd()

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

Declaration at line 144 of file docbookvisitor.h, definition at line 161 of file docbookvisitor.cpp.

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

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)

Declaration at line 137 of file docbookvisitor.h, definition at line 118 of file docbookvisitor.cpp.

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

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)

Declaration at line 126 of file docbookvisitor.h, definition at line 1624 of file docbookvisitor.cpp.

1625{
1627 QCString shortName = makeShortName(baseName);
1628 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1629 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1630 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1633}

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)

writeMscFile()

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

Declaration at line 121 of file docbookvisitor.h, definition at line 1545 of file docbookvisitor.cpp.

1546{
1548 QCString shortName = makeShortName(baseName);
1549 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1550 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1551 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1554}

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 Attributes

m_bodySet

BoolStack DocbookDocVisitor::m_bodySet

Definition at line 156 of file docbookvisitor.h.

156 BoolStack m_bodySet; // it is possible to have tables without a header, needs to be an array as we can have tables in tables

Referenced by operator() and operator().

m_ci

OutputCodeList& DocbookDocVisitor::m_ci

Definition at line 150 of file docbookvisitor.h.

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

m_colCnt

int DocbookDocVisitor::m_colCnt = 0

Definition at line 155 of file docbookvisitor.h.

155 int m_colCnt = 0;

Referenced by operator() and operator().

m_enabled

BoolStack DocbookDocVisitor::m_enabled

Definition at line 153 of file docbookvisitor.h.

m_hide

m_insidePre

bool DocbookDocVisitor::m_insidePre = false

Definition at line 151 of file docbookvisitor.h.

151 bool m_insidePre = false;

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

m_langExt

QCString DocbookDocVisitor::m_langExt

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:


Generated via doxygen2docusaurus by Doxygen 1.14.0.