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 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1224 startDotFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1225 visitChildren(df);
1226 endDotFile(df.hasCaption());
1227}
1228
1230{
1232 if (m_hide) return;
1233 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1234 startMscFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1235 visitChildren(df);
1236 endMscFile(df.hasCaption());
1237}
1238
1240{
1242 if (m_hide) return;
1243 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1244 startDiaFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1245 visitChildren(df);
1246 endDiaFile(df.hasCaption());
1247}
1248
1250{
1252 if (m_hide) return;
1253 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1254 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1255 visitChildren(df);
1257}
1258
1260{
1262 if (m_hide) return;
1263 startLink(lnk.file(),lnk.anchor());
1264 visitChildren(lnk);
1265 endLink();
1266}
1267
1269{
1271 if (m_hide) return;
1272 if (ref.isSubPage())
1273 {
1274 startLink(QCString(),ref.anchor());
1275 }
1276 else
1277 {
1278 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1279 }
1280
1281 if (!ref.hasLinkText()) filter(ref.targetTitle());
1282 visitChildren(ref);
1283 if (!ref.file().isEmpty()) endLink();
1284}
1285
1287{
1289 if (m_hide) return;
1290 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1291 m_t << "<tocentry>";
1292 visitChildren(ref);
1293 m_t << "</tocentry>\n";
1294}
1295
1297{
1299 if (m_hide) return;
1300 m_t << "<toc>\n";
1301 visitChildren(l);
1302 m_t << "</toc>\n";
1303}
1304
1306{
1308 if (m_hide) return;
1309 m_t << "\n";
1310 m_t << " <formalpara>\n";
1311 m_t << " <title>\n";
1312 switch(s.type())
1313 {
1314 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1315 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1316 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1317 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1318 default:
1319 ASSERT(0);
1320 }
1321 m_t << "</title>\n";
1322 m_t << " <para>\n";
1323 m_t << " <table frame=\"all\">\n";
1324 int ncols = 2;
1325 if (s.type() == DocParamSect::Param)
1326 {
1327 bool hasInOutSpecs = s.hasInOutSpecifier();
1328 bool hasTypeSpecs = s.hasTypeSpecifier();
1329 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1330 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1331 }
1332 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1333 for (int i = 1; i <= ncols; i++)
1334 {
1335 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1336 else m_t << " <colspec colwidth=\"1*\"/>\n";
1337 }
1338 m_t << " <tbody>\n";
1339 visitChildren(s);
1340 m_t << " </tbody>\n";
1341 m_t << " </tgroup>\n";
1342 m_t << " </table>\n";
1343 m_t << " </para>\n";
1344 m_t << " </formalpara>\n";
1345 m_t << " ";
1346}
1347
1349{
1351 if (m_hide) return;
1352 m_t << " " << sep.chars() << " ";
1353}
1354
1356{
1358 if (m_hide) return;
1359 m_t << " <row>\n";
1360
1361 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1362 if (sect && sect->hasInOutSpecifier())
1363 {
1364 m_t << "<entry>";
1366 {
1367 if (pl.direction()==DocParamSect::In)
1368 {
1369 m_t << "in";
1370 }
1371 else if (pl.direction()==DocParamSect::Out)
1372 {
1373 m_t << "out";
1374 }
1375 else if (pl.direction()==DocParamSect::InOut)
1376 {
1377 m_t << "in,out";
1378 }
1379 }
1380 m_t << "</entry>";
1381 }
1382
1383 if (sect && sect->hasTypeSpecifier())
1384 {
1385 m_t << "<entry>";
1386 for (const auto &type : pl.paramTypes())
1387 {
1388 std::visit(*this,type);
1389 }
1390 m_t << "</entry>";
1391 }
1392
1393 if (pl.parameters().empty())
1394 {
1395 m_t << "<entry></entry>\n";
1396 }
1397 else
1398 {
1399 m_t << "<entry>";
1400 int cnt = 0;
1401 for (const auto &param : pl.parameters())
1402 {
1403 if (cnt)
1404 {
1405 m_t << ", ";
1406 }
1407 std::visit(*this,param);
1408 cnt++;
1409 }
1410 m_t << "</entry>";
1411 }
1412 m_t << "<entry>";
1413 for (const auto &par : pl.paragraphs())
1414 {
1415 std::visit(*this,par);
1416 }
1417 m_t << "</entry>\n";
1418 m_t << " </row>\n";
1419}
1420
1422{
1424 if (m_hide) return;
1425 if (x.title().isEmpty()) return;
1426 m_t << "<para><link linkend=\"_";
1427 m_t << stripPath(x.file()) << "_1" << x.anchor();
1428 m_t << "\">";
1429 filter(x.title());
1430 m_t << "</link>";
1431 m_t << " ";
1432 visitChildren(x);
1433 if (x.title().isEmpty()) return;
1434 m_t << "</para>";
1435}
1436
1438{
1440 if (m_hide) return;
1441 startLink(ref.file(),ref.anchor());
1442 visitChildren(ref);
1443 endLink();
1444 m_t << " ";
1445}
1446
1448{
1450 visitChildren(t);
1451}
1452
1453
1455{
1457 if (m_hide) return;
1458 m_t << "<blockquote>";
1459 visitChildren(q);
1460 m_t << "</blockquote>";
1461}
1462
1464{
1466 // TODO: to be implemented
1467}
1468
1470{
1472 if (m_hide) return;
1473 visitChildren(b);
1474}
1475
1476
1477void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1478{
1480 m_t << convertToDocBook(str, retainNewLine);
1481}
1482
1483void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1484{
1486 m_t << "<link linkend=\"_" << stripPath(file);
1487 if (!anchor.isEmpty())
1488 {
1489 if (!file.isEmpty()) m_t << "_1";
1490 m_t << anchor;
1491 }
1492 m_t << "\">";
1493}
1494
1496{
1498 m_t << "</link>";
1499}
1500
1501void DocbookDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1502{
1504 QCString shortName = makeBaseName(fileName,".msc");
1505 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1506 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1507 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1510}
1511
1513{
1515 QCString shortName = stripPath(baseName);
1516 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1518 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1521}
1522
1524 const QCString &relPath,
1525 const QCString &width,
1526 const QCString &height,
1527 bool hasCaption,
1528 const DocNodeList &children,
1529 const QCString &srcFile,
1530 int srcLine
1531 )
1532{
1534 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1535 std::string inBuf;
1536 readInputFile(fileName,inBuf);
1537 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(outDir,
1538 QCString(),inBuf,PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1539 bool first = true;
1540 for (const auto &bName: baseNameVector)
1541 {
1542 QCString baseName=makeBaseName(bName,".pu");
1544 if (!first) endPlantUmlFile(hasCaption);
1545 first = false;
1546 m_t << "<para>\n";
1547 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1548 }
1549}
1550
1552{
1554 if (m_hide) return;
1555 m_t << "\n";
1556 visitPostEnd(m_t, hasCaption);
1557 m_t << "</para>\n";
1558}
1559
1561 const QCString &relPath,
1562 const QCString &width,
1563 const QCString &height,
1564 bool hasCaption,
1565 const DocNodeList &children,
1566 const QCString &srcFile,
1567 int srcLine
1568 )
1569{
1571 QCString baseName=makeBaseName(fileName,".msc");
1572 baseName.prepend("msc_");
1573 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1574 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1575 m_t << "<para>\n";
1576 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1577}
1578
1580{
1582 if (m_hide) return;
1583 visitPostEnd(m_t, hasCaption);
1584 m_t << "</para>\n";
1585}
1586
1588{
1590 QCString shortName = stripPath(baseName);
1591 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1592 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1593 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1596}
1597
1599 const QCString &relPath,
1600 const QCString &width,
1601 const QCString &height,
1602 bool hasCaption,
1603 const DocNodeList &children,
1604 const QCString &srcFile,
1605 int srcLine
1606 )
1607{
1609 QCString baseName=makeBaseName(fileName,".dia");
1610 baseName.prepend("dia_");
1611 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1612 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1613 m_t << "<para>\n";
1614 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1615}
1616
1618{
1620 if (m_hide) return;
1621 visitPostEnd(m_t, hasCaption);
1622 m_t << "</para>\n";
1623}
1624
1625void DocbookDocVisitor::writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1626{
1628 QCString shortName = makeBaseName(fileName,".dot");
1629 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1630 if (newFile) writeDotGraphFromFile(fileName,outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1631 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1634}
1635
1637 const QCString &relPath,
1638 const QCString &width,
1639 const QCString &height,
1640 bool hasCaption,
1641 const DocNodeList &children,
1642 const QCString &srcFile,
1643 int srcLine
1644 )
1645{
1647 QCString baseName=makeBaseName(fileName,".dot");
1648 baseName.prepend("dot_");
1649 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1650 QCString imgExt = getDotImageExtension();
1651 writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1652 m_t << "<para>\n";
1653 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1654}
1655
1657{
1659 if (m_hide) return;
1660 m_t << "\n";
1661 visitPostEnd(m_t, hasCaption);
1662 m_t << "</para>\n";
1663}
1664
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:959
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:1291
Node representing a HTML table caption.
Definition docnode.h:1228
QCString anchor() const
Definition docnode.h:1235
QCString file() const
Definition docnode.h:1234
Node representing a HTML table cell.
Definition docnode.h:1193
const HtmlAttribList & attribs() const
Definition docnode.h:1205
Node representing a HTML description data.
Definition docnode.h:1181
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:1165
const HtmlAttribList & attribs() const
Definition docnode.h:1170
Node representing a HTML table row.
Definition docnode.h:1246
bool isHeading() const
Definition docnode.cpp:1941
const HtmlAttribList & attribs() const
Definition docnode.h:1252
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1269
size_t numColumns() const
Definition docnode.h:1278
const DocNodeVariant * caption() const
Definition docnode.cpp:2189
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:1125
const DocNodeList & parameters() const
Definition docnode.h:1129
const DocNodeList & paramTypes() const
Definition docnode.h:1130
DocParamSect::Direction direction() const
Definition docnode.h:1133
const DocNodeList & paragraphs() const
Definition docnode.h:1131
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:1313
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:1153
const DocNodeVariant * paragraph() const
Definition docnode.h:1157
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:3077
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:1304
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 visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
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 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 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:268
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:6928
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5164
QCString stripPath(const QCString &s)
Definition util.cpp:4902
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:5503
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5182
QCString getDotImageExtension()
Definition util.cpp:6258
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4918
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:5826
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5206
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:2844
A bunch of utility functions.