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),
349 .setExample(s.isExample(),s.exampleFile())
350 );
351 m_t << "</computeroutput></literallayout>";
352 break;
354 m_t << "<literallayout><computeroutput>";
355 filter(s.text());
356 m_t << "</computeroutput></literallayout>";
357 break;
359 filter(s.text(), true);
360 break;
362 m_t << "<computeroutput>";
363 filter(s.text(), true);
364 m_t << "</computeroutput>";
365 break;
367 break;
369 break;
371 break;
373 break;
375 break;
377 m_t << s.text();
378 break;
379 case DocVerbatim::Dot:
380 {
381 static int dotindex = 1;
382 QCString baseName(4096, QCString::ExplicitSize);
383 QCString name;
384 QCString stext = s.text();
385 m_t << "<para>\n";
386 name.sprintf("%s%d", "dot_inline_dotgraph_", dotindex);
387 baseName.sprintf("%s%d",
388 qPrint(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_"),
389 dotindex++
390 );
391 QCString fileName = baseName+".dot";
392 std::ofstream file = Portable::openOutputStream(fileName);
393 if (!file.is_open())
394 {
395 err("Could not open file {} for writing\n",fileName);
396 }
397 file.write( stext.data(), stext.length() );
398 file.close();
399 writeDotFile(baseName, s);
400 m_t << "</para>\n";
401 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
402 }
403 break;
404 case DocVerbatim::Msc:
405 {
406 static int mscindex = 1;
407 QCString baseName(4096, QCString::ExplicitSize);
408 QCString name;
409 QCString stext = s.text();
410 m_t << "<para>\n";
411 name.sprintf("%s%d", "msc_inline_mscgraph_", mscindex);
412 baseName.sprintf("%s%d",
413 (Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_").data(),
414 mscindex++
415 );
416 QCString fileName = baseName+".msc";
417 std::ofstream file = Portable::openOutputStream(fileName);
418 if (!file.is_open())
419 {
420 err("Could not open file {} for writing\n",fileName);
421 }
422 QCString text = "msc {";
423 text+=stext;
424 text+="}";
425 file.write( text.data(), text.length() );
426 file.close();
427 writeMscFile(baseName,s);
428 m_t << "</para>\n";
429 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
430 }
431 break;
433 {
434 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
435 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(docbookOutput,
437 s.engine(),s.srcFile(),s.srcLine(),true);
438 for (const auto &baseName: baseNameVector)
439 {
440 m_t << "<para>\n";
441 writePlantUMLFile(baseName,s);
442 m_t << "</para>\n";
443 }
444 }
445 break;
446 }
447}
448
450{
452 if (m_hide) return;
453 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
454}
455
457{
459 if (m_hide) return;
461 switch(inc.type())
462 {
464 {
465 m_t << "<literallayout><computeroutput>";
466 FileInfo cfi( inc.file().str() );
467 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
469 inc.text(),
470 langExt,
471 inc.stripCodeComments(),
473 .setExample(inc.isExample(),inc.exampleFile())
474 .setFileDef(fd.get())
475 );
476 m_t << "</computeroutput></literallayout>";
477 }
478 break;
480 m_t << "<literallayout><computeroutput>";
482 inc.text(),
483 langExt,
484 inc.stripCodeComments(),
486 .setExample(inc.isExample(),inc.exampleFile())
487 );
488 m_t << "</computeroutput></literallayout>";
489 break;
497 break;
499 m_t << inc.text();
500 break;
502 m_t << "<literallayout>";
503 filter(inc.text());
504 m_t << "</literallayout>";
505 break;
508 m_t << "<literallayout><computeroutput>";
510 inc.file(),
511 inc.blockId(),
512 inc.context(),
514 inc.trimLeft(),
516 );
517 m_t << "</computeroutput></literallayout>";
518 break;
519 }
520}
521
523{
525 if (op.isFirst())
526 {
527 if (!m_hide)
528 {
529 m_t << "<programlisting linenumbering=\"unnumbered\">";
530 }
532 m_hide = TRUE;
533 }
535 if (locLangExt.isEmpty()) locLangExt = m_langExt;
536 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
537 if (op.type()!=DocIncOperator::Skip)
538 {
539 m_hide = popHidden();
540 if (!m_hide)
541 {
542 std::unique_ptr<FileDef> fd;
543 if (!op.includeFileName().isEmpty())
544 {
545 FileInfo cfi( op.includeFileName().str() );
546 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
547 }
548
549 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
550 op.text(),langExt,
553 .setExample(op.isExample(), op.exampleFile())
554 .setFileDef(fd.get())
555 .setStartLine(op.line())
557 );
558 }
560 m_hide=TRUE;
561 }
562 if (op.isLast())
563 {
564 m_hide = popHidden();
565 if (!m_hide) m_t << "</programlisting>";
566 }
567 else
568 {
569 if (!m_hide) m_t << "\n";
570 }
571}
572
574{
576 if (m_hide) return;
577
578 if (f.isInline()) m_t << "<inlinemediaobject>\n";
579 else m_t << " <mediaobject>\n";
580 m_t << " <imageobject>\n";
581 m_t << " <imagedata ";
582 m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.relPath() << f.name() << ".png\"/>\n";
583 m_t << " </imageobject>\n";
584 if (f.isInline()) m_t << "</inlinemediaobject>\n";
585 else m_t << " </mediaobject>\n";
586}
587
589{
591 if (m_hide) return;
592 m_t << "<indexterm><primary>";
593 filter(ie.entry());
594 m_t << "</primary></indexterm>\n";
595}
596
598{
600 // m_t << "<simplesect/>";
601}
602
604{
606 if (m_hide) return;
607 auto opt = cite.option();
608 if (!cite.file().isEmpty())
609 {
610 if (!opt.noCite()) startLink(cite.file(),filterId(cite.anchor()));
611
612 filter(cite.getText());
613
614 if (!opt.noCite()) endLink();
615 }
616 else
617 {
618 if (!opt.noPar()) filter("[");
619 filter(cite.target());
620 if (!opt.noPar()) filter("]");
621
622 }
623
624}
625
626//--------------------------------------
627// visitor functions for compound nodes
628//--------------------------------------
629
631{
633 if (m_hide) return;
634 if (l.isEnumList())
635 {
636 m_t << "<orderedlist>\n";
637 }
638 else
639 {
640 m_t << "<itemizedlist>\n";
641 }
642 visitChildren(l);
643 if (l.isEnumList())
644 {
645 m_t << "</orderedlist>\n";
646 }
647 else
648 {
649 m_t << "</itemizedlist>\n";
650 }
651}
652
654{
656 if (m_hide) return;
657 switch (li.itemNumber())
658 {
659 case DocAutoList::Unchecked: // unchecked
660 m_t << "<listitem override=\"unchecked\">";
661 break;
662 case DocAutoList::Checked_x: // checked with x
663 case DocAutoList::Checked_X: // checked with X
664 m_t << "<listitem override=\"checked\">";
665 break;
666 default:
667 m_t << "<listitem>";
668 break;
669 }
670 visitChildren(li);
671 m_t << "</listitem>";
672}
673
675{
677 if (m_hide) return;
678 m_t << "\n";
679 m_t << "<para>";
680 visitChildren(p);
681 m_t << "</para>";
682 m_t << "\n";
683}
684
690
692{
694 if (m_hide) return;
695 switch(s.type())
696 {
698 if (m_insidePre)
699 {
700 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
701 }
702 else
703 {
704 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
705 }
706 break;
708 if (m_insidePre)
709 {
710 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
711 }
712 else
713 {
714 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
715 }
716 break;
718 if (m_insidePre)
719 {
720 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
721 }
722 else
723 {
724 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
725 }
726 break;
728 if (m_insidePre)
729 {
730 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
731 }
732 else
733 {
734 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
735 }
736 break;
738 if (m_insidePre)
739 {
740 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
741 }
742 else
743 {
744 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
745 }
746 break;
748 if (m_insidePre)
749 {
750 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
751 }
752 else
753 {
754 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
755 }
756 break;
758 if (m_insidePre)
759 {
760 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
761 }
762 else
763 {
764 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
765 }
766 break;
768 if (m_insidePre)
769 {
770 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
771 }
772 else
773 {
774 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
775 }
776 break;
778 if (m_insidePre)
779 {
780 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
781 }
782 else
783 {
784 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
785 }
786 break;
788 if (m_insidePre)
789 {
790 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
791 }
792 else
793 {
794 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
795 }
796 break;
798 if (m_insidePre)
799 {
800 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
801 }
802 else
803 {
804 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
805 }
806 break;
808 if (m_insidePre)
809 {
810 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
811 }
812 else
813 {
814 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
815 }
816 break;
818 if (m_insidePre)
819 {
820 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
821 }
822 else
823 {
824 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
825 }
826 break;
828 // <remark> is miising the <title> possibility
829 if (m_insidePre)
830 {
831 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
832 }
833 else
834 {
835 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
836 }
837 break;
839 if (m_insidePre)
840 {
841 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
842 }
843 else
844 {
845 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
846 }
847 break;
849 if (m_insidePre)
850 {
851 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
852 }
853 else
854 {
855 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
856 }
857 break;
861 if (s.hasTitle())
862 m_t << "<formalpara>\n";
863 else
864 m_t << "<para>\n";
865 break;
866 }
867
868 if (s.title())
869 {
870 std::visit(*this,*s.title());
871 }
872 visitChildren(s);
873
874 switch(s.type())
875 {
879 if (s.hasTitle())
880 m_t << "</formalpara>\n";
881 else
882 m_t << "</para>\n";
883 break;
885 m_t << "</note>\n";
886 break;
888 m_t << "</caution>\n";
889 break;
891 m_t << "</important>\n";
892 break;
894 m_t << "</warning>\n";
895 break;
896 default:
897 m_t << "</formalpara>\n";
898 break;
899 }
900}
901
903{
905 if (m_hide) return;
906 if (t.hasTitle()) m_t << "<title>";
907 visitChildren(t);
908 if (t.hasTitle()) m_t << "</title>";
909}
910
912{
914 if (m_hide) return;
915 m_t << "<itemizedlist>\n";
916 visitChildren(l);
917 m_t << "</itemizedlist>\n";
918}
919
921{
923 if (m_hide) return;
924 m_t << "<listitem>";
925 if (li.paragraph())
926 {
927 visit(*this,*li.paragraph());
928 }
929 m_t << "</listitem>\n";
930}
931
933{
935 if (m_hide) return;
936 m_t << "<section xml:id=\"_" << stripPath(s.file());
937 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
938 m_t << "\">\n";
939 if (s.title())
940 {
941 std::visit(*this,*s.title());
942 }
943 visitChildren(s);
944 m_t << "</section>\n";
945}
946
948{
950 if (m_hide) return;
951 if (s.children().empty()) return;
952 // opening tag for ordered list will be handled in DocHtmlListItem
953 // due to (re-)numbering possibilities
954 if (s.type()!=DocHtmlList::Ordered)
955 m_t << "<itemizedlist>\n";
956 visitChildren(s);
957 if (s.type()==DocHtmlList::Ordered)
958 m_t << "</orderedlist>\n";
959 else
960 m_t << "</itemizedlist>\n";
961}
962
964{
966 if (m_hide) return;
967 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
968 if (l->type()==DocHtmlList::Ordered)
969 {
970 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
971 int value = 0;
972 QCString type;
973 for (const auto &opt : s.attribs())
974 {
975 if (opt.name=="value")
976 {
977 bool ok = false;
978 int val = opt.value.toInt(&ok);
979 if (ok) value = val;
980 }
981 }
982
983 if (value>0 || isFirst)
984 {
985 for (const auto &opt : l->attribs())
986 {
987 if (opt.name=="type")
988 {
989 if (opt.value=="1")
990 type = " numeration=\"arabic\"";
991 else if (opt.value=="a")
992 type = " numeration=\"loweralpha\"";
993 else if (opt.value=="A")
994 type = " numeration=\"upperalpha\"";
995 else if (opt.value=="i")
996 type = " numeration=\"lowerroman\"";
997 else if (opt.value=="I")
998 type = " numeration=\"upperroman\"";
999 }
1000 else if (value==0 && opt.name=="start")
1001 {
1002 bool ok = false;
1003 int val = opt.value.toInt(&ok);
1004 if (ok) value = val;
1005 }
1006 }
1007 }
1008
1009 if (value>0 && !isFirst)
1010 {
1011 m_t << "</orderedlist>\n";
1012 }
1013 if (value>0 || isFirst)
1014 {
1015 m_t << "<orderedlist";
1016 if (!type.isEmpty()) m_t << type.data();
1017 if (value>0) m_t << " startingnumber=\"" << value << "\"";
1018 m_t << ">\n";
1019 }
1020 }
1021 m_t << "<listitem>\n";
1022 visitChildren(s);
1023 m_t << "</listitem>\n";
1024}
1025
1027{
1029 if (m_hide) return;
1030 m_t << "<variablelist>\n";
1031 visitChildren(l);
1032 m_t << "</variablelist>\n";
1033}
1034
1036{
1038 if (m_hide) return;
1039 m_t << "<varlistentry><term>";
1040 visitChildren(dt);
1041 m_t << "</term></varlistentry>\n";
1042}
1043
1045{
1047 if (m_hide) return;
1048 m_t << "<listitem>";
1049 visitChildren(dd);
1050 m_t << "</listitem>\n";
1051}
1052
1054{
1056 m_bodySet.push(false);
1057 if (m_hide) return;
1058 m_t << "<informaltable frame=\"all\">\n";
1059 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1060 for (uint32_t i = 0; i <t.numColumns(); i++)
1061 {
1062 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1063 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1064 }
1065 if (t.caption())
1066 {
1067 std::visit(*this,*t.caption());
1068 }
1069 visitChildren(t);
1070 if (m_bodySet.top()) m_t << " </tbody>\n";
1071 m_bodySet.pop();
1072 m_t << " </tgroup>\n";
1073 m_t << "</informaltable>\n";
1074}
1075
1077{
1079 m_colCnt = 0;
1080 if (m_hide) return;
1081
1082 if (tr.isHeading())
1083 {
1084 if (m_bodySet.top()) m_t << "</tbody>\n";
1085 m_bodySet.top() = false;
1086 m_t << "<thead>\n";
1087 }
1088 else if (!m_bodySet.top())
1089 {
1090 m_bodySet.top() = true;
1091 m_t << "<tbody>\n";
1092 }
1093
1094 m_t << " <row ";
1095
1096 for (const auto &opt : tr.attribs())
1097 {
1098 if (supportedHtmlAttribute(opt.name))
1099 {
1100 // process supported attributes only
1101 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1102 }
1103 }
1104 m_t << ">\n";
1105 visitChildren(tr);
1106 m_t << "</row>\n";
1107 if (tr.isHeading())
1108 {
1109 m_t << "</thead><tbody>\n";
1110 m_bodySet.top() = true;
1111 }
1112}
1113
1115{
1117 m_colCnt++;
1118 if (m_hide) return;
1119 m_t << "<entry";
1120
1121 for (const auto &opt : c.attribs())
1122 {
1123 if (opt.name=="colspan")
1124 {
1125 m_t << " namest='c" << m_colCnt << "'";
1126 int cols = opt.value.toInt();
1127 m_colCnt += (cols - 1);
1128 m_t << " nameend='c" << m_colCnt << "'";
1129 }
1130 else if (opt.name=="rowspan")
1131 {
1132 int extraRows = opt.value.toInt() - 1;
1133 m_t << " morerows='" << extraRows << "'";
1134 }
1135 else if (opt.name=="class")
1136 {
1137 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1138 {
1139 if (opt.value.endsWith("Right"))
1140 {
1141 m_t << " align='right'";
1142 }
1143 else if (opt.value.endsWith("Left"))
1144 {
1145 m_t << " align='left'";
1146 }
1147 else if (opt.value.endsWith("Center"))
1148 {
1149 m_t << " align='center'";
1150 }
1151 // skip 'markdownTable*' value ending with "None"
1152 }
1153 else
1154 {
1155 m_t << " class='" << convertToDocBook(opt.value) << "'";
1156 }
1157 }
1158 else if (supportedHtmlAttribute(opt.name))
1159 {
1160 // process supported attributes only
1161 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1162 }
1163 }
1164 m_t << ">";
1165 visitChildren(c);
1166 m_t << "</entry>";
1167}
1168
1170{
1172 if (m_hide) return;
1173 m_t << "<caption>";
1174 if (!c.file().isEmpty())
1175 {
1176 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1177 }
1178 visitChildren(c);
1179 m_t << "</caption>\n";
1180}
1181
1183{
1185 if (m_hide) return;
1186 visitChildren(i);
1187}
1188
1190{
1192 if (m_hide) return;
1193 if (href.url().at(0) != '#')
1194 {
1195 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1196 }
1197 else
1198 {
1199 startLink(href.file(),filterId(href.url().mid(1)));
1200 }
1201 visitChildren(href);
1202 m_t << "</link>";
1203}
1204
1206{
1208 if (m_hide) return;
1209 m_t << "<para><emphasis role=\"bold\">";
1210 visitChildren(s);
1211 m_t << "</emphasis></para>";
1212}
1213
1215{
1217 if (m_hide) return;
1218 m_t << "\n";
1219 auto summary = d.summary();
1220 if (summary)
1221 {
1222 std::visit(*this,*summary);
1223 }
1224 m_t << "<para>";
1225 visitChildren(d);
1226 m_t << "</para>";
1227 m_t << "\n";
1228}
1229
1231{
1233 if (m_hide) return;
1234 m_t << "<formalpara><title>";
1235 visitChildren(h);
1236 m_t << "</title></formalpara>\n";
1237}
1238
1240{
1242 if (img.type()==DocImage::DocBook)
1243 {
1244 if (m_hide) return;
1245 m_t << "\n";
1246 QCString baseName=makeShortName(img.name());
1247 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1248 visitChildren(img);
1250 QCString file;
1251 bool ambig = false;
1252 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1253 if (fd)
1254 {
1255 file=fd->absFilePath();
1256 }
1257 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1258 }
1259 else // skip other formats
1260 {
1261 }
1262}
1263
1265{
1267 if (m_hide) return;
1268 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1269 startDotFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1270 visitChildren(df);
1271 endDotFile(df.hasCaption());
1272}
1273
1275{
1277 if (m_hide) return;
1278 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1279 startMscFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1280 visitChildren(df);
1281 endMscFile(df.hasCaption());
1282}
1283
1285{
1287 if (m_hide) return;
1288 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1289 startDiaFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1290 visitChildren(df);
1291 endDiaFile(df.hasCaption());
1292}
1293
1295{
1297 if (m_hide) return;
1298 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1299 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1300 visitChildren(df);
1302}
1303
1305{
1307 if (m_hide) return;
1308 startLink(lnk.file(),lnk.anchor());
1309 visitChildren(lnk);
1310 endLink();
1311}
1312
1314{
1316 if (m_hide) return;
1317 if (ref.isSubPage())
1318 {
1319 startLink(QCString(),ref.anchor());
1320 }
1321 else
1322 {
1323 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1324 }
1325
1326 if (!ref.hasLinkText()) filter(ref.targetTitle());
1327 visitChildren(ref);
1328 if (!ref.file().isEmpty()) endLink();
1329}
1330
1332{
1334 if (m_hide) return;
1335 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1336 m_t << "<tocentry>";
1337 visitChildren(ref);
1338 m_t << "</tocentry>\n";
1339}
1340
1342{
1344 if (m_hide) return;
1345 m_t << "<toc>\n";
1346 visitChildren(l);
1347 m_t << "</toc>\n";
1348}
1349
1351{
1353 if (m_hide) return;
1354 m_t << "\n";
1355 m_t << " <formalpara>\n";
1356 m_t << " <title>\n";
1357 switch(s.type())
1358 {
1359 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1360 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1361 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1362 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1363 default:
1364 ASSERT(0);
1365 }
1366 m_t << "</title>\n";
1367 m_t << " <para>\n";
1368 m_t << " <table frame=\"all\">\n";
1369 int ncols = 2;
1370 if (s.type() == DocParamSect::Param)
1371 {
1372 bool hasInOutSpecs = s.hasInOutSpecifier();
1373 bool hasTypeSpecs = s.hasTypeSpecifier();
1374 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1375 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1376 }
1377 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1378 for (int i = 1; i <= ncols; i++)
1379 {
1380 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1381 else m_t << " <colspec colwidth=\"1*\"/>\n";
1382 }
1383 m_t << " <tbody>\n";
1384 visitChildren(s);
1385 m_t << " </tbody>\n";
1386 m_t << " </tgroup>\n";
1387 m_t << " </table>\n";
1388 m_t << " </para>\n";
1389 m_t << " </formalpara>\n";
1390 m_t << " ";
1391}
1392
1394{
1396 if (m_hide) return;
1397 m_t << " " << sep.chars() << " ";
1398}
1399
1401{
1403 if (m_hide) return;
1404 m_t << " <row>\n";
1405
1406 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1407 if (sect && sect->hasInOutSpecifier())
1408 {
1409 m_t << "<entry>";
1411 {
1412 if (pl.direction()==DocParamSect::In)
1413 {
1414 m_t << "in";
1415 }
1416 else if (pl.direction()==DocParamSect::Out)
1417 {
1418 m_t << "out";
1419 }
1420 else if (pl.direction()==DocParamSect::InOut)
1421 {
1422 m_t << "in,out";
1423 }
1424 }
1425 m_t << "</entry>";
1426 }
1427
1428 if (sect && sect->hasTypeSpecifier())
1429 {
1430 m_t << "<entry>";
1431 for (const auto &type : pl.paramTypes())
1432 {
1433 std::visit(*this,type);
1434 }
1435 m_t << "</entry>";
1436 }
1437
1438 if (pl.parameters().empty())
1439 {
1440 m_t << "<entry></entry>\n";
1441 }
1442 else
1443 {
1444 m_t << "<entry>";
1445 int cnt = 0;
1446 for (const auto &param : pl.parameters())
1447 {
1448 if (cnt)
1449 {
1450 m_t << ", ";
1451 }
1452 std::visit(*this,param);
1453 cnt++;
1454 }
1455 m_t << "</entry>";
1456 }
1457 m_t << "<entry>";
1458 for (const auto &par : pl.paragraphs())
1459 {
1460 std::visit(*this,par);
1461 }
1462 m_t << "</entry>\n";
1463 m_t << " </row>\n";
1464}
1465
1467{
1469 if (m_hide) return;
1470 if (x.title().isEmpty()) return;
1471 m_t << "<para><link linkend=\"_";
1472 m_t << stripPath(x.file()) << "_1" << x.anchor();
1473 m_t << "\">";
1474 filter(x.title());
1475 m_t << "</link>";
1476 m_t << " ";
1477 visitChildren(x);
1478 if (x.title().isEmpty()) return;
1479 m_t << "</para>";
1480}
1481
1483{
1485 if (m_hide) return;
1486 startLink(ref.file(),ref.anchor());
1487 visitChildren(ref);
1488 endLink();
1489 m_t << " ";
1490}
1491
1493{
1495 visitChildren(t);
1496}
1497
1498
1500{
1502 if (m_hide) return;
1503 m_t << "<blockquote>";
1504 visitChildren(q);
1505 m_t << "</blockquote>";
1506}
1507
1509{
1511 // TODO: to be implemented
1512}
1513
1515{
1517 if (m_hide) return;
1518 visitChildren(b);
1519}
1520
1521
1522void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1523{
1525 m_t << convertToDocBook(str, retainNewLine);
1526}
1527
1528void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1529{
1531 m_t << "<link linkend=\"_" << stripPath(file);
1532 if (!anchor.isEmpty())
1533 {
1534 if (!file.isEmpty()) m_t << "_1";
1535 m_t << anchor;
1536 }
1537 m_t << "\">";
1538}
1539
1541{
1543 m_t << "</link>";
1544}
1545
1547{
1549 QCString shortName = makeShortName(baseName);
1550 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1551 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1552 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1555}
1556
1558{
1560 QCString shortName = makeShortName(baseName);
1561 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1563 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1566}
1568 const QCString &relPath,
1569 const QCString &width,
1570 const QCString &height,
1571 bool hasCaption,
1572 const DocNodeList &children,
1573 const QCString &srcFile,
1574 int srcLine
1575 )
1576{
1578 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1579 std::string inBuf;
1580 readInputFile(fileName,inBuf);
1581 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(outDir,
1582 QCString(),inBuf,PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1583 bool first = true;
1584 for (const auto &bName: baseNameVector)
1585 {
1586 QCString baseName=makeBaseName(bName);
1588 if (!first) endPlantUmlFile(hasCaption);
1589 first = false;
1590 m_t << "<para>\n";
1591 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1592 }
1593}
1594
1596{
1598 if (m_hide) return;
1599 m_t << "\n";
1600 visitPostEnd(m_t, hasCaption);
1601 m_t << "</para>\n";
1602}
1603
1605 const QCString &relPath,
1606 const QCString &width,
1607 const QCString &height,
1608 bool hasCaption,
1609 const DocNodeList &children,
1610 const QCString &srcFile,
1611 int srcLine
1612 )
1613{
1615 QCString baseName=makeBaseName(fileName);
1616 baseName.prepend("msc_");
1617 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1618 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1619 m_t << "<para>\n";
1620 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1621}
1622
1624{
1626 if (m_hide) return;
1627 visitPostEnd(m_t, hasCaption);
1628 m_t << "</para>\n";
1629}
1630
1632{
1634 QCString shortName = makeShortName(baseName);
1635 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1636 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1637 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1640}
1641
1643 const QCString &relPath,
1644 const QCString &width,
1645 const QCString &height,
1646 bool hasCaption,
1647 const DocNodeList &children,
1648 const QCString &srcFile,
1649 int srcLine
1650 )
1651{
1653 QCString baseName=makeBaseName(fileName);
1654 baseName.prepend("dia_");
1655 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1656 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1657 m_t << "<para>\n";
1658 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1659}
1660
1662{
1664 if (m_hide) return;
1665 visitPostEnd(m_t, hasCaption);
1666 m_t << "</para>\n";
1667}
1668
1670{
1672 QCString shortName = makeShortName(baseName);
1673 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1674 writeDotGraphFromFile(baseName+".dot",outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1675 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1678}
1679
1681 const QCString &relPath,
1682 const QCString &width,
1683 const QCString &height,
1684 bool hasCaption,
1685 const DocNodeList &children,
1686 const QCString &srcFile,
1687 int srcLine
1688 )
1689{
1691 QCString baseName=makeBaseName(fileName);
1692 baseName.prepend("dot_");
1693 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1694 QCString imgExt = getDotImageExtension();
1695 writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1696 m_t << "<para>\n";
1697 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1698}
1699
1701{
1703 if (m_hide) return;
1704 m_t << "\n";
1705 visitPostEnd(m_t, hasCaption);
1706 m_t << "</para>\n";
1707}
1708
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.
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
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
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.