Doxygen
Loading...
Searching...
No Matches
latexdocvisitor.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2022 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 <algorithm>
17#include <array>
18
19#include "htmlattrib.h"
20#include "latexdocvisitor.h"
21#include "latexgen.h"
22#include "docparser.h"
23#include "language.h"
24#include "doxygen.h"
25#include "outputgen.h"
26#include "outputlist.h"
27#include "dot.h"
28#include "util.h"
29#include "message.h"
30#include "parserintf.h"
31#include "msc.h"
32#include "dia.h"
33#include "cite.h"
34#include "filedef.h"
35#include "config.h"
36#include "htmlentity.h"
37#include "emoji.h"
38#include "plantuml.h"
39#include "fileinfo.h"
40#include "regex.h"
41#include "portable.h"
42#include "codefragment.h"
43#include "cite.h"
44#include "md5.h"
45
46static const int g_maxLevels = 7;
47static const std::array<const char *,g_maxLevels> g_secLabels =
48{ "doxysection",
49 "doxysubsection",
50 "doxysubsubsection",
51 "doxysubsubsubsection",
52 "doxysubsubsubsubsection",
53 "doxysubsubsubsubsubsection",
54 "doxysubsubsubsubsubsubsection"
55};
56
57static const char *g_paragraphLabel = "doxyparagraph";
58static const char *g_subparagraphLabel = "doxysubparagraph";
59
60const char *LatexDocVisitor::getSectionName(int level) const
61{
62 bool compactLatex = Config_getBool(COMPACT_LATEX);
63 int l = level;
64 if (compactLatex) l++;
65
66 if (l < g_maxLevels)
67 {
68 l += m_hierarchyLevel; /* May be -1 if generating main page */
69 // Sections get special treatment because they inherit the parent's level
70 if (l >= g_maxLevels)
71 {
72 l = g_maxLevels - 1;
73 }
74 else if (l < 0)
75 {
76 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
77 l = 0;
78 }
79 return g_secLabels[l];
80 }
81 else if (l == 7)
82 {
83 return g_paragraphLabel;
84 }
85 else
86 {
88 }
89}
90
91static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
92{
93 // dimensions for latex images can be a percentage, in this case they need some extra
94 // handling as the % symbol is used for comments
95 static const reg::Ex re(R"((\d+)%)");
96 std::string s = dimension.str();
97 reg::Match match;
98 if (reg::search(s,match,re))
99 {
100 bool ok = false;
101 double percent = QCString(match[1].str()).toInt(&ok);
102 if (ok)
103 {
104 t << percent/100.0 << "\\text" << orientationString;
105 return;
106 }
107 }
108 t << dimension;
109}
110
111static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
112{
113 if (inlineImage)
114 {
115 t << "\n\\begin{DoxyInlineImage}%\n";
116 }
117 else
118 {
119 if (hasCaption)
120 {
121 t << "\n\\begin{DoxyImage}%\n";
122 }
123 else
124 {
125 t << "\n\\begin{DoxyImageNoCaption}%\n"
126 " \\doxymbox{";
127 }
128 }
129
130 t << "\\includegraphics";
131 if (!width.isEmpty() || !height.isEmpty())
132 {
133 t << "[";
134 }
135 if (!width.isEmpty())
136 {
137 t << "width=";
138 insertDimension(t, width, "width");
139 }
140 if (!width.isEmpty() && !height.isEmpty())
141 {
142 t << ",";
143 }
144 if (!height.isEmpty())
145 {
146 t << "height=";
147 insertDimension(t, height, "height");
148 }
149 if (width.isEmpty() && height.isEmpty())
150 {
151 /* default setting */
152 if (inlineImage)
153 {
154 t << "[height=\\baselineskip,keepaspectratio=true]";
155 }
156 else
157 {
158 t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
159 }
160 }
161 else
162 {
163 t << "]";
164 }
165
166 t << "{" << name << "}";
167
168 if (hasCaption)
169 {
170 if (!inlineImage)
171 {
172 if (Config_getBool(PDF_HYPERLINKS))
173 {
174 t << "%\n\\doxyfigcaption{";
175 }
176 else
177 {
178 t << "%\n\\doxyfigcaptionnolink{";
179 }
180 }
181 else
182 {
183 t << "%"; // to catch the caption
184 }
185 }
186}
187
188
189
190static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
191{
192 if (inlineImage)
193 {
194 t << "%\n\\end{DoxyInlineImage}\n";
195 }
196 else
197 {
198 t << "}%\n"; // end doxymbox or caption
199 if (hasCaption)
200 {
201 t << "\\end{DoxyImage}\n";
202 }
203 else
204 {
205 t << "\\end{DoxyImageNoCaption}\n";
206 }
207 }
208}
209
211{
212 for (const auto &n : children)
213 {
214 std::visit(*this,n);
215 }
216}
217
219 const QCString &langExt, int hierarchyLevel)
220 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
222 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
223{
224}
225
226 //--------------------------------------
227 // visitor functions for leaf nodes
228 //--------------------------------------
229
231{
232 if (m_hide) return;
233 filter(w.word());
234}
235
237{
238 if (m_hide) return;
239 startLink(w.ref(),w.file(),w.anchor());
240 filter(w.word());
241 endLink(w.ref(),w.file(),w.anchor());
242}
243
245{
246 if (m_hide) return;
247 if (m_insidePre)
248 {
249 m_t << w.chars();
250 }
251 else
252 {
253 m_t << " ";
254 }
255}
256
258{
259 if (m_hide) return;
260 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
261 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
262 if (res)
263 {
265 {
266 if (pdfHyperlinks)
267 {
268 m_t << "\\texorpdfstring{$<$}{<}";
269 }
270 else
271 {
272 m_t << "$<$";
273 }
274 }
276 {
277 if (pdfHyperlinks)
278 {
279 m_t << "\\texorpdfstring{$>$}{>}";
280 }
281 else
282 {
283 m_t << "$>$";
284 }
285 }
286 else
287 {
288 m_t << res;
289 }
290 }
291 else
292 {
293 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
294 }
295}
296
298{
299 if (m_hide) return;
301 if (!emojiName.isEmpty())
302 {
303 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
304 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
305 filter(emojiName);
306 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
307 }
308 else
309 {
310 m_t << s.name();
311 }
312}
313
315{
316 if (m_hide) return;
317 if (Config_getBool(PDF_HYPERLINKS))
318 {
319 m_t << "\\href{";
320 if (u.isEmail()) m_t << "mailto:";
321 m_t << latexFilterURL(u.url()) << "}";
322 }
323 m_t << "{\\texttt{";
324 filter(u.url());
325 m_t << "}}";
326}
327
329{
330 if (m_hide) return;
331 if (m_insideItem)
332 {
333 m_t << "\\\\\n";
334 }
335 else
336 {
337 m_t << "~\\newline\n";
338 }
339}
340
342{
343 if (m_hide) return;
344 if (insideTable())
345 m_t << "\\DoxyHorRuler{1}\n";
346 else
347 m_t << "\\DoxyHorRuler{0}\n";
348}
349
351{
352 if (m_hide) return;
353 switch (s.style())
354 {
356 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
357 break;
361 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
362 break;
365 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
366 break;
368 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
369 break;
373 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
374 break;
376 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
377 break;
379 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
380 break;
382 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
383 break;
385 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
386 break;
388 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
389 break;
391 if (s.enable())
392 {
393 m_t << "\n\\begin{DoxyPre}";
395 }
396 else
397 {
399 m_t << "\\end{DoxyPre}\n";
400 }
401 break;
402 case DocStyleChange::Div: /* HTML only */ break;
403 case DocStyleChange::Span: /* HTML only */ break;
404 }
405}
406
408{
409 if (m_hide) return;
410 QCString lang = m_langExt;
411 if (!s.language().isEmpty()) // explicit language setting
412 {
413 lang = s.language();
414 }
415 SrcLangExt langExt = getLanguageFromCodeLang(lang);
416 switch(s.type())
417 {
419 {
420 m_ci.startCodeFragment("DoxyCode");
421 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
422 Config_getBool(STRIP_CODE_COMMENTS),
423 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
424 m_ci.endCodeFragment("DoxyCode");
425 }
426 break;
428 filter(s.text(), true);
429 break;
431 m_t << "{\\ttfamily ";
432 filter(s.text(), true);
433 m_t << "}";
434 break;
436 if (isTableNested(s.parent())) // in table
437 {
438 m_t << "\\begin{DoxyCode}{0}";
439 filter(s.text(), true);
440 m_t << "\\end{DoxyCode}\n";
441 }
442 else
443 {
444 m_t << "\\begin{DoxyVerb}";
445 m_t << s.text();
446 m_t << "\\end{DoxyVerb}\n";
447 }
448 break;
454 /* nothing */
455 break;
457 m_t << s.text();
458 break;
459 case DocVerbatim::Dot:
460 {
461 bool exists = false;
462 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
463 ".dot", // extension
464 s.text(), // contents
465 exists);
466 if (!fileName.isEmpty())
467 {
468 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
469 visitChildren(s);
471 }
472 }
473 break;
474 case DocVerbatim::Msc:
475 {
476 bool exists = false;
477 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
478 ".msc", // extension
479 "msc {"+s.text()+"}", // contents
480 exists);
481 if (!fileName.isEmpty())
482 {
483 writeMscFile(fileName, s, !exists);
484 }
485 }
486 break;
488 {
489 QCString latexOutput = Config_getString(LATEX_OUTPUT);
490 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
491 latexOutput,s.exampleFile(),s.text(),
493 s.engine(),s.srcFile(),s.srcLine(),true);
494
495 for (const auto &baseName: baseNameVector)
496 {
497 writePlantUMLFile(baseName, s);
498 }
499 }
500 break;
501 }
502}
503
505{
506 if (m_hide) return;
507 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
508 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
509 {
510 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
511 << "}%\n";
512 }
513}
514
516{
517 if (m_hide) return;
519 switch(inc.type())
520 {
522 {
523 m_ci.startCodeFragment("DoxyCodeInclude");
524 FileInfo cfi( inc.file().str() );
525 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
527 inc.text(),
528 langExt,
529 inc.stripCodeComments(),
531 .setExample(inc.isExample(), inc.exampleFile())
532 .setFileDef(fd.get())
533 .setInlineFragment(true)
534 );
535 m_ci.endCodeFragment("DoxyCodeInclude");
536 }
537 break;
539 {
540 m_ci.startCodeFragment("DoxyCodeInclude");
542 inc.text(),langExt,
543 inc.stripCodeComments(),
545 .setExample(inc.isExample(), inc.exampleFile())
546 .setInlineFragment(true)
547 .setShowLineNumbers(false)
548 );
549 m_ci.endCodeFragment("DoxyCodeInclude");
550 }
551 break;
559 break;
561 m_t << inc.text();
562 break;
564 if (isTableNested(inc.parent())) // in table
565 {
566 m_t << "\\begin{DoxyCode}{0}";
567 filter(inc.text(), true);
568 m_t << "\\end{DoxyCode}\n";
569 }
570 else
571 {
572 m_t << "\n\\begin{DoxyVerbInclude}\n";
573 m_t << inc.text();
574 m_t << "\\end{DoxyVerbInclude}\n";
575 }
576 break;
579 {
580 m_ci.startCodeFragment("DoxyCodeInclude");
582 inc.file(),
583 inc.blockId(),
584 inc.context(),
586 inc.trimLeft(),
588 );
589 m_ci.endCodeFragment("DoxyCodeInclude");
590 }
591 break;
592 }
593}
594
596{
597 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
598 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
599 if (op.isFirst())
600 {
601 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
603 m_hide = TRUE;
604 }
606 if (locLangExt.isEmpty()) locLangExt = m_langExt;
607 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
608 if (op.type()!=DocIncOperator::Skip)
609 {
610 m_hide = popHidden();
611 if (!m_hide)
612 {
613 std::unique_ptr<FileDef> fd;
614 if (!op.includeFileName().isEmpty())
615 {
616 FileInfo cfi( op.includeFileName().str() );
617 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
618 }
619
620 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
623 .setExample(op.isExample(),op.exampleFile())
624 .setFileDef(fd.get())
625 .setStartLine(op.line())
627 );
628 }
630 m_hide=TRUE;
631 }
632 if (op.isLast())
633 {
635 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
636 }
637 else
638 {
639 if (!m_hide) m_t << "\n";
640 }
641}
642
644{
645 if (m_hide) return;
646 QCString s = f.text();
647 const char *p = s.data();
648 char c = 0;
649 if (p)
650 {
651 while ((c=*p++))
652 {
653 switch (c)
654 {
655 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
656 default: m_t << c; break;
657 }
658 }
659 }
660}
661
663{
664 if (m_hide) return;
665 m_t << "\\index{";
667 m_t << "@{";
669 m_t << "}}";
670}
671
675
677{
678 if (m_hide) return;
679 auto opt = cite.option();
680 QCString txt;
681 if (opt.noCite())
682 {
683 if (!cite.file().isEmpty())
684 {
685 txt = cite.getText();
686 }
687 else
688 {
689 if (!opt.noPar()) txt += "[";
690 txt += cite.target();
691 if (!opt.noPar()) txt += "]";
692 }
693 m_t << "{\\bfseries ";
694 filter(txt);
695 m_t << "}";
696 }
697 else
698 {
699 if (!cite.file().isEmpty())
700 {
701 QCString anchor = cite.anchor();
703 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
704
705 txt = "\\DoxyCite{" + anchor + "}";
706 if (opt.isNumber())
707 {
708 txt += "{number}";
709 }
710 else if (opt.isShortAuthor())
711 {
712 txt += "{shortauthor}";
713 }
714 else if (opt.isYear())
715 {
716 txt += "{year}";
717 }
718 if (!opt.noPar()) txt += "{1}";
719 else txt += "{0}";
720
721 m_t << txt;
722 }
723 else
724 {
725 if (!opt.noPar()) txt += "[";
726 txt += cite.target();
727 if (!opt.noPar()) txt += "]";
728 m_t << "{\\bfseries ";
729 filter(txt);
730 m_t << "}";
731 }
732 }
733}
734
735//--------------------------------------
736// visitor functions for compound nodes
737//--------------------------------------
738
740{
741 if (m_hide) return;
742 if (m_indentLevel>=maxIndentLevels-1) return;
743 if (l.isEnumList())
744 {
745 m_t << "\n\\begin{DoxyEnumerate}";
746 m_listItemInfo[indentLevel()].isEnum = true;
747 }
748 else
749 {
750 m_listItemInfo[indentLevel()].isEnum = false;
751 m_t << "\n\\begin{DoxyItemize}";
752 }
753 visitChildren(l);
754 if (l.isEnumList())
755 {
756 m_t << "\n\\end{DoxyEnumerate}";
757 }
758 else
759 {
760 m_t << "\n\\end{DoxyItemize}";
761 }
762}
763
765{
766 if (m_hide) return;
767 switch (li.itemNumber())
768 {
769 case DocAutoList::Unchecked: // unchecked
770 m_t << "\n\\item[\\DoxyUnchecked] ";
771 break;
772 case DocAutoList::Checked_x: // checked with x
773 case DocAutoList::Checked_X: // checked with X
774 m_t << "\n\\item[\\DoxyChecked] ";
775 break;
776 default:
777 m_t << "\n\\item ";
778 break;
779 }
781 visitChildren(li);
783}
784
786{
787 if (m_hide) return;
788 visitChildren(p);
789 if (!p.isLast() && // omit <p> for last paragraph
790 !(p.parent() && // and for parameter sections
791 std::get_if<DocParamSect>(p.parent())
792 )
793 )
794 {
795 if (insideTable())
796 {
797 m_t << "~\\newline\n";
798 }
799 else
800 {
801 m_t << "\n\n";
802 }
803 }
804}
805
807{
808 visitChildren(r);
809}
810
812{
813 if (m_hide) return;
814 switch(s.type())
815 {
817 m_t << "\\begin{DoxySeeAlso}{";
818 filter(theTranslator->trSeeAlso());
819 break;
821 m_t << "\\begin{DoxyReturn}{";
822 filter(theTranslator->trReturns());
823 break;
825 m_t << "\\begin{DoxyAuthor}{";
826 filter(theTranslator->trAuthor(TRUE,TRUE));
827 break;
829 m_t << "\\begin{DoxyAuthor}{";
830 filter(theTranslator->trAuthor(TRUE,FALSE));
831 break;
833 m_t << "\\begin{DoxyVersion}{";
834 filter(theTranslator->trVersion());
835 break;
837 m_t << "\\begin{DoxySince}{";
838 filter(theTranslator->trSince());
839 break;
841 m_t << "\\begin{DoxyDate}{";
842 filter(theTranslator->trDate());
843 break;
845 m_t << "\\begin{DoxyNote}{";
846 filter(theTranslator->trNote());
847 break;
849 m_t << "\\begin{DoxyWarning}{";
850 filter(theTranslator->trWarning());
851 break;
853 m_t << "\\begin{DoxyPrecond}{";
854 filter(theTranslator->trPrecondition());
855 break;
857 m_t << "\\begin{DoxyPostcond}{";
858 filter(theTranslator->trPostcondition());
859 break;
861 m_t << "\\begin{DoxyCopyright}{";
862 filter(theTranslator->trCopyright());
863 break;
865 m_t << "\\begin{DoxyInvariant}{";
866 filter(theTranslator->trInvariant());
867 break;
869 m_t << "\\begin{DoxyRemark}{";
870 filter(theTranslator->trRemarks());
871 break;
873 m_t << "\\begin{DoxyAttention}{";
874 filter(theTranslator->trAttention());
875 break;
877 m_t << "\\begin{DoxyImportant}{";
878 filter(theTranslator->trImportant());
879 break;
881 m_t << "\\begin{DoxyParagraph}{";
882 break;
884 m_t << "\\begin{DoxyParagraph}{";
885 break;
886 case DocSimpleSect::Unknown: break;
887 }
888
889 if (s.title())
890 {
892 std::visit(*this,*s.title());
894 }
895 m_t << "}\n";
897 visitChildren(s);
898 switch(s.type())
899 {
901 m_t << "\n\\end{DoxySeeAlso}\n";
902 break;
904 m_t << "\n\\end{DoxyReturn}\n";
905 break;
907 m_t << "\n\\end{DoxyAuthor}\n";
908 break;
910 m_t << "\n\\end{DoxyAuthor}\n";
911 break;
913 m_t << "\n\\end{DoxyVersion}\n";
914 break;
916 m_t << "\n\\end{DoxySince}\n";
917 break;
919 m_t << "\n\\end{DoxyDate}\n";
920 break;
922 m_t << "\n\\end{DoxyNote}\n";
923 break;
925 m_t << "\n\\end{DoxyWarning}\n";
926 break;
928 m_t << "\n\\end{DoxyPrecond}\n";
929 break;
931 m_t << "\n\\end{DoxyPostcond}\n";
932 break;
934 m_t << "\n\\end{DoxyCopyright}\n";
935 break;
937 m_t << "\n\\end{DoxyInvariant}\n";
938 break;
940 m_t << "\n\\end{DoxyRemark}\n";
941 break;
943 m_t << "\n\\end{DoxyAttention}\n";
944 break;
946 m_t << "\n\\end{DoxyImportant}\n";
947 break;
949 m_t << "\n\\end{DoxyParagraph}\n";
950 break;
952 m_t << "\n\\end{DoxyParagraph}\n";
953 break;
954 default:
955 break;
956 }
958}
959
961{
962 if (m_hide) return;
963 visitChildren(t);
964}
965
967{
968 if (m_hide) return;
969 m_t << "\\begin{DoxyItemize}\n";
970 m_listItemInfo[indentLevel()].isEnum = false;
971 visitChildren(l);
972 m_t << "\\end{DoxyItemize}\n";
973}
974
976{
977 if (m_hide) return;
978 m_t << "\\item ";
980 if (li.paragraph())
981 {
982 visit(*this,*li.paragraph());
983 }
985}
986
988{
989 if (m_hide) return;
990 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
991 if (pdfHyperlinks)
992 {
993 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
994 }
995 m_t << "\\" << getSectionName(s.level()) << "{";
996 if (pdfHyperlinks)
997 {
998 m_t << "\\texorpdfstring{";
999 }
1000 if (s.title())
1001 {
1002 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1003 std::visit(*this,*s.title());
1005 }
1006 if (pdfHyperlinks)
1007 {
1008 m_t << "}{";
1009 if (s.title())
1010 {
1011 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1012 std::visit(*this,*s.title());
1014 }
1015 m_t << "}";
1016 }
1017 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1018 visitChildren(s);
1019}
1020
1022{
1023 if (m_hide) return;
1024 if (m_indentLevel>=maxIndentLevels-1) return;
1026 if (s.type()==DocHtmlList::Ordered)
1027 {
1028 bool first = true;
1029 m_t << "\n\\begin{DoxyEnumerate}";
1030 for (const auto &opt : s.attribs())
1031 {
1032 if (opt.name=="type")
1033 {
1034 if (opt.value=="1")
1035 {
1036 m_t << (first ? "[": ",");
1037 m_t << "label=\\arabic*";
1038 first = false;
1039 }
1040 else if (opt.value=="a")
1041 {
1042 m_t << (first ? "[": ",");
1043 m_t << "label=\\enumalphalphcnt*";
1044 first = false;
1045 }
1046 else if (opt.value=="A")
1047 {
1048 m_t << (first ? "[": ",");
1049 m_t << "label=\\enumAlphAlphcnt*";
1050 first = false;
1051 }
1052 else if (opt.value=="i")
1053 {
1054 m_t << (first ? "[": ",");
1055 m_t << "label=\\roman*";
1056 first = false;
1057 }
1058 else if (opt.value=="I")
1059 {
1060 m_t << (first ? "[": ",");
1061 m_t << "label=\\Roman*";
1062 first = false;
1063 }
1064 }
1065 else if (opt.name=="start")
1066 {
1067 m_t << (first ? "[": ",");
1068 bool ok = false;
1069 int val = opt.value.toInt(&ok);
1070 if (ok) m_t << "start=" << val;
1071 first = false;
1072 }
1073 }
1074 if (!first) m_t << "]\n";
1075 }
1076 else
1077 {
1078 m_t << "\n\\begin{DoxyItemize}";
1079 }
1080 visitChildren(s);
1081 if (m_indentLevel>=maxIndentLevels-1) return;
1082 if (s.type()==DocHtmlList::Ordered)
1083 m_t << "\n\\end{DoxyEnumerate}";
1084 else
1085 m_t << "\n\\end{DoxyItemize}";
1086}
1087
1089{
1090 if (m_hide) return;
1091 if (m_listItemInfo[indentLevel()].isEnum)
1092 {
1093 for (const auto &opt : l.attribs())
1094 {
1095 if (opt.name=="value")
1096 {
1097 bool ok = false;
1098 int val = opt.value.toInt(&ok);
1099 if (ok)
1100 {
1101 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1102 }
1103 }
1104 }
1105 }
1106 m_t << "\n\\item ";
1108 visitChildren(l);
1110}
1111
1112
1114{
1115 HtmlAttribList attrs = dl.attribs();
1116 auto it = std::find_if(attrs.begin(),attrs.end(),
1117 [](const auto &att) { return att.name=="class"; });
1118 if (it!=attrs.end() && it->value == "reflist") return true;
1119 return false;
1120}
1121
1122static bool listIsNested(const DocHtmlDescList &dl)
1123{
1124 bool isNested=false;
1125 const DocNodeVariant *n = dl.parent();
1126 while (n && !isNested)
1127 {
1128 if (std::get_if<DocHtmlDescList>(n))
1129 {
1130 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1131 }
1132 n = ::parent(n);
1133 }
1134 return isNested;
1135}
1136
1138{
1139 if (m_hide) return;
1140 bool eq = classEqualsReflist(dl);
1141 if (eq)
1142 {
1143 m_t << "\n\\begin{DoxyRefList}";
1144 }
1145 else
1146 {
1147 if (listIsNested(dl)) m_t << "\n\\hfill";
1148 m_t << "\n\\begin{DoxyDescription}";
1149 }
1150 visitChildren(dl);
1151 if (eq)
1152 {
1153 m_t << "\n\\end{DoxyRefList}";
1154 }
1155 else
1156 {
1157 m_t << "\n\\end{DoxyDescription}";
1158 }
1159}
1160
1162{
1163 if (m_hide) return;
1164 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1166 visitChildren(dt);
1168 m_t << "}}]";
1169}
1170
1172{
1174 if (!m_insideItem) m_t << "\\hfill";
1175 m_t << " \\\\\n";
1176 visitChildren(dd);
1178}
1179
1181{
1182 bool isNested=m_lcg.usedTableLevel()>0;
1183 while (n && !isNested)
1184 {
1186 n = ::parent(n);
1187 }
1188 return isNested;
1189}
1190
1192{
1193 if (isTableNested(n))
1194 {
1195 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1196 }
1197 else
1198 {
1199 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1200 }
1201}
1202
1204{
1205 if (isTableNested(n))
1206 {
1207 m_t << "\\end{DoxyTableNested}\n";
1208 }
1209 else
1210 {
1211 m_t << "\\end{DoxyTable}\n";
1212 }
1213}
1214
1216{
1217 if (m_hide) return;
1219 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1220 if (c)
1221 {
1222 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1223 if (!c->file().isEmpty() && pdfHyperLinks)
1224 {
1225 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1226 << "}{}";
1227 }
1228 m_t << "\n";
1229 }
1230
1232 if (!isTableNested(t.parent()))
1233 {
1234 // write caption
1235 m_t << "{";
1236 if (c)
1237 {
1238 std::visit(*this, *t.caption());
1239 }
1240 m_t << "}";
1241 // write label
1242 m_t << "{";
1243 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1244 {
1245 m_t << stripPath(c->file()) << "_" << c->anchor();
1246 }
1247 m_t << "}";
1248 }
1249
1250 // write head row(s)
1251 m_t << "{" << t.numberHeaderRows() << "}\n";
1252
1254
1255 visitChildren(t);
1257 popTableState();
1258}
1259
1261{
1262 if (m_hide) return;
1263 visitChildren(c);
1264}
1265
1267{
1268 if (m_hide) return;
1270
1271 visitChildren(row);
1272
1273 m_t << "\\\\";
1274
1275 size_t col = 1;
1276 for (auto &span : rowSpans())
1277 {
1278 if (span.rowSpan>0) span.rowSpan--;
1279 if (span.rowSpan<=0)
1280 {
1281 // inactive span
1282 }
1283 else if (span.column>col)
1284 {
1285 col = span.column+span.colSpan;
1286 }
1287 else
1288 {
1289 col = span.column+span.colSpan;
1290 }
1291 }
1292
1293 m_t << "\n";
1294}
1295
1297{
1298 if (m_hide) return;
1299 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1300
1302
1303 QCString cellOpts;
1304 QCString cellSpec;
1305 auto appendOpt = [&cellOpts](const QCString &s)
1306 {
1307 if (!cellOpts.isEmpty()) cellOpts+=",";
1308 cellOpts+=s;
1309 };
1310 auto appendSpec = [&cellSpec](const QCString &s)
1311 {
1312 if (!cellSpec.isEmpty()) cellSpec+=",";
1313 cellSpec+=s;
1314 };
1315 auto writeCell = [this,&cellOpts,&cellSpec]()
1316 {
1317 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1318 {
1319 m_t << "\\SetCell";
1320 if (!cellOpts.isEmpty())
1321 {
1322 m_t << "[" << cellOpts << "]";
1323 }
1324 m_t << "{" << cellSpec << "}";
1325 }
1326 };
1327
1328 // skip over columns that have a row span starting at an earlier row
1329 for (const auto &span : rowSpans())
1330 {
1331 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1332 // span.cell.rowIndex(),span.cell.columnIndex(),
1333 // span.column,span.colSpan,span.rowSpan,
1334 // currentColumn());
1335 if (span.rowSpan>0 && span.column==currentColumn())
1336 {
1337 setCurrentColumn(currentColumn()+span.colSpan);
1338 for (size_t i=0;i<span.colSpan;i++)
1339 {
1340 m_t << "&";
1341 }
1342 }
1343 }
1344
1345 int cs = c.colSpan();
1346 int ha = c.alignment();
1347 int rs = c.rowSpan();
1348 int va = c.valignment();
1349
1350 switch (ha) // horizontal alignment
1351 {
1352 case DocHtmlCell::Right:
1353 appendSpec("r");
1354 break;
1356 appendSpec("c");
1357 break;
1358 default:
1359 // default
1360 break;
1361 }
1362 if (rs>0) // row span
1363 {
1364 appendOpt("r="+QCString().setNum(rs));
1365 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1366 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1367 // currentColumn());
1369 }
1370 if (cs>1) // column span
1371 {
1372 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1374 appendOpt("c="+QCString().setNum(cs));
1375 }
1376 if (c.isHeading())
1377 {
1378 appendSpec("bg=\\tableheadbgcolor");
1379 appendSpec("font=\\bfseries");
1380 }
1381 switch(va) // vertical alignment
1382 {
1383 case DocHtmlCell::Top:
1384 appendSpec("h");
1385 break;
1387 appendSpec("f");
1388 break;
1390 // default
1391 break;
1392 }
1393 writeCell();
1394
1395 visitChildren(c);
1396
1397 for (int i=0;i<cs-1;i++)
1398 {
1399 m_t << "&"; // placeholder for invisible cell
1400 }
1401
1402 if (!c.isLast()) m_t << "&";
1403}
1404
1406{
1407 if (m_hide) return;
1408 visitChildren(i);
1409}
1410
1412{
1413 if (m_hide) return;
1414 if (Config_getBool(PDF_HYPERLINKS))
1415 {
1416 m_t << "\\href{";
1417 m_t << latexFilterURL(href.url());
1418 m_t << "}";
1419 }
1420 m_t << "{\\texttt{";
1421 visitChildren(href);
1422 m_t << "}}";
1423}
1424
1426{
1427 if (m_hide) return;
1428 m_t << "{\\bfseries{";
1429 visitChildren(d);
1430 m_t << "}}";
1431}
1432
1434{
1435 if (m_hide) return;
1436 m_t << "\n\n";
1437 auto summary = d.summary();
1438 if (summary)
1439 {
1440 std::visit(*this,*summary);
1441 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1442 }
1443 visitChildren(d);
1444 if (summary)
1445 {
1446 m_t << "\\end{adjustwidth}\n";
1447 }
1448 else
1449 {
1450 m_t << "\n\n";
1451 }
1452}
1453
1455{
1456 if (m_hide) return;
1457 m_t << "\\" << getSectionName(header.level()) << "*{";
1458 visitChildren(header);
1459 m_t << "}";
1460}
1461
1463{
1464 if (img.type()==DocImage::Latex)
1465 {
1466 if (m_hide) return;
1467 QCString gfxName = img.name();
1468 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1469 {
1470 gfxName=gfxName.left(gfxName.length()-4);
1471 }
1472
1473 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1474 visitChildren(img);
1476 }
1477 else // other format -> skip
1478 {
1479 }
1480}
1481
1483{
1484 if (m_hide) return;
1485 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1486 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1487 visitChildren(df);
1488 endDotFile(df.hasCaption());
1489}
1490
1492{
1493 if (m_hide) return;
1494 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1495 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1496 visitChildren(df);
1497 endMscFile(df.hasCaption());
1498}
1499
1501{
1502 if (m_hide) return;
1503 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1504 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1505 visitChildren(df);
1506 endDiaFile(df.hasCaption());
1507}
1508
1510{
1511 if (m_hide) return;
1512 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1513 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1514 visitChildren(df);
1516}
1517
1519{
1520 if (m_hide) return;
1521 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1522 visitChildren(lnk);
1523 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1524}
1525
1527{
1528 if (m_hide) return;
1529 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1530 // ref.anchor() for LaTeX/RTF
1531 if (ref.isSubPage())
1532 {
1533 startLink(ref.ref(),QCString(),ref.anchor());
1534 }
1535 else
1536 {
1537 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1538 }
1539 if (!ref.hasLinkText())
1540 {
1541 filter(ref.targetTitle());
1542 }
1543 visitChildren(ref);
1544 if (ref.isSubPage())
1545 {
1546 endLink(ref.ref(),QCString(),ref.anchor());
1547 }
1548 else
1549 {
1550 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1551 }
1552}
1553
1555{
1556 if (m_hide) return;
1557 m_t << "\\item \\contentsline{section}{";
1558 if (ref.isSubPage())
1559 {
1560 startLink(ref.ref(),QCString(),ref.anchor());
1561 }
1562 else
1563 {
1564 if (!ref.file().isEmpty())
1565 {
1566 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1567 }
1568 }
1569 visitChildren(ref);
1570 if (ref.isSubPage())
1571 {
1572 endLink(ref.ref(),QCString(),ref.anchor());
1573 }
1574 else
1575 {
1576 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1577 }
1578 m_t << "}{\\ref{";
1579 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1580 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1581 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1582 m_t << "}}{}\n";
1583}
1584
1586{
1587 if (m_hide) return;
1588 m_t << "\\footnotesize\n";
1589 m_t << "\\begin{multicols}{2}\n";
1590 m_t << "\\begin{DoxyCompactList}\n";
1592 visitChildren(l);
1594 m_t << "\\end{DoxyCompactList}\n";
1595 m_t << "\\end{multicols}\n";
1596 m_t << "\\normalsize\n";
1597}
1598
1600{
1601 if (m_hide) return;
1602 bool hasInOutSpecs = s.hasInOutSpecifier();
1603 bool hasTypeSpecs = s.hasTypeSpecifier();
1604 m_lcg.incUsedTableLevel();
1605 switch(s.type())
1606 {
1608 m_t << "\n\\begin{DoxyParams}";
1609 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1610 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1611 m_t << "{";
1612 filter(theTranslator->trParameters());
1613 break;
1615 m_t << "\n\\begin{DoxyRetVals}{";
1616 filter(theTranslator->trReturnValues());
1617 break;
1619 m_t << "\n\\begin{DoxyExceptions}{";
1620 filter(theTranslator->trExceptions());
1621 break;
1623 m_t << "\n\\begin{DoxyTemplParams}{";
1624 filter(theTranslator->trTemplateParameters());
1625 break;
1626 default:
1627 ASSERT(0);
1629 }
1630 m_t << "}\n";
1631 visitChildren(s);
1632 m_lcg.decUsedTableLevel();
1633 switch(s.type())
1634 {
1636 m_t << "\\end{DoxyParams}\n";
1637 break;
1639 m_t << "\\end{DoxyRetVals}\n";
1640 break;
1642 m_t << "\\end{DoxyExceptions}\n";
1643 break;
1645 m_t << "\\end{DoxyTemplParams}\n";
1646 break;
1647 default:
1648 ASSERT(0);
1650 }
1651}
1652
1654{
1655 m_t << " " << sep.chars() << " ";
1656}
1657
1659{
1660 if (m_hide) return;
1662 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1663 if (sect)
1664 {
1665 parentType = sect->type();
1666 }
1667 bool useTable = parentType==DocParamSect::Param ||
1668 parentType==DocParamSect::RetVal ||
1669 parentType==DocParamSect::Exception ||
1670 parentType==DocParamSect::TemplateParam;
1671 if (!useTable)
1672 {
1673 m_t << "\\item[";
1674 }
1675 if (sect && sect->hasInOutSpecifier())
1676 {
1678 {
1679 m_t << "\\doxymbox{\\texttt{";
1680 if (pl.direction()==DocParamSect::In)
1681 {
1682 m_t << "in";
1683 }
1684 else if (pl.direction()==DocParamSect::Out)
1685 {
1686 m_t << "out";
1687 }
1688 else if (pl.direction()==DocParamSect::InOut)
1689 {
1690 m_t << "in,out";
1691 }
1692 m_t << "}} ";
1693 }
1694 if (useTable) m_t << " & ";
1695 }
1696 if (sect && sect->hasTypeSpecifier())
1697 {
1698 for (const auto &type : pl.paramTypes())
1699 {
1700 std::visit(*this,type);
1701 }
1702 if (useTable) m_t << " & ";
1703 }
1704 m_t << "{\\em ";
1705 bool first=TRUE;
1706 for (const auto &param : pl.parameters())
1707 {
1708 if (!first) m_t << ","; else first=FALSE;
1710 std::visit(*this,param);
1712 }
1713 m_t << "}";
1714 if (useTable)
1715 {
1716 m_t << " & ";
1717 }
1718 else
1719 {
1720 m_t << "]";
1721 }
1722 for (const auto &par : pl.paragraphs())
1723 {
1724 std::visit(*this,par);
1725 }
1726 if (useTable)
1727 {
1728 m_t << "\\\\\n"
1729 << "\\hline\n";
1730 }
1731}
1732
1734{
1735 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1736 if (m_hide) return;
1737 if (x.title().isEmpty()) return;
1739 m_t << "\\begin{DoxyRefDesc}{";
1740 filter(x.title());
1741 m_t << "}\n";
1742 bool anonymousEnum = x.file()=="@";
1743 m_t << "\\item[";
1744 if (pdfHyperlinks && !anonymousEnum)
1745 {
1746 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1747 }
1748 else
1749 {
1750 m_t << "\\textbf{ ";
1751 }
1753 filter(x.title());
1755 if (pdfHyperlinks && !anonymousEnum)
1756 {
1757 m_t << "}";
1758 }
1759 m_t << "}]";
1760 visitChildren(x);
1761 if (x.title().isEmpty()) return;
1763 m_t << "\\end{DoxyRefDesc}\n";
1764}
1765
1767{
1768 if (m_hide) return;
1769 startLink(QCString(),ref.file(),ref.anchor());
1770 visitChildren(ref);
1771 endLink(QCString(),ref.file(),ref.anchor());
1772}
1773
1775{
1776 if (m_hide) return;
1777 visitChildren(t);
1778}
1779
1781{
1782 if (m_hide) return;
1783 m_t << "\\begin{quote}\n";
1785 visitChildren(q);
1786 m_t << "\\end{quote}\n";
1788}
1789
1793
1795{
1796 if (m_hide) return;
1797 visitChildren(pb);
1798}
1799
1800void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1801{
1802 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1804 m_lcg.insideTabbing(),
1807 m_lcg.usedTableLevel()>0, // insideTable
1808 false, // keepSpaces
1809 retainNewLine
1810 );
1811}
1812
1813void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1814 bool refToTable,bool refToSection)
1815{
1816 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1817 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1818 {
1819 if (refToTable)
1820 {
1821 m_t << "\\doxytablelink{";
1822 }
1823 else if (refToSection)
1824 {
1825 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1826 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1827 }
1828 else
1829 {
1830 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1831 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1832 }
1833 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1834 {
1835 if (!file.isEmpty()) m_t << stripPath(file);
1836 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1837 if (!anchor.isEmpty()) m_t << anchor;
1838 m_t << "}";
1839 }
1840 m_t << "{";
1841 }
1842 else if (ref.isEmpty() && refToSection)
1843 {
1844 m_t << "\\doxysectref{";
1845 }
1846 else if (ref.isEmpty() && refToTable)
1847 {
1848 m_t << "\\doxytableref{";
1849 }
1850 else if (ref.isEmpty()) // internal non-PDF link
1851 {
1852 m_t << "\\doxyref{";
1853 }
1854 else // external link
1855 {
1856 m_t << "\\textbf{ ";
1857 }
1858}
1859
1860void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1861{
1862 m_t << "}";
1863 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1864 if (ref.isEmpty() && !pdfHyperLinks)
1865 {
1866 m_t << "{";
1867 filter(theTranslator->trPageAbbreviation());
1868 m_t << "}{" << file;
1869 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1870 m_t << anchor << "}";
1871 if (refToSection)
1872 {
1873 m_t << "{" << sectionType.level() << "}";
1874 }
1875 }
1876 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1877 {
1878 if (refToSection)
1879 {
1880 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1881 }
1882 }
1883}
1884
1886 const QCString &width,
1887 const QCString &height,
1888 bool hasCaption,
1889 const QCString &srcFile,
1890 int srcLine, bool newFile
1891 )
1892{
1893 QCString baseName=makeBaseName(fileName,".dot");
1894 baseName.prepend("dot_");
1895 QCString outDir = Config_getString(LATEX_OUTPUT);
1896 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1897 visitPreStart(m_t,hasCaption, baseName, width, height);
1898}
1899
1900void LatexDocVisitor::endDotFile(bool hasCaption)
1901{
1902 if (m_hide) return;
1903 visitPostEnd(m_t,hasCaption);
1904}
1905
1907 const QCString &width,
1908 const QCString &height,
1909 bool hasCaption,
1910 const QCString &srcFile,
1911 int srcLine
1912 )
1913{
1914 QCString baseName=makeBaseName(fileName,".msc");
1915 baseName.prepend("msc_");
1916
1917 QCString outDir = Config_getString(LATEX_OUTPUT);
1918 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1919 visitPreStart(m_t,hasCaption, baseName, width, height);
1920}
1921
1922void LatexDocVisitor::endMscFile(bool hasCaption)
1923{
1924 if (m_hide) return;
1925 visitPostEnd(m_t,hasCaption);
1926}
1927
1928
1929void LatexDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1930{
1931 QCString shortName=makeBaseName(fileName,".msc");
1932 QCString outDir = Config_getString(LATEX_OUTPUT);
1933 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
1934 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1937}
1938
1940 const QCString &width,
1941 const QCString &height,
1942 bool hasCaption,
1943 const QCString &srcFile,
1944 int srcLine
1945 )
1946{
1947 QCString baseName=makeBaseName(fileName,".dia");
1948 baseName.prepend("dia_");
1949
1950 QCString outDir = Config_getString(LATEX_OUTPUT);
1951 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
1952 visitPreStart(m_t,hasCaption, baseName, width, height);
1953}
1954
1955void LatexDocVisitor::endDiaFile(bool hasCaption)
1956{
1957 if (m_hide) return;
1958 visitPostEnd(m_t,hasCaption);
1959}
1960
1962{
1963 QCString shortName = stripPath(baseName);
1964 if (s.useBitmap())
1965 {
1966 if (shortName.find('.')==-1) shortName += ".png";
1967 }
1968 QCString outDir = Config_getString(LATEX_OUTPUT);
1971 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
1974}
1975
1977 const QCString &width,
1978 const QCString &height,
1979 bool hasCaption,
1980 const QCString &srcFile,
1981 int srcLine
1982 )
1983{
1984 QCString outDir = Config_getString(LATEX_OUTPUT);
1985 std::string inBuf;
1986 readInputFile(fileName,inBuf);
1987
1988 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
1989 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
1990 outDir,QCString(),inBuf,
1992 QCString(),srcFile,srcLine,false);
1993 bool first = true;
1994 for (const auto &bName: baseNameVector)
1995 {
1996 QCString baseName = makeBaseName(bName,".pu");
1997 QCString shortName = stripPath(baseName);
1998 if (useBitmap)
1999 {
2000 if (shortName.find('.')==-1) shortName += ".png";
2001 }
2004 if (!first) endPlantUmlFile(hasCaption);
2005 first = false;
2006 visitPreStart(m_t,hasCaption, shortName, width, height);
2007 }
2008}
2009
2011{
2012 if (m_hide) return;
2013 visitPostEnd(m_t,hasCaption);
2014}
2015
2017{
2018 return std::min(m_indentLevel,maxIndentLevels-1);
2019}
2020
2022{
2023 m_indentLevel++;
2025 {
2026 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2027 }
2028}
2029
2031{
2032 if (m_indentLevel>0)
2033 {
2034 m_indentLevel--;
2035 }
2036}
2037
QCString anchorPrefix() const
Definition cite.cpp:126
static CitationManager & instance()
Definition cite.cpp:85
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Node representing an anchor.
Definition docnode.h:229
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
QCString getText() const
Definition docnode.cpp:959
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString file() const
Definition docnode.h:248
Node representing a dia file.
Definition docnode.h:731
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 text() const
Definition docnode.h:533
Node representing a Hypertext reference.
Definition docnode.h:823
QCString url() const
Definition docnode.h:830
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
Valignment valignment() const
Definition docnode.cpp:1919
uint32_t rowSpan() const
Definition docnode.cpp:1857
Alignment alignment() const
Definition docnode.cpp:1881
bool isLast() const
Definition docnode.h:1202
bool isHeading() const
Definition docnode.h:1200
uint32_t colSpan() const
Definition docnode.cpp:1869
Node representing a HTML description data.
Definition docnode.h:1181
Node representing a Html description list.
Definition docnode.h:901
const HtmlAttribList & attribs() const
Definition docnode.h:905
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
int level() const
Definition docnode.h:877
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
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1269
size_t numberHeaderRows() const
Definition docnode.cpp:2194
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 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
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 ref() const
Definition docnode.h:173
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
bool isLast() const
Definition docnode.h:1088
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
SectionType sectionType() const
Definition docnode.h:787
QCString targetTitle() const
Definition docnode.h:786
bool isSubPage() const
Definition docnode.h:792
bool refToTable() const
Definition docnode.h:791
QCString file() const
Definition docnode.h:782
QCString ref() const
Definition docnode.h:784
bool refToSection() const
Definition docnode.h:790
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
bool refToTable() const
Definition docnode.h:943
QCString file() const
Definition docnode.h:939
QCString anchor() const
Definition docnode.h:940
QCString ref() const
Definition docnode.h:942
bool isSubPage() const
Definition docnode.h:944
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
int level() const
Definition docnode.h:918
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
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
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
bool useBitmap() const
Definition docnode.h:394
@ 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
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2026
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
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 list of HTML attributes.
Definition htmlattrib.h:33
const char * latex(SymType symb) const
Access routine to the LaTeX code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
Generator for LaTeX code fragments.
Definition latexgen.h:28
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
static const int maxIndentLevels
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void endDotFile(bool hasCaption)
void operator()(const DocWord &)
void visitCaption(const DocNodeList &children)
void addRowSpan(ActiveRowSpan &&span)
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
OutputCodeList & m_ci
LatexDocVisitor(TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)
size_t currentColumn() const
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void filter(const QCString &str, const bool retainNewLine=false)
void endMscFile(bool hasCaption)
bool isTableNested(const DocNodeVariant *n) const
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
LatexListItemInfo m_listItemInfo[maxIndentLevels]
bool insideTable() const
void endDiaFile(bool hasCaption)
const char * getSectionName(int level) const
void endPlantUmlFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
void visitChildren(const T &t)
LatexCodeGenerator & m_lcg
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
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
QCString & prepend(const char *s)
Definition qcstring.h:422
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:254
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
bool endsWith(const char *s) const
Definition qcstring.h:524
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
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
constexpr int level() const
Definition section.h:45
Text streaming class that buffers data.
Definition textstream.h:36
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:151
#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
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1366
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile > DocNodeVariant
Definition docnode.h:67
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1330
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
static const char * g_subparagraphLabel
static const int g_maxLevels
static const std::array< const char *, g_maxLevels > g_secLabels
static bool listIsNested(const DocHtmlDescList &dl)
static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)
static const char * g_paragraphLabel
static bool classEqualsReflist(const DocHtmlDescList &dl)
static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
@ TEX
called through texorpdf as TeX (first) part
@ PDF
called through texorpdf as PDF (second) part
@ NO
not called through texorpdf
QCString latexFilterURL(const QCString &s)
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)
QCString latexEscapeIndexChars(const QCString &s)
QCString latexEscapeLabelName(const QCString &s)
#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
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:844
Portable versions of functions that are platform dependent.
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
Options to configure the code parser.
Definition parserintf.h:78
CodeParserOptions & setStartLine(int lineNr)
Definition parserintf.h:101
CodeParserOptions & setInlineFragment(bool enable)
Definition parserintf.h:107
CodeParserOptions & setShowLineNumbers(bool enable)
Definition parserintf.h:113
CodeParserOptions & setFileDef(const FileDef *fd)
Definition parserintf.h:98
SrcLangExt
Definition types.h:207
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
Definition util.cpp:6928
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5164
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6667
QCString stripPath(const QCString &s)
Definition util.cpp:4902
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:5503
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5182
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4918
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:5826
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5206
A bunch of utility functions.