Doxygen
Loading...
Searching...
No Matches
docbookvisitor.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include "docbookvisitor.h"
17#include "docparser.h"
18#include "language.h"
19#include "doxygen.h"
20#include "outputgen.h"
21#include "docbookgen.h"
22#include "dot.h"
23#include "message.h"
24#include "util.h"
25#include "parserintf.h"
26#include "filename.h"
27#include "config.h"
28#include "filedef.h"
29#include "msc.h"
30#include "dia.h"
31#include "htmlentity.h"
32#include "emoji.h"
33#include "plantuml.h"
34#include "growbuf.h"
35#include "fileinfo.h"
36#include "portable.h"
37#include "codefragment.h"
38
39#if 0
40#define DB_VIS_C DB_VIS_C1(m_t)
41#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
42#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
43#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
44#else
45#define DB_VIS_C
46#define DB_VIS_C1(x)
47#define DB_VIS_C2(y)
48#define DB_VIS_C2a(x,y)
49#endif
50
51static QCString filterId(const QCString &s)
52{
53 if (s.isEmpty()) return s;
54 GrowBuf growBuf;
55 growBuf.clear();
56 const char *p=s.data();
57 char c=0;
58 while ((c=*p++))
59 {
60 switch (c)
61 {
62 case ':': growBuf.addStr("_1"); break;
63 default: growBuf.addChar(c); break;
64 }
65 }
66 growBuf.addChar(0);
67 return growBuf.get();
68}
69
70static bool supportedHtmlAttribute(const QCString &name)
71{
72 return (name=="align" ||
73 name=="bgcolor" ||
74 name=="border" ||
75 name=="cellpadding" ||
76 name=="cellspacing" ||
77 name=="class" ||
78 name=="frame" ||
79 name=="label" ||
80 name=="style" ||
81 name=="width" ||
82 name=="tabstyle" ||
83 name=="title");
84}
85
86static QCString makeShortName(const QCString &baseName)
87{
88 QCString result = baseName;
89 int i = result.findRev('/');
90 if (i!=-1)
91 {
92 result=result.mid(i+1);
93 }
94 return result;
95}
96
97static QCString makeBaseName(const QCString &name)
98{
99 QCString result = makeShortName(name);
100 int i = result.find('.');
101 if (i!=-1)
102 {
103 result=result.left(i);
104 }
105 return result;
106}
107
108
110{
111 for (const auto &n : children)
112 {
113 std::visit(*this,n);
114 }
115}
116
118 const DocNodeList &children,
119 bool hasCaption,
120 const QCString &name,
121 const QCString &width,
122 const QCString &height,
123 bool inlineImage)
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}
159
160void DocbookDocVisitor::visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage)
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}
177
179 : m_t(t), m_ci(ci),m_langExt(langExt)
180{
182 // m_t << "<section>\n";
183}
184
185//--------------------------------------
186// visitor functions for leaf nodes
187//--------------------------------------
188
190{
192 if (m_hide) return;
193 filter(w.word());
194}
195
197{
199 if (m_hide) return;
200 startLink(w.file(),w.anchor());
201 filter(w.word());
202 endLink();
203}
204
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}
218
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}
233
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}
248
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}
260
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}
269
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}
277
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}
329
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}
445
447{
449 if (m_hide) return;
450 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
451}
452
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}
515
517{
519 if (op.isFirst())
520 {
521 if (!m_hide)
522 {
523 m_t << "<programlisting linenumbering=\"unnumbered\">";
524 }
526 m_hide = TRUE;
527 }
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}
569
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}
584
586{
588 if (m_hide) return;
589 m_t << "<indexterm><primary>";
590 filter(ie.entry());
591 m_t << "</primary></indexterm>\n";
592}
593
595{
597 // m_t << "<simplesect/>";
598}
599
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}
608
609//--------------------------------------
610// visitor functions for compound nodes
611//--------------------------------------
612
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}
635
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}
656
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}
667
673
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}
884
886{
888 if (m_hide) return;
889 if (t.hasTitle()) m_t << "<title>";
890 visitChildren(t);
891 if (t.hasTitle()) m_t << "</title>";
892}
893
895{
897 if (m_hide) return;
898 m_t << "<itemizedlist>\n";
899 visitChildren(l);
900 m_t << "</itemizedlist>\n";
901}
902
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}
914
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}
929
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}
945
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}
1008
1010{
1012 if (m_hide) return;
1013 m_t << "<variablelist>\n";
1014 visitChildren(l);
1015 m_t << "</variablelist>\n";
1016}
1017
1019{
1021 if (m_hide) return;
1022 m_t << "<varlistentry><term>";
1023 visitChildren(dt);
1024 m_t << "</term></varlistentry>\n";
1025}
1026
1028{
1030 if (m_hide) return;
1031 m_t << "<listitem>";
1032 visitChildren(dd);
1033 m_t << "</listitem>\n";
1034}
1035
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}
1058
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}
1096
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}
1151
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}
1164
1166{
1168 if (m_hide) return;
1169 visitChildren(i);
1170}
1171
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}
1187
1189{
1191 if (m_hide) return;
1192 m_t << "<para><emphasis role=\"bold\">";
1193 visitChildren(s);
1194 m_t << "</emphasis></para>";
1195}
1196
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}
1212
1214{
1216 if (m_hide) return;
1217 m_t << "<formalpara><title>";
1218 visitChildren(h);
1219 m_t << "</title></formalpara>\n";
1220}
1221
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}
1246
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}
1256
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}
1266
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}
1276
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}
1286
1288{
1290 if (m_hide) return;
1291 startLink(lnk.file(),lnk.anchor());
1292 visitChildren(lnk);
1293 endLink();
1294}
1295
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}
1313
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}
1323
1325{
1327 if (m_hide) return;
1328 m_t << "<toc>\n";
1329 visitChildren(l);
1330 m_t << "</toc>\n";
1331}
1332
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 {
1342 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1343 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1344 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1345 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
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}
1375
1377{
1379 if (m_hide) return;
1380 m_t << " " << sep.chars() << " ";
1381}
1382
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}
1448
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}
1464
1466{
1468 if (m_hide) return;
1469 startLink(ref.file(),ref.anchor());
1470 visitChildren(ref);
1471 endLink();
1472 m_t << " ";
1473}
1474
1476{
1478 visitChildren(t);
1479}
1480
1481
1483{
1485 if (m_hide) return;
1486 m_t << "<blockquote>";
1487 visitChildren(q);
1488 m_t << "</blockquote>";
1489}
1490
1492{
1494 // TODO: to be implemented
1495}
1496
1498{
1500 if (m_hide) return;
1501 visitChildren(b);
1502}
1503
1504
1505void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1506{
1508 m_t << convertToDocBook(str, retainNewLine);
1509}
1510
1511void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
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}
1522
1524{
1526 m_t << "</link>";
1527}
1528
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}
1539
1541{
1543 QCString shortName = makeShortName(baseName);
1544 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1546 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1549}
1551 const QCString &relPath,
1552 const QCString &width,
1553 const QCString &height,
1554 bool hasCaption,
1555 const DocNodeList &children,
1556 const QCString &srcFile,
1557 int srcLine
1558 )
1559{
1561 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1562 std::string inBuf;
1563 readInputFile(fileName,inBuf);
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}
1571
1573{
1575 if (m_hide) return;
1576 m_t << "\n";
1577 visitPostEnd(m_t, hasCaption);
1578 m_t << "</para>\n";
1579}
1580
1582 const QCString &relPath,
1583 const QCString &width,
1584 const QCString &height,
1585 bool hasCaption,
1586 const DocNodeList &children,
1587 const QCString &srcFile,
1588 int srcLine
1589 )
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}
1599
1601{
1603 if (m_hide) return;
1604 visitPostEnd(m_t, hasCaption);
1605 m_t << "</para>\n";
1606}
1607
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}
1618
1620 const QCString &relPath,
1621 const QCString &width,
1622 const QCString &height,
1623 bool hasCaption,
1624 const DocNodeList &children,
1625 const QCString &srcFile,
1626 int srcLine
1627 )
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}
1637
1639{
1641 if (m_hide) return;
1642 visitPostEnd(m_t, hasCaption);
1643 m_t << "</para>\n";
1644}
1645
1647{
1649 QCString shortName = makeShortName(baseName);
1650 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1651 writeDotGraphFromFile(baseName+".dot",outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1652 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1655}
1656
1658 const QCString &relPath,
1659 const QCString &width,
1660 const QCString &height,
1661 bool hasCaption,
1662 const DocNodeList &children,
1663 const QCString &srcFile,
1664 int srcLine
1665 )
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}
1676
1678{
1680 if (m_hide) return;
1681 m_t << "\n";
1682 visitPostEnd(m_t, hasCaption);
1683 m_t << "</para>\n";
1684}
1685
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.
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
Node representing an anchor.
Definition docnode.h:228
QCString anchor() const
Definition docnode.h:231
QCString file() const
Definition docnode.h:232
Node representing an auto List.
Definition docnode.h:566
bool isEnumList() const
Definition docnode.h:575
Node representing an item of a auto list.
Definition docnode.h:590
int itemNumber() const
Definition docnode.h:593
Node representing a citation of some bibliographic reference.
Definition docnode.h:244
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:247
DocNodeList & children()
Definition docnode.h:142
Node representing a dia file.
Definition docnode.h:725
QCString relPath() const
Definition docnode.h:680
QCString height() const
Definition docnode.h:683
QCString srcFile() const
Definition docnode.h:685
QCString file() const
Definition docnode.h:679
int srcLine() const
Definition docnode.h:686
bool hasCaption() const
Definition docnode.h:681
QCString width() const
Definition docnode.h:682
Node representing a dot file.
Definition docnode.h:707
Node representing an emoji.
Definition docnode.h:336
int index() const
Definition docnode.h:340
QCString name() const
Definition docnode.h:339
Node representing an item of a cross-referenced list.
Definition docnode.h:524
QCString name() const
Definition docnode.h:527
bool isInline() const
Definition docnode.h:531
QCString relPath() const
Definition docnode.h:529
Node representing a Hypertext reference.
Definition docnode.h:817
QCString url() const
Definition docnode.h:824
QCString file() const
Definition docnode.h:825
Node representing a horizontal ruler.
Definition docnode.h:215
Node representing an HTML blockquote.
Definition docnode.h:1285
Node representing a HTML table caption.
Definition docnode.h:1222
QCString anchor() const
Definition docnode.h:1229
QCString file() const
Definition docnode.h:1228
Node representing a HTML table cell.
Definition docnode.h:1187
const HtmlAttribList & attribs() const
Definition docnode.h:1199
Node representing a HTML description data.
Definition docnode.h:1175
Node representing a Html description list.
Definition docnode.h:895
Node representing a Html description item.
Definition docnode.h:882
Node Html details.
Definition docnode.h:851
const DocNodeVariant * summary() const
Definition docnode.h:858
Node Html heading.
Definition docnode.h:867
Node representing a Html list.
Definition docnode.h:994
const HtmlAttribList & attribs() const
Definition docnode.h:1000
Type type() const
Definition docnode.h:999
Node representing a HTML list item.
Definition docnode.h:1159
const HtmlAttribList & attribs() const
Definition docnode.h:1164
Node representing a HTML table row.
Definition docnode.h:1240
bool isHeading() const
Definition docnode.cpp:1883
const HtmlAttribList & attribs() const
Definition docnode.h:1246
Node Html summary.
Definition docnode.h:838
Node representing a HTML table.
Definition docnode.h:1263
size_t numColumns() const
Definition docnode.h:1272
const DocNodeVariant * caption() const
Definition docnode.cpp:2029
Node representing an image.
Definition docnode.h:636
QCString relPath() const
Definition docnode.h:646
QCString name() const
Definition docnode.h:642
QCString height() const
Definition docnode.h:645
Type type() const
Definition docnode.h:641
QCString width() const
Definition docnode.h:644
@ DocBook
Definition docnode.h:638
bool isInlineImage() const
Definition docnode.h:648
bool hasCaption() const
Definition docnode.h:643
Node representing a include/dontinclude operator block.
Definition docnode.h:472
bool stripCodeComments() const
Definition docnode.h:501
bool isLast() const
Definition docnode.h:498
QCString includeFileName() const
Definition docnode.h:504
QCString text() const
Definition docnode.h:494
QCString context() const
Definition docnode.h:496
QCString exampleFile() const
Definition docnode.h:503
int line() const
Definition docnode.h:492
Type type() const
Definition docnode.h:480
bool isFirst() const
Definition docnode.h:497
bool showLineNo() const
Definition docnode.h:493
bool isExample() const
Definition docnode.h:502
Node representing an included text block from file.
Definition docnode.h:430
QCString blockId() const
Definition docnode.h:449
QCString extension() const
Definition docnode.h:445
bool stripCodeComments() const
Definition docnode.h:450
@ LatexInclude
Definition docnode.h:432
@ SnippetWithLines
Definition docnode.h:433
@ DontIncWithLines
Definition docnode.h:434
@ IncWithLines
Definition docnode.h:433
@ HtmlInclude
Definition docnode.h:432
@ VerbInclude
Definition docnode.h:432
@ DontInclude
Definition docnode.h:432
@ DocbookInclude
Definition docnode.h:434
Type type() const
Definition docnode.h:446
QCString exampleFile() const
Definition docnode.h:452
QCString text() const
Definition docnode.h:447
QCString file() const
Definition docnode.h:444
bool trimLeft() const
Definition docnode.h:454
bool isExample() const
Definition docnode.h:451
QCString context() const
Definition docnode.h:448
Node representing an entry in the index.
Definition docnode.h:547
QCString entry() const
Definition docnode.h:554
Node representing an internal section of documentation.
Definition docnode.h:963
Node representing an internal reference to some item.
Definition docnode.h:801
QCString file() const
Definition docnode.h:805
QCString anchor() const
Definition docnode.h:807
Node representing a line break.
Definition docnode.h:201
Node representing a word that can be linked to something.
Definition docnode.h:164
QCString file() const
Definition docnode.h:170
QCString word() const
Definition docnode.h:169
QCString anchor() const
Definition docnode.h:173
Node representing a msc file.
Definition docnode.h:716
DocNodeVariant * parent()
Definition docnode.h:89
Node representing an block of paragraphs.
Definition docnode.h:973
Node representing a paragraph in the documentation tree.
Definition docnode.h:1074
Node representing a parameter list.
Definition docnode.h:1119
const DocNodeList & parameters() const
Definition docnode.h:1123
const DocNodeList & paramTypes() const
Definition docnode.h:1124
DocParamSect::Direction direction() const
Definition docnode.h:1127
const DocNodeList & paragraphs() const
Definition docnode.h:1125
Node representing a parameter section.
Definition docnode.h:1047
bool hasInOutSpecifier() const
Definition docnode.h:1063
bool hasTypeSpecifier() const
Definition docnode.h:1064
Type type() const
Definition docnode.h:1062
Node representing a uml file.
Definition docnode.h:734
Node representing a reference to some item.
Definition docnode.h:772
QCString anchor() const
Definition docnode.h:779
QCString targetTitle() const
Definition docnode.h:780
bool isSubPage() const
Definition docnode.h:786
QCString file() const
Definition docnode.h:776
bool hasLinkText() const
Definition docnode.h:782
Root node of documentation tree.
Definition docnode.h:1307
Node representing a reference to a section.
Definition docnode.h:929
Node representing a list of section references.
Definition docnode.h:953
Node representing a normal section.
Definition docnode.h:908
QCString file() const
Definition docnode.h:916
QCString anchor() const
Definition docnode.h:914
const DocNodeVariant * title() const
Definition docnode.h:913
Node representing a separator.
Definition docnode.h:360
QCString chars() const
Definition docnode.h:364
Node representing a simple list.
Definition docnode.h:984
Node representing a simple list item.
Definition docnode.h:1147
const DocNodeVariant * paragraph() const
Definition docnode.h:1151
Node representing a simple section.
Definition docnode.h:1011
Type type() const
Definition docnode.h:1020
const DocNodeVariant * title() const
Definition docnode.h:1027
bool hasTitle() const
Definition docnode.cpp:2893
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1038
Node representing a style change.
Definition docnode.h:264
Style style() const
Definition docnode.h:302
bool enable() const
Definition docnode.h:304
Node representing a special symbol.
Definition docnode.h:323
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:327
Root node of a text fragment.
Definition docnode.h:1298
Node representing a simple section title.
Definition docnode.h:603
bool hasTitle() const
Definition docnode.h:608
Node representing a URL (or email address)
Definition docnode.h:187
QCString url() const
Definition docnode.h:191
bool isEmail() const
Definition docnode.h:192
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:371
QCString srcFile() const
Definition docnode.h:392
int srcLine() const
Definition docnode.h:393
QCString height() const
Definition docnode.h:387
bool hasCaption() const
Definition docnode.h:385
QCString language() const
Definition docnode.h:383
const DocNodeList & children() const
Definition docnode.h:390
bool isExample() const
Definition docnode.h:380
QCString context() const
Definition docnode.h:379
Type type() const
Definition docnode.h:377
QCString text() const
Definition docnode.h:378
QCString exampleFile() const
Definition docnode.h:381
QCString engine() const
Definition docnode.h:388
QCString relPath() const
Definition docnode.h:382
@ JavaDocLiteral
Definition docnode.h:373
QCString width() const
Definition docnode.h:386
Node representing a VHDL flow chart.
Definition docnode.h:743
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:349
QCString chars() const
Definition docnode.h:353
Node representing a word.
Definition docnode.h:152
QCString word() const
Definition docnode.h:155
Node representing an item of a cross-referenced list.
Definition docnode.h:615
QCString anchor() const
Definition docnode.h:619
QCString file() const
Definition docnode.h:618
QCString title() const
Definition docnode.h:620
void writeDotFile(const QCString &fileName, const DocVerbatim &s)
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
void endDiaFile(bool hasCaption)
void operator()(const DocWord &)
void filter(const QCString &str, const bool retainNewLine=false)
void visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
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)
OutputCodeList & m_ci
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 startDotFile(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 visitCaption(const DocNodeList &children)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void endDotFile(bool hasCaption)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void endMscFile(bool hasCaption)
DocbookDocVisitor(TextStream &t, OutputCodeList &ci, const QCString &langExt)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:106
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
A model of a file symbol.
Definition filedef.h:99
virtual QCString absFilePath() const =0
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
std::string fileName() const
Definition fileinfo.cpp:118
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:137
Class representing a string buffer optimized for growing.
Definition growbuf.h:28
void addChar(char c)
Definition growbuf.h:69
void addStr(const QCString &s)
Definition growbuf.h:72
void clear()
Definition growbuf.h:68
char * get()
Definition growbuf.h:114
bool empty() const
checks whether the container is empty
Definition growvector.h:140
T & front()
access the first element
Definition growvector.h:130
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.
Class representing a list of different code generators.
Definition outputlist.h:164
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
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:127
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:537
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:133
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
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
QCString left(size_t len) const
Definition qcstring.h:214
Text streaming class that buffers data.
Definition textstream.h:36
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static QCString filterId(const QCString &s)
#define DB_VIS_C
static QCString makeBaseName(const QCString &name)
static QCString makeShortName(const QCString &baseName)
static bool supportedHtmlAttribute(const QCString &name)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:267
Translator * theTranslator
Definition language.cpp:71
#define err(fmt,...)
Definition message.h:84
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:156
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:672
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549
QCString stripPath(const QCString &s)
Definition util.cpp:5292
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
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5567
QCString getDotImageExtension()
Definition util.cpp:6617
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:6170
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5591
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3262
A bunch of utility functions.