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 "md5.h"
44
45static const int g_maxLevels = 7;
46static const std::array<const char *,g_maxLevels> g_secLabels =
47{ "doxysection",
48 "doxysubsection",
49 "doxysubsubsection",
50 "doxysubsubsubsection",
51 "doxysubsubsubsubsection",
52 "doxysubsubsubsubsubsection",
53 "doxysubsubsubsubsubsubsection"
54};
55
56static const char *g_paragraphLabel = "doxyparagraph";
57static const char *g_subparagraphLabel = "doxysubparagraph";
58
59const char *LatexDocVisitor::getSectionName(int level) const
60{
61 bool compactLatex = Config_getBool(COMPACT_LATEX);
62 int l = level;
63 if (compactLatex) l++;
64
65 if (l < g_maxLevels)
66 {
67 l += m_hierarchyLevel; /* May be -1 if generating main page */
68 // Sections get special treatment because they inherit the parent's level
69 if (l >= g_maxLevels)
70 {
71 l = g_maxLevels - 1;
72 }
73 else if (l < 0)
74 {
75 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
76 l = 0;
77 }
78 return g_secLabels[l];
79 }
80 else if (l == 7)
81 {
82 return g_paragraphLabel;
83 }
84 else
85 {
87 }
88}
89
90static void insertDimension(TextStream &t, QCString dimension, const char *orientationString)
91{
92 // dimensions for latex images can be a percentage, in this case they need some extra
93 // handling as the % symbol is used for comments
94 static const reg::Ex re(R"((\d+)%)");
95 std::string s = dimension.str();
96 reg::Match match;
97 if (reg::search(s,match,re))
98 {
99 bool ok = false;
100 double percent = QCString(match[1].str()).toInt(&ok);
101 if (ok)
102 {
103 t << percent/100.0 << "\\text" << orientationString;
104 return;
105 }
106 }
107 t << dimension;
108}
109
110static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
111{
112 if (inlineImage)
113 {
114 t << "\n\\begin{DoxyInlineImage}%\n";
115 }
116 else
117 {
118 if (hasCaption)
119 {
120 t << "\n\\begin{DoxyImage}%\n";
121 }
122 else
123 {
124 t << "\n\\begin{DoxyImageNoCaption}%\n"
125 " \\doxymbox{";
126 }
127 }
128
129 t << "\\includegraphics";
130 if (!width.isEmpty() || !height.isEmpty())
131 {
132 t << "[";
133 }
134 if (!width.isEmpty())
135 {
136 t << "width=";
137 insertDimension(t, width, "width");
138 }
139 if (!width.isEmpty() && !height.isEmpty())
140 {
141 t << ",";
142 }
143 if (!height.isEmpty())
144 {
145 t << "height=";
146 insertDimension(t, height, "height");
147 }
148 if (width.isEmpty() && height.isEmpty())
149 {
150 /* default setting */
151 if (inlineImage)
152 {
153 t << "[height=\\baselineskip,keepaspectratio=true]";
154 }
155 else
156 {
157 t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
158 }
159 }
160 else
161 {
162 t << "]";
163 }
164
165 t << "{" << name << "}";
166
167 if (hasCaption)
168 {
169 if (!inlineImage)
170 {
171 if (Config_getBool(PDF_HYPERLINKS))
172 {
173 t << "%\n\\doxyfigcaption{";
174 }
175 else
176 {
177 t << "%\n\\doxyfigcaptionnolink{";
178 }
179 }
180 else
181 {
182 t << "%"; // to catch the caption
183 }
184 }
185}
186
187
188
189static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
190{
191 if (inlineImage)
192 {
193 t << "%\n\\end{DoxyInlineImage}\n";
194 }
195 else
196 {
197 t << "}%\n"; // end doxymbox or caption
198 if (hasCaption)
199 {
200 t << "\\end{DoxyImage}\n";
201 }
202 else
203 {
204 t << "\\end{DoxyImageNoCaption}\n";
205 }
206 }
207}
208
210{
211 for (const auto &n : children)
212 {
213 std::visit(*this,n);
214 }
215}
216
218 const QCString &langExt, int hierarchyLevel)
219 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
221 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
222{
223}
224
225 //--------------------------------------
226 // visitor functions for leaf nodes
227 //--------------------------------------
228
230{
231 if (m_hide) return;
232 filter(w.word());
233}
234
236{
237 if (m_hide) return;
238 startLink(w.ref(),w.file(),w.anchor());
239 filter(w.word());
240 endLink(w.ref(),w.file(),w.anchor());
241}
242
244{
245 if (m_hide) return;
246 if (m_insidePre)
247 {
248 m_t << w.chars();
249 }
250 else
251 {
252 m_t << " ";
253 }
254}
255
257{
258 if (m_hide) return;
259 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
260 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
261 if (res)
262 {
264 {
265 if (pdfHyperlinks)
266 {
267 m_t << "\\texorpdfstring{$<$}{<}";
268 }
269 else
270 {
271 m_t << "$<$";
272 }
273 }
275 {
276 if (pdfHyperlinks)
277 {
278 m_t << "\\texorpdfstring{$>$}{>}";
279 }
280 else
281 {
282 m_t << "$>$";
283 }
284 }
285 else
286 {
287 m_t << res;
288 }
289 }
290 else
291 {
292 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
293 }
294}
295
297{
298 if (m_hide) return;
300 if (!emojiName.isEmpty())
301 {
302 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
303 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
304 filter(emojiName);
305 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
306 }
307 else
308 {
309 m_t << s.name();
310 }
311}
312
314{
315 if (m_hide) return;
316 if (Config_getBool(PDF_HYPERLINKS))
317 {
318 m_t << "\\href{";
319 if (u.isEmail()) m_t << "mailto:";
320 m_t << latexFilterURL(u.url()) << "}";
321 }
322 m_t << "{\\texttt{";
323 filter(u.url());
324 m_t << "}}";
325}
326
328{
329 if (m_hide) return;
330 if (m_insideItem)
331 {
332 m_t << "\\\\\n";
333 }
334 else
335 {
336 m_t << "~\\newline\n";
337 }
338}
339
341{
342 if (m_hide) return;
343 if (insideTable())
344 m_t << "\\DoxyHorRuler{1}\n";
345 else
346 m_t << "\\DoxyHorRuler{0}\n";
347}
348
350{
351 if (m_hide) return;
352 switch (s.style())
353 {
355 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
356 break;
360 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
361 break;
364 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
365 break;
367 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
368 break;
372 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
373 break;
375 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
376 break;
378 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
379 break;
381 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
382 break;
384 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
385 break;
387 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
388 break;
390 if (s.enable())
391 {
392 m_t << "\n\\begin{DoxyPre}";
394 }
395 else
396 {
398 m_t << "\\end{DoxyPre}\n";
399 }
400 break;
401 case DocStyleChange::Div: /* HTML only */ break;
402 case DocStyleChange::Span: /* HTML only */ break;
403 }
404}
405
407{
408 if (m_hide) return;
409 QCString lang = m_langExt;
410 if (!s.language().isEmpty()) // explicit language setting
411 {
412 lang = s.language();
413 }
414 SrcLangExt langExt = getLanguageFromCodeLang(lang);
415 switch(s.type())
416 {
418 {
419 m_ci.startCodeFragment("DoxyCode");
420 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
421 Config_getBool(STRIP_CODE_COMMENTS),
422 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
423 m_ci.endCodeFragment("DoxyCode");
424 }
425 break;
427 filter(s.text(), true);
428 break;
430 m_t << "{\\ttfamily ";
431 filter(s.text(), true);
432 m_t << "}";
433 break;
435 if (isTableNested(s.parent())) // in table
436 {
437 m_t << "\\begin{DoxyCode}{0}";
438 filter(s.text(), true);
439 m_t << "\\end{DoxyCode}\n";
440 }
441 else
442 {
443 m_t << "\\begin{DoxyVerb}";
444 m_t << s.text();
445 m_t << "\\end{DoxyVerb}\n";
446 }
447 break;
453 /* nothing */
454 break;
456 m_t << s.text();
457 break;
458 case DocVerbatim::Dot:
459 {
460 bool exists = false;
461 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
462 ".dot", // extension
463 s.text(), // contents
464 exists);
465 if (!fileName.isEmpty())
466 {
467 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
468 visitChildren(s);
470 }
471 }
472 break;
473 case DocVerbatim::Msc:
474 {
475 bool exists = false;
476 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
477 ".msc", // extension
478 "msc {"+s.text()+"}", // contents
479 exists);
480 if (!fileName.isEmpty())
481 {
482 writeMscFile(fileName, s, !exists);
483 }
484 }
485 break;
487 {
488 QCString latexOutput = Config_getString(LATEX_OUTPUT);
489 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
490 latexOutput,s.exampleFile(),s.text(),
492 s.engine(),s.srcFile(),s.srcLine(),true);
493
494 for (const auto &baseName: baseNameVector)
495 {
496 writePlantUMLFile(baseName, s);
497 }
498 }
499 break;
500 }
501}
502
504{
505 if (m_hide) return;
506 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
507 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
508 {
509 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
510 << "}%\n";
511 }
512}
513
515{
516 if (m_hide) return;
518 switch(inc.type())
519 {
521 {
522 m_ci.startCodeFragment("DoxyCodeInclude");
523 FileInfo cfi( inc.file().str() );
524 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
526 inc.text(),
527 langExt,
528 inc.stripCodeComments(),
530 .setExample(inc.isExample(), inc.exampleFile())
531 .setFileDef(fd.get())
532 .setInlineFragment(true)
533 );
534 m_ci.endCodeFragment("DoxyCodeInclude");
535 }
536 break;
538 {
539 m_ci.startCodeFragment("DoxyCodeInclude");
541 inc.text(),langExt,
542 inc.stripCodeComments(),
544 .setExample(inc.isExample(), inc.exampleFile())
545 .setInlineFragment(true)
546 .setShowLineNumbers(false)
547 );
548 m_ci.endCodeFragment("DoxyCodeInclude");
549 }
550 break;
558 break;
560 m_t << inc.text();
561 break;
563 if (isTableNested(inc.parent())) // in table
564 {
565 m_t << "\\begin{DoxyCode}{0}";
566 filter(inc.text(), true);
567 m_t << "\\end{DoxyCode}\n";
568 }
569 else
570 {
571 m_t << "\n\\begin{DoxyVerbInclude}\n";
572 m_t << inc.text();
573 m_t << "\\end{DoxyVerbInclude}\n";
574 }
575 break;
578 {
579 m_ci.startCodeFragment("DoxyCodeInclude");
581 inc.file(),
582 inc.blockId(),
583 inc.context(),
585 inc.trimLeft(),
587 );
588 m_ci.endCodeFragment("DoxyCodeInclude");
589 }
590 break;
591 }
592}
593
595{
596 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
597 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
598 if (op.isFirst())
599 {
600 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
602 m_hide = TRUE;
603 }
605 if (locLangExt.isEmpty()) locLangExt = m_langExt;
606 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
607 if (op.type()!=DocIncOperator::Skip)
608 {
609 m_hide = popHidden();
610 if (!m_hide)
611 {
612 std::unique_ptr<FileDef> fd;
613 if (!op.includeFileName().isEmpty())
614 {
615 FileInfo cfi( op.includeFileName().str() );
616 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
617 }
618
619 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
622 .setExample(op.isExample(),op.exampleFile())
623 .setFileDef(fd.get())
624 .setStartLine(op.line())
626 );
627 }
629 m_hide=TRUE;
630 }
631 if (op.isLast())
632 {
634 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
635 }
636 else
637 {
638 if (!m_hide) m_t << "\n";
639 }
640}
641
643{
644 if (m_hide) return;
645 QCString s = f.text();
646 const char *p = s.data();
647 char c = 0;
648 if (p)
649 {
650 while ((c=*p++))
651 {
652 switch (c)
653 {
654 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
655 default: m_t << c; break;
656 }
657 }
658 }
659}
660
662{
663 if (m_hide) return;
665}
666
670
672{
673 if (m_hide) return;
674 auto opt = cite.option();
675 QCString txt;
676 if (opt.noCite())
677 {
678 if (!cite.file().isEmpty())
679 {
680 txt = cite.getText();
681 }
682 else
683 {
684 if (!opt.noPar()) txt += "[";
685 txt += cite.target();
686 if (!opt.noPar()) txt += "]";
687 }
688 m_t << "{\\bfseries ";
689 filter(txt);
690 m_t << "}";
691 }
692 else
693 {
694 if (!cite.file().isEmpty())
695 {
696 QCString anchor = cite.anchor();
698 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
699
700 txt = "\\DoxyCite{" + anchor + "}";
701 if (opt.isNumber())
702 {
703 txt += "{number}";
704 }
705 else if (opt.isShortAuthor())
706 {
707 txt += "{shortauthor}";
708 }
709 else if (opt.isYear())
710 {
711 txt += "{year}";
712 }
713 if (!opt.noPar()) txt += "{1}";
714 else txt += "{0}";
715
716 m_t << txt;
717 }
718 else
719 {
720 if (!opt.noPar()) txt += "[";
721 txt += cite.target();
722 if (!opt.noPar()) txt += "]";
723 m_t << "{\\bfseries ";
724 filter(txt);
725 m_t << "}";
726 }
727 }
728}
729
730//--------------------------------------
731// visitor functions for compound nodes
732//--------------------------------------
733
735{
736 if (m_hide) return;
737 if (m_indentLevel>=maxIndentLevels-1) return;
738 if (l.isEnumList())
739 {
740 m_t << "\n\\begin{DoxyEnumerate}";
741 m_listItemInfo[indentLevel()].isEnum = true;
742 }
743 else
744 {
745 m_listItemInfo[indentLevel()].isEnum = false;
746 m_t << "\n\\begin{DoxyItemize}";
747 }
748 visitChildren(l);
749 if (l.isEnumList())
750 {
751 m_t << "\n\\end{DoxyEnumerate}";
752 }
753 else
754 {
755 m_t << "\n\\end{DoxyItemize}";
756 }
757}
758
760{
761 if (m_hide) return;
762 switch (li.itemNumber())
763 {
764 case DocAutoList::Unchecked: // unchecked
765 m_t << "\n\\item[\\DoxyUnchecked] ";
766 break;
767 case DocAutoList::Checked_x: // checked with x
768 case DocAutoList::Checked_X: // checked with X
769 m_t << "\n\\item[\\DoxyChecked] ";
770 break;
771 default:
772 m_t << "\n\\item ";
773 break;
774 }
776 visitChildren(li);
778}
779
781{
782 if (m_hide) return;
783 visitChildren(p);
784 if (!p.isLast() && // omit <p> for last paragraph
785 !(p.parent() && // and for parameter sections
786 std::get_if<DocParamSect>(p.parent())
787 )
788 )
789 {
790 if (insideTable())
791 {
792 m_t << "~\\newline\n";
793 }
794 else
795 {
796 m_t << "\n\n";
797 }
798 }
799}
800
802{
803 visitChildren(r);
804}
805
807{
808 if (m_hide) return;
809 switch(s.type())
810 {
812 m_t << "\\begin{DoxySeeAlso}{";
813 filter(theTranslator->trSeeAlso());
814 break;
816 m_t << "\\begin{DoxyReturn}{";
817 filter(theTranslator->trReturns());
818 break;
820 m_t << "\\begin{DoxyAuthor}{";
821 filter(theTranslator->trAuthor(TRUE,TRUE));
822 break;
824 m_t << "\\begin{DoxyAuthor}{";
825 filter(theTranslator->trAuthor(TRUE,FALSE));
826 break;
828 m_t << "\\begin{DoxyVersion}{";
829 filter(theTranslator->trVersion());
830 break;
832 m_t << "\\begin{DoxySince}{";
833 filter(theTranslator->trSince());
834 break;
836 m_t << "\\begin{DoxyDate}{";
837 filter(theTranslator->trDate());
838 break;
840 m_t << "\\begin{DoxyNote}{";
841 filter(theTranslator->trNote());
842 break;
844 m_t << "\\begin{DoxyWarning}{";
845 filter(theTranslator->trWarning());
846 break;
848 m_t << "\\begin{DoxyPrecond}{";
849 filter(theTranslator->trPrecondition());
850 break;
852 m_t << "\\begin{DoxyPostcond}{";
853 filter(theTranslator->trPostcondition());
854 break;
856 m_t << "\\begin{DoxyCopyright}{";
857 filter(theTranslator->trCopyright());
858 break;
860 m_t << "\\begin{DoxyInvariant}{";
861 filter(theTranslator->trInvariant());
862 break;
864 m_t << "\\begin{DoxyRemark}{";
865 filter(theTranslator->trRemarks());
866 break;
868 m_t << "\\begin{DoxyAttention}{";
869 filter(theTranslator->trAttention());
870 break;
872 m_t << "\\begin{DoxyImportant}{";
873 filter(theTranslator->trImportant());
874 break;
876 m_t << "\\begin{DoxyParagraph}{";
877 break;
879 m_t << "\\begin{DoxyParagraph}{";
880 break;
881 case DocSimpleSect::Unknown: break;
882 }
883
884 if (s.title())
885 {
887 std::visit(*this,*s.title());
889 }
890 m_t << "}\n";
892 visitChildren(s);
893 switch(s.type())
894 {
896 m_t << "\n\\end{DoxySeeAlso}\n";
897 break;
899 m_t << "\n\\end{DoxyReturn}\n";
900 break;
902 m_t << "\n\\end{DoxyAuthor}\n";
903 break;
905 m_t << "\n\\end{DoxyAuthor}\n";
906 break;
908 m_t << "\n\\end{DoxyVersion}\n";
909 break;
911 m_t << "\n\\end{DoxySince}\n";
912 break;
914 m_t << "\n\\end{DoxyDate}\n";
915 break;
917 m_t << "\n\\end{DoxyNote}\n";
918 break;
920 m_t << "\n\\end{DoxyWarning}\n";
921 break;
923 m_t << "\n\\end{DoxyPrecond}\n";
924 break;
926 m_t << "\n\\end{DoxyPostcond}\n";
927 break;
929 m_t << "\n\\end{DoxyCopyright}\n";
930 break;
932 m_t << "\n\\end{DoxyInvariant}\n";
933 break;
935 m_t << "\n\\end{DoxyRemark}\n";
936 break;
938 m_t << "\n\\end{DoxyAttention}\n";
939 break;
941 m_t << "\n\\end{DoxyImportant}\n";
942 break;
944 m_t << "\n\\end{DoxyParagraph}\n";
945 break;
947 m_t << "\n\\end{DoxyParagraph}\n";
948 break;
949 default:
950 break;
951 }
953}
954
956{
957 if (m_hide) return;
958 visitChildren(t);
959}
960
962{
963 if (m_hide) return;
964 m_t << "\\begin{DoxyItemize}\n";
965 m_listItemInfo[indentLevel()].isEnum = false;
966 visitChildren(l);
967 m_t << "\\end{DoxyItemize}\n";
968}
969
971{
972 if (m_hide) return;
973 m_t << "\\item ";
975 if (li.paragraph())
976 {
977 visit(*this,*li.paragraph());
978 }
980}
981
983{
984 if (m_hide) return;
985 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
986 if (pdfHyperlinks)
987 {
988 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
989 }
990 m_t << "\\" << getSectionName(s.level()) << "{";
991 if (pdfHyperlinks)
992 {
993 m_t << "\\texorpdfstring{";
994 }
995 if (s.title())
996 {
997 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
998 std::visit(*this,*s.title());
1000 }
1001 if (pdfHyperlinks)
1002 {
1003 m_t << "}{";
1004 if (s.title())
1005 {
1006 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1007 std::visit(*this,*s.title());
1009 }
1010 m_t << "}";
1011 }
1012 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1013 visitChildren(s);
1014}
1015
1017{
1018 if (m_hide) return;
1019 if (m_indentLevel>=maxIndentLevels-1) return;
1021 if (s.type()==DocHtmlList::Ordered)
1022 {
1023 bool first = true;
1024 m_t << "\n\\begin{DoxyEnumerate}";
1025 for (const auto &opt : s.attribs())
1026 {
1027 if (opt.name=="type")
1028 {
1029 if (opt.value=="1")
1030 {
1031 m_t << (first ? "[": ",");
1032 m_t << "label=\\arabic*";
1033 first = false;
1034 }
1035 else if (opt.value=="a")
1036 {
1037 m_t << (first ? "[": ",");
1038 m_t << "label=\\enumalphalphcnt*";
1039 first = false;
1040 }
1041 else if (opt.value=="A")
1042 {
1043 m_t << (first ? "[": ",");
1044 m_t << "label=\\enumAlphAlphcnt*";
1045 first = false;
1046 }
1047 else if (opt.value=="i")
1048 {
1049 m_t << (first ? "[": ",");
1050 m_t << "label=\\roman*";
1051 first = false;
1052 }
1053 else if (opt.value=="I")
1054 {
1055 m_t << (first ? "[": ",");
1056 m_t << "label=\\Roman*";
1057 first = false;
1058 }
1059 }
1060 else if (opt.name=="start")
1061 {
1062 m_t << (first ? "[": ",");
1063 bool ok = false;
1064 int val = opt.value.toInt(&ok);
1065 if (ok) m_t << "start=" << val;
1066 first = false;
1067 }
1068 }
1069 if (!first) m_t << "]\n";
1070 }
1071 else
1072 {
1073 m_t << "\n\\begin{DoxyItemize}";
1074 }
1075 visitChildren(s);
1076 if (m_indentLevel>=maxIndentLevels-1) return;
1077 if (s.type()==DocHtmlList::Ordered)
1078 m_t << "\n\\end{DoxyEnumerate}";
1079 else
1080 m_t << "\n\\end{DoxyItemize}";
1081}
1082
1084{
1085 if (m_hide) return;
1086 if (m_listItemInfo[indentLevel()].isEnum)
1087 {
1088 for (const auto &opt : l.attribs())
1089 {
1090 if (opt.name=="value")
1091 {
1092 bool ok = false;
1093 int val = opt.value.toInt(&ok);
1094 if (ok)
1095 {
1096 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1097 }
1098 }
1099 }
1100 }
1101 m_t << "\n\\item ";
1103 visitChildren(l);
1105}
1106
1107
1109{
1110 HtmlAttribList attrs = dl.attribs();
1111 auto it = std::find_if(attrs.begin(),attrs.end(),
1112 [](const auto &att) { return att.name=="class"; });
1113 if (it!=attrs.end() && it->value == "reflist") return true;
1114 return false;
1115}
1116
1117static bool listIsNested(const DocHtmlDescList &dl)
1118{
1119 bool isNested=false;
1120 const DocNodeVariant *n = dl.parent();
1121 while (n && !isNested)
1122 {
1123 if (std::get_if<DocHtmlDescList>(n))
1124 {
1125 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1126 }
1127 n = ::parent(n);
1128 }
1129 return isNested;
1130}
1131
1133{
1134 if (m_hide) return;
1135 bool eq = classEqualsReflist(dl);
1136 if (eq)
1137 {
1138 m_t << "\n\\begin{DoxyRefList}";
1139 }
1140 else
1141 {
1142 if (listIsNested(dl)) m_t << "\n\\hfill";
1143 m_t << "\n\\begin{DoxyDescription}";
1144 }
1145 visitChildren(dl);
1146 if (eq)
1147 {
1148 m_t << "\n\\end{DoxyRefList}";
1149 }
1150 else
1151 {
1152 m_t << "\n\\end{DoxyDescription}";
1153 }
1154}
1155
1157{
1158 if (m_hide) return;
1159 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1161 visitChildren(dt);
1163 m_t << "}}]";
1164}
1165
1167{
1169 if (!m_insideItem) m_t << "\\hfill";
1170 m_t << " \\\\\n";
1171 visitChildren(dd);
1173}
1174
1176{
1177 bool isNested=m_lcg.usedTableLevel()>0;
1178 while (n && !isNested)
1179 {
1181 n = ::parent(n);
1182 }
1183 return isNested;
1184}
1185
1187{
1188 if (isTableNested(n))
1189 {
1190 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1191 }
1192 else
1193 {
1194 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1195 }
1196}
1197
1199{
1200 if (isTableNested(n))
1201 {
1202 m_t << "\\end{DoxyTableNested}\n";
1203 }
1204 else
1205 {
1206 m_t << "\\end{DoxyTable}\n";
1207 }
1208}
1209
1211{
1212 if (m_hide) return;
1214 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1215 if (c)
1216 {
1217 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1218 if (!c->file().isEmpty() && pdfHyperLinks)
1219 {
1220 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1221 << "}{}";
1222 }
1223 m_t << "\n";
1224 }
1225
1227 if (!isTableNested(t.parent()))
1228 {
1229 // write caption
1230 m_t << "{";
1231 if (c)
1232 {
1233 std::visit(*this, *t.caption());
1234 }
1235 m_t << "}";
1236 // write label
1237 m_t << "{";
1238 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1239 {
1240 m_t << stripPath(c->file()) << "_" << c->anchor();
1241 }
1242 m_t << "}";
1243 }
1244
1245 // write head row(s)
1246 m_t << "{" << t.numberHeaderRows() << "}\n";
1247
1249
1250 visitChildren(t);
1252 popTableState();
1253}
1254
1256{
1257 if (m_hide) return;
1258 visitChildren(c);
1259}
1260
1262{
1263 if (m_hide) return;
1265
1266 visitChildren(row);
1267
1268 m_t << "\\\\";
1269
1270 size_t col = 1;
1271 for (auto &span : rowSpans())
1272 {
1273 if (span.rowSpan>0) span.rowSpan--;
1274 if (span.rowSpan<=0)
1275 {
1276 // inactive span
1277 }
1278 else if (span.column>col)
1279 {
1280 col = span.column+span.colSpan;
1281 }
1282 else
1283 {
1284 col = span.column+span.colSpan;
1285 }
1286 }
1287
1288 m_t << "\n";
1289}
1290
1292{
1293 if (m_hide) return;
1294 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1295
1297
1298 QCString cellOpts;
1299 QCString cellSpec;
1300 auto appendOpt = [&cellOpts](const QCString &s)
1301 {
1302 if (!cellOpts.isEmpty()) cellOpts+=",";
1303 cellOpts+=s;
1304 };
1305 auto appendSpec = [&cellSpec](const QCString &s)
1306 {
1307 if (!cellSpec.isEmpty()) cellSpec+=",";
1308 cellSpec+=s;
1309 };
1310 auto writeCell = [this,&cellOpts,&cellSpec]()
1311 {
1312 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1313 {
1314 m_t << "\\SetCell";
1315 if (!cellOpts.isEmpty())
1316 {
1317 m_t << "[" << cellOpts << "]";
1318 }
1319 m_t << "{" << cellSpec << "}";
1320 }
1321 };
1322
1323 // skip over columns that have a row span starting at an earlier row
1324 for (const auto &span : rowSpans())
1325 {
1326 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1327 // span.cell.rowIndex(),span.cell.columnIndex(),
1328 // span.column,span.colSpan,span.rowSpan,
1329 // currentColumn());
1330 if (span.rowSpan>0 && span.column==currentColumn())
1331 {
1332 setCurrentColumn(currentColumn()+span.colSpan);
1333 for (size_t i=0;i<span.colSpan;i++)
1334 {
1335 m_t << "&";
1336 }
1337 }
1338 }
1339
1340 int cs = c.colSpan();
1341 int ha = c.alignment();
1342 int rs = c.rowSpan();
1343 int va = c.valignment();
1344
1345 switch (ha) // horizontal alignment
1346 {
1347 case DocHtmlCell::Right:
1348 appendSpec("r");
1349 break;
1351 appendSpec("c");
1352 break;
1353 default:
1354 // default
1355 break;
1356 }
1357 if (rs>0) // row span
1358 {
1359 appendOpt("r="+QCString().setNum(rs));
1360 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1361 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1362 // currentColumn());
1364 }
1365 if (cs>1) // column span
1366 {
1367 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1369 appendOpt("c="+QCString().setNum(cs));
1370 }
1371 if (c.isHeading())
1372 {
1373 appendSpec("bg=\\tableheadbgcolor");
1374 appendSpec("font=\\bfseries");
1375 }
1376 switch(va) // vertical alignment
1377 {
1378 case DocHtmlCell::Top:
1379 appendSpec("h");
1380 break;
1382 appendSpec("f");
1383 break;
1385 // default
1386 break;
1387 }
1388 writeCell();
1389
1390 visitChildren(c);
1391
1392 for (int i=0;i<cs-1;i++)
1393 {
1394 m_t << "&"; // placeholder for invisible cell
1395 }
1396
1397 if (!c.isLast()) m_t << "&";
1398}
1399
1401{
1402 if (m_hide) return;
1403 visitChildren(i);
1404}
1405
1407{
1408 if (m_hide) return;
1409 if (Config_getBool(PDF_HYPERLINKS))
1410 {
1411 m_t << "\\href{";
1412 m_t << latexFilterURL(href.url());
1413 m_t << "}";
1414 }
1415 m_t << "{\\texttt{";
1416 visitChildren(href);
1417 m_t << "}}";
1418}
1419
1421{
1422 if (m_hide) return;
1423 m_t << "{\\bfseries{";
1424 visitChildren(d);
1425 m_t << "}}";
1426}
1427
1429{
1430 if (m_hide) return;
1431 m_t << "\n\n";
1432 auto summary = d.summary();
1433 if (summary)
1434 {
1435 std::visit(*this,*summary);
1436 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1437 }
1438 visitChildren(d);
1439 if (summary)
1440 {
1441 m_t << "\\end{adjustwidth}\n";
1442 }
1443 else
1444 {
1445 m_t << "\n\n";
1446 }
1447}
1448
1450{
1451 if (m_hide) return;
1452 m_t << "\\" << getSectionName(header.level()) << "*{";
1453 visitChildren(header);
1454 m_t << "}";
1455}
1456
1458{
1459 if (img.type()==DocImage::Latex)
1460 {
1461 if (m_hide) return;
1462 QCString gfxName = img.name();
1463 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1464 {
1465 gfxName=gfxName.left(gfxName.length()-4);
1466 }
1467
1468 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1469 visitChildren(img);
1471 }
1472 else // other format -> skip
1473 {
1474 }
1475}
1476
1478{
1479 if (m_hide) return;
1480 bool exists = false;
1481 std::string inBuf;
1482 if (readInputFile(df.file(),inBuf))
1483 {
1484 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1485 ".dot", // extension
1486 inBuf, // contents
1487 exists);
1488 if (!fileName.isEmpty())
1489 {
1490 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1491 visitChildren(df);
1492 endDotFile(df.hasCaption());
1493 }
1494 }
1495}
1496
1498{
1499 if (m_hide) return;
1500 bool exists = false;
1501 std::string inBuf;
1502 if (readInputFile(df.file(),inBuf))
1503 {
1504 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1505 ".msc", // extension
1506 inBuf, // contents
1507 exists);
1508 if (!fileName.isEmpty())
1509 {
1510 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1511 visitChildren(df);
1512 endMscFile(df.hasCaption());
1513 }
1514 }
1515}
1516
1518{
1519 if (m_hide) return;
1520 bool exists = false;
1521 std::string inBuf;
1522 if (readInputFile(df.file(),inBuf))
1523 {
1524 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1525 ".dia", // extension
1526 inBuf, // contents
1527 exists);
1528 if (!fileName.isEmpty())
1529 {
1530 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1531 visitChildren(df);
1532 endDiaFile(df.hasCaption());
1533 }
1534 }
1535}
1536
1538{
1539 if (m_hide) return;
1540 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1541 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1542 visitChildren(df);
1544}
1545
1547{
1548 if (m_hide) return;
1549 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1550 visitChildren(lnk);
1551 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1552}
1553
1555{
1556 if (m_hide) return;
1557 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1558 // ref.anchor() for LaTeX/RTF
1559 if (ref.isSubPage())
1560 {
1561 startLink(ref.ref(),QCString(),ref.anchor());
1562 }
1563 else
1564 {
1565 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1566 }
1567 if (!ref.hasLinkText())
1568 {
1569 filter(ref.targetTitle());
1570 }
1571 visitChildren(ref);
1572 if (ref.isSubPage())
1573 {
1574 endLink(ref.ref(),QCString(),ref.anchor());
1575 }
1576 else
1577 {
1578 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1579 }
1580}
1581
1583{
1584 if (m_hide) return;
1585 m_t << "\\item \\contentsline{section}{";
1586 if (ref.isSubPage())
1587 {
1588 startLink(ref.ref(),QCString(),ref.anchor());
1589 }
1590 else
1591 {
1592 if (!ref.file().isEmpty())
1593 {
1594 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1595 }
1596 }
1597 visitChildren(ref);
1598 if (ref.isSubPage())
1599 {
1600 endLink(ref.ref(),QCString(),ref.anchor());
1601 }
1602 else
1603 {
1604 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1605 }
1606 m_t << "}{\\ref{";
1607 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1608 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1609 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1610 m_t << "}}{}\n";
1611}
1612
1614{
1615 if (m_hide) return;
1616 m_t << "\\footnotesize\n";
1617 m_t << "\\begin{multicols}{2}\n";
1618 m_t << "\\begin{DoxyCompactList}\n";
1620 visitChildren(l);
1622 m_t << "\\end{DoxyCompactList}\n";
1623 m_t << "\\end{multicols}\n";
1624 m_t << "\\normalsize\n";
1625}
1626
1628{
1629 if (m_hide) return;
1630 bool hasInOutSpecs = s.hasInOutSpecifier();
1631 bool hasTypeSpecs = s.hasTypeSpecifier();
1632 m_lcg.incUsedTableLevel();
1633 switch(s.type())
1634 {
1636 m_t << "\n\\begin{DoxyParams}";
1637 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1638 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1639 m_t << "{";
1640 filter(theTranslator->trParameters());
1641 break;
1643 m_t << "\n\\begin{DoxyRetVals}{";
1644 filter(theTranslator->trReturnValues());
1645 break;
1647 m_t << "\n\\begin{DoxyExceptions}{";
1648 filter(theTranslator->trExceptions());
1649 break;
1651 m_t << "\n\\begin{DoxyTemplParams}{";
1652 filter(theTranslator->trTemplateParameters());
1653 break;
1654 default:
1655 ASSERT(0);
1657 }
1658 m_t << "}\n";
1659 visitChildren(s);
1660 m_lcg.decUsedTableLevel();
1661 switch(s.type())
1662 {
1664 m_t << "\\end{DoxyParams}\n";
1665 break;
1667 m_t << "\\end{DoxyRetVals}\n";
1668 break;
1670 m_t << "\\end{DoxyExceptions}\n";
1671 break;
1673 m_t << "\\end{DoxyTemplParams}\n";
1674 break;
1675 default:
1676 ASSERT(0);
1678 }
1679}
1680
1682{
1683 m_t << " " << sep.chars() << " ";
1684}
1685
1687{
1688 if (m_hide) return;
1690 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1691 if (sect)
1692 {
1693 parentType = sect->type();
1694 }
1695 bool useTable = parentType==DocParamSect::Param ||
1696 parentType==DocParamSect::RetVal ||
1697 parentType==DocParamSect::Exception ||
1698 parentType==DocParamSect::TemplateParam;
1699 if (!useTable)
1700 {
1701 m_t << "\\item[";
1702 }
1703 if (sect && sect->hasInOutSpecifier())
1704 {
1706 {
1707 m_t << "\\doxymbox{\\texttt{";
1708 if (pl.direction()==DocParamSect::In)
1709 {
1710 m_t << "in";
1711 }
1712 else if (pl.direction()==DocParamSect::Out)
1713 {
1714 m_t << "out";
1715 }
1716 else if (pl.direction()==DocParamSect::InOut)
1717 {
1718 m_t << "in,out";
1719 }
1720 m_t << "}} ";
1721 }
1722 if (useTable) m_t << " & ";
1723 }
1724 if (sect && sect->hasTypeSpecifier())
1725 {
1726 for (const auto &type : pl.paramTypes())
1727 {
1728 std::visit(*this,type);
1729 }
1730 if (useTable) m_t << " & ";
1731 }
1732 m_t << "{\\em ";
1733 bool first=TRUE;
1734 for (const auto &param : pl.parameters())
1735 {
1736 if (!first) m_t << ","; else first=FALSE;
1738 std::visit(*this,param);
1740 }
1741 m_t << "}";
1742 if (useTable)
1743 {
1744 m_t << " & ";
1745 }
1746 else
1747 {
1748 m_t << "]";
1749 }
1750 for (const auto &par : pl.paragraphs())
1751 {
1752 std::visit(*this,par);
1753 }
1754 if (useTable)
1755 {
1756 m_t << "\\\\\n"
1757 << "\\hline\n";
1758 }
1759}
1760
1762{
1763 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1764 if (m_hide) return;
1765 if (x.title().isEmpty()) return;
1767 m_t << "\\begin{DoxyRefDesc}{";
1768 filter(x.title());
1769 m_t << "}\n";
1770 bool anonymousEnum = x.file()=="@";
1771 m_t << "\\item[";
1772 if (pdfHyperlinks && !anonymousEnum)
1773 {
1774 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1775 }
1776 else
1777 {
1778 m_t << "\\textbf{ ";
1779 }
1781 filter(x.title());
1783 if (pdfHyperlinks && !anonymousEnum)
1784 {
1785 m_t << "}";
1786 }
1787 m_t << "}]";
1788 visitChildren(x);
1789 if (x.title().isEmpty()) return;
1791 m_t << "\\end{DoxyRefDesc}\n";
1792}
1793
1795{
1796 if (m_hide) return;
1797 startLink(QCString(),ref.file(),ref.anchor());
1798 visitChildren(ref);
1799 endLink(QCString(),ref.file(),ref.anchor());
1800}
1801
1803{
1804 if (m_hide) return;
1805 visitChildren(t);
1806}
1807
1809{
1810 if (m_hide) return;
1811 m_t << "\\begin{quote}\n";
1813 visitChildren(q);
1814 m_t << "\\end{quote}\n";
1816}
1817
1821
1823{
1824 if (m_hide) return;
1825 visitChildren(pb);
1826}
1827
1828void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1829{
1830 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1832 m_lcg.insideTabbing(),
1835 m_lcg.usedTableLevel()>0, // insideTable
1836 false, // keepSpaces
1837 retainNewLine
1838 );
1839}
1840
1841void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1842 bool refToTable,bool refToSection)
1843{
1844 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1845 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1846 {
1847 if (refToTable)
1848 {
1849 m_t << "\\doxytablelink{";
1850 }
1851 else if (refToSection)
1852 {
1853 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1854 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1855 }
1856 else
1857 {
1858 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1859 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1860 }
1861 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1862 {
1863 if (!file.isEmpty()) m_t << stripPath(file);
1864 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1865 if (!anchor.isEmpty()) m_t << anchor;
1866 m_t << "}";
1867 }
1868 m_t << "{";
1869 }
1870 else if (ref.isEmpty() && refToSection)
1871 {
1872 m_t << "\\doxysectref{";
1873 }
1874 else if (ref.isEmpty() && refToTable)
1875 {
1876 m_t << "\\doxytableref{";
1877 }
1878 else if (ref.isEmpty()) // internal non-PDF link
1879 {
1880 m_t << "\\doxyref{";
1881 }
1882 else // external link
1883 {
1884 m_t << "\\textbf{ ";
1885 }
1886}
1887
1888void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1889{
1890 m_t << "}";
1891 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1892 if (ref.isEmpty() && !pdfHyperLinks)
1893 {
1894 m_t << "{";
1895 filter(theTranslator->trPageAbbreviation());
1896 m_t << "}{" << file;
1897 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1898 m_t << anchor << "}";
1899 if (refToSection)
1900 {
1901 m_t << "{" << sectionType.level() << "}";
1902 }
1903 }
1904 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1905 {
1906 if (refToSection)
1907 {
1908 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1909 }
1910 }
1911}
1912
1914 const QCString &width,
1915 const QCString &height,
1916 bool hasCaption,
1917 const QCString &srcFile,
1918 int srcLine, bool newFile
1919 )
1920{
1921 QCString baseName=makeBaseName(fileName,".dot");
1922 baseName.prepend("dot_");
1923 QCString outDir = Config_getString(LATEX_OUTPUT);
1924 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1925 visitPreStart(m_t,hasCaption, baseName, width, height);
1926}
1927
1928void LatexDocVisitor::endDotFile(bool hasCaption)
1929{
1930 if (m_hide) return;
1931 visitPostEnd(m_t,hasCaption);
1932}
1933
1935 const QCString &width,
1936 const QCString &height,
1937 bool hasCaption,
1938 const QCString &srcFile,
1939 int srcLine, bool newFile
1940 )
1941{
1942 QCString baseName=makeBaseName(fileName,".msc");
1943 baseName.prepend("msc_");
1944
1945 QCString outDir = Config_getString(LATEX_OUTPUT);
1946 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1947 visitPreStart(m_t,hasCaption, baseName, width, height);
1948}
1949
1950void LatexDocVisitor::endMscFile(bool hasCaption)
1951{
1952 if (m_hide) return;
1953 visitPostEnd(m_t,hasCaption);
1954}
1955
1956
1957void LatexDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1958{
1959 QCString shortName=makeBaseName(fileName,".msc");
1960 QCString outDir = Config_getString(LATEX_OUTPUT);
1961 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
1962 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1965}
1966
1968 const QCString &width,
1969 const QCString &height,
1970 bool hasCaption,
1971 const QCString &srcFile,
1972 int srcLine, bool newFile
1973 )
1974{
1975 QCString baseName=makeBaseName(fileName,".dia");
1976 baseName.prepend("dia_");
1977
1978 QCString outDir = Config_getString(LATEX_OUTPUT);
1979 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
1980 visitPreStart(m_t,hasCaption, baseName, width, height);
1981}
1982
1983void LatexDocVisitor::endDiaFile(bool hasCaption)
1984{
1985 if (m_hide) return;
1986 visitPostEnd(m_t,hasCaption);
1987}
1988
1990{
1991 QCString shortName = stripPath(baseName);
1992 if (s.useBitmap())
1993 {
1994 if (shortName.find('.')==-1) shortName += ".png";
1995 }
1996 QCString outDir = Config_getString(LATEX_OUTPUT);
1999 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2002}
2003
2005 const QCString &width,
2006 const QCString &height,
2007 bool hasCaption,
2008 const QCString &srcFile,
2009 int srcLine
2010 )
2011{
2012 QCString outDir = Config_getString(LATEX_OUTPUT);
2013 std::string inBuf;
2014 readInputFile(fileName,inBuf);
2015
2016 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2017 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2018 outDir,QCString(),inBuf,
2020 QCString(),srcFile,srcLine,false);
2021 bool first = true;
2022 for (const auto &bName: baseNameVector)
2023 {
2024 QCString baseName = makeBaseName(bName,".pu");
2025 QCString shortName = stripPath(baseName);
2026 if (useBitmap)
2027 {
2028 if (shortName.find('.')==-1) shortName += ".png";
2029 }
2032 if (!first) endPlantUmlFile(hasCaption);
2033 first = false;
2034 visitPreStart(m_t,hasCaption, shortName, width, height);
2035 }
2036}
2037
2039{
2040 if (m_hide) return;
2041 visitPostEnd(m_t,hasCaption);
2042}
2043
2045{
2046 return std::min(m_indentLevel,maxIndentLevels-1);
2047}
2048
2050{
2051 m_indentLevel++;
2053 {
2054 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2055 }
2056}
2057
2059{
2060 if (m_indentLevel>0)
2061 {
2062 m_indentLevel--;
2063 }
2064}
2065
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:1288
Node representing a HTML table caption.
Definition docnode.h:1225
QCString anchor() const
Definition docnode.h:1232
QCString file() const
Definition docnode.h:1231
Node representing a HTML table cell.
Definition docnode.h:1190
Valignment valignment() const
Definition docnode.cpp:1938
uint32_t rowSpan() const
Definition docnode.cpp:1876
Alignment alignment() const
Definition docnode.cpp:1900
bool isLast() const
Definition docnode.h:1199
bool isHeading() const
Definition docnode.h:1197
uint32_t colSpan() const
Definition docnode.cpp:1888
Node representing a HTML description data.
Definition docnode.h:1178
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:1162
const HtmlAttribList & attribs() const
Definition docnode.h:1167
Node representing a HTML table row.
Definition docnode.h:1243
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1266
size_t numberHeaderRows() const
Definition docnode.cpp:2213
size_t numColumns() const
Definition docnode.h:1275
const DocNodeVariant * caption() const
Definition docnode.cpp:2208
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:1122
const DocNodeList & parameters() const
Definition docnode.h:1126
const DocNodeList & paramTypes() const
Definition docnode.h:1127
DocParamSect::Direction direction() const
Definition docnode.h:1130
const DocNodeList & paragraphs() const
Definition docnode.h:1128
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:1310
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:1150
const DocNodeVariant * paragraph() const
Definition docnode.h:1154
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:1301
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:1363
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:1327
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)
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:6961
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5193
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6700
QCString stripPath(const QCString &s)
Definition util.cpp:4931
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:5532
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5211
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4947
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:5859
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5235
A bunch of utility functions.