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 "fileinfo.h"
35#include "portable.h"
36#include "codefragment.h"
37#include "cite.h"
38#include "md5.h"
39
40#if 0
41#define DB_VIS_C DB_VIS_C1(m_t)
42#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
43#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
44#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
45#else
46#define DB_VIS_C
47#define DB_VIS_C1(x)
48#define DB_VIS_C2(y)
49#define DB_VIS_C2a(x,y)
50#endif
51
52static QCString filterId(const QCString &s)
53{
54 if (s.isEmpty()) return s;
55 QCString result;
56 result.reserve(s.length()+8);
57 const char *p=s.data();
58 char c=0;
59 while ((c=*p++))
60 {
61 switch (c)
62 {
63 case ':': result+="_1"; break;
64 default: result+=c; break;
65 }
66 }
67 return result;
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
87{
88 for (const auto &n : children)
89 {
90 std::visit(*this,n);
91 }
92}
93
95 const DocNodeList &children,
96 bool hasCaption,
97 const QCString &name,
98 const QCString &width,
99 const QCString &height,
100 bool inlineImage)
101{
102 if (hasCaption && !inlineImage)
103 {
104 t << " <figure>\n";
105 t << " <title>\n";
106 visitCaption(children);
107 t << " </title>\n";
108 }
109 else
110 {
111 t << " <informalfigure>\n";
112 }
113 t << " <mediaobject>\n";
114 t << " <imageobject>\n";
115 t << " <imagedata";
116 if (!width.isEmpty())
117 {
118 t << " width=\"" << convertToDocBook(width) << "\"";
119 }
120 else
121 {
122 if (!height.isEmpty() && !inlineImage) t << " width=\"50%\"";
123 }
124 if (!height.isEmpty())
125 {
126 t << " depth=\"" << convertToDocBook(height) << "\"";
127 }
128 t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">";
129 t << "</imagedata>\n";
130 t << " </imageobject>\n";
131 if (hasCaption && !inlineImage)
132 {
133 t << " <!--\n"; // Needed for general formatting with title for other formats
134 }
135}
136
137void DocbookDocVisitor::visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage)
138{
139 t << "\n";
140 if (hasCaption && !inlineImage)
141 {
142 t << " -->\n"; // Needed for general formatting with title for other formats
143 }
144 t << " </mediaobject>\n";
145 if (hasCaption && !inlineImage)
146 {
147 t << " </figure>\n";
148 }
149 else
150 {
151 t << " </informalfigure>\n";
152 }
153}
154
156 : m_t(t), m_ci(ci),m_langExt(langExt)
157{
159 // m_t << "<section>\n";
160}
161
162//--------------------------------------
163// visitor functions for leaf nodes
164//--------------------------------------
165
167{
169 if (m_hide) return;
170 filter(w.word());
171}
172
174{
176 if (m_hide) return;
177 startLink(w.file(),w.anchor());
178 filter(w.word());
179 endLink();
180}
181
183{
185 if (m_hide) return;
186 if (m_insidePre)
187 {
188 m_t << w.chars();
189 }
190 else
191 {
192 m_t << " ";
193 }
194}
195
197{
199 if (m_hide) return;
200 const char *res = HtmlEntityMapper::instance().docbook(s.symbol());
201 if (res)
202 {
203 m_t << res;
204 }
205 else
206 {
207 err("DocBook: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
208 }
209}
210
212{
214 if (m_hide) return;
215 const char *res = EmojiEntityMapper::instance().unicode(s.index());
216 if (res)
217 {
218 m_t << res;
219 }
220 else
221 {
222 m_t << s.name();
223 }
224}
225
227{
229 if (m_hide) return;
230 m_t << "<link xlink:href=\"";
231 if (u.isEmail()) m_t << "mailto:";
232 filter(u.url());
233 m_t << "\">";
234 filter(u.url());
235 m_t << "</link>";
236}
237
239{
241 if (m_hide) return;
242 m_t << "<?linebreak?>";
243 // gives nicer results but gives problems as it is not allowed in <pare> and also problems with dblatex
244 // m_t << "\n" << "<sbr/>\n";
245}
246
248{
250 if (m_hide) return;
251 m_t << "<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
252 m_t << "</entry></row></tbody></tgroup></informaltable>\n";
253}
254
256{
258 if (m_hide) return;
259 switch (s.style())
260 {
262 if (s.enable()) m_t << "<emphasis role=\"bold\">"; else m_t << "</emphasis>";
263 break;
265 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
266 break;
270 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
271 break;
273 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
274 break;
276 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
277 break;
279 if (s.enable()) m_t << "<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
280 else m_t << "</entry></row></tbody></tgroup></informaltable>";
281 break;
283 if (s.enable())
284 {
285 m_t << "<literallayout>";
287 }
288 else
289 {
290 m_t << "</literallayout>";
292 }
293 break;
294 /* There is no equivalent Docbook tag for rendering Small text */
295 case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
296 /* HTML only */
297 case DocStyleChange::Cite: break;
298 case DocStyleChange::S: break;
299 case DocStyleChange::Strike: break;
300 case DocStyleChange::Del: break;
301 case DocStyleChange::Underline: break;
302 case DocStyleChange::Ins: break;
303 case DocStyleChange::Div: /* HTML only */ break;
304 case DocStyleChange::Span: /* HTML only */ break;
305 }
306}
307
309{
311 if (m_hide) return;
312 QCString lang = m_langExt;
313 if (!s.language().isEmpty()) // explicit language setting
314 {
315 lang = s.language();
316 }
317 SrcLangExt langExt = getLanguageFromCodeLang(lang);
318 switch(s.type())
319 {
321 m_t << "<literallayout><computeroutput>";
323 s.text(),
324 langExt,
325 Config_getBool(STRIP_CODE_COMMENTS),
327 .setExample(s.isExample(),s.exampleFile())
328 );
329 m_t << "</computeroutput></literallayout>";
330 break;
332 m_t << "<literallayout><computeroutput>";
333 filter(s.text());
334 m_t << "</computeroutput></literallayout>";
335 break;
337 filter(s.text(), true);
338 break;
340 m_t << "<computeroutput>";
341 filter(s.text(), true);
342 m_t << "</computeroutput>";
343 break;
345 break;
347 break;
349 break;
351 break;
353 break;
355 m_t << s.text();
356 break;
357 case DocVerbatim::Dot:
358 {
359 m_t << "<para>\n";
360 bool exists = false;
361 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_", // baseName
362 ".dot", // extension
363 s.text(), // contents
364 exists);
365 if (!fileName.isEmpty())
366 {
367 writeDotFile(fileName, s, !exists);
368 }
369 m_t << "</para>\n";
370 }
371 break;
372 case DocVerbatim::Msc:
373 {
374 m_t << "<para>\n";
375 bool exists = false;
376 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_", // baseName
377 ".msc", // extension
378 "msc {"+s.text()+"}", // contents
379 exists);
380 if (!fileName.isEmpty())
381 {
382 writeMscFile(fileName,s,!exists);
383 }
384 m_t << "</para>\n";
385 }
386 break;
388 {
389 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
390 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(docbookOutput,
392 s.engine(),s.srcFile(),s.srcLine(),true);
393 for (const auto &baseName: baseNameVector)
394 {
395 m_t << "<para>\n";
396 writePlantUMLFile(baseName,s);
397 m_t << "</para>\n";
398 }
399 }
400 break;
401 }
402}
403
405{
407 if (m_hide) return;
408 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
409}
410
412{
414 if (m_hide) return;
416 switch(inc.type())
417 {
419 {
420 m_t << "<literallayout><computeroutput>";
421 FileInfo cfi( inc.file().str() );
422 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
424 inc.text(),
425 langExt,
426 inc.stripCodeComments(),
428 .setExample(inc.isExample(),inc.exampleFile())
429 .setFileDef(fd.get())
430 );
431 m_t << "</computeroutput></literallayout>";
432 }
433 break;
435 m_t << "<literallayout><computeroutput>";
437 inc.text(),
438 langExt,
439 inc.stripCodeComments(),
441 .setExample(inc.isExample(),inc.exampleFile())
442 );
443 m_t << "</computeroutput></literallayout>";
444 break;
452 break;
454 m_t << inc.text();
455 break;
457 m_t << "<literallayout>";
458 filter(inc.text());
459 m_t << "</literallayout>";
460 break;
463 m_t << "<literallayout><computeroutput>";
465 inc.file(),
466 inc.blockId(),
467 inc.context(),
469 inc.trimLeft(),
471 );
472 m_t << "</computeroutput></literallayout>";
473 break;
474 }
475}
476
478{
480 if (op.isFirst())
481 {
482 if (!m_hide)
483 {
484 m_t << "<programlisting linenumbering=\"unnumbered\">";
485 }
487 m_hide = TRUE;
488 }
490 if (locLangExt.isEmpty()) locLangExt = m_langExt;
491 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
492 if (op.type()!=DocIncOperator::Skip)
493 {
494 m_hide = popHidden();
495 if (!m_hide)
496 {
497 std::unique_ptr<FileDef> fd;
498 if (!op.includeFileName().isEmpty())
499 {
500 FileInfo cfi( op.includeFileName().str() );
501 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
502 }
503
504 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
505 op.text(),langExt,
508 .setExample(op.isExample(), op.exampleFile())
509 .setFileDef(fd.get())
510 .setStartLine(op.line())
512 );
513 }
515 m_hide=TRUE;
516 }
517 if (op.isLast())
518 {
519 m_hide = popHidden();
520 if (!m_hide) m_t << "</programlisting>";
521 }
522 else
523 {
524 if (!m_hide) m_t << "\n";
525 }
526}
527
529{
531 if (m_hide) return;
532
533 if (f.isInline()) m_t << "<inlinemediaobject>\n";
534 else m_t << " <mediaobject>\n";
535 m_t << " <imageobject>\n";
536 m_t << " <imagedata ";
537 m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.relPath() << f.name() << ".png\"/>\n";
538 m_t << " </imageobject>\n";
539 if (f.isInline()) m_t << "</inlinemediaobject>\n";
540 else m_t << " </mediaobject>\n";
541}
542
544{
546 if (m_hide) return;
547 m_t << "<indexterm><primary>";
548 filter(ie.entry());
549 m_t << "</primary></indexterm>\n";
550}
551
553{
555 // m_t << "<simplesect/>";
556}
557
559{
561 if (m_hide) return;
562 auto opt = cite.option();
563 if (!cite.file().isEmpty())
564 {
565 if (!opt.noCite()) startLink(cite.file(),filterId(cite.anchor()));
566
567 filter(cite.getText());
568
569 if (!opt.noCite()) endLink();
570 }
571 else
572 {
573 if (!opt.noPar()) filter("[");
574 filter(cite.target());
575 if (!opt.noPar()) filter("]");
576
577 }
578
579}
580
581//--------------------------------------
582// visitor functions for compound nodes
583//--------------------------------------
584
586{
588 if (m_hide) return;
589 if (l.isEnumList())
590 {
591 m_t << "<orderedlist>\n";
592 }
593 else
594 {
595 m_t << "<itemizedlist>\n";
596 }
597 visitChildren(l);
598 if (l.isEnumList())
599 {
600 m_t << "</orderedlist>\n";
601 }
602 else
603 {
604 m_t << "</itemizedlist>\n";
605 }
606}
607
609{
611 if (m_hide) return;
612 switch (li.itemNumber())
613 {
614 case DocAutoList::Unchecked: // unchecked
615 m_t << "<listitem override=\"unchecked\">";
616 break;
617 case DocAutoList::Checked_x: // checked with x
618 case DocAutoList::Checked_X: // checked with X
619 m_t << "<listitem override=\"checked\">";
620 break;
621 default:
622 m_t << "<listitem>";
623 break;
624 }
625 visitChildren(li);
626 m_t << "</listitem>";
627}
628
630{
632 if (m_hide) return;
633 m_t << "\n";
634 m_t << "<para>";
635 visitChildren(p);
636 m_t << "</para>";
637 m_t << "\n";
638}
639
645
647{
649 if (m_hide) return;
650 switch(s.type())
651 {
653 if (m_insidePre)
654 {
655 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
656 }
657 else
658 {
659 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
660 }
661 break;
663 if (m_insidePre)
664 {
665 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
666 }
667 else
668 {
669 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
670 }
671 break;
673 if (m_insidePre)
674 {
675 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
676 }
677 else
678 {
679 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
680 }
681 break;
683 if (m_insidePre)
684 {
685 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
686 }
687 else
688 {
689 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
690 }
691 break;
693 if (m_insidePre)
694 {
695 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
696 }
697 else
698 {
699 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
700 }
701 break;
703 if (m_insidePre)
704 {
705 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
706 }
707 else
708 {
709 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
710 }
711 break;
713 if (m_insidePre)
714 {
715 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
716 }
717 else
718 {
719 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
720 }
721 break;
723 if (m_insidePre)
724 {
725 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
726 }
727 else
728 {
729 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
730 }
731 break;
733 if (m_insidePre)
734 {
735 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
736 }
737 else
738 {
739 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
740 }
741 break;
743 if (m_insidePre)
744 {
745 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
746 }
747 else
748 {
749 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
750 }
751 break;
753 if (m_insidePre)
754 {
755 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
756 }
757 else
758 {
759 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
760 }
761 break;
763 if (m_insidePre)
764 {
765 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
766 }
767 else
768 {
769 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
770 }
771 break;
773 if (m_insidePre)
774 {
775 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
776 }
777 else
778 {
779 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
780 }
781 break;
783 // <remark> is miising the <title> possibility
784 if (m_insidePre)
785 {
786 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
787 }
788 else
789 {
790 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
791 }
792 break;
794 if (m_insidePre)
795 {
796 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
797 }
798 else
799 {
800 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
801 }
802 break;
804 if (m_insidePre)
805 {
806 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
807 }
808 else
809 {
810 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
811 }
812 break;
816 if (s.hasTitle())
817 m_t << "<formalpara>\n";
818 else
819 m_t << "<para>\n";
820 break;
821 }
822
823 if (s.title())
824 {
825 std::visit(*this,*s.title());
826 }
827 visitChildren(s);
828
829 switch(s.type())
830 {
834 if (s.hasTitle())
835 m_t << "</formalpara>\n";
836 else
837 m_t << "</para>\n";
838 break;
840 m_t << "</note>\n";
841 break;
843 m_t << "</caution>\n";
844 break;
846 m_t << "</important>\n";
847 break;
849 m_t << "</warning>\n";
850 break;
851 default:
852 m_t << "</formalpara>\n";
853 break;
854 }
855}
856
858{
860 if (m_hide) return;
861 if (t.hasTitle()) m_t << "<title>";
862 visitChildren(t);
863 if (t.hasTitle()) m_t << "</title>";
864}
865
867{
869 if (m_hide) return;
870 m_t << "<itemizedlist>\n";
871 visitChildren(l);
872 m_t << "</itemizedlist>\n";
873}
874
876{
878 if (m_hide) return;
879 m_t << "<listitem>";
880 if (li.paragraph())
881 {
882 visit(*this,*li.paragraph());
883 }
884 m_t << "</listitem>\n";
885}
886
888{
890 if (m_hide) return;
891 m_t << "<section xml:id=\"_" << stripPath(s.file());
892 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
893 m_t << "\">\n";
894 if (s.title())
895 {
896 std::visit(*this,*s.title());
897 }
898 visitChildren(s);
899 m_t << "</section>\n";
900}
901
903{
905 if (m_hide) return;
906 if (s.children().empty()) return;
907 // opening tag for ordered list will be handled in DocHtmlListItem
908 // due to (re-)numbering possibilities
909 if (s.type()!=DocHtmlList::Ordered)
910 m_t << "<itemizedlist>\n";
911 visitChildren(s);
912 if (s.type()==DocHtmlList::Ordered)
913 m_t << "</orderedlist>\n";
914 else
915 m_t << "</itemizedlist>\n";
916}
917
919{
921 if (m_hide) return;
922 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
923 if (l->type()==DocHtmlList::Ordered)
924 {
925 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
926 int value = 0;
927 QCString type;
928 for (const auto &opt : s.attribs())
929 {
930 if (opt.name=="value")
931 {
932 bool ok = false;
933 int val = opt.value.toInt(&ok);
934 if (ok) value = val;
935 }
936 }
937
938 if (value>0 || isFirst)
939 {
940 for (const auto &opt : l->attribs())
941 {
942 if (opt.name=="type")
943 {
944 if (opt.value=="1")
945 type = " numeration=\"arabic\"";
946 else if (opt.value=="a")
947 type = " numeration=\"loweralpha\"";
948 else if (opt.value=="A")
949 type = " numeration=\"upperalpha\"";
950 else if (opt.value=="i")
951 type = " numeration=\"lowerroman\"";
952 else if (opt.value=="I")
953 type = " numeration=\"upperroman\"";
954 }
955 else if (value==0 && opt.name=="start")
956 {
957 bool ok = false;
958 int val = opt.value.toInt(&ok);
959 if (ok) value = val;
960 }
961 }
962 }
963
964 if (value>0 && !isFirst)
965 {
966 m_t << "</orderedlist>\n";
967 }
968 if (value>0 || isFirst)
969 {
970 m_t << "<orderedlist";
971 if (!type.isEmpty()) m_t << type.data();
972 if (value>0) m_t << " startingnumber=\"" << value << "\"";
973 m_t << ">\n";
974 }
975 }
976 m_t << "<listitem>\n";
977 visitChildren(s);
978 m_t << "</listitem>\n";
979}
980
982{
984 if (m_hide) return;
985 m_t << "<variablelist>\n";
986 visitChildren(l);
987 m_t << "</variablelist>\n";
988}
989
991{
993 if (m_hide) return;
994 m_t << "<varlistentry><term>";
995 visitChildren(dt);
996 m_t << "</term></varlistentry>\n";
997}
998
1000{
1002 if (m_hide) return;
1003 m_t << "<listitem>";
1004 visitChildren(dd);
1005 m_t << "</listitem>\n";
1006}
1007
1009{
1011 m_bodySet.push(false);
1012 if (m_hide) return;
1013 m_t << "<informaltable frame=\"all\">\n";
1014 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1015 for (uint32_t i = 0; i <t.numColumns(); i++)
1016 {
1017 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1018 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1019 }
1020 if (t.caption())
1021 {
1022 std::visit(*this,*t.caption());
1023 }
1024 visitChildren(t);
1025 if (m_bodySet.top()) m_t << " </tbody>\n";
1026 m_bodySet.pop();
1027 m_t << " </tgroup>\n";
1028 m_t << "</informaltable>\n";
1029}
1030
1032{
1034 m_colCnt = 0;
1035 if (m_hide) return;
1036
1037 if (tr.isHeading())
1038 {
1039 if (m_bodySet.top()) m_t << "</tbody>\n";
1040 m_bodySet.top() = false;
1041 m_t << "<thead>\n";
1042 }
1043 else if (!m_bodySet.top())
1044 {
1045 m_bodySet.top() = true;
1046 m_t << "<tbody>\n";
1047 }
1048
1049 m_t << " <row ";
1050
1051 for (const auto &opt : tr.attribs())
1052 {
1053 if (supportedHtmlAttribute(opt.name))
1054 {
1055 // process supported attributes only
1056 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1057 }
1058 }
1059 m_t << ">\n";
1060 visitChildren(tr);
1061 m_t << "</row>\n";
1062 if (tr.isHeading())
1063 {
1064 m_t << "</thead><tbody>\n";
1065 m_bodySet.top() = true;
1066 }
1067}
1068
1070{
1072 m_colCnt++;
1073 if (m_hide) return;
1074 m_t << "<entry";
1075
1076 for (const auto &opt : c.attribs())
1077 {
1078 if (opt.name=="colspan")
1079 {
1080 m_t << " namest='c" << m_colCnt << "'";
1081 int cols = opt.value.toInt();
1082 m_colCnt += (cols - 1);
1083 m_t << " nameend='c" << m_colCnt << "'";
1084 }
1085 else if (opt.name=="rowspan")
1086 {
1087 int extraRows = opt.value.toInt() - 1;
1088 m_t << " morerows='" << extraRows << "'";
1089 }
1090 else if (opt.name=="class")
1091 {
1092 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1093 {
1094 if (opt.value.endsWith("Right"))
1095 {
1096 m_t << " align='right'";
1097 }
1098 else if (opt.value.endsWith("Left"))
1099 {
1100 m_t << " align='left'";
1101 }
1102 else if (opt.value.endsWith("Center"))
1103 {
1104 m_t << " align='center'";
1105 }
1106 // skip 'markdownTable*' value ending with "None"
1107 }
1108 else
1109 {
1110 m_t << " class='" << convertToDocBook(opt.value) << "'";
1111 }
1112 }
1113 else if (supportedHtmlAttribute(opt.name))
1114 {
1115 // process supported attributes only
1116 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1117 }
1118 }
1119 m_t << ">";
1120 visitChildren(c);
1121 m_t << "</entry>";
1122}
1123
1125{
1127 if (m_hide) return;
1128 m_t << "<caption>";
1129 if (!c.file().isEmpty())
1130 {
1131 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1132 }
1133 visitChildren(c);
1134 m_t << "</caption>\n";
1135}
1136
1138{
1140 if (m_hide) return;
1141 visitChildren(i);
1142}
1143
1145{
1147 if (m_hide) return;
1148 if (href.url().at(0) != '#')
1149 {
1150 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1151 }
1152 else
1153 {
1154 startLink(href.file(),filterId(href.url().mid(1)));
1155 }
1156 visitChildren(href);
1157 m_t << "</link>";
1158}
1159
1161{
1163 if (m_hide) return;
1164 m_t << "<para><emphasis role=\"bold\">";
1165 visitChildren(s);
1166 m_t << "</emphasis></para>";
1167}
1168
1170{
1172 if (m_hide) return;
1173 m_t << "\n";
1174 auto summary = d.summary();
1175 if (summary)
1176 {
1177 std::visit(*this,*summary);
1178 }
1179 m_t << "<para>";
1180 visitChildren(d);
1181 m_t << "</para>";
1182 m_t << "\n";
1183}
1184
1186{
1188 if (m_hide) return;
1189 m_t << "<formalpara><title>";
1190 visitChildren(h);
1191 m_t << "</title></formalpara>\n";
1192}
1193
1195{
1197 if (img.type()==DocImage::DocBook)
1198 {
1199 if (m_hide) return;
1200 m_t << "\n";
1201 QCString baseName=stripPath(img.name());
1202 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1203 visitChildren(img);
1205 QCString file;
1206 bool ambig = false;
1207 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1208 if (fd)
1209 {
1210 file=fd->absFilePath();
1211 }
1212 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1213 }
1214 else // skip other formats
1215 {
1216 }
1217}
1218
1220{
1222 if (m_hide) return;
1223 bool exists = false;
1224 std::string inBuf;
1225 if (readInputFile(df.file(),inBuf))
1226 {
1227 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1228 ".dot", // extension
1229 inBuf, // contents
1230 exists);
1231 if (!fileName.isEmpty())
1232 {
1233 startDotFile(fileName,df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine(),!exists);
1234 visitChildren(df);
1235 endDotFile(df.hasCaption());
1236 }
1237 }
1238}
1239
1241{
1243 if (m_hide) return;
1244 bool exists = false;
1245 std::string inBuf;
1246 if (readInputFile(df.file(),inBuf))
1247 {
1248 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1249 ".msc", // extension
1250 inBuf, // contents
1251 exists);
1252 if (!fileName.isEmpty())
1253 {
1254 startMscFile(fileName,df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine(),!exists);
1255 visitChildren(df);
1256 endMscFile(df.hasCaption());
1257 }
1258 }
1259}
1260
1262{
1264 if (m_hide) return;
1265 bool exists = false;
1266 std::string inBuf;
1267 if (readInputFile(df.file(),inBuf))
1268 {
1269 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1270 ".dia", // extension
1271 inBuf, // contents
1272 exists);
1273 if (!fileName.isEmpty())
1274 {
1275 startDiaFile(fileName,df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine(),!exists);
1276 visitChildren(df);
1277 endDiaFile(df.hasCaption());
1278 }
1279 }
1280}
1281
1283{
1285 if (m_hide) return;
1286 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1287 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1288 visitChildren(df);
1290}
1291
1293{
1295 if (m_hide) return;
1296 startLink(lnk.file(),lnk.anchor());
1297 visitChildren(lnk);
1298 endLink();
1299}
1300
1302{
1304 if (m_hide) return;
1305 if (ref.isSubPage())
1306 {
1307 startLink(QCString(),ref.anchor());
1308 }
1309 else
1310 {
1311 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1312 }
1313
1314 if (!ref.hasLinkText()) filter(ref.targetTitle());
1315 visitChildren(ref);
1316 if (!ref.file().isEmpty()) endLink();
1317}
1318
1320{
1322 if (m_hide) return;
1323 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1324 m_t << "<tocentry>";
1325 visitChildren(ref);
1326 m_t << "</tocentry>\n";
1327}
1328
1330{
1332 if (m_hide) return;
1333 m_t << "<toc>\n";
1334 visitChildren(l);
1335 m_t << "</toc>\n";
1336}
1337
1339{
1341 if (m_hide) return;
1342 m_t << "\n";
1343 m_t << " <formalpara>\n";
1344 m_t << " <title>\n";
1345 switch(s.type())
1346 {
1347 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1348 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1349 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1350 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1351 default:
1352 ASSERT(0);
1353 }
1354 m_t << "</title>\n";
1355 m_t << " <para>\n";
1356 m_t << " <table frame=\"all\">\n";
1357 int ncols = 2;
1358 if (s.type() == DocParamSect::Param)
1359 {
1360 bool hasInOutSpecs = s.hasInOutSpecifier();
1361 bool hasTypeSpecs = s.hasTypeSpecifier();
1362 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1363 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1364 }
1365 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1366 for (int i = 1; i <= ncols; i++)
1367 {
1368 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1369 else m_t << " <colspec colwidth=\"1*\"/>\n";
1370 }
1371 m_t << " <tbody>\n";
1372 visitChildren(s);
1373 m_t << " </tbody>\n";
1374 m_t << " </tgroup>\n";
1375 m_t << " </table>\n";
1376 m_t << " </para>\n";
1377 m_t << " </formalpara>\n";
1378 m_t << " ";
1379}
1380
1382{
1384 if (m_hide) return;
1385 m_t << " " << sep.chars() << " ";
1386}
1387
1389{
1391 if (m_hide) return;
1392 m_t << " <row>\n";
1393
1394 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1395 if (sect && sect->hasInOutSpecifier())
1396 {
1397 m_t << "<entry>";
1399 {
1400 if (pl.direction()==DocParamSect::In)
1401 {
1402 m_t << "in";
1403 }
1404 else if (pl.direction()==DocParamSect::Out)
1405 {
1406 m_t << "out";
1407 }
1408 else if (pl.direction()==DocParamSect::InOut)
1409 {
1410 m_t << "in,out";
1411 }
1412 }
1413 m_t << "</entry>";
1414 }
1415
1416 if (sect && sect->hasTypeSpecifier())
1417 {
1418 m_t << "<entry>";
1419 for (const auto &type : pl.paramTypes())
1420 {
1421 std::visit(*this,type);
1422 }
1423 m_t << "</entry>";
1424 }
1425
1426 if (pl.parameters().empty())
1427 {
1428 m_t << "<entry></entry>\n";
1429 }
1430 else
1431 {
1432 m_t << "<entry>";
1433 int cnt = 0;
1434 for (const auto &param : pl.parameters())
1435 {
1436 if (cnt)
1437 {
1438 m_t << ", ";
1439 }
1440 std::visit(*this,param);
1441 cnt++;
1442 }
1443 m_t << "</entry>";
1444 }
1445 m_t << "<entry>";
1446 for (const auto &par : pl.paragraphs())
1447 {
1448 std::visit(*this,par);
1449 }
1450 m_t << "</entry>\n";
1451 m_t << " </row>\n";
1452}
1453
1455{
1457 if (m_hide) return;
1458 if (x.title().isEmpty()) return;
1459 m_t << "<para><link linkend=\"_";
1460 m_t << stripPath(x.file()) << "_1" << x.anchor();
1461 m_t << "\">";
1462 filter(x.title());
1463 m_t << "</link>";
1464 m_t << " ";
1465 visitChildren(x);
1466 if (x.title().isEmpty()) return;
1467 m_t << "</para>";
1468}
1469
1471{
1473 if (m_hide) return;
1474 startLink(ref.file(),ref.anchor());
1475 visitChildren(ref);
1476 endLink();
1477 m_t << " ";
1478}
1479
1481{
1483 visitChildren(t);
1484}
1485
1486
1488{
1490 if (m_hide) return;
1491 m_t << "<blockquote>";
1492 visitChildren(q);
1493 m_t << "</blockquote>";
1494}
1495
1497{
1499 // TODO: to be implemented
1500}
1501
1503{
1505 if (m_hide) return;
1506 visitChildren(b);
1507}
1508
1509
1510void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1511{
1513 m_t << convertToDocBook(str, retainNewLine);
1514}
1515
1516void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1517{
1519 m_t << "<link linkend=\"_" << stripPath(file);
1520 if (!anchor.isEmpty())
1521 {
1522 if (!file.isEmpty()) m_t << "_1";
1523 m_t << anchor;
1524 }
1525 m_t << "\">";
1526}
1527
1529{
1531 m_t << "</link>";
1532}
1533
1534void DocbookDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1535{
1537 QCString shortName = makeBaseName(fileName,".msc");
1538 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1539 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1540 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1543}
1544
1546{
1548 QCString shortName = stripPath(baseName);
1549 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1551 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1554}
1555
1557 const QCString &relPath,
1558 const QCString &width,
1559 const QCString &height,
1560 bool hasCaption,
1561 const DocNodeList &children,
1562 const QCString &srcFile,
1563 int srcLine
1564 )
1565{
1567 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1568 std::string inBuf;
1569 readInputFile(fileName,inBuf);
1570 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(outDir,
1571 QCString(),inBuf,PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1572 bool first = true;
1573 for (const auto &bName: baseNameVector)
1574 {
1575 QCString baseName=makeBaseName(bName,".pu");
1577 if (!first) endPlantUmlFile(hasCaption);
1578 first = false;
1579 m_t << "<para>\n";
1580 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1581 }
1582}
1583
1585{
1587 if (m_hide) return;
1588 m_t << "\n";
1589 visitPostEnd(m_t, hasCaption);
1590 m_t << "</para>\n";
1591}
1592
1594 const QCString &relPath,
1595 const QCString &width,
1596 const QCString &height,
1597 bool hasCaption,
1598 const DocNodeList &children,
1599 const QCString &srcFile,
1600 int srcLine, bool newFile
1601 )
1602{
1604 QCString baseName=makeBaseName(fileName,".msc");
1605 baseName.prepend("msc_");
1606 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1607 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1608 m_t << "<para>\n";
1609 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1610}
1611
1613{
1615 if (m_hide) return;
1616 visitPostEnd(m_t, hasCaption);
1617 m_t << "</para>\n";
1618}
1619
1621{
1623 QCString shortName = stripPath(baseName);
1624 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1625 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1626 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1629}
1630
1632 const QCString &relPath,
1633 const QCString &width,
1634 const QCString &height,
1635 bool hasCaption,
1636 const DocNodeList &children,
1637 const QCString &srcFile,
1638 int srcLine, bool newFile
1639 )
1640{
1642 QCString baseName=makeBaseName(fileName,".dia");
1643 baseName.prepend("dia_");
1644 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1645 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1646 m_t << "<para>\n";
1647 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1648}
1649
1651{
1653 if (m_hide) return;
1654 visitPostEnd(m_t, hasCaption);
1655 m_t << "</para>\n";
1656}
1657
1658void DocbookDocVisitor::writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1659{
1661 QCString shortName = makeBaseName(fileName,".dot");
1662 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1663 if (newFile) writeDotGraphFromFile(fileName,outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1664 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1667}
1668
1670 const QCString &relPath,
1671 const QCString &width,
1672 const QCString &height,
1673 bool hasCaption,
1674 const DocNodeList &children,
1675 const QCString &srcFile,
1676 int srcLine, bool newFile
1677 )
1678{
1680 QCString baseName=makeBaseName(fileName,".dot");
1681 baseName.prepend("dot_");
1682 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1683 QCString imgExt = getDotImageExtension();
1684 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1685 m_t << "<para>\n";
1686 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1687}
1688
1690{
1692 if (m_hide) return;
1693 m_t << "\n";
1694 visitPostEnd(m_t, hasCaption);
1695 m_t << "</para>\n";
1696}
1697
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, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Node representing an anchor.
Definition docnode.h:229
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
QCString getText() const
Definition docnode.cpp:972
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString file() const
Definition docnode.h:248
DocNodeList & children()
Definition docnode.h:143
Node representing a dia file.
Definition docnode.h:731
QCString relPath() const
Definition docnode.h:686
QCString height() const
Definition docnode.h:689
QCString srcFile() const
Definition docnode.h:691
QCString file() const
Definition docnode.h:685
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
QCString width() const
Definition docnode.h:688
Node representing a dot file.
Definition docnode.h:713
Node representing an emoji.
Definition docnode.h:341
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
Node representing an item of a cross-referenced list.
Definition docnode.h:529
QCString name() const
Definition docnode.h:532
bool isInline() const
Definition docnode.h:536
QCString relPath() const
Definition docnode.h:534
Node representing a Hypertext reference.
Definition docnode.h:823
QCString url() const
Definition docnode.h:830
QCString file() const
Definition docnode.h:831
Node representing a horizontal ruler.
Definition docnode.h:216
Node representing an HTML blockquote.
Definition docnode.h:1289
Node representing a HTML table caption.
Definition docnode.h:1226
QCString anchor() const
Definition docnode.h:1233
QCString file() const
Definition docnode.h:1232
Node representing a HTML table cell.
Definition docnode.h:1191
const HtmlAttribList & attribs() const
Definition docnode.h:1203
Node representing a HTML description data.
Definition docnode.h:1179
Node representing a Html description list.
Definition docnode.h:901
Node representing a Html description item.
Definition docnode.h:888
Node Html details.
Definition docnode.h:857
const DocNodeVariant * summary() const
Definition docnode.h:864
Node Html heading.
Definition docnode.h:873
Node representing a Html list.
Definition docnode.h:1000
const HtmlAttribList & attribs() const
Definition docnode.h:1006
Type type() const
Definition docnode.h:1005
Node representing a HTML list item.
Definition docnode.h:1163
const HtmlAttribList & attribs() const
Definition docnode.h:1168
Node representing a HTML table row.
Definition docnode.h:1244
bool isHeading() const
Definition docnode.cpp:1954
const HtmlAttribList & attribs() const
Definition docnode.h:1250
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1267
size_t numColumns() const
Definition docnode.h:1276
const DocNodeVariant * caption() const
Definition docnode.cpp:2202
Node representing an image.
Definition docnode.h:642
QCString relPath() const
Definition docnode.h:652
QCString name() const
Definition docnode.h:648
QCString height() const
Definition docnode.h:651
Type type() const
Definition docnode.h:647
QCString width() const
Definition docnode.h:650
@ DocBook
Definition docnode.h:644
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
Node representing a include/dontinclude operator block.
Definition docnode.h:477
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
QCString includeFileName() const
Definition docnode.h:509
QCString text() const
Definition docnode.h:499
QCString context() const
Definition docnode.h:501
QCString exampleFile() const
Definition docnode.h:508
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
Node representing an included text block from file.
Definition docnode.h:435
QCString blockId() const
Definition docnode.h:454
QCString extension() const
Definition docnode.h:450
bool stripCodeComments() const
Definition docnode.h:455
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
Type type() const
Definition docnode.h:451
QCString exampleFile() const
Definition docnode.h:457
QCString text() const
Definition docnode.h:452
QCString file() const
Definition docnode.h:449
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
QCString context() const
Definition docnode.h:453
Node representing an entry in the index.
Definition docnode.h:552
QCString entry() const
Definition docnode.h:559
Node representing an internal section of documentation.
Definition docnode.h:969
Node representing an internal reference to some item.
Definition docnode.h:807
QCString file() const
Definition docnode.h:811
QCString anchor() const
Definition docnode.h:813
Node representing a line break.
Definition docnode.h:202
Node representing a word that can be linked to something.
Definition docnode.h:165
QCString file() const
Definition docnode.h:171
QCString word() const
Definition docnode.h:170
QCString anchor() const
Definition docnode.h:174
Node representing a msc file.
Definition docnode.h:722
DocNodeVariant * parent()
Definition docnode.h:90
Node representing an block of paragraphs.
Definition docnode.h:979
Node representing a paragraph in the documentation tree.
Definition docnode.h:1080
Node representing a parameter list.
Definition docnode.h:1123
const DocNodeList & parameters() const
Definition docnode.h:1127
const DocNodeList & paramTypes() const
Definition docnode.h:1128
DocParamSect::Direction direction() const
Definition docnode.h:1131
const DocNodeList & paragraphs() const
Definition docnode.h:1129
Node representing a parameter section.
Definition docnode.h:1053
bool hasInOutSpecifier() const
Definition docnode.h:1069
bool hasTypeSpecifier() const
Definition docnode.h:1070
Type type() const
Definition docnode.h:1068
Node representing a uml file.
Definition docnode.h:740
Node representing a reference to some item.
Definition docnode.h:778
QCString anchor() const
Definition docnode.h:785
QCString targetTitle() const
Definition docnode.h:786
bool isSubPage() const
Definition docnode.h:792
QCString file() const
Definition docnode.h:782
bool hasLinkText() const
Definition docnode.h:788
Root node of documentation tree.
Definition docnode.h:1311
Node representing a reference to a section.
Definition docnode.h:935
Node representing a list of section references.
Definition docnode.h:959
Node representing a normal section.
Definition docnode.h:914
QCString file() const
Definition docnode.h:922
QCString anchor() const
Definition docnode.h:920
const DocNodeVariant * title() const
Definition docnode.h:919
Node representing a separator.
Definition docnode.h:365
QCString chars() const
Definition docnode.h:369
Node representing a simple list.
Definition docnode.h:990
Node representing a simple list item.
Definition docnode.h:1151
const DocNodeVariant * paragraph() const
Definition docnode.h:1155
Node representing a simple section.
Definition docnode.h:1017
Type type() const
Definition docnode.h:1026
const DocNodeVariant * title() const
Definition docnode.h:1033
bool hasTitle() const
Definition docnode.cpp:3097
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1044
Node representing a style change.
Definition docnode.h:268
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309
Node representing a special symbol.
Definition docnode.h:328
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
Root node of a text fragment.
Definition docnode.h:1302
Node representing a simple section title.
Definition docnode.h:608
bool hasTitle() const
Definition docnode.h:613
Node representing a URL (or email address).
Definition docnode.h:188
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:376
QCString srcFile() const
Definition docnode.h:397
int srcLine() const
Definition docnode.h:398
QCString height() const
Definition docnode.h:392
bool hasCaption() const
Definition docnode.h:390
QCString language() const
Definition docnode.h:388
const DocNodeList & children() const
Definition docnode.h:395
bool isExample() const
Definition docnode.h:385
QCString context() const
Definition docnode.h:384
Type type() const
Definition docnode.h:382
QCString text() const
Definition docnode.h:383
QCString exampleFile() const
Definition docnode.h:386
QCString engine() const
Definition docnode.h:393
QCString relPath() const
Definition docnode.h:387
@ JavaDocLiteral
Definition docnode.h:378
QCString width() const
Definition docnode.h:391
Node representing a VHDL flow chart.
Definition docnode.h:749
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:354
QCString chars() const
Definition docnode.h:358
Node representing a word.
Definition docnode.h:153
QCString word() const
Definition docnode.h:156
Node representing an item of a cross-referenced list.
Definition docnode.h:621
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626
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 startDotFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
void startMscFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
OutputCodeList & m_ci
void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
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 startDiaFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:105
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
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:165
StringVector 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:31
static PlantumlManager & instance()
Definition plantuml.cpp:231
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202
This is an alternative implementation of QCString.
Definition qcstring.h:101
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
Definition qcstring.h:185
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:172
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 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:269
Translator * theTranslator
Definition language.cpp:71
#define err(fmt,...)
Definition message.h:127
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157
Portable versions of functions that are platform dependent.
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
Options to configure the code parser.
Definition parserintf.h:78
CodeParserOptions & setStartLine(int lineNr)
Definition parserintf.h:101
CodeParserOptions & setShowLineNumbers(bool enable)
Definition parserintf.h:113
CodeParserOptions & setFileDef(const FileDef *fd)
Definition parserintf.h:98
SrcLangExt
Definition types.h:207
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
Definition util.cpp:6959
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5191
QCString stripPath(const QCString &s)
Definition util.cpp:4929
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:5530
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5209
QCString getDotImageExtension()
Definition util.cpp:6289
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4945
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:5857
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5233
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:2871
A bunch of utility functions.