Doxygen
Loading...
Searching...
No Matches
docbookvisitor.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include "docbookvisitor.h"
17#include "docparser.h"
18#include "language.h"
19#include "doxygen.h"
20#include "outputgen.h"
21#include "docbookgen.h"
22#include "dot.h"
23#include "message.h"
24#include "util.h"
25#include "parserintf.h"
26#include "filename.h"
27#include "config.h"
28#include "filedef.h"
29#include "msc.h"
30#include "dia.h"
31#include "htmlentity.h"
32#include "emoji.h"
33#include "plantuml.h"
34#include "growbuf.h"
35#include "fileinfo.h"
36#include "portable.h"
37#include "codefragment.h"
38#include "cite.h"
39
40#if 0
41#define DB_VIS_C DB_VIS_C1(m_t)
42#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
43#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
44#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
45#else
46#define DB_VIS_C
47#define DB_VIS_C1(x)
48#define DB_VIS_C2(y)
49#define DB_VIS_C2a(x,y)
50#endif
51
52static QCString filterId(const QCString &s)
53{
54 if (s.isEmpty()) return s;
55 GrowBuf growBuf;
56 growBuf.clear();
57 const char *p=s.data();
58 char c=0;
59 while ((c=*p++))
60 {
61 switch (c)
62 {
63 case ':': growBuf.addStr("_1"); break;
64 default: growBuf.addChar(c); break;
65 }
66 }
67 growBuf.addChar(0);
68 return growBuf.get();
69}
70
71static bool supportedHtmlAttribute(const QCString &name)
72{
73 return (name=="align" ||
74 name=="bgcolor" ||
75 name=="border" ||
76 name=="cellpadding" ||
77 name=="cellspacing" ||
78 name=="class" ||
79 name=="frame" ||
80 name=="label" ||
81 name=="style" ||
82 name=="width" ||
83 name=="tabstyle" ||
84 name=="title");
85}
86
87static QCString makeShortName(const QCString &baseName)
88{
89 QCString result = baseName;
90 int i = result.findRev('/');
91 if (i!=-1)
92 {
93 result=result.mid(i+1);
94 }
95 return result;
96}
97
98static QCString makeBaseName(const QCString &name)
99{
100 QCString result = makeShortName(name);
101 int i = result.find('.');
102 if (i!=-1)
103 {
104 result=result.left(i);
105 }
106 return result;
107}
108
109
111{
112 for (const auto &n : children)
113 {
114 std::visit(*this,n);
115 }
116}
117
119 const DocNodeList &children,
120 bool hasCaption,
121 const QCString &name,
122 const QCString &width,
123 const QCString &height,
124 bool inlineImage)
125{
126 if (hasCaption && !inlineImage)
127 {
128 t << " <figure>\n";
129 t << " <title>\n";
130 visitCaption(children);
131 t << " </title>\n";
132 }
133 else
134 {
135 t << " <informalfigure>\n";
136 }
137 t << " <mediaobject>\n";
138 t << " <imageobject>\n";
139 t << " <imagedata";
140 if (!width.isEmpty())
141 {
142 t << " width=\"" << convertToDocBook(width) << "\"";
143 }
144 else
145 {
146 if (!height.isEmpty() && !inlineImage) t << " width=\"50%\"";
147 }
148 if (!height.isEmpty())
149 {
150 t << " depth=\"" << convertToDocBook(height) << "\"";
151 }
152 t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">";
153 t << "</imagedata>\n";
154 t << " </imageobject>\n";
155 if (hasCaption && !inlineImage)
156 {
157 t << " <!--\n"; // Needed for general formatting with title for other formats
158 }
159}
160
161void DocbookDocVisitor::visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage)
162{
163 t << "\n";
164 if (hasCaption && !inlineImage)
165 {
166 t << " -->\n"; // Needed for general formatting with title for other formats
167 }
168 t << " </mediaobject>\n";
169 if (hasCaption && !inlineImage)
170 {
171 t << " </figure>\n";
172 }
173 else
174 {
175 t << " </informalfigure>\n";
176 }
177}
178
180 : m_t(t), m_ci(ci),m_langExt(langExt)
181{
183 // m_t << "<section>\n";
184}
185
186//--------------------------------------
187// visitor functions for leaf nodes
188//--------------------------------------
189
191{
193 if (m_hide) return;
194 filter(w.word());
195}
196
198{
200 if (m_hide) return;
201 startLink(w.file(),w.anchor());
202 filter(w.word());
203 endLink();
204}
205
207{
209 if (m_hide) return;
210 if (m_insidePre)
211 {
212 m_t << w.chars();
213 }
214 else
215 {
216 m_t << " ";
217 }
218}
219
221{
223 if (m_hide) return;
224 const char *res = HtmlEntityMapper::instance().docbook(s.symbol());
225 if (res)
226 {
227 m_t << res;
228 }
229 else
230 {
231 err("DocBook: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
232 }
233}
234
236{
238 if (m_hide) return;
239 const char *res = EmojiEntityMapper::instance().unicode(s.index());
240 if (res)
241 {
242 m_t << res;
243 }
244 else
245 {
246 m_t << s.name();
247 }
248}
249
251{
253 if (m_hide) return;
254 m_t << "<link xlink:href=\"";
255 if (u.isEmail()) m_t << "mailto:";
256 filter(u.url());
257 m_t << "\">";
258 filter(u.url());
259 m_t << "</link>";
260}
261
263{
265 if (m_hide) return;
266 m_t << "<?linebreak?>";
267 // gives nicer results but gives problems as it is not allowed in <pare> and also problems with dblatex
268 // m_t << "\n" << "<sbr/>\n";
269}
270
272{
274 if (m_hide) return;
275 m_t << "<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
276 m_t << "</entry></row></tbody></tgroup></informaltable>\n";
277}
278
280{
282 if (m_hide) return;
283 switch (s.style())
284 {
286 if (s.enable()) m_t << "<emphasis role=\"bold\">"; else m_t << "</emphasis>";
287 break;
289 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
290 break;
294 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
295 break;
297 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
298 break;
300 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
301 break;
303 if (s.enable()) m_t << "<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
304 else m_t << "</entry></row></tbody></tgroup></informaltable>";
305 break;
307 if (s.enable())
308 {
309 m_t << "<literallayout>";
311 }
312 else
313 {
314 m_t << "</literallayout>";
316 }
317 break;
318 /* There is no equivalent Docbook tag for rendering Small text */
319 case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
320 /* HTML only */
321 case DocStyleChange::Cite: break;
322 case DocStyleChange::S: break;
323 case DocStyleChange::Strike: break;
324 case DocStyleChange::Del: break;
325 case DocStyleChange::Underline: break;
326 case DocStyleChange::Ins: break;
327 case DocStyleChange::Div: /* HTML only */ break;
328 case DocStyleChange::Span: /* HTML only */ break;
329 }
330}
331
333{
335 if (m_hide) return;
336 QCString lang = m_langExt;
337 if (!s.language().isEmpty()) // explicit language setting
338 {
339 lang = s.language();
340 }
341 SrcLangExt langExt = getLanguageFromCodeLang(lang);
342 switch(s.type())
343 {
345 m_t << "<literallayout><computeroutput>";
347 s.text(),
348 langExt,
349 Config_getBool(STRIP_CODE_COMMENTS),
350 s.isExample(),
351 s.exampleFile());
352 m_t << "</computeroutput></literallayout>";
353 break;
355 m_t << "<literallayout><computeroutput>";
356 filter(s.text());
357 m_t << "</computeroutput></literallayout>";
358 break;
360 filter(s.text(), true);
361 break;
363 m_t << "<computeroutput>";
364 filter(s.text(), true);
365 m_t << "</computeroutput>";
366 break;
368 break;
370 break;
372 break;
374 break;
376 break;
378 m_t << s.text();
379 break;
380 case DocVerbatim::Dot:
381 {
382 static int dotindex = 1;
383 QCString baseName(4096, QCString::ExplicitSize);
384 QCString name;
385 QCString stext = s.text();
386 m_t << "<para>\n";
387 name.sprintf("%s%d", "dot_inline_dotgraph_", dotindex);
388 baseName.sprintf("%s%d",
389 qPrint(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_"),
390 dotindex++
391 );
392 QCString fileName = baseName+".dot";
393 std::ofstream file = Portable::openOutputStream(fileName);
394 if (!file.is_open())
395 {
396 err("Could not open file {} for writing\n",fileName);
397 }
398 file.write( stext.data(), stext.length() );
399 file.close();
400 writeDotFile(baseName, s);
401 m_t << "</para>\n";
402 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
403 }
404 break;
405 case DocVerbatim::Msc:
406 {
407 static int mscindex = 1;
408 QCString baseName(4096, QCString::ExplicitSize);
409 QCString name;
410 QCString stext = s.text();
411 m_t << "<para>\n";
412 name.sprintf("%s%d", "msc_inline_mscgraph_", mscindex);
413 baseName.sprintf("%s%d",
414 (Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_").data(),
415 mscindex++
416 );
417 QCString fileName = baseName+".msc";
418 std::ofstream file = Portable::openOutputStream(fileName);
419 if (!file.is_open())
420 {
421 err("Could not open file {} for writing\n",fileName);
422 }
423 QCString text = "msc {";
424 text+=stext;
425 text+="}";
426 file.write( text.data(), text.length() );
427 file.close();
428 writeMscFile(baseName,s);
429 m_t << "</para>\n";
430 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
431 }
432 break;
434 {
435 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
436 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(docbookOutput,
438 s.engine(),s.srcFile(),s.srcLine(),true);
439 for (const auto &baseName: baseNameVector)
440 {
441 m_t << "<para>\n";
442 writePlantUMLFile(QCString(baseName),s);
443 m_t << "</para>\n";
444 }
445 }
446 break;
447 }
448}
449
451{
453 if (m_hide) return;
454 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
455}
456
458{
460 if (m_hide) return;
462 switch(inc.type())
463 {
465 {
466 m_t << "<literallayout><computeroutput>";
467 FileInfo cfi( inc.file().str() );
468 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
470 inc.text(),
471 langExt,
472 inc.stripCodeComments(),
473 inc.isExample(),
474 inc.exampleFile(), fd.get());
475 m_t << "</computeroutput></literallayout>";
476 }
477 break;
479 m_t << "<literallayout><computeroutput>";
481 inc.text(),
482 langExt,
483 inc.stripCodeComments(),
484 inc.isExample(),
485 inc.exampleFile());
486 m_t << "</computeroutput></literallayout>";
487 break;
495 break;
497 m_t << inc.text();
498 break;
500 m_t << "<literallayout>";
501 filter(inc.text());
502 m_t << "</literallayout>";
503 break;
506 m_t << "<literallayout><computeroutput>";
508 inc.file(),
509 inc.blockId(),
510 inc.context(),
512 inc.trimLeft(),
514 );
515 m_t << "</computeroutput></literallayout>";
516 break;
517 }
518}
519
521{
523 if (op.isFirst())
524 {
525 if (!m_hide)
526 {
527 m_t << "<programlisting linenumbering=\"unnumbered\">";
528 }
530 m_hide = TRUE;
531 }
533 if (locLangExt.isEmpty()) locLangExt = m_langExt;
534 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
535 if (op.type()!=DocIncOperator::Skip)
536 {
537 m_hide = popHidden();
538 if (!m_hide)
539 {
540 std::unique_ptr<FileDef> fd;
541 if (!op.includeFileName().isEmpty())
542 {
543 FileInfo cfi( op.includeFileName().str() );
544 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
545 }
546
547 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
548 op.text(),langExt,
550 op.isExample(),
551 op.exampleFile(),
552 fd.get(), // fileDef
553 op.line(), // startLine
554 -1, // endLine
555 FALSE, // inline fragment
556 nullptr, // memberDef
557 op.showLineNo() // show line numbers
558 );
559 }
561 m_hide=TRUE;
562 }
563 if (op.isLast())
564 {
565 m_hide = popHidden();
566 if (!m_hide) m_t << "</programlisting>";
567 }
568 else
569 {
570 if (!m_hide) m_t << "\n";
571 }
572}
573
575{
577 if (m_hide) return;
578
579 if (f.isInline()) m_t << "<inlinemediaobject>\n";
580 else m_t << " <mediaobject>\n";
581 m_t << " <imageobject>\n";
582 m_t << " <imagedata ";
583 m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.relPath() << f.name() << ".png\"/>\n";
584 m_t << " </imageobject>\n";
585 if (f.isInline()) m_t << "</inlinemediaobject>\n";
586 else m_t << " </mediaobject>\n";
587}
588
590{
592 if (m_hide) return;
593 m_t << "<indexterm><primary>";
594 filter(ie.entry());
595 m_t << "</primary></indexterm>\n";
596}
597
599{
601 // m_t << "<simplesect/>";
602}
603
605{
607 if (m_hide) return;
608 auto opt = cite.option();
609 if (!cite.file().isEmpty())
610 {
611 if (!opt.noCite()) startLink(cite.file(),filterId(cite.anchor()));
612
613 filter(cite.getText());
614
615 if (!opt.noCite()) endLink();
616 }
617 else
618 {
619 if (!opt.noPar()) filter("[");
620 filter(cite.target());
621 if (!opt.noPar()) filter("]");
622
623 }
624
625}
626
627//--------------------------------------
628// visitor functions for compound nodes
629//--------------------------------------
630
632{
634 if (m_hide) return;
635 if (l.isEnumList())
636 {
637 m_t << "<orderedlist>\n";
638 }
639 else
640 {
641 m_t << "<itemizedlist>\n";
642 }
643 visitChildren(l);
644 if (l.isEnumList())
645 {
646 m_t << "</orderedlist>\n";
647 }
648 else
649 {
650 m_t << "</itemizedlist>\n";
651 }
652}
653
655{
657 if (m_hide) return;
658 switch (li.itemNumber())
659 {
660 case DocAutoList::Unchecked: // unchecked
661 m_t << "<listitem override=\"unchecked\">";
662 break;
663 case DocAutoList::Checked_x: // checked with x
664 case DocAutoList::Checked_X: // checked with X
665 m_t << "<listitem override=\"checked\">";
666 break;
667 default:
668 m_t << "<listitem>";
669 break;
670 }
671 visitChildren(li);
672 m_t << "</listitem>";
673}
674
676{
678 if (m_hide) return;
679 m_t << "\n";
680 m_t << "<para>";
681 visitChildren(p);
682 m_t << "</para>";
683 m_t << "\n";
684}
685
691
693{
695 if (m_hide) return;
696 switch(s.type())
697 {
699 if (m_insidePre)
700 {
701 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
702 }
703 else
704 {
705 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
706 }
707 break;
709 if (m_insidePre)
710 {
711 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
712 }
713 else
714 {
715 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
716 }
717 break;
719 if (m_insidePre)
720 {
721 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
722 }
723 else
724 {
725 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
726 }
727 break;
729 if (m_insidePre)
730 {
731 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
732 }
733 else
734 {
735 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
736 }
737 break;
739 if (m_insidePre)
740 {
741 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
742 }
743 else
744 {
745 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
746 }
747 break;
749 if (m_insidePre)
750 {
751 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
752 }
753 else
754 {
755 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
756 }
757 break;
759 if (m_insidePre)
760 {
761 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
762 }
763 else
764 {
765 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
766 }
767 break;
769 if (m_insidePre)
770 {
771 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
772 }
773 else
774 {
775 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
776 }
777 break;
779 if (m_insidePre)
780 {
781 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
782 }
783 else
784 {
785 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
786 }
787 break;
789 if (m_insidePre)
790 {
791 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
792 }
793 else
794 {
795 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
796 }
797 break;
799 if (m_insidePre)
800 {
801 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
802 }
803 else
804 {
805 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
806 }
807 break;
809 if (m_insidePre)
810 {
811 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
812 }
813 else
814 {
815 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
816 }
817 break;
819 if (m_insidePre)
820 {
821 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
822 }
823 else
824 {
825 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
826 }
827 break;
829 // <remark> is miising the <title> possibility
830 if (m_insidePre)
831 {
832 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
833 }
834 else
835 {
836 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
837 }
838 break;
840 if (m_insidePre)
841 {
842 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
843 }
844 else
845 {
846 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
847 }
848 break;
850 if (m_insidePre)
851 {
852 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
853 }
854 else
855 {
856 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
857 }
858 break;
862 if (s.hasTitle())
863 m_t << "<formalpara>\n";
864 else
865 m_t << "<para>\n";
866 break;
867 }
868
869 if (s.title())
870 {
871 std::visit(*this,*s.title());
872 }
873 visitChildren(s);
874
875 switch(s.type())
876 {
880 if (s.hasTitle())
881 m_t << "</formalpara>\n";
882 else
883 m_t << "</para>\n";
884 break;
886 m_t << "</note>\n";
887 break;
889 m_t << "</caution>\n";
890 break;
892 m_t << "</important>\n";
893 break;
895 m_t << "</warning>\n";
896 break;
897 default:
898 m_t << "</formalpara>\n";
899 break;
900 }
901}
902
904{
906 if (m_hide) return;
907 if (t.hasTitle()) m_t << "<title>";
908 visitChildren(t);
909 if (t.hasTitle()) m_t << "</title>";
910}
911
913{
915 if (m_hide) return;
916 m_t << "<itemizedlist>\n";
917 visitChildren(l);
918 m_t << "</itemizedlist>\n";
919}
920
922{
924 if (m_hide) return;
925 m_t << "<listitem>";
926 if (li.paragraph())
927 {
928 visit(*this,*li.paragraph());
929 }
930 m_t << "</listitem>\n";
931}
932
934{
936 if (m_hide) return;
937 m_t << "<section xml:id=\"_" << stripPath(s.file());
938 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
939 m_t << "\">\n";
940 if (s.title())
941 {
942 std::visit(*this,*s.title());
943 }
944 visitChildren(s);
945 m_t << "</section>\n";
946}
947
949{
951 if (m_hide) return;
952 if (s.children().empty()) return;
953 // opening tag for ordered list will be handled in DocHtmlListItem
954 // due to (re-)numbering possibilities
955 if (s.type()!=DocHtmlList::Ordered)
956 m_t << "<itemizedlist>\n";
957 visitChildren(s);
958 if (s.type()==DocHtmlList::Ordered)
959 m_t << "</orderedlist>\n";
960 else
961 m_t << "</itemizedlist>\n";
962}
963
965{
967 if (m_hide) return;
968 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
969 if (l->type()==DocHtmlList::Ordered)
970 {
971 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
972 int value = 0;
973 QCString type;
974 for (const auto &opt : s.attribs())
975 {
976 if (opt.name=="value")
977 {
978 bool ok = false;
979 int val = opt.value.toInt(&ok);
980 if (ok) value = val;
981 }
982 }
983
984 if (value>0 || isFirst)
985 {
986 for (const auto &opt : l->attribs())
987 {
988 if (opt.name=="type")
989 {
990 if (opt.value=="1")
991 type = " numeration=\"arabic\"";
992 else if (opt.value=="a")
993 type = " numeration=\"loweralpha\"";
994 else if (opt.value=="A")
995 type = " numeration=\"upperalpha\"";
996 else if (opt.value=="i")
997 type = " numeration=\"lowerroman\"";
998 else if (opt.value=="I")
999 type = " numeration=\"upperroman\"";
1000 }
1001 else if (value==0 && opt.name=="start")
1002 {
1003 bool ok = false;
1004 int val = opt.value.toInt(&ok);
1005 if (ok) value = val;
1006 }
1007 }
1008 }
1009
1010 if (value>0 && !isFirst)
1011 {
1012 m_t << "</orderedlist>\n";
1013 }
1014 if (value>0 || isFirst)
1015 {
1016 m_t << "<orderedlist";
1017 if (!type.isEmpty()) m_t << type.data();
1018 if (value>0) m_t << " startingnumber=\"" << value << "\"";
1019 m_t << ">\n";
1020 }
1021 }
1022 m_t << "<listitem>\n";
1023 visitChildren(s);
1024 m_t << "</listitem>\n";
1025}
1026
1028{
1030 if (m_hide) return;
1031 m_t << "<variablelist>\n";
1032 visitChildren(l);
1033 m_t << "</variablelist>\n";
1034}
1035
1037{
1039 if (m_hide) return;
1040 m_t << "<varlistentry><term>";
1041 visitChildren(dt);
1042 m_t << "</term></varlistentry>\n";
1043}
1044
1046{
1048 if (m_hide) return;
1049 m_t << "<listitem>";
1050 visitChildren(dd);
1051 m_t << "</listitem>\n";
1052}
1053
1055{
1057 m_bodySet.push(false);
1058 if (m_hide) return;
1059 m_t << "<informaltable frame=\"all\">\n";
1060 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1061 for (uint32_t i = 0; i <t.numColumns(); i++)
1062 {
1063 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1064 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1065 }
1066 if (t.caption())
1067 {
1068 std::visit(*this,*t.caption());
1069 }
1070 visitChildren(t);
1071 if (m_bodySet.top()) m_t << " </tbody>\n";
1072 m_bodySet.pop();
1073 m_t << " </tgroup>\n";
1074 m_t << "</informaltable>\n";
1075}
1076
1078{
1080 m_colCnt = 0;
1081 if (m_hide) return;
1082
1083 if (tr.isHeading())
1084 {
1085 if (m_bodySet.top()) m_t << "</tbody>\n";
1086 m_bodySet.top() = false;
1087 m_t << "<thead>\n";
1088 }
1089 else if (!m_bodySet.top())
1090 {
1091 m_bodySet.top() = true;
1092 m_t << "<tbody>\n";
1093 }
1094
1095 m_t << " <row ";
1096
1097 for (const auto &opt : tr.attribs())
1098 {
1099 if (supportedHtmlAttribute(opt.name))
1100 {
1101 // process supported attributes only
1102 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1103 }
1104 }
1105 m_t << ">\n";
1106 visitChildren(tr);
1107 m_t << "</row>\n";
1108 if (tr.isHeading())
1109 {
1110 m_t << "</thead><tbody>\n";
1111 m_bodySet.top() = true;
1112 }
1113}
1114
1116{
1118 m_colCnt++;
1119 if (m_hide) return;
1120 m_t << "<entry";
1121
1122 for (const auto &opt : c.attribs())
1123 {
1124 if (opt.name=="colspan")
1125 {
1126 m_t << " namest='c" << m_colCnt << "'";
1127 int cols = opt.value.toInt();
1128 m_colCnt += (cols - 1);
1129 m_t << " nameend='c" << m_colCnt << "'";
1130 }
1131 else if (opt.name=="rowspan")
1132 {
1133 int extraRows = opt.value.toInt() - 1;
1134 m_t << " morerows='" << extraRows << "'";
1135 }
1136 else if (opt.name=="class")
1137 {
1138 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1139 {
1140 if (opt.value.endsWith("Right"))
1141 {
1142 m_t << " align='right'";
1143 }
1144 else if (opt.value.endsWith("Left"))
1145 {
1146 m_t << " align='left'";
1147 }
1148 else if (opt.value.endsWith("Center"))
1149 {
1150 m_t << " align='center'";
1151 }
1152 // skip 'markdownTable*' value ending with "None"
1153 }
1154 else
1155 {
1156 m_t << " class='" << convertToDocBook(opt.value) << "'";
1157 }
1158 }
1159 else if (supportedHtmlAttribute(opt.name))
1160 {
1161 // process supported attributes only
1162 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1163 }
1164 }
1165 m_t << ">";
1166 visitChildren(c);
1167 m_t << "</entry>";
1168}
1169
1171{
1173 if (m_hide) return;
1174 m_t << "<caption>";
1175 if (!c.file().isEmpty())
1176 {
1177 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1178 }
1179 visitChildren(c);
1180 m_t << "</caption>\n";
1181}
1182
1184{
1186 if (m_hide) return;
1187 visitChildren(i);
1188}
1189
1191{
1193 if (m_hide) return;
1194 if (href.url().at(0) != '#')
1195 {
1196 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1197 }
1198 else
1199 {
1200 startLink(href.file(),filterId(href.url().mid(1)));
1201 }
1202 visitChildren(href);
1203 m_t << "</link>";
1204}
1205
1207{
1209 if (m_hide) return;
1210 m_t << "<para><emphasis role=\"bold\">";
1211 visitChildren(s);
1212 m_t << "</emphasis></para>";
1213}
1214
1216{
1218 if (m_hide) return;
1219 m_t << "\n";
1220 auto summary = d.summary();
1221 if (summary)
1222 {
1223 std::visit(*this,*summary);
1224 }
1225 m_t << "<para>";
1226 visitChildren(d);
1227 m_t << "</para>";
1228 m_t << "\n";
1229}
1230
1232{
1234 if (m_hide) return;
1235 m_t << "<formalpara><title>";
1236 visitChildren(h);
1237 m_t << "</title></formalpara>\n";
1238}
1239
1241{
1243 if (img.type()==DocImage::DocBook)
1244 {
1245 if (m_hide) return;
1246 m_t << "\n";
1247 QCString baseName=makeShortName(img.name());
1248 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1249 visitChildren(img);
1251 QCString file;
1252 bool ambig = false;
1253 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1254 if (fd)
1255 {
1256 file=fd->absFilePath();
1257 }
1258 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1259 }
1260 else // skip other formats
1261 {
1262 }
1263}
1264
1266{
1268 if (m_hide) return;
1269 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1270 startDotFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1271 visitChildren(df);
1272 endDotFile(df.hasCaption());
1273}
1274
1276{
1278 if (m_hide) return;
1279 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1280 startMscFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1281 visitChildren(df);
1282 endMscFile(df.hasCaption());
1283}
1284
1286{
1288 if (m_hide) return;
1289 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1290 startDiaFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1291 visitChildren(df);
1292 endDiaFile(df.hasCaption());
1293}
1294
1296{
1298 if (m_hide) return;
1299 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1300 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1301 visitChildren(df);
1303}
1304
1306{
1308 if (m_hide) return;
1309 startLink(lnk.file(),lnk.anchor());
1310 visitChildren(lnk);
1311 endLink();
1312}
1313
1315{
1317 if (m_hide) return;
1318 if (ref.isSubPage())
1319 {
1320 startLink(QCString(),ref.anchor());
1321 }
1322 else
1323 {
1324 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1325 }
1326
1327 if (!ref.hasLinkText()) filter(ref.targetTitle());
1328 visitChildren(ref);
1329 if (!ref.file().isEmpty()) endLink();
1330}
1331
1333{
1335 if (m_hide) return;
1336 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1337 m_t << "<tocentry>";
1338 visitChildren(ref);
1339 m_t << "</tocentry>\n";
1340}
1341
1343{
1345 if (m_hide) return;
1346 m_t << "<toc>\n";
1347 visitChildren(l);
1348 m_t << "</toc>\n";
1349}
1350
1352{
1354 if (m_hide) return;
1355 m_t << "\n";
1356 m_t << " <formalpara>\n";
1357 m_t << " <title>\n";
1358 switch(s.type())
1359 {
1360 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1361 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1362 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1363 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1364 default:
1365 ASSERT(0);
1366 }
1367 m_t << "</title>\n";
1368 m_t << " <para>\n";
1369 m_t << " <table frame=\"all\">\n";
1370 int ncols = 2;
1371 if (s.type() == DocParamSect::Param)
1372 {
1373 bool hasInOutSpecs = s.hasInOutSpecifier();
1374 bool hasTypeSpecs = s.hasTypeSpecifier();
1375 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1376 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1377 }
1378 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1379 for (int i = 1; i <= ncols; i++)
1380 {
1381 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1382 else m_t << " <colspec colwidth=\"1*\"/>\n";
1383 }
1384 m_t << " <tbody>\n";
1385 visitChildren(s);
1386 m_t << " </tbody>\n";
1387 m_t << " </tgroup>\n";
1388 m_t << " </table>\n";
1389 m_t << " </para>\n";
1390 m_t << " </formalpara>\n";
1391 m_t << " ";
1392}
1393
1395{
1397 if (m_hide) return;
1398 m_t << " " << sep.chars() << " ";
1399}
1400
1402{
1404 if (m_hide) return;
1405 m_t << " <row>\n";
1406
1407 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1408 if (sect && sect->hasInOutSpecifier())
1409 {
1410 m_t << "<entry>";
1412 {
1413 if (pl.direction()==DocParamSect::In)
1414 {
1415 m_t << "in";
1416 }
1417 else if (pl.direction()==DocParamSect::Out)
1418 {
1419 m_t << "out";
1420 }
1421 else if (pl.direction()==DocParamSect::InOut)
1422 {
1423 m_t << "in,out";
1424 }
1425 }
1426 m_t << "</entry>";
1427 }
1428
1429 if (sect && sect->hasTypeSpecifier())
1430 {
1431 m_t << "<entry>";
1432 for (const auto &type : pl.paramTypes())
1433 {
1434 std::visit(*this,type);
1435 }
1436 m_t << "</entry>";
1437 }
1438
1439 if (pl.parameters().empty())
1440 {
1441 m_t << "<entry></entry>\n";
1442 }
1443 else
1444 {
1445 m_t << "<entry>";
1446 int cnt = 0;
1447 for (const auto &param : pl.parameters())
1448 {
1449 if (cnt)
1450 {
1451 m_t << ", ";
1452 }
1453 std::visit(*this,param);
1454 cnt++;
1455 }
1456 m_t << "</entry>";
1457 }
1458 m_t << "<entry>";
1459 for (const auto &par : pl.paragraphs())
1460 {
1461 std::visit(*this,par);
1462 }
1463 m_t << "</entry>\n";
1464 m_t << " </row>\n";
1465}
1466
1468{
1470 if (m_hide) return;
1471 if (x.title().isEmpty()) return;
1472 m_t << "<para><link linkend=\"_";
1473 m_t << stripPath(x.file()) << "_1" << x.anchor();
1474 m_t << "\">";
1475 filter(x.title());
1476 m_t << "</link>";
1477 m_t << " ";
1478 visitChildren(x);
1479 if (x.title().isEmpty()) return;
1480 m_t << "</para>";
1481}
1482
1484{
1486 if (m_hide) return;
1487 startLink(ref.file(),ref.anchor());
1488 visitChildren(ref);
1489 endLink();
1490 m_t << " ";
1491}
1492
1494{
1496 visitChildren(t);
1497}
1498
1499
1501{
1503 if (m_hide) return;
1504 m_t << "<blockquote>";
1505 visitChildren(q);
1506 m_t << "</blockquote>";
1507}
1508
1510{
1512 // TODO: to be implemented
1513}
1514
1516{
1518 if (m_hide) return;
1519 visitChildren(b);
1520}
1521
1522
1523void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1524{
1526 m_t << convertToDocBook(str, retainNewLine);
1527}
1528
1529void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1530{
1532 m_t << "<link linkend=\"_" << stripPath(file);
1533 if (!anchor.isEmpty())
1534 {
1535 if (!file.isEmpty()) m_t << "_1";
1536 m_t << anchor;
1537 }
1538 m_t << "\">";
1539}
1540
1542{
1544 m_t << "</link>";
1545}
1546
1548{
1550 QCString shortName = makeShortName(baseName);
1551 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1552 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1553 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1556}
1557
1559{
1561 QCString shortName = makeShortName(baseName);
1562 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1564 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1567}
1569 const QCString &relPath,
1570 const QCString &width,
1571 const QCString &height,
1572 bool hasCaption,
1573 const DocNodeList &children,
1574 const QCString &srcFile,
1575 int srcLine
1576 )
1577{
1579 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1580 std::string inBuf;
1581 readInputFile(fileName,inBuf);
1582 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(outDir,
1583 QCString(),inBuf.c_str(),PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1584 bool first = true;
1585 for (const auto &bName: baseNameVector)
1586 {
1587 QCString baseName=makeBaseName(QCString(bName));
1589 if (!first) endPlantUmlFile(hasCaption);
1590 first = false;
1591 m_t << "<para>\n";
1592 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1593 }
1594}
1595
1597{
1599 if (m_hide) return;
1600 m_t << "\n";
1601 visitPostEnd(m_t, hasCaption);
1602 m_t << "</para>\n";
1603}
1604
1606 const QCString &relPath,
1607 const QCString &width,
1608 const QCString &height,
1609 bool hasCaption,
1610 const DocNodeList &children,
1611 const QCString &srcFile,
1612 int srcLine
1613 )
1614{
1616 QCString baseName=makeBaseName(fileName);
1617 baseName.prepend("msc_");
1618 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1619 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1620 m_t << "<para>\n";
1621 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1622}
1623
1625{
1627 if (m_hide) return;
1628 visitPostEnd(m_t, hasCaption);
1629 m_t << "</para>\n";
1630}
1631
1633{
1635 QCString shortName = makeShortName(baseName);
1636 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1637 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1638 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1641}
1642
1644 const QCString &relPath,
1645 const QCString &width,
1646 const QCString &height,
1647 bool hasCaption,
1648 const DocNodeList &children,
1649 const QCString &srcFile,
1650 int srcLine
1651 )
1652{
1654 QCString baseName=makeBaseName(fileName);
1655 baseName.prepend("dia_");
1656 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1657 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1658 m_t << "<para>\n";
1659 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1660}
1661
1663{
1665 if (m_hide) return;
1666 visitPostEnd(m_t, hasCaption);
1667 m_t << "</para>\n";
1668}
1669
1671{
1673 QCString shortName = makeShortName(baseName);
1674 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1675 writeDotGraphFromFile(baseName+".dot",outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine());
1676 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1679}
1680
1682 const QCString &relPath,
1683 const QCString &width,
1684 const QCString &height,
1685 bool hasCaption,
1686 const DocNodeList &children,
1687 const QCString &srcFile,
1688 int srcLine
1689 )
1690{
1692 QCString baseName=makeBaseName(fileName);
1693 baseName.prepend("dot_");
1694 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1695 QCString imgExt = getDotImageExtension();
1696 writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1697 m_t << "<para>\n";
1698 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1699}
1700
1702{
1704 if (m_hide) return;
1705 m_t << "\n";
1706 visitPostEnd(m_t, hasCaption);
1707 m_t << "</para>\n";
1708}
1709
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:939
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:1922
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:2141
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:3014
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:106
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:2016
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
A model of a file symbol.
Definition filedef.h:99
virtual QCString absFilePath() const =0
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
std::string fileName() const
Definition fileinfo.cpp:118
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:137
Class representing a string buffer optimized for growing.
Definition growbuf.h:28
void addChar(char c)
Definition growbuf.h:69
void addStr(const QCString &s)
Definition growbuf.h:72
void clear()
Definition growbuf.h:68
char * get()
Definition growbuf.h:114
bool empty() const
checks whether the container is empty
Definition growvector.h:140
T & front()
access the first element
Definition growvector.h:130
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * docbook(SymType symb) const
Access routine to the docbook code of the HTML entity.
Class representing a list of different code generators.
Definition outputlist.h:164
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:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:537
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:133
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
QCString left(size_t len) const
Definition qcstring.h:214
Text streaming class that buffers data.
Definition textstream.h:36
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static QCString filterId(const QCString &s)
#define DB_VIS_C
static QCString makeBaseName(const QCString &name)
static QCString makeShortName(const QCString &baseName)
static bool supportedHtmlAttribute(const QCString &name)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp: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:665
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:672
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5718
QCString stripPath(const QCString &s)
Definition util.cpp:5461
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:6047
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5736
QCString getDotImageExtension()
Definition util.cpp:6800
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:6370
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5760
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3416
A bunch of utility functions.