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;
666}
667
671
673{
674 if (m_hide) return;
675 auto opt = cite.option();
676 QCString txt;
677 if (opt.noCite())
678 {
679 if (!cite.file().isEmpty())
680 {
681 txt = cite.getText();
682 }
683 else
684 {
685 if (!opt.noPar()) txt += "[";
686 txt += cite.target();
687 if (!opt.noPar()) txt += "]";
688 }
689 m_t << "{\\bfseries ";
690 filter(txt);
691 m_t << "}";
692 }
693 else
694 {
695 if (!cite.file().isEmpty())
696 {
697 QCString anchor = cite.anchor();
699 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
700
701 txt = "\\DoxyCite{" + anchor + "}";
702 if (opt.isNumber())
703 {
704 txt += "{number}";
705 }
706 else if (opt.isShortAuthor())
707 {
708 txt += "{shortauthor}";
709 }
710 else if (opt.isYear())
711 {
712 txt += "{year}";
713 }
714 if (!opt.noPar()) txt += "{1}";
715 else txt += "{0}";
716
717 m_t << txt;
718 }
719 else
720 {
721 if (!opt.noPar()) txt += "[";
722 txt += cite.target();
723 if (!opt.noPar()) txt += "]";
724 m_t << "{\\bfseries ";
725 filter(txt);
726 m_t << "}";
727 }
728 }
729}
730
731//--------------------------------------
732// visitor functions for compound nodes
733//--------------------------------------
734
736{
737 if (m_hide) return;
738 if (m_indentLevel>=maxIndentLevels-1) return;
739 if (l.isEnumList())
740 {
741 m_t << "\n\\begin{DoxyEnumerate}";
742 m_listItemInfo[indentLevel()].isEnum = true;
743 }
744 else
745 {
746 m_listItemInfo[indentLevel()].isEnum = false;
747 m_t << "\n\\begin{DoxyItemize}";
748 }
749 visitChildren(l);
750 if (l.isEnumList())
751 {
752 m_t << "\n\\end{DoxyEnumerate}";
753 }
754 else
755 {
756 m_t << "\n\\end{DoxyItemize}";
757 }
758}
759
761{
762 if (m_hide) return;
763 switch (li.itemNumber())
764 {
765 case DocAutoList::Unchecked: // unchecked
766 m_t << "\n\\item[\\DoxyUnchecked] ";
767 break;
768 case DocAutoList::Checked_x: // checked with x
769 case DocAutoList::Checked_X: // checked with X
770 m_t << "\n\\item[\\DoxyChecked] ";
771 break;
772 default:
773 m_t << "\n\\item ";
774 break;
775 }
777 visitChildren(li);
779}
780
782{
783 if (m_hide) return;
784 visitChildren(p);
785 if (!p.isLast() && // omit <p> for last paragraph
786 !(p.parent() && // and for parameter sections
787 std::get_if<DocParamSect>(p.parent())
788 )
789 )
790 {
791 if (insideTable())
792 {
793 m_t << "~\\newline\n";
794 }
795 else
796 {
797 m_t << "\n\n";
798 }
799 }
800}
801
803{
804 visitChildren(r);
805}
806
808{
809 if (m_hide) return;
810 switch(s.type())
811 {
813 m_t << "\\begin{DoxySeeAlso}{";
814 filter(theTranslator->trSeeAlso());
815 break;
817 m_t << "\\begin{DoxyReturn}{";
818 filter(theTranslator->trReturns());
819 break;
821 m_t << "\\begin{DoxyAuthor}{";
822 filter(theTranslator->trAuthor(TRUE,TRUE));
823 break;
825 m_t << "\\begin{DoxyAuthor}{";
826 filter(theTranslator->trAuthor(TRUE,FALSE));
827 break;
829 m_t << "\\begin{DoxyVersion}{";
830 filter(theTranslator->trVersion());
831 break;
833 m_t << "\\begin{DoxySince}{";
834 filter(theTranslator->trSince());
835 break;
837 m_t << "\\begin{DoxyDate}{";
838 filter(theTranslator->trDate());
839 break;
841 m_t << "\\begin{DoxyNote}{";
842 filter(theTranslator->trNote());
843 break;
845 m_t << "\\begin{DoxyWarning}{";
846 filter(theTranslator->trWarning());
847 break;
849 m_t << "\\begin{DoxyPrecond}{";
850 filter(theTranslator->trPrecondition());
851 break;
853 m_t << "\\begin{DoxyPostcond}{";
854 filter(theTranslator->trPostcondition());
855 break;
857 m_t << "\\begin{DoxyCopyright}{";
858 filter(theTranslator->trCopyright());
859 break;
861 m_t << "\\begin{DoxyInvariant}{";
862 filter(theTranslator->trInvariant());
863 break;
865 m_t << "\\begin{DoxyRemark}{";
866 filter(theTranslator->trRemarks());
867 break;
869 m_t << "\\begin{DoxyAttention}{";
870 filter(theTranslator->trAttention());
871 break;
873 m_t << "\\begin{DoxyImportant}{";
874 filter(theTranslator->trImportant());
875 break;
877 m_t << "\\begin{DoxyParagraph}{";
878 break;
880 m_t << "\\begin{DoxyParagraph}{";
881 break;
882 case DocSimpleSect::Unknown: break;
883 }
884
885 if (s.title())
886 {
888 std::visit(*this,*s.title());
890 }
891 m_t << "}\n";
893 visitChildren(s);
894 switch(s.type())
895 {
897 m_t << "\n\\end{DoxySeeAlso}\n";
898 break;
900 m_t << "\n\\end{DoxyReturn}\n";
901 break;
903 m_t << "\n\\end{DoxyAuthor}\n";
904 break;
906 m_t << "\n\\end{DoxyAuthor}\n";
907 break;
909 m_t << "\n\\end{DoxyVersion}\n";
910 break;
912 m_t << "\n\\end{DoxySince}\n";
913 break;
915 m_t << "\n\\end{DoxyDate}\n";
916 break;
918 m_t << "\n\\end{DoxyNote}\n";
919 break;
921 m_t << "\n\\end{DoxyWarning}\n";
922 break;
924 m_t << "\n\\end{DoxyPrecond}\n";
925 break;
927 m_t << "\n\\end{DoxyPostcond}\n";
928 break;
930 m_t << "\n\\end{DoxyCopyright}\n";
931 break;
933 m_t << "\n\\end{DoxyInvariant}\n";
934 break;
936 m_t << "\n\\end{DoxyRemark}\n";
937 break;
939 m_t << "\n\\end{DoxyAttention}\n";
940 break;
942 m_t << "\n\\end{DoxyImportant}\n";
943 break;
945 m_t << "\n\\end{DoxyParagraph}\n";
946 break;
948 m_t << "\n\\end{DoxyParagraph}\n";
949 break;
950 default:
951 break;
952 }
954}
955
957{
958 if (m_hide) return;
959 visitChildren(t);
960}
961
963{
964 if (m_hide) return;
965 m_t << "\\begin{DoxyItemize}\n";
966 m_listItemInfo[indentLevel()].isEnum = false;
967 visitChildren(l);
968 m_t << "\\end{DoxyItemize}\n";
969}
970
972{
973 if (m_hide) return;
974 m_t << "\\item ";
976 if (li.paragraph())
977 {
978 visit(*this,*li.paragraph());
979 }
981}
982
984{
985 if (m_hide) return;
986 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
987 if (pdfHyperlinks)
988 {
989 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
990 }
991 m_t << "\\" << getSectionName(s.level()) << "{";
992 if (pdfHyperlinks)
993 {
994 m_t << "\\texorpdfstring{";
995 }
996 if (s.title())
997 {
998 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
999 std::visit(*this,*s.title());
1001 }
1002 if (pdfHyperlinks)
1003 {
1004 m_t << "}{";
1005 if (s.title())
1006 {
1007 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1008 std::visit(*this,*s.title());
1010 }
1011 m_t << "}";
1012 }
1013 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1014 visitChildren(s);
1015}
1016
1018{
1019 if (m_hide) return;
1020 if (m_indentLevel>=maxIndentLevels-1) return;
1022 if (s.type()==DocHtmlList::Ordered)
1023 {
1024 bool first = true;
1025 m_t << "\n\\begin{DoxyEnumerate}";
1026 for (const auto &opt : s.attribs())
1027 {
1028 if (opt.name=="type")
1029 {
1030 if (opt.value=="1")
1031 {
1032 m_t << (first ? "[": ",");
1033 m_t << "label=\\arabic*";
1034 first = false;
1035 }
1036 else if (opt.value=="a")
1037 {
1038 m_t << (first ? "[": ",");
1039 m_t << "label=\\enumalphalphcnt*";
1040 first = false;
1041 }
1042 else if (opt.value=="A")
1043 {
1044 m_t << (first ? "[": ",");
1045 m_t << "label=\\enumAlphAlphcnt*";
1046 first = false;
1047 }
1048 else if (opt.value=="i")
1049 {
1050 m_t << (first ? "[": ",");
1051 m_t << "label=\\roman*";
1052 first = false;
1053 }
1054 else if (opt.value=="I")
1055 {
1056 m_t << (first ? "[": ",");
1057 m_t << "label=\\Roman*";
1058 first = false;
1059 }
1060 }
1061 else if (opt.name=="start")
1062 {
1063 m_t << (first ? "[": ",");
1064 bool ok = false;
1065 int val = opt.value.toInt(&ok);
1066 if (ok) m_t << "start=" << val;
1067 first = false;
1068 }
1069 }
1070 if (!first) m_t << "]\n";
1071 }
1072 else
1073 {
1074 m_t << "\n\\begin{DoxyItemize}";
1075 }
1076 visitChildren(s);
1077 if (m_indentLevel>=maxIndentLevels-1) return;
1078 if (s.type()==DocHtmlList::Ordered)
1079 m_t << "\n\\end{DoxyEnumerate}";
1080 else
1081 m_t << "\n\\end{DoxyItemize}";
1082}
1083
1085{
1086 if (m_hide) return;
1087 if (m_listItemInfo[indentLevel()].isEnum)
1088 {
1089 for (const auto &opt : l.attribs())
1090 {
1091 if (opt.name=="value")
1092 {
1093 bool ok = false;
1094 int val = opt.value.toInt(&ok);
1095 if (ok)
1096 {
1097 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1098 }
1099 }
1100 }
1101 }
1102 m_t << "\n\\item ";
1104 visitChildren(l);
1106}
1107
1108
1110{
1111 HtmlAttribList attrs = dl.attribs();
1112 auto it = std::find_if(attrs.begin(),attrs.end(),
1113 [](const auto &att) { return att.name=="class"; });
1114 if (it!=attrs.end() && it->value == "reflist") return true;
1115 return false;
1116}
1117
1118static bool listIsNested(const DocHtmlDescList &dl)
1119{
1120 bool isNested=false;
1121 const DocNodeVariant *n = dl.parent();
1122 while (n && !isNested)
1123 {
1124 if (std::get_if<DocHtmlDescList>(n))
1125 {
1126 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1127 }
1128 n = ::parent(n);
1129 }
1130 return isNested;
1131}
1132
1134{
1135 if (m_hide) return;
1136 bool eq = classEqualsReflist(dl);
1137 if (eq)
1138 {
1139 m_t << "\n\\begin{DoxyRefList}";
1140 }
1141 else
1142 {
1143 if (listIsNested(dl)) m_t << "\n\\hfill";
1144 m_t << "\n\\begin{DoxyDescription}";
1145 }
1146 visitChildren(dl);
1147 if (eq)
1148 {
1149 m_t << "\n\\end{DoxyRefList}";
1150 }
1151 else
1152 {
1153 m_t << "\n\\end{DoxyDescription}";
1154 }
1155}
1156
1158{
1159 if (m_hide) return;
1160 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1162 visitChildren(dt);
1164 m_t << "}}]";
1165}
1166
1168{
1170 if (!m_insideItem) m_t << "\\hfill";
1171 m_t << " \\\\\n";
1172 visitChildren(dd);
1174}
1175
1177{
1178 bool isNested=m_lcg.usedTableLevel()>0;
1179 while (n && !isNested)
1180 {
1182 n = ::parent(n);
1183 }
1184 return isNested;
1185}
1186
1188{
1189 if (isTableNested(n))
1190 {
1191 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1192 }
1193 else
1194 {
1195 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1196 }
1197}
1198
1200{
1201 if (isTableNested(n))
1202 {
1203 m_t << "\\end{DoxyTableNested}\n";
1204 }
1205 else
1206 {
1207 m_t << "\\end{DoxyTable}\n";
1208 }
1209}
1210
1212{
1213 if (m_hide) return;
1215 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1216 if (c)
1217 {
1218 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1219 if (!c->file().isEmpty() && pdfHyperLinks)
1220 {
1221 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1222 << "}{}";
1223 }
1224 m_t << "\n";
1225 }
1226
1228 if (!isTableNested(t.parent()))
1229 {
1230 // write caption
1231 m_t << "{";
1232 if (c)
1233 {
1234 std::visit(*this, *t.caption());
1235 }
1236 m_t << "}";
1237 // write label
1238 m_t << "{";
1239 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1240 {
1241 m_t << stripPath(c->file()) << "_" << c->anchor();
1242 }
1243 m_t << "}";
1244 }
1245
1246 // write head row(s)
1247 m_t << "{" << t.numberHeaderRows() << "}\n";
1248
1250
1251 visitChildren(t);
1253 popTableState();
1254}
1255
1257{
1258 if (m_hide) return;
1259 visitChildren(c);
1260}
1261
1263{
1264 if (m_hide) return;
1266
1267 visitChildren(row);
1268
1269 m_t << "\\\\";
1270
1271 size_t col = 1;
1272 for (auto &span : rowSpans())
1273 {
1274 if (span.rowSpan>0) span.rowSpan--;
1275 if (span.rowSpan<=0)
1276 {
1277 // inactive span
1278 }
1279 else if (span.column>col)
1280 {
1281 col = span.column+span.colSpan;
1282 }
1283 else
1284 {
1285 col = span.column+span.colSpan;
1286 }
1287 }
1288
1289 m_t << "\n";
1290}
1291
1293{
1294 if (m_hide) return;
1295 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1296
1298
1299 QCString cellOpts;
1300 QCString cellSpec;
1301 auto appendOpt = [&cellOpts](const QCString &s)
1302 {
1303 if (!cellOpts.isEmpty()) cellOpts+=",";
1304 cellOpts+=s;
1305 };
1306 auto appendSpec = [&cellSpec](const QCString &s)
1307 {
1308 if (!cellSpec.isEmpty()) cellSpec+=",";
1309 cellSpec+=s;
1310 };
1311 auto writeCell = [this,&cellOpts,&cellSpec]()
1312 {
1313 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1314 {
1315 m_t << "\\SetCell";
1316 if (!cellOpts.isEmpty())
1317 {
1318 m_t << "[" << cellOpts << "]";
1319 }
1320 m_t << "{" << cellSpec << "}";
1321 }
1322 };
1323
1324 // skip over columns that have a row span starting at an earlier row
1325 for (const auto &span : rowSpans())
1326 {
1327 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1328 // span.cell.rowIndex(),span.cell.columnIndex(),
1329 // span.column,span.colSpan,span.rowSpan,
1330 // currentColumn());
1331 if (span.rowSpan>0 && span.column==currentColumn())
1332 {
1333 setCurrentColumn(currentColumn()+span.colSpan);
1334 for (size_t i=0;i<span.colSpan;i++)
1335 {
1336 m_t << "&";
1337 }
1338 }
1339 }
1340
1341 int cs = c.colSpan();
1342 int ha = c.alignment();
1343 int rs = c.rowSpan();
1344 int va = c.valignment();
1345
1346 switch (ha) // horizontal alignment
1347 {
1348 case DocHtmlCell::Right:
1349 appendSpec("r");
1350 break;
1352 appendSpec("c");
1353 break;
1354 default:
1355 // default
1356 break;
1357 }
1358 if (rs>0) // row span
1359 {
1360 appendOpt("r="+QCString().setNum(rs));
1361 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1362 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1363 // currentColumn());
1365 }
1366 if (cs>1) // column span
1367 {
1368 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1370 appendOpt("c="+QCString().setNum(cs));
1371 }
1372 if (c.isHeading())
1373 {
1374 appendSpec("bg=\\tableheadbgcolor");
1375 appendSpec("font=\\bfseries");
1376 }
1377 switch(va) // vertical alignment
1378 {
1379 case DocHtmlCell::Top:
1380 appendSpec("h");
1381 break;
1383 appendSpec("f");
1384 break;
1386 // default
1387 break;
1388 }
1389 writeCell();
1390
1391 visitChildren(c);
1392
1393 for (int i=0;i<cs-1;i++)
1394 {
1395 m_t << "&"; // placeholder for invisible cell
1396 }
1397
1398 if (!c.isLast()) m_t << "&";
1399}
1400
1402{
1403 if (m_hide) return;
1404 visitChildren(i);
1405}
1406
1408{
1409 if (m_hide) return;
1410 if (Config_getBool(PDF_HYPERLINKS))
1411 {
1412 m_t << "\\href{";
1413 m_t << latexFilterURL(href.url());
1414 m_t << "}";
1415 }
1416 m_t << "{\\texttt{";
1417 visitChildren(href);
1418 m_t << "}}";
1419}
1420
1422{
1423 if (m_hide) return;
1424 m_t << "{\\bfseries{";
1425 visitChildren(d);
1426 m_t << "}}";
1427}
1428
1430{
1431 if (m_hide) return;
1432 m_t << "\n\n";
1433 auto summary = d.summary();
1434 if (summary)
1435 {
1436 std::visit(*this,*summary);
1437 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1438 }
1439 visitChildren(d);
1440 if (summary)
1441 {
1442 m_t << "\\end{adjustwidth}\n";
1443 }
1444 else
1445 {
1446 m_t << "\n\n";
1447 }
1448}
1449
1451{
1452 if (m_hide) return;
1453 m_t << "\\" << getSectionName(header.level()) << "*{";
1454 visitChildren(header);
1455 m_t << "}";
1456}
1457
1459{
1460 if (img.type()==DocImage::Latex)
1461 {
1462 if (m_hide) return;
1463 QCString gfxName = img.name();
1464 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1465 {
1466 gfxName=gfxName.left(gfxName.length()-4);
1467 }
1468
1469 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1470 visitChildren(img);
1472 }
1473 else // other format -> skip
1474 {
1475 }
1476}
1477
1479{
1480 if (m_hide) return;
1481 bool exists = false;
1482 std::string inBuf;
1483 if (readInputFile(df.file(),inBuf))
1484 {
1485 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1486 ".dot", // extension
1487 inBuf, // contents
1488 exists);
1489 if (!fileName.isEmpty())
1490 {
1491 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1492 visitChildren(df);
1493 endDotFile(df.hasCaption());
1494 }
1495 }
1496}
1497
1499{
1500 if (m_hide) return;
1501 bool exists = false;
1502 std::string inBuf;
1503 if (readInputFile(df.file(),inBuf))
1504 {
1505 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1506 ".msc", // extension
1507 inBuf, // contents
1508 exists);
1509 if (!fileName.isEmpty())
1510 {
1511 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1512 visitChildren(df);
1513 endMscFile(df.hasCaption());
1514 }
1515 }
1516}
1517
1519{
1520 if (m_hide) return;
1521 bool exists = false;
1522 std::string inBuf;
1523 if (readInputFile(df.file(),inBuf))
1524 {
1525 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1526 ".dia", // extension
1527 inBuf, // contents
1528 exists);
1529 if (!fileName.isEmpty())
1530 {
1531 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1532 visitChildren(df);
1533 endDiaFile(df.hasCaption());
1534 }
1535 }
1536}
1537
1539{
1540 if (m_hide) return;
1541 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1542 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1543 visitChildren(df);
1545}
1546
1548{
1549 if (m_hide) return;
1550 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1551 visitChildren(lnk);
1552 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1553}
1554
1556{
1557 if (m_hide) return;
1558 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1559 // ref.anchor() for LaTeX/RTF
1560 if (ref.isSubPage())
1561 {
1562 startLink(ref.ref(),QCString(),ref.anchor());
1563 }
1564 else
1565 {
1566 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1567 }
1568 if (!ref.hasLinkText())
1569 {
1570 filter(ref.targetTitle());
1571 }
1572 visitChildren(ref);
1573 if (ref.isSubPage())
1574 {
1575 endLink(ref.ref(),QCString(),ref.anchor());
1576 }
1577 else
1578 {
1579 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1580 }
1581}
1582
1584{
1585 if (m_hide) return;
1586 m_t << "\\item \\contentsline{section}{";
1587 if (ref.isSubPage())
1588 {
1589 startLink(ref.ref(),QCString(),ref.anchor());
1590 }
1591 else
1592 {
1593 if (!ref.file().isEmpty())
1594 {
1595 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1596 }
1597 }
1598 visitChildren(ref);
1599 if (ref.isSubPage())
1600 {
1601 endLink(ref.ref(),QCString(),ref.anchor());
1602 }
1603 else
1604 {
1605 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1606 }
1607 m_t << "}{\\ref{";
1608 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1609 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1610 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1611 m_t << "}}{}\n";
1612}
1613
1615{
1616 if (m_hide) return;
1617 m_t << "\\footnotesize\n";
1618 m_t << "\\begin{multicols}{2}\n";
1619 m_t << "\\begin{DoxyCompactList}\n";
1621 visitChildren(l);
1623 m_t << "\\end{DoxyCompactList}\n";
1624 m_t << "\\end{multicols}\n";
1625 m_t << "\\normalsize\n";
1626}
1627
1629{
1630 if (m_hide) return;
1631 bool hasInOutSpecs = s.hasInOutSpecifier();
1632 bool hasTypeSpecs = s.hasTypeSpecifier();
1633 m_lcg.incUsedTableLevel();
1634 switch(s.type())
1635 {
1637 m_t << "\n\\begin{DoxyParams}";
1638 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1639 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1640 m_t << "{";
1641 filter(theTranslator->trParameters());
1642 break;
1644 m_t << "\n\\begin{DoxyRetVals}{";
1645 filter(theTranslator->trReturnValues());
1646 break;
1648 m_t << "\n\\begin{DoxyExceptions}{";
1649 filter(theTranslator->trExceptions());
1650 break;
1652 m_t << "\n\\begin{DoxyTemplParams}{";
1653 filter(theTranslator->trTemplateParameters());
1654 break;
1655 default:
1656 ASSERT(0);
1658 }
1659 m_t << "}\n";
1660 visitChildren(s);
1661 m_lcg.decUsedTableLevel();
1662 switch(s.type())
1663 {
1665 m_t << "\\end{DoxyParams}\n";
1666 break;
1668 m_t << "\\end{DoxyRetVals}\n";
1669 break;
1671 m_t << "\\end{DoxyExceptions}\n";
1672 break;
1674 m_t << "\\end{DoxyTemplParams}\n";
1675 break;
1676 default:
1677 ASSERT(0);
1679 }
1680}
1681
1683{
1684 m_t << " " << sep.chars() << " ";
1685}
1686
1688{
1689 if (m_hide) return;
1691 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1692 if (sect)
1693 {
1694 parentType = sect->type();
1695 }
1696 bool useTable = parentType==DocParamSect::Param ||
1697 parentType==DocParamSect::RetVal ||
1698 parentType==DocParamSect::Exception ||
1699 parentType==DocParamSect::TemplateParam;
1700 if (!useTable)
1701 {
1702 m_t << "\\item[";
1703 }
1704 if (sect && sect->hasInOutSpecifier())
1705 {
1707 {
1708 m_t << "\\doxymbox{\\texttt{";
1709 if (pl.direction()==DocParamSect::In)
1710 {
1711 m_t << "in";
1712 }
1713 else if (pl.direction()==DocParamSect::Out)
1714 {
1715 m_t << "out";
1716 }
1717 else if (pl.direction()==DocParamSect::InOut)
1718 {
1719 m_t << "in,out";
1720 }
1721 m_t << "}} ";
1722 }
1723 if (useTable) m_t << " & ";
1724 }
1725 if (sect && sect->hasTypeSpecifier())
1726 {
1727 for (const auto &type : pl.paramTypes())
1728 {
1729 std::visit(*this,type);
1730 }
1731 if (useTable) m_t << " & ";
1732 }
1733 m_t << "{\\em ";
1734 bool first=TRUE;
1735 for (const auto &param : pl.parameters())
1736 {
1737 if (!first) m_t << ","; else first=FALSE;
1739 std::visit(*this,param);
1741 }
1742 m_t << "}";
1743 if (useTable)
1744 {
1745 m_t << " & ";
1746 }
1747 else
1748 {
1749 m_t << "]";
1750 }
1751 for (const auto &par : pl.paragraphs())
1752 {
1753 std::visit(*this,par);
1754 }
1755 if (useTable)
1756 {
1757 m_t << "\\\\\n"
1758 << "\\hline\n";
1759 }
1760}
1761
1763{
1764 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1765 if (m_hide) return;
1766 if (x.title().isEmpty()) return;
1768 m_t << "\\begin{DoxyRefDesc}{";
1769 filter(x.title());
1770 m_t << "}\n";
1771 bool anonymousEnum = x.file()=="@";
1772 m_t << "\\item[";
1773 if (pdfHyperlinks && !anonymousEnum)
1774 {
1775 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1776 }
1777 else
1778 {
1779 m_t << "\\textbf{ ";
1780 }
1782 filter(x.title());
1784 if (pdfHyperlinks && !anonymousEnum)
1785 {
1786 m_t << "}";
1787 }
1788 m_t << "}]";
1789 visitChildren(x);
1790 if (x.title().isEmpty()) return;
1792 m_t << "\\end{DoxyRefDesc}\n";
1793}
1794
1796{
1797 if (m_hide) return;
1798 startLink(QCString(),ref.file(),ref.anchor());
1799 visitChildren(ref);
1800 endLink(QCString(),ref.file(),ref.anchor());
1801}
1802
1804{
1805 if (m_hide) return;
1806 visitChildren(t);
1807}
1808
1810{
1811 if (m_hide) return;
1812 m_t << "\\begin{quote}\n";
1814 visitChildren(q);
1815 m_t << "\\end{quote}\n";
1817}
1818
1822
1824{
1825 if (m_hide) return;
1826 visitChildren(pb);
1827}
1828
1829void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1830{
1831 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1833 m_lcg.insideTabbing(),
1836 m_lcg.usedTableLevel()>0, // insideTable
1837 false, // keepSpaces
1838 retainNewLine
1839 );
1840}
1841
1842void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1843 bool refToTable,bool refToSection)
1844{
1845 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1846 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1847 {
1848 if (refToTable)
1849 {
1850 m_t << "\\doxytablelink{";
1851 }
1852 else if (refToSection)
1853 {
1854 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1855 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1856 }
1857 else
1858 {
1859 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1860 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1861 }
1862 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1863 {
1864 if (!file.isEmpty()) m_t << stripPath(file);
1865 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1866 if (!anchor.isEmpty()) m_t << anchor;
1867 m_t << "}";
1868 }
1869 m_t << "{";
1870 }
1871 else if (ref.isEmpty() && refToSection)
1872 {
1873 m_t << "\\doxysectref{";
1874 }
1875 else if (ref.isEmpty() && refToTable)
1876 {
1877 m_t << "\\doxytableref{";
1878 }
1879 else if (ref.isEmpty()) // internal non-PDF link
1880 {
1881 m_t << "\\doxyref{";
1882 }
1883 else // external link
1884 {
1885 m_t << "\\textbf{ ";
1886 }
1887}
1888
1889void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1890{
1891 m_t << "}";
1892 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1893 if (ref.isEmpty() && !pdfHyperLinks)
1894 {
1895 m_t << "{";
1896 filter(theTranslator->trPageAbbreviation());
1897 m_t << "}{" << file;
1898 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1899 m_t << anchor << "}";
1900 if (refToSection)
1901 {
1902 m_t << "{" << sectionType.level() << "}";
1903 }
1904 }
1905 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1906 {
1907 if (refToSection)
1908 {
1909 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1910 }
1911 }
1912}
1913
1915 const QCString &width,
1916 const QCString &height,
1917 bool hasCaption,
1918 const QCString &srcFile,
1919 int srcLine, bool newFile
1920 )
1921{
1922 QCString baseName=makeBaseName(fileName,".dot");
1923 baseName.prepend("dot_");
1924 QCString outDir = Config_getString(LATEX_OUTPUT);
1925 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1926 visitPreStart(m_t,hasCaption, baseName, width, height);
1927}
1928
1929void LatexDocVisitor::endDotFile(bool hasCaption)
1930{
1931 if (m_hide) return;
1932 visitPostEnd(m_t,hasCaption);
1933}
1934
1936 const QCString &width,
1937 const QCString &height,
1938 bool hasCaption,
1939 const QCString &srcFile,
1940 int srcLine, bool newFile
1941 )
1942{
1943 QCString baseName=makeBaseName(fileName,".msc");
1944 baseName.prepend("msc_");
1945
1946 QCString outDir = Config_getString(LATEX_OUTPUT);
1947 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1948 visitPreStart(m_t,hasCaption, baseName, width, height);
1949}
1950
1951void LatexDocVisitor::endMscFile(bool hasCaption)
1952{
1953 if (m_hide) return;
1954 visitPostEnd(m_t,hasCaption);
1955}
1956
1957
1958void LatexDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1959{
1960 QCString shortName=makeBaseName(fileName,".msc");
1961 QCString outDir = Config_getString(LATEX_OUTPUT);
1962 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
1963 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1966}
1967
1969 const QCString &width,
1970 const QCString &height,
1971 bool hasCaption,
1972 const QCString &srcFile,
1973 int srcLine, bool newFile
1974 )
1975{
1976 QCString baseName=makeBaseName(fileName,".dia");
1977 baseName.prepend("dia_");
1978
1979 QCString outDir = Config_getString(LATEX_OUTPUT);
1980 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
1981 visitPreStart(m_t,hasCaption, baseName, width, height);
1982}
1983
1984void LatexDocVisitor::endDiaFile(bool hasCaption)
1985{
1986 if (m_hide) return;
1987 visitPostEnd(m_t,hasCaption);
1988}
1989
1991{
1992 QCString shortName = stripPath(baseName);
1993 if (s.useBitmap())
1994 {
1995 if (shortName.find('.')==-1) shortName += ".png";
1996 }
1997 QCString outDir = Config_getString(LATEX_OUTPUT);
2000 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2003}
2004
2006 const QCString &width,
2007 const QCString &height,
2008 bool hasCaption,
2009 const QCString &srcFile,
2010 int srcLine
2011 )
2012{
2013 QCString outDir = Config_getString(LATEX_OUTPUT);
2014 std::string inBuf;
2015 readInputFile(fileName,inBuf);
2016
2017 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2018 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2019 outDir,QCString(),inBuf,
2021 QCString(),srcFile,srcLine,false);
2022 bool first = true;
2023 for (const auto &bName: baseNameVector)
2024 {
2025 QCString baseName = makeBaseName(bName,".pu");
2026 QCString shortName = stripPath(baseName);
2027 if (useBitmap)
2028 {
2029 if (shortName.find('.')==-1) shortName += ".png";
2030 }
2033 if (!first) endPlantUmlFile(hasCaption);
2034 first = false;
2035 visitPreStart(m_t,hasCaption, shortName, width, height);
2036 }
2037}
2038
2040{
2041 if (m_hide) return;
2042 visitPostEnd(m_t,hasCaption);
2043}
2044
2046{
2047 return std::min(m_indentLevel,maxIndentLevels-1);
2048}
2049
2051{
2052 m_indentLevel++;
2054 {
2055 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2056 }
2057}
2058
2060{
2061 if (m_indentLevel>0)
2062 {
2063 m_indentLevel--;
2064 }
2065}
2066
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:972
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:1289
Node representing a HTML table caption.
Definition docnode.h:1226
QCString anchor() const
Definition docnode.h:1233
QCString file() const
Definition docnode.h:1232
Node representing a HTML table cell.
Definition docnode.h:1191
Valignment valignment() const
Definition docnode.cpp:1932
uint32_t rowSpan() const
Definition docnode.cpp:1870
Alignment alignment() const
Definition docnode.cpp:1894
bool isLast() const
Definition docnode.h:1200
bool isHeading() const
Definition docnode.h:1198
uint32_t colSpan() const
Definition docnode.cpp:1882
Node representing a HTML description data.
Definition docnode.h:1179
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:1163
const HtmlAttribList & attribs() const
Definition docnode.h:1168
Node representing a HTML table row.
Definition docnode.h:1244
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1267
size_t numberHeaderRows() const
Definition docnode.cpp:2207
size_t numColumns() const
Definition docnode.h:1276
const DocNodeVariant * caption() const
Definition docnode.cpp:2202
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:1123
const DocNodeList & parameters() const
Definition docnode.h:1127
const DocNodeList & paramTypes() const
Definition docnode.h:1128
DocParamSect::Direction direction() const
Definition docnode.h:1131
const DocNodeList & paragraphs() const
Definition docnode.h:1129
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:1311
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:1151
const DocNodeVariant * paragraph() const
Definition docnode.h:1155
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:1302
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
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
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 startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
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 writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
void visitChildren(const T &t)
LatexCodeGenerator & m_lcg
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:46
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:1364
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:1328
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:269
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)
void latexWriteIndexItem(TextStream &m_t, const QCString &s1, const QCString &s2)
#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:6959
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5191
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6698
QCString stripPath(const QCString &s)
Definition util.cpp:4929
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:5530
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5209
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4945
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:5857
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5233
A bunch of utility functions.