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
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
209static QCString makeShortName(const QCString &name)
210{
211 QCString shortName = name;
212 int i = shortName.findRev('/');
213 if (i!=-1)
214 {
215 shortName=shortName.mid(i+1);
216 }
217 return shortName;
218}
219
220static QCString makeBaseName(const QCString &name)
221{
222 QCString baseName = makeShortName(name);
223 int i=baseName.find('.');
224 if (i!=-1)
225 {
226 baseName=baseName.left(i);
227 }
228 return baseName;
229}
230
231
233{
234 for (const auto &n : children)
235 {
236 std::visit(*this,n);
237 }
238}
239
241 const QCString &langExt, int hierarchyLevel)
242 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
244 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
245{
246}
247
248 //--------------------------------------
249 // visitor functions for leaf nodes
250 //--------------------------------------
251
253{
254 if (m_hide) return;
255 filter(w.word());
256}
257
259{
260 if (m_hide) return;
261 startLink(w.ref(),w.file(),w.anchor());
262 filter(w.word());
263 endLink(w.ref(),w.file(),w.anchor());
264}
265
267{
268 if (m_hide) return;
269 if (m_insidePre)
270 {
271 m_t << w.chars();
272 }
273 else
274 {
275 m_t << " ";
276 }
277}
278
280{
281 if (m_hide) return;
282 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
283 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
284 if (res)
285 {
287 {
288 if (pdfHyperlinks)
289 {
290 m_t << "\\texorpdfstring{$<$}{<}";
291 }
292 else
293 {
294 m_t << "$<$";
295 }
296 }
298 {
299 if (pdfHyperlinks)
300 {
301 m_t << "\\texorpdfstring{$>$}{>}";
302 }
303 else
304 {
305 m_t << "$>$";
306 }
307 }
308 else
309 {
310 m_t << res;
311 }
312 }
313 else
314 {
315 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
316 }
317}
318
320{
321 if (m_hide) return;
323 if (!emojiName.isEmpty())
324 {
325 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
326 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
327 filter(emojiName);
328 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
329 }
330 else
331 {
332 m_t << s.name();
333 }
334}
335
337{
338 if (m_hide) return;
339 if (Config_getBool(PDF_HYPERLINKS))
340 {
341 m_t << "\\href{";
342 if (u.isEmail()) m_t << "mailto:";
343 m_t << latexFilterURL(u.url()) << "}";
344 }
345 m_t << "{\\texttt{";
346 filter(u.url());
347 m_t << "}}";
348}
349
351{
352 if (m_hide) return;
353 if (m_insideItem)
354 {
355 m_t << "\\\\\n";
356 }
357 else
358 {
359 m_t << "~\\newline\n";
360 }
361}
362
364{
365 if (m_hide) return;
366 if (insideTable())
367 m_t << "\\DoxyHorRuler{1}\n";
368 else
369 m_t << "\\DoxyHorRuler{0}\n";
370}
371
373{
374 if (m_hide) return;
375 switch (s.style())
376 {
378 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
379 break;
383 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
384 break;
387 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
388 break;
390 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
391 break;
395 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
396 break;
398 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
399 break;
401 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
402 break;
404 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
405 break;
407 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
408 break;
410 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
411 break;
413 if (s.enable())
414 {
415 m_t << "\n\\begin{DoxyPre}";
417 }
418 else
419 {
421 m_t << "\\end{DoxyPre}\n";
422 }
423 break;
424 case DocStyleChange::Div: /* HTML only */ break;
425 case DocStyleChange::Span: /* HTML only */ break;
426 }
427}
428
430{
431 if (m_hide) return;
432 QCString lang = m_langExt;
433 if (!s.language().isEmpty()) // explicit language setting
434 {
435 lang = s.language();
436 }
437 SrcLangExt langExt = getLanguageFromCodeLang(lang);
438 switch(s.type())
439 {
441 {
442 m_ci.startCodeFragment("DoxyCode");
443 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
444 Config_getBool(STRIP_CODE_COMMENTS),
445 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
446 m_ci.endCodeFragment("DoxyCode");
447 }
448 break;
450 filter(s.text(), true);
451 break;
453 m_t << "{\\ttfamily ";
454 filter(s.text(), true);
455 m_t << "}";
456 break;
458 if (isTableNested(s.parent())) // in table
459 {
460 m_t << "\\begin{DoxyCode}{0}";
461 filter(s.text(), true);
462 m_t << "\\end{DoxyCode}\n";
463 }
464 else
465 {
466 m_t << "\\begin{DoxyVerb}";
467 m_t << s.text();
468 m_t << "\\end{DoxyVerb}\n";
469 }
470 break;
476 /* nothing */
477 break;
479 m_t << s.text();
480 break;
481 case DocVerbatim::Dot:
482 {
483 static int dotindex = 1;
484 QCString fileName(4096, QCString::ExplicitSize);
485
486 fileName.sprintf("%s%d%s",
487 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
488 dotindex++,
489 ".dot"
490 );
491 std::ofstream file = Portable::openOutputStream(fileName);
492 if (!file.is_open())
493 {
494 err("Could not open file {} for writing\n",fileName);
495 }
496 else
497 {
498 file.write( s.text().data(), s.text().length() );
499 file.close();
500
501 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
502 visitChildren(s);
504
505 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
506 }
507 }
508 break;
509 case DocVerbatim::Msc:
510 {
511 static int mscindex = 1;
512 QCString baseName(4096, QCString::ExplicitSize);
513
514 baseName.sprintf("%s%d",
515 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
516 mscindex++
517 );
518 QCString fileName = baseName+".msc";
519 std::ofstream file = Portable::openOutputStream(fileName);
520 if (!file.is_open())
521 {
522 err("Could not open file {} for writing\n",fileName);
523 }
524 else
525 {
526 QCString text = "msc {";
527 text+=s.text();
528 text+="}";
529 file.write( text.data(), text.length() );
530 file.close();
531
532 writeMscFile(baseName, s);
533
534 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
535 }
536 }
537 break;
539 {
540 QCString latexOutput = Config_getString(LATEX_OUTPUT);
541 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
542 latexOutput,s.exampleFile(),s.text(),
544 s.engine(),s.srcFile(),s.srcLine(),true);
545
546 for (const auto &baseName: baseNameVector)
547 {
548 writePlantUMLFile(baseName, s);
549 }
550 }
551 break;
552 }
553}
554
556{
557 if (m_hide) return;
558 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
559 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
560 {
561 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
562 << "}%\n";
563 }
564}
565
567{
568 if (m_hide) return;
570 switch(inc.type())
571 {
573 {
574 m_ci.startCodeFragment("DoxyCodeInclude");
575 FileInfo cfi( inc.file().str() );
576 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
578 inc.text(),
579 langExt,
580 inc.stripCodeComments(),
582 .setExample(inc.isExample(), inc.exampleFile())
583 .setFileDef(fd.get())
584 .setInlineFragment(true)
585 );
586 m_ci.endCodeFragment("DoxyCodeInclude");
587 }
588 break;
590 {
591 m_ci.startCodeFragment("DoxyCodeInclude");
593 inc.text(),langExt,
594 inc.stripCodeComments(),
596 .setExample(inc.isExample(), inc.exampleFile())
597 .setInlineFragment(true)
598 .setShowLineNumbers(false)
599 );
600 m_ci.endCodeFragment("DoxyCodeInclude");
601 }
602 break;
610 break;
612 m_t << inc.text();
613 break;
615 if (isTableNested(inc.parent())) // in table
616 {
617 m_t << "\\begin{DoxyCode}{0}";
618 filter(inc.text(), true);
619 m_t << "\\end{DoxyCode}\n";
620 }
621 else
622 {
623 m_t << "\n\\begin{DoxyVerbInclude}\n";
624 m_t << inc.text();
625 m_t << "\\end{DoxyVerbInclude}\n";
626 }
627 break;
630 {
631 m_ci.startCodeFragment("DoxyCodeInclude");
633 inc.file(),
634 inc.blockId(),
635 inc.context(),
637 inc.trimLeft(),
639 );
640 m_ci.endCodeFragment("DoxyCodeInclude");
641 }
642 break;
643 }
644}
645
647{
648 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
649 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
650 if (op.isFirst())
651 {
652 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
654 m_hide = TRUE;
655 }
657 if (locLangExt.isEmpty()) locLangExt = m_langExt;
658 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
659 if (op.type()!=DocIncOperator::Skip)
660 {
661 m_hide = popHidden();
662 if (!m_hide)
663 {
664 std::unique_ptr<FileDef> fd;
665 if (!op.includeFileName().isEmpty())
666 {
667 FileInfo cfi( op.includeFileName().str() );
668 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
669 }
670
671 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
674 .setExample(op.isExample(),op.exampleFile())
675 .setFileDef(fd.get())
676 .setStartLine(op.line())
678 );
679 }
681 m_hide=TRUE;
682 }
683 if (op.isLast())
684 {
686 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
687 }
688 else
689 {
690 if (!m_hide) m_t << "\n";
691 }
692}
693
695{
696 if (m_hide) return;
697 QCString s = f.text();
698 const char *p = s.data();
699 char c = 0;
700 if (p)
701 {
702 while ((c=*p++))
703 {
704 switch (c)
705 {
706 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
707 default: m_t << c; break;
708 }
709 }
710 }
711}
712
714{
715 if (m_hide) return;
716 m_t << "\\index{";
718 m_t << "@{";
720 m_t << "}}";
721}
722
726
728{
729 if (m_hide) return;
730 auto opt = cite.option();
731 QCString txt;
732 if (opt.noCite())
733 {
734 if (!cite.file().isEmpty())
735 {
736 txt = cite.getText();
737 }
738 else
739 {
740 if (!opt.noPar()) txt += "[";
741 txt += cite.target();
742 if (!opt.noPar()) txt += "]";
743 }
744 m_t << "{\\bfseries ";
745 filter(txt);
746 m_t << "}";
747 }
748 else
749 {
750 if (!cite.file().isEmpty())
751 {
752 QCString anchor = cite.anchor();
754 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
755
756 txt = "\\DoxyCite{" + anchor + "}";
757 if (opt.isNumber())
758 {
759 txt += "{number}";
760 }
761 else if (opt.isShortAuthor())
762 {
763 txt += "{shortauthor}";
764 }
765 else if (opt.isYear())
766 {
767 txt += "{year}";
768 }
769 if (!opt.noPar()) txt += "{1}";
770 else txt += "{0}";
771
772 m_t << txt;
773 }
774 else
775 {
776 if (!opt.noPar()) txt += "[";
777 txt += cite.target();
778 if (!opt.noPar()) txt += "]";
779 m_t << "{\\bfseries ";
780 filter(txt);
781 m_t << "}";
782 }
783 }
784}
785
786//--------------------------------------
787// visitor functions for compound nodes
788//--------------------------------------
789
791{
792 if (m_hide) return;
793 if (m_indentLevel>=maxIndentLevels-1) return;
794 if (l.isEnumList())
795 {
796 m_t << "\n\\begin{DoxyEnumerate}";
797 m_listItemInfo[indentLevel()].isEnum = true;
798 }
799 else
800 {
801 m_listItemInfo[indentLevel()].isEnum = false;
802 m_t << "\n\\begin{DoxyItemize}";
803 }
804 visitChildren(l);
805 if (l.isEnumList())
806 {
807 m_t << "\n\\end{DoxyEnumerate}";
808 }
809 else
810 {
811 m_t << "\n\\end{DoxyItemize}";
812 }
813}
814
816{
817 if (m_hide) return;
818 switch (li.itemNumber())
819 {
820 case DocAutoList::Unchecked: // unchecked
821 m_t << "\n\\item[\\DoxyUnchecked] ";
822 break;
823 case DocAutoList::Checked_x: // checked with x
824 case DocAutoList::Checked_X: // checked with X
825 m_t << "\n\\item[\\DoxyChecked] ";
826 break;
827 default:
828 m_t << "\n\\item ";
829 break;
830 }
832 visitChildren(li);
834}
835
837{
838 if (m_hide) return;
839 visitChildren(p);
840 if (!p.isLast() && // omit <p> for last paragraph
841 !(p.parent() && // and for parameter sections
842 std::get_if<DocParamSect>(p.parent())
843 )
844 )
845 {
846 if (insideTable())
847 {
848 m_t << "~\\newline\n";
849 }
850 else
851 {
852 m_t << "\n\n";
853 }
854 }
855}
856
858{
859 visitChildren(r);
860}
861
863{
864 if (m_hide) return;
865 switch(s.type())
866 {
868 m_t << "\\begin{DoxySeeAlso}{";
869 filter(theTranslator->trSeeAlso());
870 break;
872 m_t << "\\begin{DoxyReturn}{";
873 filter(theTranslator->trReturns());
874 break;
876 m_t << "\\begin{DoxyAuthor}{";
877 filter(theTranslator->trAuthor(TRUE,TRUE));
878 break;
880 m_t << "\\begin{DoxyAuthor}{";
881 filter(theTranslator->trAuthor(TRUE,FALSE));
882 break;
884 m_t << "\\begin{DoxyVersion}{";
885 filter(theTranslator->trVersion());
886 break;
888 m_t << "\\begin{DoxySince}{";
889 filter(theTranslator->trSince());
890 break;
892 m_t << "\\begin{DoxyDate}{";
893 filter(theTranslator->trDate());
894 break;
896 m_t << "\\begin{DoxyNote}{";
897 filter(theTranslator->trNote());
898 break;
900 m_t << "\\begin{DoxyWarning}{";
901 filter(theTranslator->trWarning());
902 break;
904 m_t << "\\begin{DoxyPrecond}{";
905 filter(theTranslator->trPrecondition());
906 break;
908 m_t << "\\begin{DoxyPostcond}{";
909 filter(theTranslator->trPostcondition());
910 break;
912 m_t << "\\begin{DoxyCopyright}{";
913 filter(theTranslator->trCopyright());
914 break;
916 m_t << "\\begin{DoxyInvariant}{";
917 filter(theTranslator->trInvariant());
918 break;
920 m_t << "\\begin{DoxyRemark}{";
921 filter(theTranslator->trRemarks());
922 break;
924 m_t << "\\begin{DoxyAttention}{";
925 filter(theTranslator->trAttention());
926 break;
928 m_t << "\\begin{DoxyImportant}{";
929 filter(theTranslator->trImportant());
930 break;
932 m_t << "\\begin{DoxyParagraph}{";
933 break;
935 m_t << "\\begin{DoxyParagraph}{";
936 break;
937 case DocSimpleSect::Unknown: break;
938 }
939
940 if (s.title())
941 {
943 std::visit(*this,*s.title());
945 }
946 m_t << "}\n";
948 visitChildren(s);
949 switch(s.type())
950 {
952 m_t << "\n\\end{DoxySeeAlso}\n";
953 break;
955 m_t << "\n\\end{DoxyReturn}\n";
956 break;
958 m_t << "\n\\end{DoxyAuthor}\n";
959 break;
961 m_t << "\n\\end{DoxyAuthor}\n";
962 break;
964 m_t << "\n\\end{DoxyVersion}\n";
965 break;
967 m_t << "\n\\end{DoxySince}\n";
968 break;
970 m_t << "\n\\end{DoxyDate}\n";
971 break;
973 m_t << "\n\\end{DoxyNote}\n";
974 break;
976 m_t << "\n\\end{DoxyWarning}\n";
977 break;
979 m_t << "\n\\end{DoxyPrecond}\n";
980 break;
982 m_t << "\n\\end{DoxyPostcond}\n";
983 break;
985 m_t << "\n\\end{DoxyCopyright}\n";
986 break;
988 m_t << "\n\\end{DoxyInvariant}\n";
989 break;
991 m_t << "\n\\end{DoxyRemark}\n";
992 break;
994 m_t << "\n\\end{DoxyAttention}\n";
995 break;
997 m_t << "\n\\end{DoxyImportant}\n";
998 break;
1000 m_t << "\n\\end{DoxyParagraph}\n";
1001 break;
1002 case DocSimpleSect::Rcs:
1003 m_t << "\n\\end{DoxyParagraph}\n";
1004 break;
1005 default:
1006 break;
1007 }
1009}
1010
1012{
1013 if (m_hide) return;
1014 visitChildren(t);
1015}
1016
1018{
1019 if (m_hide) return;
1020 m_t << "\\begin{DoxyItemize}\n";
1021 m_listItemInfo[indentLevel()].isEnum = false;
1022 visitChildren(l);
1023 m_t << "\\end{DoxyItemize}\n";
1024}
1025
1027{
1028 if (m_hide) return;
1029 m_t << "\\item ";
1031 if (li.paragraph())
1032 {
1033 visit(*this,*li.paragraph());
1034 }
1036}
1037
1039{
1040 if (m_hide) return;
1041 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1042 if (pdfHyperlinks)
1043 {
1044 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1045 }
1046 m_t << "\\" << getSectionName(s.level()) << "{";
1047 if (pdfHyperlinks)
1048 {
1049 m_t << "\\texorpdfstring{";
1050 }
1051 if (s.title())
1052 {
1053 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1054 std::visit(*this,*s.title());
1056 }
1057 if (pdfHyperlinks)
1058 {
1059 m_t << "}{";
1060 if (s.title())
1061 {
1062 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1063 std::visit(*this,*s.title());
1065 }
1066 m_t << "}";
1067 }
1068 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1069 visitChildren(s);
1070}
1071
1073{
1074 if (m_hide) return;
1075 if (m_indentLevel>=maxIndentLevels-1) return;
1077 if (s.type()==DocHtmlList::Ordered)
1078 {
1079 bool first = true;
1080 m_t << "\n\\begin{DoxyEnumerate}";
1081 for (const auto &opt : s.attribs())
1082 {
1083 if (opt.name=="type")
1084 {
1085 if (opt.value=="1")
1086 {
1087 m_t << (first ? "[": ",");
1088 m_t << "label=\\arabic*";
1089 first = false;
1090 }
1091 else if (opt.value=="a")
1092 {
1093 m_t << (first ? "[": ",");
1094 m_t << "label=\\enumalphalphcnt*";
1095 first = false;
1096 }
1097 else if (opt.value=="A")
1098 {
1099 m_t << (first ? "[": ",");
1100 m_t << "label=\\enumAlphAlphcnt*";
1101 first = false;
1102 }
1103 else if (opt.value=="i")
1104 {
1105 m_t << (first ? "[": ",");
1106 m_t << "label=\\roman*";
1107 first = false;
1108 }
1109 else if (opt.value=="I")
1110 {
1111 m_t << (first ? "[": ",");
1112 m_t << "label=\\Roman*";
1113 first = false;
1114 }
1115 }
1116 else if (opt.name=="start")
1117 {
1118 m_t << (first ? "[": ",");
1119 bool ok = false;
1120 int val = opt.value.toInt(&ok);
1121 if (ok) m_t << "start=" << val;
1122 first = false;
1123 }
1124 }
1125 if (!first) m_t << "]\n";
1126 }
1127 else
1128 {
1129 m_t << "\n\\begin{DoxyItemize}";
1130 }
1131 visitChildren(s);
1132 if (m_indentLevel>=maxIndentLevels-1) return;
1133 if (s.type()==DocHtmlList::Ordered)
1134 m_t << "\n\\end{DoxyEnumerate}";
1135 else
1136 m_t << "\n\\end{DoxyItemize}";
1137}
1138
1140{
1141 if (m_hide) return;
1142 if (m_listItemInfo[indentLevel()].isEnum)
1143 {
1144 for (const auto &opt : l.attribs())
1145 {
1146 if (opt.name=="value")
1147 {
1148 bool ok = false;
1149 int val = opt.value.toInt(&ok);
1150 if (ok)
1151 {
1152 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1153 }
1154 }
1155 }
1156 }
1157 m_t << "\n\\item ";
1159 visitChildren(l);
1161}
1162
1163
1165{
1166 HtmlAttribList attrs = dl.attribs();
1167 auto it = std::find_if(attrs.begin(),attrs.end(),
1168 [](const auto &att) { return att.name=="class"; });
1169 if (it!=attrs.end() && it->value == "reflist") return true;
1170 return false;
1171}
1172
1173static bool listIsNested(const DocHtmlDescList &dl)
1174{
1175 bool isNested=false;
1176 const DocNodeVariant *n = dl.parent();
1177 while (n && !isNested)
1178 {
1179 if (std::get_if<DocHtmlDescList>(n))
1180 {
1181 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1182 }
1183 n = ::parent(n);
1184 }
1185 return isNested;
1186}
1187
1189{
1190 if (m_hide) return;
1191 bool eq = classEqualsReflist(dl);
1192 if (eq)
1193 {
1194 m_t << "\n\\begin{DoxyRefList}";
1195 }
1196 else
1197 {
1198 if (listIsNested(dl)) m_t << "\n\\hfill";
1199 m_t << "\n\\begin{DoxyDescription}";
1200 }
1201 visitChildren(dl);
1202 if (eq)
1203 {
1204 m_t << "\n\\end{DoxyRefList}";
1205 }
1206 else
1207 {
1208 m_t << "\n\\end{DoxyDescription}";
1209 }
1210}
1211
1213{
1214 if (m_hide) return;
1215 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1217 visitChildren(dt);
1219 m_t << "}}]";
1220}
1221
1223{
1225 if (!m_insideItem) m_t << "\\hfill";
1226 m_t << " \\\\\n";
1227 visitChildren(dd);
1229}
1230
1232{
1233 bool isNested=m_lcg.usedTableLevel()>0;
1234 while (n && !isNested)
1235 {
1237 n = ::parent(n);
1238 }
1239 return isNested;
1240}
1241
1243{
1244 if (isTableNested(n))
1245 {
1246 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1247 }
1248 else
1249 {
1250 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1251 }
1252}
1253
1255{
1256 if (isTableNested(n))
1257 {
1258 m_t << "\\end{DoxyTableNested}\n";
1259 }
1260 else
1261 {
1262 m_t << "\\end{DoxyTable}\n";
1263 }
1264}
1265
1267{
1268 if (m_hide) return;
1270 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1271 if (c)
1272 {
1273 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1274 if (!c->file().isEmpty() && pdfHyperLinks)
1275 {
1276 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1277 << "}{}";
1278 }
1279 m_t << "\n";
1280 }
1281
1283 if (!isTableNested(t.parent()))
1284 {
1285 // write caption
1286 m_t << "{";
1287 if (c)
1288 {
1289 std::visit(*this, *t.caption());
1290 }
1291 m_t << "}";
1292 // write label
1293 m_t << "{";
1294 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1295 {
1296 m_t << stripPath(c->file()) << "_" << c->anchor();
1297 }
1298 m_t << "}";
1299 }
1300
1301 // write head row(s)
1302 m_t << "{" << t.numberHeaderRows() << "}\n";
1303
1305
1306 visitChildren(t);
1308 popTableState();
1309}
1310
1312{
1313 if (m_hide) return;
1314 visitChildren(c);
1315}
1316
1318{
1319 if (m_hide) return;
1321
1322 visitChildren(row);
1323
1324 m_t << "\\\\";
1325
1326 size_t col = 1;
1327 for (auto &span : rowSpans())
1328 {
1329 if (span.rowSpan>0) span.rowSpan--;
1330 if (span.rowSpan<=0)
1331 {
1332 // inactive span
1333 }
1334 else if (span.column>col)
1335 {
1336 col = span.column+span.colSpan;
1337 }
1338 else
1339 {
1340 col = span.column+span.colSpan;
1341 }
1342 }
1343
1344 m_t << "\n";
1345}
1346
1348{
1349 if (m_hide) return;
1350 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1351
1353
1354 QCString cellOpts;
1355 QCString cellSpec;
1356 auto appendOpt = [&cellOpts](const QCString &s)
1357 {
1358 if (!cellOpts.isEmpty()) cellOpts+=",";
1359 cellOpts+=s;
1360 };
1361 auto appendSpec = [&cellSpec](const QCString &s)
1362 {
1363 if (!cellSpec.isEmpty()) cellSpec+=",";
1364 cellSpec+=s;
1365 };
1366 auto writeCell = [this,&cellOpts,&cellSpec]()
1367 {
1368 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1369 {
1370 m_t << "\\SetCell";
1371 if (!cellOpts.isEmpty())
1372 {
1373 m_t << "[" << cellOpts << "]";
1374 }
1375 m_t << "{" << cellSpec << "}";
1376 }
1377 };
1378
1379 // skip over columns that have a row span starting at an earlier row
1380 for (const auto &span : rowSpans())
1381 {
1382 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1383 // span.cell.rowIndex(),span.cell.columnIndex(),
1384 // span.column,span.colSpan,span.rowSpan,
1385 // currentColumn());
1386 if (span.rowSpan>0 && span.column==currentColumn())
1387 {
1388 setCurrentColumn(currentColumn()+span.colSpan);
1389 for (size_t i=0;i<span.colSpan;i++)
1390 {
1391 m_t << "&";
1392 }
1393 }
1394 }
1395
1396 int cs = c.colSpan();
1397 int ha = c.alignment();
1398 int rs = c.rowSpan();
1399 int va = c.valignment();
1400
1401 switch (ha) // horizontal alignment
1402 {
1403 case DocHtmlCell::Right:
1404 appendSpec("r");
1405 break;
1407 appendSpec("c");
1408 break;
1409 default:
1410 // default
1411 break;
1412 }
1413 if (rs>0) // row span
1414 {
1415 appendOpt("r="+QCString().setNum(rs));
1416 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1417 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1418 // currentColumn());
1420 }
1421 if (cs>1) // column span
1422 {
1423 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1425 appendOpt("c="+QCString().setNum(cs));
1426 }
1427 if (c.isHeading())
1428 {
1429 appendSpec("bg=\\tableheadbgcolor");
1430 appendSpec("font=\\bfseries");
1431 }
1432 switch(va) // vertical alignment
1433 {
1434 case DocHtmlCell::Top:
1435 appendSpec("h");
1436 break;
1438 appendSpec("f");
1439 break;
1441 // default
1442 break;
1443 }
1444 writeCell();
1445
1446 visitChildren(c);
1447
1448 for (int i=0;i<cs-1;i++)
1449 {
1450 m_t << "&"; // placeholder for invisible cell
1451 }
1452
1453 if (!c.isLast()) m_t << "&";
1454}
1455
1457{
1458 if (m_hide) return;
1459 visitChildren(i);
1460}
1461
1463{
1464 if (m_hide) return;
1465 if (Config_getBool(PDF_HYPERLINKS))
1466 {
1467 m_t << "\\href{";
1468 m_t << latexFilterURL(href.url());
1469 m_t << "}";
1470 }
1471 m_t << "{\\texttt{";
1472 visitChildren(href);
1473 m_t << "}}";
1474}
1475
1477{
1478 if (m_hide) return;
1479 m_t << "{\\bfseries{";
1480 visitChildren(d);
1481 m_t << "}}";
1482}
1483
1485{
1486 if (m_hide) return;
1487 m_t << "\n\n";
1488 auto summary = d.summary();
1489 if (summary)
1490 {
1491 std::visit(*this,*summary);
1492 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1493 }
1494 visitChildren(d);
1495 if (summary)
1496 {
1497 m_t << "\\end{adjustwidth}\n";
1498 }
1499 else
1500 {
1501 m_t << "\n\n";
1502 }
1503}
1504
1506{
1507 if (m_hide) return;
1508 m_t << "\\" << getSectionName(header.level()) << "*{";
1509 visitChildren(header);
1510 m_t << "}";
1511}
1512
1514{
1515 if (img.type()==DocImage::Latex)
1516 {
1517 if (m_hide) return;
1518 QCString gfxName = img.name();
1519 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1520 {
1521 gfxName=gfxName.left(gfxName.length()-4);
1522 }
1523
1524 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1525 visitChildren(img);
1527 }
1528 else // other format -> skip
1529 {
1530 }
1531}
1532
1534{
1535 if (m_hide) return;
1536 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1537 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1538 visitChildren(df);
1539 endDotFile(df.hasCaption());
1540}
1541
1543{
1544 if (m_hide) return;
1545 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1546 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1547 visitChildren(df);
1548 endMscFile(df.hasCaption());
1549}
1550
1552{
1553 if (m_hide) return;
1554 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1555 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1556 visitChildren(df);
1557 endDiaFile(df.hasCaption());
1558}
1559
1561{
1562 if (m_hide) return;
1563 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1564 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1565 visitChildren(df);
1567}
1568
1570{
1571 if (m_hide) return;
1572 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1573 visitChildren(lnk);
1574 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1575}
1576
1578{
1579 if (m_hide) return;
1580 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1581 // ref.anchor() for LaTeX/RTF
1582 if (ref.isSubPage())
1583 {
1584 startLink(ref.ref(),QCString(),ref.anchor());
1585 }
1586 else
1587 {
1588 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1589 }
1590 if (!ref.hasLinkText())
1591 {
1592 filter(ref.targetTitle());
1593 }
1594 visitChildren(ref);
1595 if (ref.isSubPage())
1596 {
1597 endLink(ref.ref(),QCString(),ref.anchor());
1598 }
1599 else
1600 {
1601 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1602 }
1603}
1604
1606{
1607 if (m_hide) return;
1608 m_t << "\\item \\contentsline{section}{";
1609 if (ref.isSubPage())
1610 {
1611 startLink(ref.ref(),QCString(),ref.anchor());
1612 }
1613 else
1614 {
1615 if (!ref.file().isEmpty())
1616 {
1617 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1618 }
1619 }
1620 visitChildren(ref);
1621 if (ref.isSubPage())
1622 {
1623 endLink(ref.ref(),QCString(),ref.anchor());
1624 }
1625 else
1626 {
1627 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1628 }
1629 m_t << "}{\\ref{";
1630 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1631 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1632 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1633 m_t << "}}{}\n";
1634}
1635
1637{
1638 if (m_hide) return;
1639 m_t << "\\footnotesize\n";
1640 m_t << "\\begin{multicols}{2}\n";
1641 m_t << "\\begin{DoxyCompactList}\n";
1643 visitChildren(l);
1645 m_t << "\\end{DoxyCompactList}\n";
1646 m_t << "\\end{multicols}\n";
1647 m_t << "\\normalsize\n";
1648}
1649
1651{
1652 if (m_hide) return;
1653 bool hasInOutSpecs = s.hasInOutSpecifier();
1654 bool hasTypeSpecs = s.hasTypeSpecifier();
1655 m_lcg.incUsedTableLevel();
1656 switch(s.type())
1657 {
1659 m_t << "\n\\begin{DoxyParams}";
1660 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1661 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1662 m_t << "{";
1663 filter(theTranslator->trParameters());
1664 break;
1666 m_t << "\n\\begin{DoxyRetVals}{";
1667 filter(theTranslator->trReturnValues());
1668 break;
1670 m_t << "\n\\begin{DoxyExceptions}{";
1671 filter(theTranslator->trExceptions());
1672 break;
1674 m_t << "\n\\begin{DoxyTemplParams}{";
1675 filter(theTranslator->trTemplateParameters());
1676 break;
1677 default:
1678 ASSERT(0);
1680 }
1681 m_t << "}\n";
1682 visitChildren(s);
1683 m_lcg.decUsedTableLevel();
1684 switch(s.type())
1685 {
1687 m_t << "\\end{DoxyParams}\n";
1688 break;
1690 m_t << "\\end{DoxyRetVals}\n";
1691 break;
1693 m_t << "\\end{DoxyExceptions}\n";
1694 break;
1696 m_t << "\\end{DoxyTemplParams}\n";
1697 break;
1698 default:
1699 ASSERT(0);
1701 }
1702}
1703
1705{
1706 m_t << " " << sep.chars() << " ";
1707}
1708
1710{
1711 if (m_hide) return;
1713 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1714 if (sect)
1715 {
1716 parentType = sect->type();
1717 }
1718 bool useTable = parentType==DocParamSect::Param ||
1719 parentType==DocParamSect::RetVal ||
1720 parentType==DocParamSect::Exception ||
1721 parentType==DocParamSect::TemplateParam;
1722 if (!useTable)
1723 {
1724 m_t << "\\item[";
1725 }
1726 if (sect && sect->hasInOutSpecifier())
1727 {
1729 {
1730 m_t << "\\doxymbox{\\texttt{";
1731 if (pl.direction()==DocParamSect::In)
1732 {
1733 m_t << "in";
1734 }
1735 else if (pl.direction()==DocParamSect::Out)
1736 {
1737 m_t << "out";
1738 }
1739 else if (pl.direction()==DocParamSect::InOut)
1740 {
1741 m_t << "in,out";
1742 }
1743 m_t << "}} ";
1744 }
1745 if (useTable) m_t << " & ";
1746 }
1747 if (sect && sect->hasTypeSpecifier())
1748 {
1749 for (const auto &type : pl.paramTypes())
1750 {
1751 std::visit(*this,type);
1752 }
1753 if (useTable) m_t << " & ";
1754 }
1755 m_t << "{\\em ";
1756 bool first=TRUE;
1757 for (const auto &param : pl.parameters())
1758 {
1759 if (!first) m_t << ","; else first=FALSE;
1761 std::visit(*this,param);
1763 }
1764 m_t << "}";
1765 if (useTable)
1766 {
1767 m_t << " & ";
1768 }
1769 else
1770 {
1771 m_t << "]";
1772 }
1773 for (const auto &par : pl.paragraphs())
1774 {
1775 std::visit(*this,par);
1776 }
1777 if (useTable)
1778 {
1779 m_t << "\\\\\n"
1780 << "\\hline\n";
1781 }
1782}
1783
1785{
1786 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1787 if (m_hide) return;
1788 if (x.title().isEmpty()) return;
1790 m_t << "\\begin{DoxyRefDesc}{";
1791 filter(x.title());
1792 m_t << "}\n";
1793 bool anonymousEnum = x.file()=="@";
1794 m_t << "\\item[";
1795 if (pdfHyperlinks && !anonymousEnum)
1796 {
1797 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1798 }
1799 else
1800 {
1801 m_t << "\\textbf{ ";
1802 }
1804 filter(x.title());
1806 if (pdfHyperlinks && !anonymousEnum)
1807 {
1808 m_t << "}";
1809 }
1810 m_t << "}]";
1811 visitChildren(x);
1812 if (x.title().isEmpty()) return;
1814 m_t << "\\end{DoxyRefDesc}\n";
1815}
1816
1818{
1819 if (m_hide) return;
1820 startLink(QCString(),ref.file(),ref.anchor());
1821 visitChildren(ref);
1822 endLink(QCString(),ref.file(),ref.anchor());
1823}
1824
1826{
1827 if (m_hide) return;
1828 visitChildren(t);
1829}
1830
1832{
1833 if (m_hide) return;
1834 m_t << "\\begin{quote}\n";
1836 visitChildren(q);
1837 m_t << "\\end{quote}\n";
1839}
1840
1844
1846{
1847 if (m_hide) return;
1848 visitChildren(pb);
1849}
1850
1851void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1852{
1853 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1855 m_lcg.insideTabbing(),
1858 m_lcg.usedTableLevel()>0, // insideTable
1859 false, // keepSpaces
1860 retainNewLine
1861 );
1862}
1863
1864void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1865 bool refToTable,bool refToSection)
1866{
1867 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1868 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1869 {
1870 if (refToTable)
1871 {
1872 m_t << "\\doxytablelink{";
1873 }
1874 else if (refToSection)
1875 {
1876 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1877 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1878 }
1879 else
1880 {
1881 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1882 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1883 }
1884 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1885 {
1886 if (!file.isEmpty()) m_t << stripPath(file);
1887 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1888 if (!anchor.isEmpty()) m_t << anchor;
1889 m_t << "}";
1890 }
1891 m_t << "{";
1892 }
1893 else if (ref.isEmpty() && refToSection)
1894 {
1895 m_t << "\\doxysectref{";
1896 }
1897 else if (ref.isEmpty() && refToTable)
1898 {
1899 m_t << "\\doxytableref{";
1900 }
1901 else if (ref.isEmpty()) // internal non-PDF link
1902 {
1903 m_t << "\\doxyref{";
1904 }
1905 else // external link
1906 {
1907 m_t << "\\textbf{ ";
1908 }
1909}
1910
1911void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1912{
1913 m_t << "}";
1914 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1915 if (ref.isEmpty() && !pdfHyperLinks)
1916 {
1917 m_t << "{";
1918 filter(theTranslator->trPageAbbreviation());
1919 m_t << "}{" << file;
1920 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1921 m_t << anchor << "}";
1922 if (refToSection)
1923 {
1924 m_t << "{" << sectionType.level() << "}";
1925 }
1926 }
1927 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1928 {
1929 if (refToSection)
1930 {
1931 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1932 }
1933 }
1934}
1935
1937 const QCString &width,
1938 const QCString &height,
1939 bool hasCaption,
1940 const QCString &srcFile,
1941 int srcLine
1942 )
1943{
1944 QCString baseName=makeBaseName(fileName);
1945 baseName.prepend("dot_");
1946 QCString outDir = Config_getString(LATEX_OUTPUT);
1947 QCString name = fileName;
1948 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1949 visitPreStart(m_t,hasCaption, baseName, width, height);
1950}
1951
1952void LatexDocVisitor::endDotFile(bool hasCaption)
1953{
1954 if (m_hide) return;
1955 visitPostEnd(m_t,hasCaption);
1956}
1957
1959 const QCString &width,
1960 const QCString &height,
1961 bool hasCaption,
1962 const QCString &srcFile,
1963 int srcLine
1964 )
1965{
1966 QCString baseName=makeBaseName(fileName);
1967 baseName.prepend("msc_");
1968
1969 QCString outDir = Config_getString(LATEX_OUTPUT);
1970 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1971 visitPreStart(m_t,hasCaption, baseName, width, height);
1972}
1973
1974void LatexDocVisitor::endMscFile(bool hasCaption)
1975{
1976 if (m_hide) return;
1977 visitPostEnd(m_t,hasCaption);
1978}
1979
1980
1982{
1983 QCString shortName = makeShortName(baseName);
1984 QCString outDir = Config_getString(LATEX_OUTPUT);
1985 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
1986 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1989}
1990
1991
1993 const QCString &width,
1994 const QCString &height,
1995 bool hasCaption,
1996 const QCString &srcFile,
1997 int srcLine
1998 )
1999{
2000 QCString baseName=makeBaseName(fileName);
2001 baseName.prepend("dia_");
2002
2003 QCString outDir = Config_getString(LATEX_OUTPUT);
2004 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2005 visitPreStart(m_t,hasCaption, baseName, width, height);
2006}
2007
2008void LatexDocVisitor::endDiaFile(bool hasCaption)
2009{
2010 if (m_hide) return;
2011 visitPostEnd(m_t,hasCaption);
2012}
2013
2015{
2016 QCString shortName = makeShortName(baseName);
2017 if (s.useBitmap())
2018 {
2019 if (shortName.find('.')==-1) shortName += ".png";
2020 }
2021 QCString outDir = Config_getString(LATEX_OUTPUT);
2024 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2027}
2028
2030 const QCString &width,
2031 const QCString &height,
2032 bool hasCaption,
2033 const QCString &srcFile,
2034 int srcLine
2035 )
2036{
2037 QCString outDir = Config_getString(LATEX_OUTPUT);
2038 std::string inBuf;
2039 readInputFile(fileName,inBuf);
2040
2041 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2042 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2043 outDir,QCString(),inBuf,
2045 QCString(),srcFile,srcLine,false);
2046 bool first = true;
2047 for (const auto &bName: baseNameVector)
2048 {
2049 QCString baseName = makeBaseName(bName);
2050 QCString shortName = makeShortName(baseName);
2051 if (useBitmap)
2052 {
2053 if (shortName.find('.')==-1) shortName += ".png";
2054 }
2057 if (!first) endPlantUmlFile(hasCaption);
2058 first = false;
2059 visitPreStart(m_t,hasCaption, shortName, width, height);
2060 }
2061}
2062
2064{
2065 if (m_hide) return;
2066 visitPostEnd(m_t,hasCaption);
2067}
2068
2070{
2071 return std::min(m_indentLevel,maxIndentLevels-1);
2072}
2073
2075{
2076 m_indentLevel++;
2078 {
2079 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2080 }
2081}
2082
2084{
2085 if (m_indentLevel>0)
2086 {
2087 m_indentLevel--;
2088 }
2089}
2090
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.
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
Node representing an anchor.
Definition docnode.h:229
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
QCString getText() const
Definition docnode.cpp:959
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString file() const
Definition docnode.h:248
Node representing a dia file.
Definition docnode.h:731
QCString height() const
Definition docnode.h:689
QCString srcFile() const
Definition docnode.h:691
QCString file() const
Definition docnode.h:685
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
QCString width() const
Definition docnode.h:688
Node representing a dot file.
Definition docnode.h:713
Node representing an emoji.
Definition docnode.h:341
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
Node representing an item of a cross-referenced list.
Definition docnode.h:529
QCString text() const
Definition docnode.h:533
Node representing a Hypertext reference.
Definition docnode.h:823
QCString url() const
Definition docnode.h:830
Node representing a horizontal ruler.
Definition docnode.h:216
Node representing an HTML blockquote.
Definition docnode.h:1291
Node representing a HTML table caption.
Definition docnode.h:1228
QCString anchor() const
Definition docnode.h:1235
QCString file() const
Definition docnode.h:1234
Node representing a HTML table cell.
Definition docnode.h:1193
Valignment valignment() const
Definition docnode.cpp:1919
uint32_t rowSpan() const
Definition docnode.cpp:1857
Alignment alignment() const
Definition docnode.cpp:1881
bool isLast() const
Definition docnode.h:1202
bool isHeading() const
Definition docnode.h:1200
uint32_t colSpan() const
Definition docnode.cpp:1869
Node representing a HTML description data.
Definition docnode.h:1181
Node representing a Html description list.
Definition docnode.h:901
const HtmlAttribList & attribs() const
Definition docnode.h:905
Node representing a Html description item.
Definition docnode.h:888
Node Html details.
Definition docnode.h:857
const DocNodeVariant * summary() const
Definition docnode.h:864
Node Html heading.
Definition docnode.h:873
int level() const
Definition docnode.h:877
Node representing a Html list.
Definition docnode.h:1000
const HtmlAttribList & attribs() const
Definition docnode.h:1006
Type type() const
Definition docnode.h:1005
Node representing a HTML list item.
Definition docnode.h:1165
const HtmlAttribList & attribs() const
Definition docnode.h:1170
Node representing a HTML table row.
Definition docnode.h:1246
Node Html summary.
Definition docnode.h:844
Node representing a HTML table.
Definition docnode.h:1269
size_t numberHeaderRows() const
Definition docnode.cpp:2194
size_t numColumns() const
Definition docnode.h:1278
const DocNodeVariant * caption() const
Definition docnode.cpp:2189
Node representing an image.
Definition docnode.h:642
QCString name() const
Definition docnode.h:648
QCString height() const
Definition docnode.h:651
Type type() const
Definition docnode.h:647
QCString width() const
Definition docnode.h:650
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
Node representing a include/dontinclude operator block.
Definition docnode.h:477
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
QCString includeFileName() const
Definition docnode.h:509
QCString text() const
Definition docnode.h:499
QCString context() const
Definition docnode.h:501
QCString exampleFile() const
Definition docnode.h:508
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
Node representing an included text block from file.
Definition docnode.h:435
QCString blockId() const
Definition docnode.h:454
QCString extension() const
Definition docnode.h:450
bool stripCodeComments() const
Definition docnode.h:455
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
Type type() const
Definition docnode.h:451
QCString exampleFile() const
Definition docnode.h:457
QCString text() const
Definition docnode.h:452
QCString file() const
Definition docnode.h:449
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
QCString context() const
Definition docnode.h:453
Node representing an entry in the index.
Definition docnode.h:552
QCString entry() const
Definition docnode.h:559
Node representing an internal section of documentation.
Definition docnode.h:969
Node representing an internal reference to some item.
Definition docnode.h:807
QCString file() const
Definition docnode.h:811
QCString anchor() const
Definition docnode.h:813
Node representing a line break.
Definition docnode.h:202
Node representing a word that can be linked to something.
Definition docnode.h:165
QCString file() const
Definition docnode.h:171
QCString ref() const
Definition docnode.h:173
QCString word() const
Definition docnode.h:170
QCString anchor() const
Definition docnode.h:174
Node representing a msc file.
Definition docnode.h:722
DocNodeVariant * parent()
Definition docnode.h:90
Node representing an block of paragraphs.
Definition docnode.h:979
Node representing a paragraph in the documentation tree.
Definition docnode.h:1080
bool isLast() const
Definition docnode.h:1088
Node representing a parameter list.
Definition docnode.h:1125
const DocNodeList & parameters() const
Definition docnode.h:1129
const DocNodeList & paramTypes() const
Definition docnode.h:1130
DocParamSect::Direction direction() const
Definition docnode.h:1133
const DocNodeList & paragraphs() const
Definition docnode.h:1131
Node representing a parameter section.
Definition docnode.h:1053
bool hasInOutSpecifier() const
Definition docnode.h:1069
bool hasTypeSpecifier() const
Definition docnode.h:1070
Type type() const
Definition docnode.h:1068
Node representing a uml file.
Definition docnode.h:740
Node representing a reference to some item.
Definition docnode.h:778
QCString anchor() const
Definition docnode.h:785
SectionType sectionType() const
Definition docnode.h:787
QCString targetTitle() const
Definition docnode.h:786
bool isSubPage() const
Definition docnode.h:792
bool refToTable() const
Definition docnode.h:791
QCString file() const
Definition docnode.h:782
QCString ref() const
Definition docnode.h:784
bool refToSection() const
Definition docnode.h:790
bool hasLinkText() const
Definition docnode.h:788
Root node of documentation tree.
Definition docnode.h:1313
Node representing a reference to a section.
Definition docnode.h:935
bool refToTable() const
Definition docnode.h:943
QCString file() const
Definition docnode.h:939
QCString anchor() const
Definition docnode.h:940
QCString ref() const
Definition docnode.h:942
bool isSubPage() const
Definition docnode.h:944
Node representing a list of section references.
Definition docnode.h:959
Node representing a normal section.
Definition docnode.h:914
QCString file() const
Definition docnode.h:922
int level() const
Definition docnode.h:918
QCString anchor() const
Definition docnode.h:920
const DocNodeVariant * title() const
Definition docnode.h:919
Node representing a separator.
Definition docnode.h:365
QCString chars() const
Definition docnode.h:369
Node representing a simple list.
Definition docnode.h:990
Node representing a simple list item.
Definition docnode.h:1153
const DocNodeVariant * paragraph() const
Definition docnode.h:1157
Node representing a simple section.
Definition docnode.h:1017
Type type() const
Definition docnode.h:1026
const DocNodeVariant * title() const
Definition docnode.h:1033
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1044
Node representing a style change.
Definition docnode.h:268
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309
Node representing a special symbol.
Definition docnode.h:328
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
Root node of a text fragment.
Definition docnode.h:1304
Node representing a simple section title.
Definition docnode.h:608
Node representing a URL (or email address).
Definition docnode.h:188
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:376
QCString srcFile() const
Definition docnode.h:397
int srcLine() const
Definition docnode.h:398
QCString height() const
Definition docnode.h:392
bool hasCaption() const
Definition docnode.h:390
QCString language() const
Definition docnode.h:388
const DocNodeList & children() const
Definition docnode.h:395
bool isExample() const
Definition docnode.h:385
QCString context() const
Definition docnode.h:384
Type type() const
Definition docnode.h:382
QCString text() const
Definition docnode.h:383
QCString exampleFile() const
Definition docnode.h:386
QCString engine() const
Definition docnode.h:393
bool useBitmap() const
Definition docnode.h:394
@ JavaDocLiteral
Definition docnode.h:378
QCString width() const
Definition docnode.h:391
Node representing a VHDL flow chart.
Definition docnode.h:749
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:354
QCString chars() const
Definition docnode.h:358
Node representing a word.
Definition docnode.h:153
QCString word() const
Definition docnode.h:156
Node representing an item of a cross-referenced list.
Definition docnode.h:621
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2026
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
std::string fileName() const
Definition fileinfo.cpp:118
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:137
Class representing a list of HTML attributes.
Definition htmlattrib.h:33
const char * latex(SymType symb) const
Access routine to the LaTeX code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
Generator for LaTeX code fragments.
Definition latexgen.h:28
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
static const int maxIndentLevels
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void endDotFile(bool hasCaption)
void operator()(const DocWord &)
void visitCaption(const DocNodeList &children)
void addRowSpan(ActiveRowSpan &&span)
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
OutputCodeList & m_ci
LatexDocVisitor(TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)
size_t currentColumn() const
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void filter(const QCString &str, const bool retainNewLine=false)
void endMscFile(bool hasCaption)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
bool isTableNested(const DocNodeVariant *n) const
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
LatexListItemInfo m_listItemInfo[maxIndentLevels]
bool insideTable() const
void endDiaFile(bool hasCaption)
const char * getSectionName(int level) const
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
void endPlantUmlFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void visitChildren(const T &t)
LatexCodeGenerator & m_lcg
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
Class representing a list of different code generators.
Definition outputlist.h:165
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:31
static PlantumlManager & instance()
Definition plantuml.cpp:231
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:422
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:254
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
bool endsWith(const char *s) const
Definition qcstring.h:524
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
@ ExplicitSize
Definition qcstring.h:146
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
QCString left(size_t len) const
Definition qcstring.h:229
constexpr int level() const
Definition section.h:45
Text streaming class that buffers data.
Definition textstream.h:36
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:151
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
static QCString makeBaseName(const QCString &name)
static QCString makeShortName(const QCString &baseName)
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 bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1366
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1330
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
Translator * theTranslator
Definition language.cpp:71
static const char * g_subparagraphLabel
static const int g_maxLevels
static QCString makeBaseName(const QCString &name)
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 QCString makeShortName(const QCString &name)
static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
@ TEX
called through texorpdf as TeX (first) part
@ PDF
called through texorpdf as PDF (second) part
@ NO
not called through texorpdf
QCString latexFilterURL(const QCString &s)
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)
QCString latexEscapeIndexChars(const QCString &s)
QCString latexEscapeLabelName(const QCString &s)
#define err(fmt,...)
Definition message.h:127
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:649
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.
const char * qPrint(const char *s)
Definition qcstring.h:687
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
Options to configure the code parser.
Definition parserintf.h:78
CodeParserOptions & setStartLine(int lineNr)
Definition parserintf.h:101
CodeParserOptions & 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
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5147
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6648
QCString stripPath(const QCString &s)
Definition util.cpp:4890
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:5486
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5165
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:5809
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5189
A bunch of utility functions.