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 " \\mbox{";
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 mbox 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{
242 QCString result;
243 const char *p=s;
244 char str[2]; str[1]=0;
245 char c = 0;
246 if (p)
247 {
248 while ((c=*p++))
249 {
250 switch (c)
251 {
252 case '!': m_t << "\"!"; break;
253 case '"': m_t << "\"\""; break;
254 case '@': m_t << "\"@"; break;
255 case '|': m_t << "\\texttt{\"|}"; break;
256 case '[': m_t << "["; break;
257 case ']': m_t << "]"; break;
258 case '{': m_t << "\\lcurly{}"; break;
259 case '}': m_t << "\\rcurly{}"; break;
260 default: str[0]=c; filter(str); break;
261 }
262 }
263 }
264 return result;
265}
266
267
269 const QCString &langExt, int hierarchyLevel)
270 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
272 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
273{
274}
275
276 //--------------------------------------
277 // visitor functions for leaf nodes
278 //--------------------------------------
279
281{
282 if (m_hide) return;
283 filter(w.word());
284}
285
287{
288 if (m_hide) return;
289 startLink(w.ref(),w.file(),w.anchor());
290 filter(w.word());
291 endLink(w.ref(),w.file(),w.anchor());
292}
293
295{
296 if (m_hide) return;
297 if (m_insidePre)
298 {
299 m_t << w.chars();
300 }
301 else
302 {
303 m_t << " ";
304 }
305}
306
308{
309 if (m_hide) return;
310 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
311 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
312 if (res)
313 {
315 {
316 if (pdfHyperlinks)
317 {
318 m_t << "\\texorpdfstring{$<$}{<}";
319 }
320 else
321 {
322 m_t << "$<$";
323 }
324 }
326 {
327 if (pdfHyperlinks)
328 {
329 m_t << "\\texorpdfstring{$>$}{>}";
330 }
331 else
332 {
333 m_t << "$>$";
334 }
335 }
336 else
337 {
338 m_t << res;
339 }
340 }
341 else
342 {
343 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
344 }
345}
346
348{
349 if (m_hide) return;
351 if (!emojiName.isEmpty())
352 {
353 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
354 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
355 filter(emojiName);
356 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
357 }
358 else
359 {
360 m_t << s.name();
361 }
362}
363
365{
366 if (m_hide) return;
367 if (Config_getBool(PDF_HYPERLINKS))
368 {
369 m_t << "\\href{";
370 if (u.isEmail()) m_t << "mailto:";
371 m_t << latexFilterURL(u.url()) << "}";
372 }
373 m_t << "{\\texttt{";
374 filter(u.url());
375 m_t << "}}";
376}
377
379{
380 if (m_hide) return;
381 m_t << "~\\newline\n";
382}
383
385{
386 if (m_hide) return;
387 if (insideTable())
388 m_t << "\\DoxyHorRuler{1}\n";
389 else
390 m_t << "\\DoxyHorRuler{0}\n";
391}
392
394{
395 if (m_hide) return;
396 switch (s.style())
397 {
399 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
400 break;
404 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
405 break;
408 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
409 break;
411 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
412 break;
416 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
417 break;
419 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
420 break;
422 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
423 break;
425 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
426 break;
428 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
429 break;
431 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
432 break;
434 if (s.enable())
435 {
436 m_t << "\n\\begin{DoxyPre}";
438 }
439 else
440 {
442 m_t << "\\end{DoxyPre}\n";
443 }
444 break;
445 case DocStyleChange::Div: /* HTML only */ break;
446 case DocStyleChange::Span: /* HTML only */ break;
447 }
448}
449
451{
452 if (m_hide) return;
453 QCString lang = m_langExt;
454 if (!s.language().isEmpty()) // explicit language setting
455 {
456 lang = s.language();
457 }
458 SrcLangExt langExt = getLanguageFromCodeLang(lang);
459 switch(s.type())
460 {
462 {
463 m_ci.startCodeFragment("DoxyCode");
464 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
465 Config_getBool(STRIP_CODE_COMMENTS),
466 s.isExample(),s.exampleFile());
467 m_ci.endCodeFragment("DoxyCode");
468 }
469 break;
471 filter(s.text(), true);
472 break;
474 m_t << "{\\ttfamily ";
475 filter(s.text(), true);
476 m_t << "}";
477 break;
479 if (isTableNested(s.parent())) // in table
480 {
481 m_t << "\\begin{DoxyCode}{0}";
482 filter(s.text(), true);
483 m_t << "\\end{DoxyCode}\n";
484 }
485 else
486 {
487 m_t << "\\begin{DoxyVerb}";
488 m_t << s.text();
489 m_t << "\\end{DoxyVerb}\n";
490 }
491 break;
497 /* nothing */
498 break;
500 m_t << s.text();
501 break;
502 case DocVerbatim::Dot:
503 {
504 static int dotindex = 1;
505 QCString fileName(4096, QCString::ExplicitSize);
506
507 fileName.sprintf("%s%d%s",
508 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
509 dotindex++,
510 ".dot"
511 );
512 std::ofstream file = Portable::openOutputStream(fileName);
513 if (!file.is_open())
514 {
515 err("Could not open file {} for writing\n",fileName);
516 }
517 else
518 {
519 file.write( s.text().data(), s.text().length() );
520 file.close();
521
522 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
523 visitChildren(s);
525
526 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
527 }
528 }
529 break;
530 case DocVerbatim::Msc:
531 {
532 static int mscindex = 1;
533 QCString baseName(4096, QCString::ExplicitSize);
534
535 baseName.sprintf("%s%d",
536 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
537 mscindex++
538 );
539 QCString fileName = baseName+".msc";
540 std::ofstream file = Portable::openOutputStream(fileName);
541 if (!file.is_open())
542 {
543 err("Could not open file {} for writing\n",fileName);
544 }
545 else
546 {
547 QCString text = "msc {";
548 text+=s.text();
549 text+="}";
550 file.write( text.data(), text.length() );
551 file.close();
552
553 writeMscFile(baseName, s);
554
555 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
556 }
557 }
558 break;
560 {
561 QCString latexOutput = Config_getString(LATEX_OUTPUT);
562 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
563 latexOutput,s.exampleFile(),s.text(),
565 s.engine(),s.srcFile(),s.srcLine(),true);
566
567 for (const auto &baseName: baseNameVector)
568 {
569 writePlantUMLFile(baseName, s);
570 }
571 }
572 break;
573 }
574}
575
577{
578 if (m_hide) return;
579 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
580 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
581 {
582 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
583 << "}%\n";
584 }
585}
586
588{
589 if (m_hide) return;
591 switch(inc.type())
592 {
594 {
595 m_ci.startCodeFragment("DoxyCodeInclude");
596 FileInfo cfi( inc.file().str() );
597 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
599 inc.text(),
600 langExt,
601 inc.stripCodeComments(),
602 inc.isExample(),
603 inc.exampleFile(),
604 fd.get(), // fileDef,
605 -1, // start line
606 -1, // end line
607 FALSE, // inline fragment
608 nullptr, // memberDef
609 TRUE // show line numbers
610 );
611 m_ci.endCodeFragment("DoxyCodeInclude");
612 }
613 break;
615 {
616 m_ci.startCodeFragment("DoxyCodeInclude");
618 inc.text(),langExt,
619 inc.stripCodeComments(),
620 inc.isExample(),
621 inc.exampleFile(),
622 nullptr, // fileDef
623 -1, // startLine
624 -1, // endLine
625 TRUE, // inlineFragment
626 nullptr, // memberDef
627 FALSE
628 );
629 m_ci.endCodeFragment("DoxyCodeInclude");
630 }
631 break;
639 break;
641 m_t << inc.text();
642 break;
644 if (isTableNested(inc.parent())) // in table
645 {
646 m_t << "\\begin{DoxyCode}{0}";
647 filter(inc.text(), true);
648 m_t << "\\end{DoxyCode}\n";
649 }
650 else
651 {
652 m_t << "\n\\begin{DoxyVerbInclude}\n";
653 m_t << inc.text();
654 m_t << "\\end{DoxyVerbInclude}\n";
655 }
656 break;
659 {
660 m_ci.startCodeFragment("DoxyCodeInclude");
662 inc.file(),
663 inc.blockId(),
664 inc.context(),
666 inc.trimLeft(),
668 );
669 m_ci.endCodeFragment("DoxyCodeInclude");
670 }
671 break;
672 }
673}
674
676{
677 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
678 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
679 if (op.isFirst())
680 {
681 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
683 m_hide = TRUE;
684 }
686 if (locLangExt.isEmpty()) locLangExt = m_langExt;
687 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
688 if (op.type()!=DocIncOperator::Skip)
689 {
690 m_hide = popHidden();
691 if (!m_hide)
692 {
693 std::unique_ptr<FileDef> fd;
694 if (!op.includeFileName().isEmpty())
695 {
696 FileInfo cfi( op.includeFileName().str() );
697 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
698 }
699
700 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
702 op.isExample(),op.exampleFile(),
703 fd.get(), // fileDef
704 op.line(), // startLine
705 -1, // endLine
706 FALSE, // inline fragment
707 nullptr, // memberDef
708 op.showLineNo() // show line numbers
709 );
710 }
712 m_hide=TRUE;
713 }
714 if (op.isLast())
715 {
717 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
718 }
719 else
720 {
721 if (!m_hide) m_t << "\n";
722 }
723}
724
726{
727 if (m_hide) return;
728 QCString s = f.text();
729 const char *p = s.data();
730 char c = 0;
731 if (p)
732 {
733 while ((c=*p++))
734 {
735 switch (c)
736 {
737 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
738 default: m_t << c; break;
739 }
740 }
741 }
742}
743
745{
746 if (m_hide) return;
747 m_t << "\\index{";
749 m_t << "@{";
751 m_t << "}}";
752}
753
757
759{
760 if (m_hide) return;
761 auto opt = cite.option();
762 QCString txt;
763 if (opt.noCite())
764 {
765 if (!cite.file().isEmpty())
766 {
767 txt = cite.getText();
768 }
769 else
770 {
771 if (!opt.noPar()) txt += "[";
772 txt += cite.target();
773 if (!opt.noPar()) txt += "]";
774 }
775 m_t << "{\\bfseries ";
776 filter(txt);
777 m_t << "}";
778 }
779 else
780 {
781 if (!cite.file().isEmpty())
782 {
783 QCString anchor = cite.anchor();
785 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
786
787 txt = "\\DoxyCite{" + anchor + "}";
788 if (opt.isNumber())
789 {
790 txt += "{number}";
791 }
792 else if (opt.isShortAuthor())
793 {
794 txt += "{shortauthor}";
795 }
796 else if (opt.isYear())
797 {
798 txt += "{year}";
799 }
800 if (!opt.noPar()) txt += "{1}";
801 else txt += "{0}";
802
803 m_t << txt;
804 }
805 else
806 {
807 if (!opt.noPar()) txt += "[";
808 txt += cite.target();
809 if (!opt.noPar()) txt += "]";
810 m_t << "{\\bfseries ";
811 filter(txt);
812 m_t << "}";
813 }
814 }
815}
816
817//--------------------------------------
818// visitor functions for compound nodes
819//--------------------------------------
820
822{
823 if (m_hide) return;
824 if (m_indentLevel>=maxIndentLevels-1) return;
825 if (l.isEnumList())
826 {
827 m_t << "\n\\begin{DoxyEnumerate}";
828 m_listItemInfo[indentLevel()].isEnum = true;
829 }
830 else
831 {
832 m_listItemInfo[indentLevel()].isEnum = false;
833 m_t << "\n\\begin{DoxyItemize}";
834 }
835 visitChildren(l);
836 if (l.isEnumList())
837 {
838 m_t << "\n\\end{DoxyEnumerate}";
839 }
840 else
841 {
842 m_t << "\n\\end{DoxyItemize}";
843 }
844}
845
847{
848 if (m_hide) return;
849 switch (li.itemNumber())
850 {
851 case DocAutoList::Unchecked: // unchecked
852 m_t << "\n\\item[\\DoxyUnchecked] ";
853 break;
854 case DocAutoList::Checked_x: // checked with x
855 case DocAutoList::Checked_X: // checked with X
856 m_t << "\n\\item[\\DoxyChecked] ";
857 break;
858 default:
859 m_t << "\n\\item ";
860 break;
861 }
863 visitChildren(li);
865}
866
868{
869 if (m_hide) return;
870 visitChildren(p);
871 if (!p.isLast() && // omit <p> for last paragraph
872 !(p.parent() && // and for parameter sections
873 std::get_if<DocParamSect>(p.parent())
874 )
875 )
876 {
877 if (insideTable())
878 {
879 m_t << "~\\newline\n";
880 }
881 else
882 {
883 m_t << "\n\n";
884 }
885 }
886}
887
889{
890 visitChildren(r);
891}
892
894{
895 if (m_hide) return;
896 switch(s.type())
897 {
899 m_t << "\\begin{DoxySeeAlso}{";
900 filter(theTranslator->trSeeAlso());
901 break;
903 m_t << "\\begin{DoxyReturn}{";
904 filter(theTranslator->trReturns());
905 break;
907 m_t << "\\begin{DoxyAuthor}{";
908 filter(theTranslator->trAuthor(TRUE,TRUE));
909 break;
911 m_t << "\\begin{DoxyAuthor}{";
912 filter(theTranslator->trAuthor(TRUE,FALSE));
913 break;
915 m_t << "\\begin{DoxyVersion}{";
916 filter(theTranslator->trVersion());
917 break;
919 m_t << "\\begin{DoxySince}{";
920 filter(theTranslator->trSince());
921 break;
923 m_t << "\\begin{DoxyDate}{";
924 filter(theTranslator->trDate());
925 break;
927 m_t << "\\begin{DoxyNote}{";
928 filter(theTranslator->trNote());
929 break;
931 m_t << "\\begin{DoxyWarning}{";
932 filter(theTranslator->trWarning());
933 break;
935 m_t << "\\begin{DoxyPrecond}{";
936 filter(theTranslator->trPrecondition());
937 break;
939 m_t << "\\begin{DoxyPostcond}{";
940 filter(theTranslator->trPostcondition());
941 break;
943 m_t << "\\begin{DoxyCopyright}{";
944 filter(theTranslator->trCopyright());
945 break;
947 m_t << "\\begin{DoxyInvariant}{";
948 filter(theTranslator->trInvariant());
949 break;
951 m_t << "\\begin{DoxyRemark}{";
952 filter(theTranslator->trRemarks());
953 break;
955 m_t << "\\begin{DoxyAttention}{";
956 filter(theTranslator->trAttention());
957 break;
959 m_t << "\\begin{DoxyImportant}{";
960 filter(theTranslator->trImportant());
961 break;
963 m_t << "\\begin{DoxyParagraph}{";
964 break;
966 m_t << "\\begin{DoxyParagraph}{";
967 break;
968 case DocSimpleSect::Unknown: break;
969 }
970
971 if (s.title())
972 {
974 std::visit(*this,*s.title());
976 }
977 m_t << "}\n";
979 visitChildren(s);
980 switch(s.type())
981 {
983 m_t << "\n\\end{DoxySeeAlso}\n";
984 break;
986 m_t << "\n\\end{DoxyReturn}\n";
987 break;
989 m_t << "\n\\end{DoxyAuthor}\n";
990 break;
992 m_t << "\n\\end{DoxyAuthor}\n";
993 break;
995 m_t << "\n\\end{DoxyVersion}\n";
996 break;
998 m_t << "\n\\end{DoxySince}\n";
999 break;
1001 m_t << "\n\\end{DoxyDate}\n";
1002 break;
1004 m_t << "\n\\end{DoxyNote}\n";
1005 break;
1007 m_t << "\n\\end{DoxyWarning}\n";
1008 break;
1009 case DocSimpleSect::Pre:
1010 m_t << "\n\\end{DoxyPrecond}\n";
1011 break;
1013 m_t << "\n\\end{DoxyPostcond}\n";
1014 break;
1016 m_t << "\n\\end{DoxyCopyright}\n";
1017 break;
1019 m_t << "\n\\end{DoxyInvariant}\n";
1020 break;
1022 m_t << "\n\\end{DoxyRemark}\n";
1023 break;
1025 m_t << "\n\\end{DoxyAttention}\n";
1026 break;
1028 m_t << "\n\\end{DoxyImportant}\n";
1029 break;
1031 m_t << "\n\\end{DoxyParagraph}\n";
1032 break;
1033 case DocSimpleSect::Rcs:
1034 m_t << "\n\\end{DoxyParagraph}\n";
1035 break;
1036 default:
1037 break;
1038 }
1040}
1041
1043{
1044 if (m_hide) return;
1045 visitChildren(t);
1046}
1047
1049{
1050 if (m_hide) return;
1051 m_t << "\\begin{DoxyItemize}\n";
1052 m_listItemInfo[indentLevel()].isEnum = false;
1053 visitChildren(l);
1054 m_t << "\\end{DoxyItemize}\n";
1055}
1056
1058{
1059 if (m_hide) return;
1060 m_t << "\\item ";
1062 if (li.paragraph())
1063 {
1064 visit(*this,*li.paragraph());
1065 }
1067}
1068
1070{
1071 if (m_hide) return;
1072 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1073 if (pdfHyperlinks)
1074 {
1075 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1076 }
1077 m_t << "\\" << getSectionName(s.level()) << "{";
1078 if (pdfHyperlinks)
1079 {
1080 m_t << "\\texorpdfstring{";
1081 }
1082 if (s.title())
1083 {
1084 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1085 std::visit(*this,*s.title());
1087 }
1088 if (pdfHyperlinks)
1089 {
1090 m_t << "}{";
1091 if (s.title())
1092 {
1093 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1094 std::visit(*this,*s.title());
1096 }
1097 m_t << "}";
1098 }
1099 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1100 visitChildren(s);
1101}
1102
1104{
1105 if (m_hide) return;
1106 if (m_indentLevel>=maxIndentLevels-1) return;
1108 if (s.type()==DocHtmlList::Ordered)
1109 {
1110 bool first = true;
1111 m_t << "\n\\begin{DoxyEnumerate}";
1112 for (const auto &opt : s.attribs())
1113 {
1114 if (opt.name=="type")
1115 {
1116 if (opt.value=="1")
1117 {
1118 m_t << (first ? "[": ",");
1119 m_t << "label=\\arabic*";
1120 first = false;
1121 }
1122 else if (opt.value=="a")
1123 {
1124 m_t << (first ? "[": ",");
1125 m_t << "label=\\enumalphalphcnt*";
1126 first = false;
1127 }
1128 else if (opt.value=="A")
1129 {
1130 m_t << (first ? "[": ",");
1131 m_t << "label=\\enumAlphAlphcnt*";
1132 first = false;
1133 }
1134 else if (opt.value=="i")
1135 {
1136 m_t << (first ? "[": ",");
1137 m_t << "label=\\roman*";
1138 first = false;
1139 }
1140 else if (opt.value=="I")
1141 {
1142 m_t << (first ? "[": ",");
1143 m_t << "label=\\Roman*";
1144 first = false;
1145 }
1146 }
1147 else if (opt.name=="start")
1148 {
1149 m_t << (first ? "[": ",");
1150 bool ok = false;
1151 int val = opt.value.toInt(&ok);
1152 if (ok) m_t << "start=" << val;
1153 first = false;
1154 }
1155 }
1156 if (!first) m_t << "]\n";
1157 }
1158 else
1159 {
1160 m_t << "\n\\begin{DoxyItemize}";
1161 }
1162 visitChildren(s);
1163 if (m_indentLevel>=maxIndentLevels-1) return;
1164 if (s.type()==DocHtmlList::Ordered)
1165 m_t << "\n\\end{DoxyEnumerate}";
1166 else
1167 m_t << "\n\\end{DoxyItemize}";
1168}
1169
1171{
1172 if (m_hide) return;
1173 if (m_listItemInfo[indentLevel()].isEnum)
1174 {
1175 for (const auto &opt : l.attribs())
1176 {
1177 if (opt.name=="value")
1178 {
1179 bool ok = false;
1180 int val = opt.value.toInt(&ok);
1181 if (ok)
1182 {
1183 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1184 }
1185 }
1186 }
1187 }
1188 m_t << "\n\\item ";
1190 visitChildren(l);
1192}
1193
1194
1196{
1197 HtmlAttribList attrs = dl.attribs();
1198 auto it = std::find_if(attrs.begin(),attrs.end(),
1199 [](const auto &att) { return att.name=="class"; });
1200 if (it!=attrs.end() && it->value == "reflist") return true;
1201 return false;
1202}
1203
1204static bool listIsNested(const DocHtmlDescList &dl)
1205{
1206 bool isNested=false;
1207 const DocNodeVariant *n = dl.parent();
1208 while (n && !isNested)
1209 {
1210 if (std::get_if<DocHtmlDescList>(n))
1211 {
1212 isNested = !classEqualsReflist(std::get<DocHtmlDescList>(*n));
1213 }
1214 n = ::parent(n);
1215 }
1216 return isNested;
1217}
1218
1220{
1221 if (m_hide) return;
1222 bool eq = classEqualsReflist(dl);
1223 if (eq)
1224 {
1225 m_t << "\n\\begin{DoxyRefList}";
1226 }
1227 else
1228 {
1229 if (listIsNested(dl)) m_t << "\n\\hfill";
1230 m_t << "\n\\begin{DoxyDescription}";
1231 }
1232 visitChildren(dl);
1233 if (eq)
1234 {
1235 m_t << "\n\\end{DoxyRefList}";
1236 }
1237 else
1238 {
1239 m_t << "\n\\end{DoxyDescription}";
1240 }
1241}
1242
1244{
1245 if (m_hide) return;
1246 m_t << "\n\\item[";
1248 visitChildren(dt);
1250 m_t << "]";
1251}
1252
1254{
1256 if (!m_insideItem) m_t << "\\hfill";
1257 m_t << " \\\\\n";
1258 visitChildren(dd);
1260}
1261
1263{
1264 bool isNested=m_lcg.usedTableLevel()>0;
1265 while (n && !isNested)
1266 {
1268 n = ::parent(n);
1269 }
1270 return isNested;
1271}
1272
1274{
1275 if (isTableNested(n))
1276 {
1277 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1278 }
1279 else
1280 {
1281 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1282 }
1283}
1284
1286{
1287 if (isTableNested(n))
1288 {
1289 m_t << "\\end{DoxyTableNested}\n";
1290 }
1291 else
1292 {
1293 m_t << "\\end{DoxyTable}\n";
1294 }
1295}
1296
1298{
1299 if (m_hide) return;
1301 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1302 if (c)
1303 {
1304 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1305 if (!c->file().isEmpty() && pdfHyperLinks)
1306 {
1307 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1308 << "}{}";
1309 }
1310 m_t << "\n";
1311 }
1312
1314 if (!isTableNested(t.parent()))
1315 {
1316 // write caption
1317 m_t << "{";
1318 if (c)
1319 {
1320 std::visit(*this, *t.caption());
1321 }
1322 m_t << "}";
1323 // write label
1324 m_t << "{";
1325 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1326 {
1327 m_t << stripPath(c->file()) << "_" << c->anchor();
1328 }
1329 m_t << "}";
1330 }
1331
1332 // write head row(s)
1333 m_t << "{" << t.numberHeaderRows() << "}\n";
1334
1336
1337 visitChildren(t);
1339 popTableState();
1340}
1341
1343{
1344 if (m_hide) return;
1345 visitChildren(c);
1346}
1347
1349{
1350 if (m_hide) return;
1352
1353 visitChildren(row);
1354
1355 m_t << "\\\\";
1356
1357 size_t col = 1;
1358 for (auto &span : rowSpans())
1359 {
1360 if (span.rowSpan>0) span.rowSpan--;
1361 if (span.rowSpan<=0)
1362 {
1363 // inactive span
1364 }
1365 else if (span.column>col)
1366 {
1367 col = span.column+span.colSpan;
1368 }
1369 else
1370 {
1371 col = span.column+span.colSpan;
1372 }
1373 }
1374
1375 m_t << "\n";
1376}
1377
1379{
1380 if (m_hide) return;
1381 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1382
1384
1385 QCString cellOpts;
1386 QCString cellSpec;
1387 auto appendOpt = [&cellOpts](const QCString &s)
1388 {
1389 if (!cellOpts.isEmpty()) cellOpts+=",";
1390 cellOpts+=s;
1391 };
1392 auto appendSpec = [&cellSpec](const QCString &s)
1393 {
1394 if (!cellSpec.isEmpty()) cellSpec+=",";
1395 cellSpec+=s;
1396 };
1397 auto writeCell = [this,&cellOpts,&cellSpec]()
1398 {
1399 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1400 {
1401 m_t << "\\SetCell";
1402 if (!cellOpts.isEmpty())
1403 {
1404 m_t << "[" << cellOpts << "]";
1405 }
1406 m_t << "{" << cellSpec << "}";
1407 }
1408 };
1409
1410 // skip over columns that have a row span starting at an earlier row
1411 for (const auto &span : rowSpans())
1412 {
1413 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1414 // span.cell.rowIndex(),span.cell.columnIndex(),
1415 // span.column,span.colSpan,span.rowSpan,
1416 // currentColumn());
1417 if (span.rowSpan>0 && span.column==currentColumn())
1418 {
1419 setCurrentColumn(currentColumn()+span.colSpan);
1420 for (size_t i=0;i<span.colSpan;i++)
1421 {
1422 m_t << "&";
1423 }
1424 }
1425 }
1426
1427 int cs = c.colSpan();
1428 int ha = c.alignment();
1429 int rs = c.rowSpan();
1430 int va = c.valignment();
1431
1432 switch (ha) // horizontal alignment
1433 {
1434 case DocHtmlCell::Right:
1435 appendSpec("r");
1436 break;
1438 appendSpec("c");
1439 break;
1440 default:
1441 // default
1442 break;
1443 }
1444 if (rs>0) // row span
1445 {
1446 appendOpt("r="+QCString().setNum(rs));
1447 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1448 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1449 // currentColumn());
1451 }
1452 if (cs>1) // column span
1453 {
1454 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1456 appendOpt("c="+QCString().setNum(cs));
1457 }
1458 if (c.isHeading())
1459 {
1460 appendSpec("bg=\\tableheadbgcolor");
1461 appendSpec("font=\\bfseries");
1462 }
1463 switch(va) // vertical alignment
1464 {
1465 case DocHtmlCell::Top:
1466 appendSpec("h");
1467 break;
1469 appendSpec("f");
1470 break;
1472 // default
1473 break;
1474 }
1475 writeCell();
1476
1477 visitChildren(c);
1478
1479 for (int i=0;i<cs-1;i++)
1480 {
1481 m_t << "&"; // placeholder for invisible cell
1482 }
1483
1484 if (!c.isLast()) m_t << "&";
1485}
1486
1488{
1489 if (m_hide) return;
1490 visitChildren(i);
1491}
1492
1494{
1495 if (m_hide) return;
1496 if (Config_getBool(PDF_HYPERLINKS))
1497 {
1498 m_t << "\\href{";
1499 m_t << latexFilterURL(href.url());
1500 m_t << "}";
1501 }
1502 m_t << "{\\texttt{";
1503 visitChildren(href);
1504 m_t << "}}";
1505}
1506
1508{
1509 if (m_hide) return;
1510 m_t << "{\\bfseries{";
1511 visitChildren(d);
1512 m_t << "}}";
1513}
1514
1516{
1517 if (m_hide) return;
1518 m_t << "\n\n";
1519 auto summary = d.summary();
1520 if (summary)
1521 {
1522 std::visit(*this,*summary);
1523 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1524 }
1525 visitChildren(d);
1526 if (summary)
1527 {
1528 m_t << "\\end{adjustwidth}\n";
1529 }
1530 else
1531 {
1532 m_t << "\n\n";
1533 }
1534}
1535
1537{
1538 if (m_hide) return;
1539 m_t << "\\" << getSectionName(header.level()) << "*{";
1540 visitChildren(header);
1541 m_t << "}";
1542}
1543
1545{
1546 if (img.type()==DocImage::Latex)
1547 {
1548 if (m_hide) return;
1549 QCString gfxName = img.name();
1550 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1551 {
1552 gfxName=gfxName.left(gfxName.length()-4);
1553 }
1554
1555 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1556 visitChildren(img);
1558 }
1559 else // other format -> skip
1560 {
1561 }
1562}
1563
1565{
1566 if (m_hide) return;
1567 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1568 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1569 visitChildren(df);
1570 endDotFile(df.hasCaption());
1571}
1572
1574{
1575 if (m_hide) return;
1576 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1577 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1578 visitChildren(df);
1579 endMscFile(df.hasCaption());
1580}
1581
1583{
1584 if (m_hide) return;
1585 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1586 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1587 visitChildren(df);
1588 endDiaFile(df.hasCaption());
1589}
1590
1592{
1593 if (m_hide) return;
1594 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1595 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1596 visitChildren(df);
1598}
1599
1601{
1602 if (m_hide) return;
1603 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1604 visitChildren(lnk);
1605 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1606}
1607
1609{
1610 if (m_hide) return;
1611 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1612 // ref.anchor() for LaTeX/RTF
1613 if (ref.isSubPage())
1614 {
1615 startLink(ref.ref(),QCString(),ref.anchor());
1616 }
1617 else
1618 {
1619 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1620 }
1621 if (!ref.hasLinkText())
1622 {
1623 filter(ref.targetTitle());
1624 }
1625 visitChildren(ref);
1626 if (ref.isSubPage())
1627 {
1628 endLink(ref.ref(),QCString(),ref.anchor());
1629 }
1630 else
1631 {
1632 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1633 }
1634}
1635
1637{
1638 if (m_hide) return;
1639 m_t << "\\item \\contentsline{section}{";
1640 if (ref.isSubPage())
1641 {
1642 startLink(ref.ref(),QCString(),ref.anchor());
1643 }
1644 else
1645 {
1646 if (!ref.file().isEmpty())
1647 {
1648 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1649 }
1650 }
1651 visitChildren(ref);
1652 if (ref.isSubPage())
1653 {
1654 endLink(ref.ref(),QCString(),ref.anchor());
1655 }
1656 else
1657 {
1658 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1659 }
1660 m_t << "}{\\ref{";
1661 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1662 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1663 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1664 m_t << "}}{}\n";
1665}
1666
1668{
1669 if (m_hide) return;
1670 m_t << "\\footnotesize\n";
1671 m_t << "\\begin{multicols}{2}\n";
1672 m_t << "\\begin{DoxyCompactList}\n";
1674 visitChildren(l);
1676 m_t << "\\end{DoxyCompactList}\n";
1677 m_t << "\\end{multicols}\n";
1678 m_t << "\\normalsize\n";
1679}
1680
1682{
1683 if (m_hide) return;
1684 bool hasInOutSpecs = s.hasInOutSpecifier();
1685 bool hasTypeSpecs = s.hasTypeSpecifier();
1686 m_lcg.incUsedTableLevel();
1687 switch(s.type())
1688 {
1690 m_t << "\n\\begin{DoxyParams}";
1691 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1692 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1693 m_t << "{";
1694 filter(theTranslator->trParameters());
1695 break;
1697 m_t << "\n\\begin{DoxyRetVals}{";
1698 filter(theTranslator->trReturnValues());
1699 break;
1701 m_t << "\n\\begin{DoxyExceptions}{";
1702 filter(theTranslator->trExceptions());
1703 break;
1705 m_t << "\n\\begin{DoxyTemplParams}{";
1706 filter(theTranslator->trTemplateParameters());
1707 break;
1708 default:
1709 ASSERT(0);
1711 }
1712 m_t << "}\n";
1713 visitChildren(s);
1714 m_lcg.decUsedTableLevel();
1715 switch(s.type())
1716 {
1718 m_t << "\\end{DoxyParams}\n";
1719 break;
1721 m_t << "\\end{DoxyRetVals}\n";
1722 break;
1724 m_t << "\\end{DoxyExceptions}\n";
1725 break;
1727 m_t << "\\end{DoxyTemplParams}\n";
1728 break;
1729 default:
1730 ASSERT(0);
1732 }
1733}
1734
1736{
1737 m_t << " " << sep.chars() << " ";
1738}
1739
1741{
1742 if (m_hide) return;
1744 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1745 if (sect)
1746 {
1747 parentType = sect->type();
1748 }
1749 bool useTable = parentType==DocParamSect::Param ||
1750 parentType==DocParamSect::RetVal ||
1751 parentType==DocParamSect::Exception ||
1752 parentType==DocParamSect::TemplateParam;
1753 if (!useTable)
1754 {
1755 m_t << "\\item[";
1756 }
1757 if (sect && sect->hasInOutSpecifier())
1758 {
1760 {
1761 m_t << "\\mbox{\\texttt{";
1762 if (pl.direction()==DocParamSect::In)
1763 {
1764 m_t << "in";
1765 }
1766 else if (pl.direction()==DocParamSect::Out)
1767 {
1768 m_t << "out";
1769 }
1770 else if (pl.direction()==DocParamSect::InOut)
1771 {
1772 m_t << "in,out";
1773 }
1774 m_t << "}} ";
1775 }
1776 if (useTable) m_t << " & ";
1777 }
1778 if (sect && sect->hasTypeSpecifier())
1779 {
1780 for (const auto &type : pl.paramTypes())
1781 {
1782 std::visit(*this,type);
1783 }
1784 if (useTable) m_t << " & ";
1785 }
1786 m_t << "{\\em ";
1787 bool first=TRUE;
1788 for (const auto &param : pl.parameters())
1789 {
1790 if (!first) m_t << ","; else first=FALSE;
1792 std::visit(*this,param);
1794 }
1795 m_t << "}";
1796 if (useTable)
1797 {
1798 m_t << " & ";
1799 }
1800 else
1801 {
1802 m_t << "]";
1803 }
1804 for (const auto &par : pl.paragraphs())
1805 {
1806 std::visit(*this,par);
1807 }
1808 if (useTable)
1809 {
1810 m_t << "\\\\\n"
1811 << "\\hline\n";
1812 }
1813}
1814
1816{
1817 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1818 if (m_hide) return;
1819 if (x.title().isEmpty()) return;
1821 m_t << "\\begin{DoxyRefDesc}{";
1822 filter(x.title());
1823 m_t << "}\n";
1824 bool anonymousEnum = x.file()=="@";
1825 m_t << "\\item[";
1826 if (pdfHyperlinks && !anonymousEnum)
1827 {
1828 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1829 }
1830 else
1831 {
1832 m_t << "\\textbf{ ";
1833 }
1835 filter(x.title());
1837 if (pdfHyperlinks && !anonymousEnum)
1838 {
1839 m_t << "}";
1840 }
1841 m_t << "}]";
1842 visitChildren(x);
1843 if (x.title().isEmpty()) return;
1845 m_t << "\\end{DoxyRefDesc}\n";
1846}
1847
1849{
1850 if (m_hide) return;
1851 startLink(QCString(),ref.file(),ref.anchor());
1852 visitChildren(ref);
1853 endLink(QCString(),ref.file(),ref.anchor());
1854}
1855
1857{
1858 if (m_hide) return;
1859 visitChildren(t);
1860}
1861
1863{
1864 if (m_hide) return;
1865 m_t << "\\begin{quote}\n";
1867 visitChildren(q);
1868 m_t << "\\end{quote}\n";
1870}
1871
1875
1877{
1878 if (m_hide) return;
1879 visitChildren(pb);
1880}
1881
1882void LatexDocVisitor::filter(const QCString &str, const bool retainNewLine)
1883{
1884 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1886 m_lcg.insideTabbing(),
1889 m_lcg.usedTableLevel()>0, // insideTable
1890 false, // keepSpaces
1891 retainNewLine
1892 );
1893}
1894
1895void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,
1896 bool refToTable,bool refToSection)
1897{
1898 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1899 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1900 {
1901 if (refToTable)
1902 {
1903 m_t << "\\doxytablelink{";
1904 }
1905 else if (refToSection)
1906 {
1907 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1908 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1909 }
1910 else
1911 {
1912 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1913 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1914 }
1915 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1916 {
1917 if (!file.isEmpty()) m_t << stripPath(file);
1918 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1919 if (!anchor.isEmpty()) m_t << anchor;
1920 m_t << "}";
1921 }
1922 m_t << "{";
1923 }
1924 else if (ref.isEmpty() && refToSection)
1925 {
1926 m_t << "\\doxysectref{";
1927 }
1928 else if (ref.isEmpty() && refToTable)
1929 {
1930 m_t << "\\doxytableref{";
1931 }
1932 else if (ref.isEmpty()) // internal non-PDF link
1933 {
1934 m_t << "\\doxyref{";
1935 }
1936 else // external link
1937 {
1938 m_t << "\\textbf{ ";
1939 }
1940}
1941
1942void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool /*refToTable*/,bool refToSection, SectionType sectionType)
1943{
1944 m_t << "}";
1945 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1946 if (ref.isEmpty() && !pdfHyperLinks)
1947 {
1948 m_t << "{";
1949 filter(theTranslator->trPageAbbreviation());
1950 m_t << "}{" << file;
1951 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1952 m_t << anchor << "}";
1953 if (refToSection)
1954 {
1955 m_t << "{" << sectionType.level() << "}";
1956 }
1957 }
1958 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1959 {
1960 if (refToSection)
1961 {
1962 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1963 }
1964 }
1965}
1966
1968 const QCString &width,
1969 const QCString &height,
1970 bool hasCaption,
1971 const QCString &srcFile,
1972 int srcLine
1973 )
1974{
1975 QCString baseName=makeBaseName(fileName);
1976 baseName.prepend("dot_");
1977 QCString outDir = Config_getString(LATEX_OUTPUT);
1978 QCString name = fileName;
1979 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1980 visitPreStart(m_t,hasCaption, baseName, width, height);
1981}
1982
1983void LatexDocVisitor::endDotFile(bool hasCaption)
1984{
1985 if (m_hide) return;
1986 visitPostEnd(m_t,hasCaption);
1987}
1988
1990 const QCString &width,
1991 const QCString &height,
1992 bool hasCaption,
1993 const QCString &srcFile,
1994 int srcLine
1995 )
1996{
1997 QCString baseName=makeBaseName(fileName);
1998 baseName.prepend("msc_");
1999
2000 QCString outDir = Config_getString(LATEX_OUTPUT);
2001 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
2002 visitPreStart(m_t,hasCaption, baseName, width, height);
2003}
2004
2005void LatexDocVisitor::endMscFile(bool hasCaption)
2006{
2007 if (m_hide) return;
2008 visitPostEnd(m_t,hasCaption);
2009}
2010
2011
2013{
2014 QCString shortName = makeShortName(baseName);
2015 QCString outDir = Config_getString(LATEX_OUTPUT);
2016 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2017 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2020}
2021
2022
2024 const QCString &width,
2025 const QCString &height,
2026 bool hasCaption,
2027 const QCString &srcFile,
2028 int srcLine
2029 )
2030{
2031 QCString baseName=makeBaseName(fileName);
2032 baseName.prepend("dia_");
2033
2034 QCString outDir = Config_getString(LATEX_OUTPUT);
2035 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2036 visitPreStart(m_t,hasCaption, baseName, width, height);
2037}
2038
2039void LatexDocVisitor::endDiaFile(bool hasCaption)
2040{
2041 if (m_hide) return;
2042 visitPostEnd(m_t,hasCaption);
2043}
2044
2045
2047{
2048 QCString shortName = makeShortName(baseName);
2049 QCString outDir = Config_getString(LATEX_OUTPUT);
2050 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2051 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2054}
2055
2057{
2058 QCString shortName = makeShortName(baseName);
2059 if (s.useBitmap())
2060 {
2061 if (shortName.find('.')==-1) shortName += ".png";
2062 }
2063 QCString outDir = Config_getString(LATEX_OUTPUT);
2066 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2069}
2070
2072 const QCString &width,
2073 const QCString &height,
2074 bool hasCaption,
2075 const QCString &srcFile,
2076 int srcLine
2077 )
2078{
2079 QCString outDir = Config_getString(LATEX_OUTPUT);
2080 std::string inBuf;
2081 readInputFile(fileName,inBuf);
2082
2083 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2084 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2085 outDir,QCString(),inBuf,
2087 QCString(),srcFile,srcLine,false);
2088 bool first = true;
2089 for (const auto &bName: baseNameVector)
2090 {
2091 QCString baseName = makeBaseName(bName);
2092 QCString shortName = makeShortName(baseName);
2093 if (useBitmap)
2094 {
2095 if (shortName.find('.')==-1) shortName += ".png";
2096 }
2099 if (!first) endPlantUmlFile(hasCaption);
2100 first = false;
2101 visitPreStart(m_t,hasCaption, shortName, width, height);
2102 }
2103}
2104
2106{
2107 if (m_hide) return;
2108 visitPostEnd(m_t,hasCaption);
2109}
2110
2112{
2113 return std::min(m_indentLevel,maxIndentLevels-1);
2114}
2115
2117{
2118 m_indentLevel++;
2120 {
2121 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2122 }
2123}
2124
2126{
2127 if (m_indentLevel>0)
2128 {
2129 m_indentLevel--;
2130 }
2131}
2132
QCString anchorPrefix() const
Definition cite.cpp:128
static CitationManager & instance()
Definition cite.cpp:86
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
Node representing an anchor.
Definition docnode.h:229
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
QCString getText() const
Definition docnode.cpp:951
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:1912
uint32_t rowSpan() const
Definition docnode.cpp:1850
Alignment alignment() const
Definition docnode.cpp:1874
bool isLast() const
Definition docnode.h:1202
bool isHeading() const
Definition docnode.h:1200
uint32_t colSpan() const
Definition docnode.cpp:1862
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:2187
size_t numColumns() const
Definition docnode.h:1278
const DocNodeVariant * caption() const
Definition docnode.cpp:2182
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
QCString escapeMakeIndexChars(const char *s)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
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:164
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:31
static PlantumlManager & instance()
Definition plantuml.cpp:231
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
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:153
#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:748
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
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5724
QCString integerToRoman(int n, bool upper)
Definition util.cpp:7215
QCString stripPath(const QCString &s)
Definition util.cpp:5467
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:6053
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5742
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:6376
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5766
A bunch of utility functions.