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
39#if 0
40#define DB_VIS_C DB_VIS_C1(m_t)
41#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
42#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
43#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
44#else
45#define DB_VIS_C
46#define DB_VIS_C1(x)
47#define DB_VIS_C2(y)
48#define DB_VIS_C2a(x,y)
49#endif
50
51static QCString filterId(const QCString &s)
52{
53 if (s.isEmpty()) return s;
54 QCString result;
55 result.reserve(s.length()+8);
56 const char *p=s.data();
57 char c=0;
58 while ((c=*p++))
59 {
60 switch (c)
61 {
62 case ':': result+="_1"; break;
63 default: result+=c; break;
64 }
65 }
66 return result;
67}
68
69static bool supportedHtmlAttribute(const QCString &name)
70{
71 return (name=="align" ||
72 name=="bgcolor" ||
73 name=="border" ||
74 name=="cellpadding" ||
75 name=="cellspacing" ||
76 name=="class" ||
77 name=="frame" ||
78 name=="label" ||
79 name=="style" ||
80 name=="width" ||
81 name=="tabstyle" ||
82 name=="title");
83}
84
85static QCString makeShortName(const QCString &baseName)
86{
87 QCString result = baseName;
88 int i = result.findRev('/');
89 if (i!=-1)
90 {
91 result=result.mid(i+1);
92 }
93 return result;
94}
95
96static QCString makeBaseName(const QCString &name)
97{
98 QCString result = makeShortName(name);
99 int i = result.find('.');
100 if (i!=-1)
101 {
102 result=result.left(i);
103 }
104 return result;
105}
106
107
109{
110 for (const auto &n : children)
111 {
112 std::visit(*this,n);
113 }
114}
115
117 const DocNodeList &children,
118 bool hasCaption,
119 const QCString &name,
120 const QCString &width,
121 const QCString &height,
122 bool inlineImage)
123{
124 if (hasCaption && !inlineImage)
125 {
126 t << " <figure>\n";
127 t << " <title>\n";
128 visitCaption(children);
129 t << " </title>\n";
130 }
131 else
132 {
133 t << " <informalfigure>\n";
134 }
135 t << " <mediaobject>\n";
136 t << " <imageobject>\n";
137 t << " <imagedata";
138 if (!width.isEmpty())
139 {
140 t << " width=\"" << convertToDocBook(width) << "\"";
141 }
142 else
143 {
144 if (!height.isEmpty() && !inlineImage) t << " width=\"50%\"";
145 }
146 if (!height.isEmpty())
147 {
148 t << " depth=\"" << convertToDocBook(height) << "\"";
149 }
150 t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">";
151 t << "</imagedata>\n";
152 t << " </imageobject>\n";
153 if (hasCaption && !inlineImage)
154 {
155 t << " <!--\n"; // Needed for general formatting with title for other formats
156 }
157}
158
159void DocbookDocVisitor::visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage)
160{
161 t << "\n";
162 if (hasCaption && !inlineImage)
163 {
164 t << " -->\n"; // Needed for general formatting with title for other formats
165 }
166 t << " </mediaobject>\n";
167 if (hasCaption && !inlineImage)
168 {
169 t << " </figure>\n";
170 }
171 else
172 {
173 t << " </informalfigure>\n";
174 }
175}
176
178 : m_t(t), m_ci(ci),m_langExt(langExt)
179{
181 // m_t << "<section>\n";
182}
183
184//--------------------------------------
185// visitor functions for leaf nodes
186//--------------------------------------
187
189{
191 if (m_hide) return;
192 filter(w.word());
193}
194
196{
198 if (m_hide) return;
199 startLink(w.file(),w.anchor());
200 filter(w.word());
201 endLink();
202}
203
205{
207 if (m_hide) return;
208 if (m_insidePre)
209 {
210 m_t << w.chars();
211 }
212 else
213 {
214 m_t << " ";
215 }
216}
217
219{
221 if (m_hide) return;
222 const char *res = HtmlEntityMapper::instance().docbook(s.symbol());
223 if (res)
224 {
225 m_t << res;
226 }
227 else
228 {
229 err("DocBook: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
230 }
231}
232
234{
236 if (m_hide) return;
237 const char *res = EmojiEntityMapper::instance().unicode(s.index());
238 if (res)
239 {
240 m_t << res;
241 }
242 else
243 {
244 m_t << s.name();
245 }
246}
247
249{
251 if (m_hide) return;
252 m_t << "<link xlink:href=\"";
253 if (u.isEmail()) m_t << "mailto:";
254 filter(u.url());
255 m_t << "\">";
256 filter(u.url());
257 m_t << "</link>";
258}
259
261{
263 if (m_hide) return;
264 m_t << "<?linebreak?>";
265 // gives nicer results but gives problems as it is not allowed in <pare> and also problems with dblatex
266 // m_t << "\n" << "<sbr/>\n";
267}
268
270{
272 if (m_hide) return;
273 m_t << "<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
274 m_t << "</entry></row></tbody></tgroup></informaltable>\n";
275}
276
278{
280 if (m_hide) return;
281 switch (s.style())
282 {
284 if (s.enable()) m_t << "<emphasis role=\"bold\">"; else m_t << "</emphasis>";
285 break;
287 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
288 break;
292 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
293 break;
295 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
296 break;
298 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
299 break;
301 if (s.enable()) m_t << "<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
302 else m_t << "</entry></row></tbody></tgroup></informaltable>";
303 break;
305 if (s.enable())
306 {
307 m_t << "<literallayout>";
309 }
310 else
311 {
312 m_t << "</literallayout>";
314 }
315 break;
316 /* There is no equivalent Docbook tag for rendering Small text */
317 case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
318 /* HTML only */
319 case DocStyleChange::Cite: break;
320 case DocStyleChange::S: break;
321 case DocStyleChange::Strike: break;
322 case DocStyleChange::Del: break;
323 case DocStyleChange::Underline: break;
324 case DocStyleChange::Ins: break;
325 case DocStyleChange::Div: /* HTML only */ break;
326 case DocStyleChange::Span: /* HTML only */ break;
327 }
328}
329
331{
333 if (m_hide) return;
334 QCString lang = m_langExt;
335 if (!s.language().isEmpty()) // explicit language setting
336 {
337 lang = s.language();
338 }
339 SrcLangExt langExt = getLanguageFromCodeLang(lang);
340 switch(s.type())
341 {
343 m_t << "<literallayout><computeroutput>";
345 s.text(),
346 langExt,
347 Config_getBool(STRIP_CODE_COMMENTS),
348 s.isExample(),
349 s.exampleFile());
350 m_t << "</computeroutput></literallayout>";
351 break;
353 m_t << "<literallayout><computeroutput>";
354 filter(s.text());
355 m_t << "</computeroutput></literallayout>";
356 break;
358 filter(s.text(), true);
359 break;
361 m_t << "<computeroutput>";
362 filter(s.text(), true);
363 m_t << "</computeroutput>";
364 break;
366 break;
368 break;
370 break;
372 break;
374 break;
376 m_t << s.text();
377 break;
378 case DocVerbatim::Dot:
379 {
380 static int dotindex = 1;
381 QCString baseName(4096, QCString::ExplicitSize);
382 QCString name;
383 QCString stext = s.text();
384 m_t << "<para>\n";
385 name.sprintf("%s%d", "dot_inline_dotgraph_", dotindex);
386 baseName.sprintf("%s%d",
387 qPrint(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_"),
388 dotindex++
389 );
390 QCString fileName = baseName+".dot";
391 std::ofstream file = Portable::openOutputStream(fileName);
392 if (!file.is_open())
393 {
394 err("Could not open file {} for writing\n",fileName);
395 }
396 file.write( stext.data(), stext.length() );
397 file.close();
398 writeDotFile(baseName, s);
399 m_t << "</para>\n";
400 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
401 }
402 break;
403 case DocVerbatim::Msc:
404 {
405 static int mscindex = 1;
406 QCString baseName(4096, QCString::ExplicitSize);
407 QCString name;
408 QCString stext = s.text();
409 m_t << "<para>\n";
410 name.sprintf("%s%d", "msc_inline_mscgraph_", mscindex);
411 baseName.sprintf("%s%d",
412 (Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_").data(),
413 mscindex++
414 );
415 QCString fileName = baseName+".msc";
416 std::ofstream file = Portable::openOutputStream(fileName);
417 if (!file.is_open())
418 {
419 err("Could not open file {} for writing\n",fileName);
420 }
421 QCString text = "msc {";
422 text+=stext;
423 text+="}";
424 file.write( text.data(), text.length() );
425 file.close();
426 writeMscFile(baseName,s);
427 m_t << "</para>\n";
428 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
429 }
430 break;
432 {
433 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
434 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(docbookOutput,
436 s.engine(),s.srcFile(),s.srcLine(),true);
437 for (const auto &baseName: baseNameVector)
438 {
439 m_t << "<para>\n";
440 writePlantUMLFile(baseName,s);
441 m_t << "</para>\n";
442 }
443 }
444 break;
445 }
446}
447
449{
451 if (m_hide) return;
452 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
453}
454
456{
458 if (m_hide) return;
460 switch(inc.type())
461 {
463 {
464 m_t << "<literallayout><computeroutput>";
465 FileInfo cfi( inc.file().str() );
466 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
468 inc.text(),
469 langExt,
470 inc.stripCodeComments(),
471 inc.isExample(),
472 inc.exampleFile(), fd.get());
473 m_t << "</computeroutput></literallayout>";
474 }
475 break;
477 m_t << "<literallayout><computeroutput>";
479 inc.text(),
480 langExt,
481 inc.stripCodeComments(),
482 inc.isExample(),
483 inc.exampleFile());
484 m_t << "</computeroutput></literallayout>";
485 break;
493 break;
495 m_t << inc.text();
496 break;
498 m_t << "<literallayout>";
499 filter(inc.text());
500 m_t << "</literallayout>";
501 break;
504 m_t << "<literallayout><computeroutput>";
506 inc.file(),
507 inc.blockId(),
508 inc.context(),
510 inc.trimLeft(),
512 );
513 m_t << "</computeroutput></literallayout>";
514 break;
515 }
516}
517
519{
521 if (op.isFirst())
522 {
523 if (!m_hide)
524 {
525 m_t << "<programlisting linenumbering=\"unnumbered\">";
526 }
528 m_hide = TRUE;
529 }
531 if (locLangExt.isEmpty()) locLangExt = m_langExt;
532 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
533 if (op.type()!=DocIncOperator::Skip)
534 {
535 m_hide = popHidden();
536 if (!m_hide)
537 {
538 std::unique_ptr<FileDef> fd;
539 if (!op.includeFileName().isEmpty())
540 {
541 FileInfo cfi( op.includeFileName().str() );
542 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
543 }
544
545 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
546 op.text(),langExt,
548 op.isExample(),
549 op.exampleFile(),
550 fd.get(), // fileDef
551 op.line(), // startLine
552 -1, // endLine
553 FALSE, // inline fragment
554 nullptr, // memberDef
555 op.showLineNo() // show line numbers
556 );
557 }
559 m_hide=TRUE;
560 }
561 if (op.isLast())
562 {
563 m_hide = popHidden();
564 if (!m_hide) m_t << "</programlisting>";
565 }
566 else
567 {
568 if (!m_hide) m_t << "\n";
569 }
570}
571
573{
575 if (m_hide) return;
576
577 if (f.isInline()) m_t << "<inlinemediaobject>\n";
578 else m_t << " <mediaobject>\n";
579 m_t << " <imageobject>\n";
580 m_t << " <imagedata ";
581 m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.relPath() << f.name() << ".png\"/>\n";
582 m_t << " </imageobject>\n";
583 if (f.isInline()) m_t << "</inlinemediaobject>\n";
584 else m_t << " </mediaobject>\n";
585}
586
588{
590 if (m_hide) return;
591 m_t << "<indexterm><primary>";
592 filter(ie.entry());
593 m_t << "</primary></indexterm>\n";
594}
595
597{
599 // m_t << "<simplesect/>";
600}
601
603{
605 if (m_hide) return;
606 auto opt = cite.option();
607 if (!cite.file().isEmpty())
608 {
609 if (!opt.noCite()) startLink(cite.file(),filterId(cite.anchor()));
610
611 filter(cite.getText());
612
613 if (!opt.noCite()) endLink();
614 }
615 else
616 {
617 if (!opt.noPar()) filter("[");
618 filter(cite.target());
619 if (!opt.noPar()) filter("]");
620
621 }
622
623}
624
625//--------------------------------------
626// visitor functions for compound nodes
627//--------------------------------------
628
630{
632 if (m_hide) return;
633 if (l.isEnumList())
634 {
635 m_t << "<orderedlist>\n";
636 }
637 else
638 {
639 m_t << "<itemizedlist>\n";
640 }
641 visitChildren(l);
642 if (l.isEnumList())
643 {
644 m_t << "</orderedlist>\n";
645 }
646 else
647 {
648 m_t << "</itemizedlist>\n";
649 }
650}
651
653{
655 if (m_hide) return;
656 switch (li.itemNumber())
657 {
658 case DocAutoList::Unchecked: // unchecked
659 m_t << "<listitem override=\"unchecked\">";
660 break;
661 case DocAutoList::Checked_x: // checked with x
662 case DocAutoList::Checked_X: // checked with X
663 m_t << "<listitem override=\"checked\">";
664 break;
665 default:
666 m_t << "<listitem>";
667 break;
668 }
669 visitChildren(li);
670 m_t << "</listitem>";
671}
672
674{
676 if (m_hide) return;
677 m_t << "\n";
678 m_t << "<para>";
679 visitChildren(p);
680 m_t << "</para>";
681 m_t << "\n";
682}
683
689
691{
693 if (m_hide) return;
694 switch(s.type())
695 {
697 if (m_insidePre)
698 {
699 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
700 }
701 else
702 {
703 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
704 }
705 break;
707 if (m_insidePre)
708 {
709 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
710 }
711 else
712 {
713 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
714 }
715 break;
717 if (m_insidePre)
718 {
719 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
720 }
721 else
722 {
723 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
724 }
725 break;
727 if (m_insidePre)
728 {
729 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
730 }
731 else
732 {
733 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
734 }
735 break;
737 if (m_insidePre)
738 {
739 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
740 }
741 else
742 {
743 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
744 }
745 break;
747 if (m_insidePre)
748 {
749 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
750 }
751 else
752 {
753 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
754 }
755 break;
757 if (m_insidePre)
758 {
759 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
760 }
761 else
762 {
763 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
764 }
765 break;
767 if (m_insidePre)
768 {
769 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
770 }
771 else
772 {
773 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
774 }
775 break;
777 if (m_insidePre)
778 {
779 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
780 }
781 else
782 {
783 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
784 }
785 break;
787 if (m_insidePre)
788 {
789 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
790 }
791 else
792 {
793 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
794 }
795 break;
797 if (m_insidePre)
798 {
799 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
800 }
801 else
802 {
803 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
804 }
805 break;
807 if (m_insidePre)
808 {
809 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
810 }
811 else
812 {
813 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
814 }
815 break;
817 if (m_insidePre)
818 {
819 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
820 }
821 else
822 {
823 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
824 }
825 break;
827 // <remark> is miising the <title> possibility
828 if (m_insidePre)
829 {
830 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
831 }
832 else
833 {
834 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
835 }
836 break;
838 if (m_insidePre)
839 {
840 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
841 }
842 else
843 {
844 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
845 }
846 break;
848 if (m_insidePre)
849 {
850 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
851 }
852 else
853 {
854 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
855 }
856 break;
860 if (s.hasTitle())
861 m_t << "<formalpara>\n";
862 else
863 m_t << "<para>\n";
864 break;
865 }
866
867 if (s.title())
868 {
869 std::visit(*this,*s.title());
870 }
871 visitChildren(s);
872
873 switch(s.type())
874 {
878 if (s.hasTitle())
879 m_t << "</formalpara>\n";
880 else
881 m_t << "</para>\n";
882 break;
884 m_t << "</note>\n";
885 break;
887 m_t << "</caution>\n";
888 break;
890 m_t << "</important>\n";
891 break;
893 m_t << "</warning>\n";
894 break;
895 default:
896 m_t << "</formalpara>\n";
897 break;
898 }
899}
900
902{
904 if (m_hide) return;
905 if (t.hasTitle()) m_t << "<title>";
906 visitChildren(t);
907 if (t.hasTitle()) m_t << "</title>";
908}
909
911{
913 if (m_hide) return;
914 m_t << "<itemizedlist>\n";
915 visitChildren(l);
916 m_t << "</itemizedlist>\n";
917}
918
920{
922 if (m_hide) return;
923 m_t << "<listitem>";
924 if (li.paragraph())
925 {
926 visit(*this,*li.paragraph());
927 }
928 m_t << "</listitem>\n";
929}
930
932{
934 if (m_hide) return;
935 m_t << "<section xml:id=\"_" << stripPath(s.file());
936 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
937 m_t << "\">\n";
938 if (s.title())
939 {
940 std::visit(*this,*s.title());
941 }
942 visitChildren(s);
943 m_t << "</section>\n";
944}
945
947{
949 if (m_hide) return;
950 if (s.children().empty()) return;
951 // opening tag for ordered list will be handled in DocHtmlListItem
952 // due to (re-)numbering possibilities
953 if (s.type()!=DocHtmlList::Ordered)
954 m_t << "<itemizedlist>\n";
955 visitChildren(s);
956 if (s.type()==DocHtmlList::Ordered)
957 m_t << "</orderedlist>\n";
958 else
959 m_t << "</itemizedlist>\n";
960}
961
963{
965 if (m_hide) return;
966 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
967 if (l->type()==DocHtmlList::Ordered)
968 {
969 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
970 int value = 0;
971 QCString type;
972 for (const auto &opt : s.attribs())
973 {
974 if (opt.name=="value")
975 {
976 bool ok = false;
977 int val = opt.value.toInt(&ok);
978 if (ok) value = val;
979 }
980 }
981
982 if (value>0 || isFirst)
983 {
984 for (const auto &opt : l->attribs())
985 {
986 if (opt.name=="type")
987 {
988 if (opt.value=="1")
989 type = " numeration=\"arabic\"";
990 else if (opt.value=="a")
991 type = " numeration=\"loweralpha\"";
992 else if (opt.value=="A")
993 type = " numeration=\"upperalpha\"";
994 else if (opt.value=="i")
995 type = " numeration=\"lowerroman\"";
996 else if (opt.value=="I")
997 type = " numeration=\"upperroman\"";
998 }
999 else if (value==0 && opt.name=="start")
1000 {
1001 bool ok = false;
1002 int val = opt.value.toInt(&ok);
1003 if (ok) value = val;
1004 }
1005 }
1006 }
1007
1008 if (value>0 && !isFirst)
1009 {
1010 m_t << "</orderedlist>\n";
1011 }
1012 if (value>0 || isFirst)
1013 {
1014 m_t << "<orderedlist";
1015 if (!type.isEmpty()) m_t << type.data();
1016 if (value>0) m_t << " startingnumber=\"" << value << "\"";
1017 m_t << ">\n";
1018 }
1019 }
1020 m_t << "<listitem>\n";
1021 visitChildren(s);
1022 m_t << "</listitem>\n";
1023}
1024
1026{
1028 if (m_hide) return;
1029 m_t << "<variablelist>\n";
1030 visitChildren(l);
1031 m_t << "</variablelist>\n";
1032}
1033
1035{
1037 if (m_hide) return;
1038 m_t << "<varlistentry><term>";
1039 visitChildren(dt);
1040 m_t << "</term></varlistentry>\n";
1041}
1042
1044{
1046 if (m_hide) return;
1047 m_t << "<listitem>";
1048 visitChildren(dd);
1049 m_t << "</listitem>\n";
1050}
1051
1053{
1055 m_bodySet.push(false);
1056 if (m_hide) return;
1057 m_t << "<informaltable frame=\"all\">\n";
1058 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1059 for (uint32_t i = 0; i <t.numColumns(); i++)
1060 {
1061 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1062 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1063 }
1064 if (t.caption())
1065 {
1066 std::visit(*this,*t.caption());
1067 }
1068 visitChildren(t);
1069 if (m_bodySet.top()) m_t << " </tbody>\n";
1070 m_bodySet.pop();
1071 m_t << " </tgroup>\n";
1072 m_t << "</informaltable>\n";
1073}
1074
1076{
1078 m_colCnt = 0;
1079 if (m_hide) return;
1080
1081 if (tr.isHeading())
1082 {
1083 if (m_bodySet.top()) m_t << "</tbody>\n";
1084 m_bodySet.top() = false;
1085 m_t << "<thead>\n";
1086 }
1087 else if (!m_bodySet.top())
1088 {
1089 m_bodySet.top() = true;
1090 m_t << "<tbody>\n";
1091 }
1092
1093 m_t << " <row ";
1094
1095 for (const auto &opt : tr.attribs())
1096 {
1097 if (supportedHtmlAttribute(opt.name))
1098 {
1099 // process supported attributes only
1100 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1101 }
1102 }
1103 m_t << ">\n";
1104 visitChildren(tr);
1105 m_t << "</row>\n";
1106 if (tr.isHeading())
1107 {
1108 m_t << "</thead><tbody>\n";
1109 m_bodySet.top() = true;
1110 }
1111}
1112
1114{
1116 m_colCnt++;
1117 if (m_hide) return;
1118 m_t << "<entry";
1119
1120 for (const auto &opt : c.attribs())
1121 {
1122 if (opt.name=="colspan")
1123 {
1124 m_t << " namest='c" << m_colCnt << "'";
1125 int cols = opt.value.toInt();
1126 m_colCnt += (cols - 1);
1127 m_t << " nameend='c" << m_colCnt << "'";
1128 }
1129 else if (opt.name=="rowspan")
1130 {
1131 int extraRows = opt.value.toInt() - 1;
1132 m_t << " morerows='" << extraRows << "'";
1133 }
1134 else if (opt.name=="class")
1135 {
1136 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1137 {
1138 if (opt.value.endsWith("Right"))
1139 {
1140 m_t << " align='right'";
1141 }
1142 else if (opt.value.endsWith("Left"))
1143 {
1144 m_t << " align='left'";
1145 }
1146 else if (opt.value.endsWith("Center"))
1147 {
1148 m_t << " align='center'";
1149 }
1150 // skip 'markdownTable*' value ending with "None"
1151 }
1152 else
1153 {
1154 m_t << " class='" << convertToDocBook(opt.value) << "'";
1155 }
1156 }
1157 else if (supportedHtmlAttribute(opt.name))
1158 {
1159 // process supported attributes only
1160 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1161 }
1162 }
1163 m_t << ">";
1164 visitChildren(c);
1165 m_t << "</entry>";
1166}
1167
1169{
1171 if (m_hide) return;
1172 m_t << "<caption>";
1173 if (!c.file().isEmpty())
1174 {
1175 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1176 }
1177 visitChildren(c);
1178 m_t << "</caption>\n";
1179}
1180
1182{
1184 if (m_hide) return;
1185 visitChildren(i);
1186}
1187
1189{
1191 if (m_hide) return;
1192 if (href.url().at(0) != '#')
1193 {
1194 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1195 }
1196 else
1197 {
1198 startLink(href.file(),filterId(href.url().mid(1)));
1199 }
1200 visitChildren(href);
1201 m_t << "</link>";
1202}
1203
1205{
1207 if (m_hide) return;
1208 m_t << "<para><emphasis role=\"bold\">";
1209 visitChildren(s);
1210 m_t << "</emphasis></para>";
1211}
1212
1214{
1216 if (m_hide) return;
1217 m_t << "\n";
1218 auto summary = d.summary();
1219 if (summary)
1220 {
1221 std::visit(*this,*summary);
1222 }
1223 m_t << "<para>";
1224 visitChildren(d);
1225 m_t << "</para>";
1226 m_t << "\n";
1227}
1228
1230{
1232 if (m_hide) return;
1233 m_t << "<formalpara><title>";
1234 visitChildren(h);
1235 m_t << "</title></formalpara>\n";
1236}
1237
1239{
1241 if (img.type()==DocImage::DocBook)
1242 {
1243 if (m_hide) return;
1244 m_t << "\n";
1245 QCString baseName=makeShortName(img.name());
1246 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1247 visitChildren(img);
1249 QCString file;
1250 bool ambig = false;
1251 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1252 if (fd)
1253 {
1254 file=fd->absFilePath();
1255 }
1256 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1257 }
1258 else // skip other formats
1259 {
1260 }
1261}
1262
1264{
1266 if (m_hide) return;
1267 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1268 startDotFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1269 visitChildren(df);
1270 endDotFile(df.hasCaption());
1271}
1272
1274{
1276 if (m_hide) return;
1277 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1278 startMscFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1279 visitChildren(df);
1280 endMscFile(df.hasCaption());
1281}
1282
1284{
1286 if (m_hide) return;
1287 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1288 startDiaFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1289 visitChildren(df);
1290 endDiaFile(df.hasCaption());
1291}
1292
1294{
1296 if (m_hide) return;
1297 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1298 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1299 visitChildren(df);
1301}
1302
1304{
1306 if (m_hide) return;
1307 startLink(lnk.file(),lnk.anchor());
1308 visitChildren(lnk);
1309 endLink();
1310}
1311
1313{
1315 if (m_hide) return;
1316 if (ref.isSubPage())
1317 {
1318 startLink(QCString(),ref.anchor());
1319 }
1320 else
1321 {
1322 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1323 }
1324
1325 if (!ref.hasLinkText()) filter(ref.targetTitle());
1326 visitChildren(ref);
1327 if (!ref.file().isEmpty()) endLink();
1328}
1329
1331{
1333 if (m_hide) return;
1334 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1335 m_t << "<tocentry>";
1336 visitChildren(ref);
1337 m_t << "</tocentry>\n";
1338}
1339
1341{
1343 if (m_hide) return;
1344 m_t << "<toc>\n";
1345 visitChildren(l);
1346 m_t << "</toc>\n";
1347}
1348
1350{
1352 if (m_hide) return;
1353 m_t << "\n";
1354 m_t << " <formalpara>\n";
1355 m_t << " <title>\n";
1356 switch(s.type())
1357 {
1358 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1359 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1360 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1361 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1362 default:
1363 ASSERT(0);
1364 }
1365 m_t << "</title>\n";
1366 m_t << " <para>\n";
1367 m_t << " <table frame=\"all\">\n";
1368 int ncols = 2;
1369 if (s.type() == DocParamSect::Param)
1370 {
1371 bool hasInOutSpecs = s.hasInOutSpecifier();
1372 bool hasTypeSpecs = s.hasTypeSpecifier();
1373 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1374 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1375 }
1376 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1377 for (int i = 1; i <= ncols; i++)
1378 {
1379 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1380 else m_t << " <colspec colwidth=\"1*\"/>\n";
1381 }
1382 m_t << " <tbody>\n";
1383 visitChildren(s);
1384 m_t << " </tbody>\n";
1385 m_t << " </tgroup>\n";
1386 m_t << " </table>\n";
1387 m_t << " </para>\n";
1388 m_t << " </formalpara>\n";
1389 m_t << " ";
1390}
1391
1393{
1395 if (m_hide) return;
1396 m_t << " " << sep.chars() << " ";
1397}
1398
1400{
1402 if (m_hide) return;
1403 m_t << " <row>\n";
1404
1405 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1406 if (sect && sect->hasInOutSpecifier())
1407 {
1408 m_t << "<entry>";
1410 {
1411 if (pl.direction()==DocParamSect::In)
1412 {
1413 m_t << "in";
1414 }
1415 else if (pl.direction()==DocParamSect::Out)
1416 {
1417 m_t << "out";
1418 }
1419 else if (pl.direction()==DocParamSect::InOut)
1420 {
1421 m_t << "in,out";
1422 }
1423 }
1424 m_t << "</entry>";
1425 }
1426
1427 if (sect && sect->hasTypeSpecifier())
1428 {
1429 m_t << "<entry>";
1430 for (const auto &type : pl.paramTypes())
1431 {
1432 std::visit(*this,type);
1433 }
1434 m_t << "</entry>";
1435 }
1436
1437 if (pl.parameters().empty())
1438 {
1439 m_t << "<entry></entry>\n";
1440 }
1441 else
1442 {
1443 m_t << "<entry>";
1444 int cnt = 0;
1445 for (const auto &param : pl.parameters())
1446 {
1447 if (cnt)
1448 {
1449 m_t << ", ";
1450 }
1451 std::visit(*this,param);
1452 cnt++;
1453 }
1454 m_t << "</entry>";
1455 }
1456 m_t << "<entry>";
1457 for (const auto &par : pl.paragraphs())
1458 {
1459 std::visit(*this,par);
1460 }
1461 m_t << "</entry>\n";
1462 m_t << " </row>\n";
1463}
1464
1466{
1468 if (m_hide) return;
1469 if (x.title().isEmpty()) return;
1470 m_t << "<para><link linkend=\"_";
1471 m_t << stripPath(x.file()) << "_1" << x.anchor();
1472 m_t << "\">";
1473 filter(x.title());
1474 m_t << "</link>";
1475 m_t << " ";
1476 visitChildren(x);
1477 if (x.title().isEmpty()) return;
1478 m_t << "</para>";
1479}
1480
1482{
1484 if (m_hide) return;
1485 startLink(ref.file(),ref.anchor());
1486 visitChildren(ref);
1487 endLink();
1488 m_t << " ";
1489}
1490
1492{
1494 visitChildren(t);
1495}
1496
1497
1499{
1501 if (m_hide) return;
1502 m_t << "<blockquote>";
1503 visitChildren(q);
1504 m_t << "</blockquote>";
1505}
1506
1508{
1510 // TODO: to be implemented
1511}
1512
1514{
1516 if (m_hide) return;
1517 visitChildren(b);
1518}
1519
1520
1521void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1522{
1524 m_t << convertToDocBook(str, retainNewLine);
1525}
1526
1527void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1528{
1530 m_t << "<link linkend=\"_" << stripPath(file);
1531 if (!anchor.isEmpty())
1532 {
1533 if (!file.isEmpty()) m_t << "_1";
1534 m_t << anchor;
1535 }
1536 m_t << "\">";
1537}
1538
1540{
1542 m_t << "</link>";
1543}
1544
1546{
1548 QCString shortName = makeShortName(baseName);
1549 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1550 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1551 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1554}
1555
1557{
1559 QCString shortName = makeShortName(baseName);
1560 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1562 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1565}
1567 const QCString &relPath,
1568 const QCString &width,
1569 const QCString &height,
1570 bool hasCaption,
1571 const DocNodeList &children,
1572 const QCString &srcFile,
1573 int srcLine
1574 )
1575{
1577 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1578 std::string inBuf;
1579 readInputFile(fileName,inBuf);
1580 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(outDir,
1581 QCString(),inBuf,PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1582 bool first = true;
1583 for (const auto &bName: baseNameVector)
1584 {
1585 QCString baseName=makeBaseName(bName);
1587 if (!first) endPlantUmlFile(hasCaption);
1588 first = false;
1589 m_t << "<para>\n";
1590 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1591 }
1592}
1593
1595{
1597 if (m_hide) return;
1598 m_t << "\n";
1599 visitPostEnd(m_t, hasCaption);
1600 m_t << "</para>\n";
1601}
1602
1604 const QCString &relPath,
1605 const QCString &width,
1606 const QCString &height,
1607 bool hasCaption,
1608 const DocNodeList &children,
1609 const QCString &srcFile,
1610 int srcLine
1611 )
1612{
1614 QCString baseName=makeBaseName(fileName);
1615 baseName.prepend("msc_");
1616 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1617 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1618 m_t << "<para>\n";
1619 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1620}
1621
1623{
1625 if (m_hide) return;
1626 visitPostEnd(m_t, hasCaption);
1627 m_t << "</para>\n";
1628}
1629
1631{
1633 QCString shortName = makeShortName(baseName);
1634 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1635 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1636 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1639}
1640
1642 const QCString &relPath,
1643 const QCString &width,
1644 const QCString &height,
1645 bool hasCaption,
1646 const DocNodeList &children,
1647 const QCString &srcFile,
1648 int srcLine
1649 )
1650{
1652 QCString baseName=makeBaseName(fileName);
1653 baseName.prepend("dia_");
1654 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1655 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1656 m_t << "<para>\n";
1657 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1658}
1659
1661{
1663 if (m_hide) return;
1664 visitPostEnd(m_t, hasCaption);
1665 m_t << "</para>\n";
1666}
1667
1669{
1671 QCString shortName = makeShortName(baseName);
1672 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1673 writeDotGraphFromFile(baseName+".dot",outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1674 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1677}
1678
1680 const QCString &relPath,
1681 const QCString &width,
1682 const QCString &height,
1683 bool hasCaption,
1684 const DocNodeList &children,
1685 const QCString &srcFile,
1686 int srcLine
1687 )
1688{
1690 QCString baseName=makeBaseName(fileName);
1691 baseName.prepend("dot_");
1692 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1693 QCString imgExt = getDotImageExtension();
1694 writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1695 m_t << "<para>\n";
1696 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1697}
1698
1700{
1702 if (m_hide) return;
1703 m_t << "\n";
1704 visitPostEnd(m_t, hasCaption);
1705 m_t << "</para>\n";
1706}
1707
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
Node representing an anchor.
Definition docnode.h: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 writeDotFile(const QCString &fileName, const DocVerbatim &s)
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
void endDiaFile(bool hasCaption)
void operator()(const DocWord &)
void filter(const QCString &str, const bool retainNewLine=false)
void visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
void startDiaFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
OutputCodeList & m_ci
void startMscFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void startDotFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void endPlantUmlFile(bool hasCaption)
void visitCaption(const DocNodeList &children)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void endDotFile(bool hasCaption)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void endMscFile(bool hasCaption)
DocbookDocVisitor(TextStream &t, OutputCodeList &ci, const QCString &langExt)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h: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
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h: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
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:146
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
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
QCString left(size_t len) const
Definition qcstring.h:229
Text streaming class that buffers data.
Definition textstream.h:36
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static QCString filterId(const QCString &s)
#define DB_VIS_C
static QCString makeBaseName(const QCString &name)
static QCString makeShortName(const QCString &baseName)
static bool supportedHtmlAttribute(const QCString &name)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp: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
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:649
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:687
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5147
QCString stripPath(const QCString &s)
Definition util.cpp:4890
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:5486
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5165
QCString getDotImageExtension()
Definition util.cpp:6239
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:5809
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5189
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:2838
A bunch of utility functions.