Doxygen
Loading...
Searching...
No Matches
LatexDocVisitor Class Reference

Concrete visitor implementation for LaTeX output. More...

#include <src/latexdocvisitor.h>

Inheritance diagram for LatexDocVisitor:
Collaboration diagram for LatexDocVisitor:

Classes

struct  ActiveRowSpan
struct  TableState
struct  LatexListItemInfo

Public Member Functions

 LatexDocVisitor (TextStream &t, OutputCodeList &ci, LatexCodeGenerator &lcg, const QCString &langExt, int hierarchyLevel=0)
void operator() (const DocWord &)
void operator() (const DocLinkedWord &)
void operator() (const DocWhiteSpace &)
void operator() (const DocSymbol &)
void operator() (const DocEmoji &)
void operator() (const DocURL &)
void operator() (const DocLineBreak &)
void operator() (const DocHorRuler &)
void operator() (const DocStyleChange &)
void operator() (const DocVerbatim &)
void operator() (const DocAnchor &)
void operator() (const DocInclude &)
void operator() (const DocIncOperator &)
void operator() (const DocFormula &)
void operator() (const DocIndexEntry &)
void operator() (const DocSimpleSectSep &)
void operator() (const DocCite &)
void operator() (const DocSeparator &)
void operator() (const DocAutoList &)
void operator() (const DocAutoListItem &)
void operator() (const DocPara &)
void operator() (const DocRoot &)
void operator() (const DocSimpleSect &)
void operator() (const DocTitle &)
void operator() (const DocSimpleList &)
void operator() (const DocSimpleListItem &)
void operator() (const DocSection &s)
void operator() (const DocHtmlList &s)
void operator() (const DocHtmlListItem &)
void operator() (const DocHtmlDescList &)
void operator() (const DocHtmlDescTitle &)
void operator() (const DocHtmlDescData &)
void operator() (const DocHtmlTable &t)
void operator() (const DocHtmlCaption &)
void operator() (const DocHtmlRow &)
void operator() (const DocHtmlCell &)
void operator() (const DocInternal &)
void operator() (const DocHRef &)
void operator() (const DocHtmlSummary &)
void operator() (const DocHtmlDetails &)
void operator() (const DocHtmlHeader &)
void operator() (const DocImage &)
void operator() (const DocDotFile &)
void operator() (const DocMscFile &)
void operator() (const DocDiaFile &)
void operator() (const DocPlantUmlFile &)
void operator() (const DocMermaidFile &)
void operator() (const DocLink &lnk)
void operator() (const DocRef &ref)
void operator() (const DocSecRefItem &)
void operator() (const DocSecRefList &)
void operator() (const DocParamSect &)
void operator() (const DocParamList &)
void operator() (const DocXRefItem &)
void operator() (const DocInternalRef &)
void operator() (const DocText &)
void operator() (const DocHtmlBlockQuote &)
void operator() (const DocVhdlFlow &)
void operator() (const DocParBlock &)
Public Member Functions inherited from DocVisitor
 DocVisitor ()
virtual ~DocVisitor ()
CodeParserInterfacegetCodeParser (const QCString &langExt)
void pushHidden (bool hide)
bool popHidden ()

Private Types

typedef std::vector< ActiveRowSpanRowSpanList

Private Member Functions

template<class T>
void visitChildren (const T &t)
void filter (const QCString &str, const bool retainNewLine=false)
void startLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
void endLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void startDotFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void endDotFile (bool hasCaption)
void startMscFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void endMscFile (bool hasCaption)
void writeMscFile (const QCString &fileName, const DocVerbatim &s, bool newFile=true)
void startDiaFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void endDiaFile (bool hasCaption)
void writePlantUMLFile (const QCString &fileName, const DocVerbatim &s)
void startPlantUmlFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endPlantUmlFile (bool hasCaption)
void writeMermaidFile (const QCString &baseName, const DocVerbatim &s)
void startMermaidFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endMermaidFile (bool hasCaption)
void visitCaption (const DocNodeList &children)
void incIndentLevel ()
void decIndentLevel ()
int indentLevel () const
const char * getSectionName (int level) const
void pushTableState ()
void popTableState ()
size_t currentColumn () const
void setCurrentColumn (size_t col)
void setNumCols (size_t num)
RowSpanListrowSpans ()
void addRowSpan (ActiveRowSpan &&span)
bool insideTable () const
bool isTableNested (const DocNodeVariant *n) const
void writeStartTableCommand (const DocNodeVariant *n, size_t cols)
void writeEndTableCommand (const DocNodeVariant *n)

Private Attributes

TextStreamm_t
OutputCodeListm_ci
LatexCodeGeneratorm_lcg
bool m_insidePre
bool m_insideItem
bool m_hide
QCString m_langExt
int m_hierarchyLevel
TexOrPdf m_texOrPdf = TexOrPdf::NO
std::stack< TableStatem_tableStateStack
RowSpanList m_emptyRowSpanList
int m_indentLevel = 0
LatexListItemInfo m_listItemInfo [maxIndentLevels]

Static Private Attributes

static const int maxIndentLevels = 13

Detailed Description

Concrete visitor implementation for LaTeX output.

Definition at line 37 of file latexdocvisitor.h.

Member Typedef Documentation

◆ RowSpanList

typedef std::vector<ActiveRowSpan> LatexDocVisitor::RowSpanList
private

Definition at line 132 of file latexdocvisitor.h.

Constructor & Destructor Documentation

◆ LatexDocVisitor()

LatexDocVisitor::LatexDocVisitor ( TextStream & t,
OutputCodeList & ci,
LatexCodeGenerator & lcg,
const QCString & langExt,
int hierarchyLevel = 0 )

Definition at line 218 of file latexdocvisitor.cpp.

220 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
222 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
223{
224}
OutputCodeList & m_ci
LatexCodeGenerator & m_lcg
#define FALSE
Definition qcstring.h:34

References FALSE, m_ci, m_hide, m_hierarchyLevel, m_insideItem, m_insidePre, m_langExt, m_lcg, and m_t.

Member Function Documentation

◆ addRowSpan()

void LatexDocVisitor::addRowSpan ( ActiveRowSpan && span)
inlineprivate

Definition at line 233 of file latexdocvisitor.h.

234 {
235 if (!m_tableStateStack.empty()) m_tableStateStack.top().rowSpans.push_back(std::move(span));
236 }
std::stack< TableState > m_tableStateStack

References m_tableStateStack.

Referenced by operator()().

◆ currentColumn()

size_t LatexDocVisitor::currentColumn ( ) const
inlineprivate

Definition at line 217 of file latexdocvisitor.h.

218 {
219 return !m_tableStateStack.empty() ? m_tableStateStack.top().currentColumn : 0;
220 }

References m_tableStateStack.

Referenced by operator()().

◆ decIndentLevel()

void LatexDocVisitor::decIndentLevel ( )
private

Definition at line 2124 of file latexdocvisitor.cpp.

2125{
2126 if (m_indentLevel>0)
2127 {
2128 m_indentLevel--;
2129 }
2130}

References m_indentLevel.

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ endDiaFile()

void LatexDocVisitor::endDiaFile ( bool hasCaption)
private

Definition at line 2006 of file latexdocvisitor.cpp.

2007{
2008 if (m_hide) return;
2009 visitPostEnd(m_t,hasCaption);
2010}
static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endDotFile()

void LatexDocVisitor::endDotFile ( bool hasCaption)
private

Definition at line 1951 of file latexdocvisitor.cpp.

1952{
1953 if (m_hide) return;
1954 visitPostEnd(m_t,hasCaption);
1955}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()(), and operator()().

◆ endLink()

void LatexDocVisitor::endLink ( const QCString & ref,
const QCString & file,
const QCString & anchor,
bool refToTable = false,
bool refToSection = false,
SectionType sectionType = SectionType::Anchor )
private

Definition at line 1911 of file latexdocvisitor.cpp.

1912{
1913 m_t << "}";
1914 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1915 if (ref.isEmpty() && !pdfHyperLinks)
1916 {
1917 m_t << "{";
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}
void filter(const QCString &str, const bool retainNewLine=false)
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
constexpr int level() const
Definition section.h:46
virtual QCString trPageAbbreviation()=0
#define Config_getBool(name)
Definition config.h:33
Translator * theTranslator
Definition language.cpp:71
@ PDF
called through texorpdf as PDF (second) part

References Config_getBool, filter(), QCString::isEmpty(), SectionType::level(), m_t, m_texOrPdf, PDF, and theTranslator.

Referenced by operator()(), operator()(), operator()(), operator()(), and operator()().

◆ endMermaidFile()

void LatexDocVisitor::endMermaidFile ( bool hasCaption)
private

Definition at line 2104 of file latexdocvisitor.cpp.

2105{
2106 if (m_hide) return;
2107 visitPostEnd(m_t,hasCaption);
2108}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endMscFile()

void LatexDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 1973 of file latexdocvisitor.cpp.

1974{
1975 if (m_hide) return;
1976 visitPostEnd(m_t,hasCaption);
1977}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2061 of file latexdocvisitor.cpp.

2062{
2063 if (m_hide) return;
2064 visitPostEnd(m_t,hasCaption);
2065}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()(), and startPlantUmlFile().

◆ filter()

void LatexDocVisitor::filter ( const QCString & str,
const bool retainNewLine = false )
private

Definition at line 1851 of file latexdocvisitor.cpp.

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}
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)

References filterLatexString(), m_insideItem, m_insidePre, m_lcg, and m_t.

Referenced by endLink(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ getSectionName()

const char * LatexDocVisitor::getSectionName ( int level) const
private

Definition at line 60 of file latexdocvisitor.cpp.

61{
62 bool compactLatex = Config_getBool(COMPACT_LATEX);
63 int l = level;
64 if (compactLatex) l++;
65
66 if (l < g_maxLevels)
67 {
68 l += m_hierarchyLevel; /* May be -1 if generating main page */
69 // Sections get special treatment because they inherit the parent's level
70 if (l >= g_maxLevels)
71 {
72 l = g_maxLevels - 1;
73 }
74 else if (l < 0)
75 {
76 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
77 l = 0;
78 }
79 return g_secLabels[l];
80 }
81 else if (l == 7)
82 {
83 return g_paragraphLabel;
84 }
85 else
86 {
88 }
89}
static const char * g_subparagraphLabel
static const int g_maxLevels
static const std::array< const char *, g_maxLevels > g_secLabels
static const char * g_paragraphLabel

References Config_getBool, g_maxLevels, g_paragraphLabel, g_secLabels, g_subparagraphLabel, and m_hierarchyLevel.

Referenced by operator()(), and operator()().

◆ incIndentLevel()

void LatexDocVisitor::incIndentLevel ( )
private

Definition at line 2115 of file latexdocvisitor.cpp.

2116{
2117 m_indentLevel++;
2119 {
2120 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2121 }
2122}
static const int maxIndentLevels
#define err(fmt,...)
Definition message.h:127

References err, m_indentLevel, and maxIndentLevels.

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ indentLevel()

int LatexDocVisitor::indentLevel ( ) const
private

Definition at line 2110 of file latexdocvisitor.cpp.

2111{
2112 return std::min(m_indentLevel,maxIndentLevels-1);
2113}

References m_indentLevel, and maxIndentLevels.

Referenced by operator()(), operator()(), operator()(), and operator()().

◆ insideTable()

bool LatexDocVisitor::insideTable ( ) const
inlineprivate

Definition at line 237 of file latexdocvisitor.h.

238 {
239 return !m_tableStateStack.empty();
240 }

References m_tableStateStack.

Referenced by operator()(), and operator()().

◆ isTableNested()

bool LatexDocVisitor::isTableNested ( const DocNodeVariant * n) const
private

Definition at line 1188 of file latexdocvisitor.cpp.

1189{
1190 bool isNested=m_lcg.usedTableLevel()>0;
1191 while (n && !isNested)
1192 {
1194 n = ::parent(n);
1195 }
1196 return isNested;
1197}
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1372
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:1336

References holds_one_of_alternatives(), m_lcg, and parent().

Referenced by operator()(), operator()(), operator()(), writeEndTableCommand(), and writeStartTableCommand().

◆ operator()() [1/59]

void LatexDocVisitor::operator() ( const DocAnchor & anc)

Definition at line 516 of file latexdocvisitor.cpp.

517{
518 if (m_hide) return;
519 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
520 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
521 {
522 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
523 << "}%\n";
524 }
525}
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
QCString stripPath(const QCString &s)
Definition util.cpp:4959

References DocAnchor::anchor(), Config_getBool, DocAnchor::file(), QCString::isEmpty(), m_hide, m_t, and stripPath().

◆ operator()() [2/59]

void LatexDocVisitor::operator() ( const DocAutoList & l)

Definition at line 747 of file latexdocvisitor.cpp.

748{
749 if (m_hide) return;
750 if (m_indentLevel>=maxIndentLevels-1) return;
751 if (l.isEnumList())
752 {
753 m_t << "\n\\begin{DoxyEnumerate}";
754 m_listItemInfo[indentLevel()].isEnum = true;
755 }
756 else
757 {
758 m_listItemInfo[indentLevel()].isEnum = false;
759 m_t << "\n\\begin{DoxyItemize}";
760 }
761 visitChildren(l);
762 if (l.isEnumList())
763 {
764 m_t << "\n\\end{DoxyEnumerate}";
765 }
766 else
767 {
768 m_t << "\n\\end{DoxyItemize}";
769 }
770}
bool isEnumList() const
Definition docnode.h:580
LatexListItemInfo m_listItemInfo[maxIndentLevels]
void visitChildren(const T &t)

References indentLevel(), DocAutoList::isEnumList(), m_hide, m_indentLevel, m_listItemInfo, m_t, maxIndentLevels, and visitChildren().

◆ operator()() [3/59]

void LatexDocVisitor::operator() ( const DocAutoListItem & li)

Definition at line 772 of file latexdocvisitor.cpp.

773{
774 if (m_hide) return;
775 switch (li.itemNumber())
776 {
777 case DocAutoList::Unchecked: // unchecked
778 m_t << "\n\\item[\\DoxyUnchecked] ";
779 break;
780 case DocAutoList::Checked_x: // checked with x
781 case DocAutoList::Checked_X: // checked with X
782 m_t << "\n\\item[\\DoxyChecked] ";
783 break;
784 default:
785 m_t << "\n\\item ";
786 break;
787 }
789 visitChildren(li);
791}
int itemNumber() const
Definition docnode.h:598

References DocAutoList::Checked_X, DocAutoList::Checked_x, decIndentLevel(), incIndentLevel(), DocAutoListItem::itemNumber(), m_hide, m_t, DocAutoList::Unchecked, and visitChildren().

◆ operator()() [4/59]

void LatexDocVisitor::operator() ( const DocCite & cite)

Definition at line 684 of file latexdocvisitor.cpp.

685{
686 if (m_hide) return;
687 auto opt = cite.option();
688 QCString txt;
689 if (opt.noCite())
690 {
691 if (!cite.file().isEmpty())
692 {
693 txt = cite.getText();
694 }
695 else
696 {
697 if (!opt.noPar()) txt += "[";
698 txt += cite.target();
699 if (!opt.noPar()) txt += "]";
700 }
701 m_t << "{\\bfseries ";
702 filter(txt);
703 m_t << "}";
704 }
705 else
706 {
707 if (!cite.file().isEmpty())
708 {
709 QCString anchor = cite.anchor();
710 QCString anchorPrefix = CitationManager::instance().anchorPrefix();
711 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
712
713 txt = "\\DoxyCite{" + anchor + "}";
714 if (opt.isNumber())
715 {
716 txt += "{number}";
717 }
718 else if (opt.isShortAuthor())
719 {
720 txt += "{shortauthor}";
721 }
722 else if (opt.isYear())
723 {
724 txt += "{year}";
725 }
726 if (!opt.noPar()) txt += "{1}";
727 else txt += "{0}";
728
729 m_t << txt;
730 }
731 else
732 {
733 if (!opt.noPar()) txt += "[";
734 txt += cite.target();
735 if (!opt.noPar()) txt += "]";
736 m_t << "{\\bfseries ";
737 filter(txt);
738 m_t << "}";
739 }
740 }
741}
QCString anchorPrefix() const
Definition cite.cpp:126
static CitationManager & instance()
Definition cite.cpp:85
QCString getText() const
Definition docnode.cpp:974
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
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

References DocCite::anchor(), CitationManager::anchorPrefix(), DocCite::file(), filter(), DocCite::getText(), CitationManager::instance(), QCString::isEmpty(), QCString::length(), m_hide, m_t, QCString::mid(), DocCite::option(), and DocCite::target().

◆ operator()() [5/59]

void LatexDocVisitor::operator() ( const DocDiaFile & df)

Definition at line 1530 of file latexdocvisitor.cpp.

1531{
1532 if (m_hide) return;
1533 bool exists = false;
1534 std::string inBuf;
1535 if (readInputFile(df.file(),inBuf))
1536 {
1537 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1538 ".dia", // extension
1539 inBuf, // contents
1540 exists);
1541 if (!fileName.isEmpty())
1542 {
1543 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1544 visitChildren(df);
1545 endDiaFile(df.hasCaption());
1546 }
1547 }
1548}
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
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void endDiaFile(bool hasCaption)
#define Config_getString(name)
Definition config.h:32
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
Definition util.cpp:6989
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:5560

References Config_getString, endDiaFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startDiaFile(), stripPath(), visitChildren(), DocDiagramFileBase::width(), and writeFileContents().

◆ operator()() [6/59]

void LatexDocVisitor::operator() ( const DocDotFile & df)

Definition at line 1490 of file latexdocvisitor.cpp.

1491{
1492 if (m_hide) return;
1493 bool exists = false;
1494 std::string inBuf;
1495 if (readInputFile(df.file(),inBuf))
1496 {
1497 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1498 ".dot", // extension
1499 inBuf, // contents
1500 exists);
1501 if (!fileName.isEmpty())
1502 {
1503 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1504 visitChildren(df);
1505 endDotFile(df.hasCaption());
1506 }
1507 }
1508}
void endDotFile(bool hasCaption)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)

References Config_getString, endDotFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startDotFile(), stripPath(), visitChildren(), DocDiagramFileBase::width(), and writeFileContents().

◆ operator()() [7/59]

void LatexDocVisitor::operator() ( const DocEmoji & s)

Definition at line 297 of file latexdocvisitor.cpp.

298{
299 if (m_hide) return;
300 QCString emojiName = EmojiEntityMapper::instance().name(s.index());
301 if (!emojiName.isEmpty())
302 {
303 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
304 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
305 filter(emojiName);
306 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
307 }
308 else
309 {
310 m_t << s.name();
311 }
312}
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
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

References filter(), DocEmoji::index(), EmojiEntityMapper::instance(), QCString::isEmpty(), QCString::length(), m_hide, m_t, m_texOrPdf, QCString::mid(), DocEmoji::name(), EmojiEntityMapper::name(), and PDF.

◆ operator()() [8/59]

void LatexDocVisitor::operator() ( const DocFormula & f)

Definition at line 655 of file latexdocvisitor.cpp.

656{
657 if (m_hide) return;
658 QCString s = f.text();
659 const char *p = s.data();
660 char c = 0;
661 if (p)
662 {
663 while ((c=*p++))
664 {
665 switch (c)
666 {
667 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
668 default: m_t << c; break;
669 }
670 }
671 }
672}
QCString text() const
Definition docnode.h:533
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

References QCString::data(), m_hide, m_t, and DocFormula::text().

◆ operator()() [9/59]

void LatexDocVisitor::operator() ( const DocHorRuler & )

Definition at line 341 of file latexdocvisitor.cpp.

342{
343 if (m_hide) return;
344 if (insideTable())
345 m_t << "\\DoxyHorRuler{1}\n";
346 else
347 m_t << "\\DoxyHorRuler{0}\n";
348}
bool insideTable() const

References insideTable(), m_hide, and m_t.

◆ operator()() [10/59]

void LatexDocVisitor::operator() ( const DocHRef & href)

Definition at line 1419 of file latexdocvisitor.cpp.

1420{
1421 if (m_hide) return;
1422 if (Config_getBool(PDF_HYPERLINKS))
1423 {
1424 m_t << "\\href{";
1425 m_t << latexFilterURL(href.url());
1426 m_t << "}";
1427 }
1428 m_t << "{\\texttt{";
1429 visitChildren(href);
1430 m_t << "}}";
1431}
QCString url() const
Definition docnode.h:839
QCString latexFilterURL(const QCString &s)

References Config_getBool, latexFilterURL(), m_hide, m_t, DocHRef::url(), and visitChildren().

◆ operator()() [11/59]

void LatexDocVisitor::operator() ( const DocHtmlBlockQuote & q)

Definition at line 1831 of file latexdocvisitor.cpp.

1832{
1833 if (m_hide) return;
1834 m_t << "\\begin{quote}\n";
1836 visitChildren(q);
1837 m_t << "\\end{quote}\n";
1839}

References decIndentLevel(), incIndentLevel(), m_hide, m_t, and visitChildren().

◆ operator()() [12/59]

void LatexDocVisitor::operator() ( const DocHtmlCaption & c)

Definition at line 1268 of file latexdocvisitor.cpp.

1269{
1270 if (m_hide) return;
1271 visitChildren(c);
1272}

References m_hide, and visitChildren().

◆ operator()() [13/59]

void LatexDocVisitor::operator() ( const DocHtmlCell & c)

Definition at line 1304 of file latexdocvisitor.cpp.

1305{
1306 if (m_hide) return;
1307 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1308
1310
1311 QCString cellOpts;
1312 QCString cellSpec;
1313 auto appendOpt = [&cellOpts](const QCString &s)
1314 {
1315 if (!cellOpts.isEmpty()) cellOpts+=",";
1316 cellOpts+=s;
1317 };
1318 auto appendSpec = [&cellSpec](const QCString &s)
1319 {
1320 if (!cellSpec.isEmpty()) cellSpec+=",";
1321 cellSpec+=s;
1322 };
1323 auto writeCell = [this,&cellOpts,&cellSpec]()
1324 {
1325 if (!cellOpts.isEmpty() || !cellSpec.isEmpty())
1326 {
1327 m_t << "\\SetCell";
1328 if (!cellOpts.isEmpty())
1329 {
1330 m_t << "[" << cellOpts << "]";
1331 }
1332 m_t << "{" << cellSpec << "}";
1333 }
1334 };
1335
1336 // skip over columns that have a row span starting at an earlier row
1337 for (const auto &span : rowSpans())
1338 {
1339 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1340 // span.cell.rowIndex(),span.cell.columnIndex(),
1341 // span.column,span.colSpan,span.rowSpan,
1342 // currentColumn());
1343 if (span.rowSpan>0 && span.column==currentColumn())
1344 {
1345 setCurrentColumn(currentColumn()+span.colSpan);
1346 for (size_t i=0;i<span.colSpan;i++)
1347 {
1348 m_t << "&";
1349 }
1350 }
1351 }
1352
1353 int cs = c.colSpan();
1354 int ha = c.alignment();
1355 int rs = c.rowSpan();
1356 int va = c.valignment();
1357
1358 switch (ha) // horizontal alignment
1359 {
1360 case DocHtmlCell::Right:
1361 appendSpec("r");
1362 break;
1364 appendSpec("c");
1365 break;
1366 default:
1367 // default
1368 break;
1369 }
1370 if (rs>0) // row span
1371 {
1372 appendOpt("r="+QCString().setNum(rs));
1373 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1374 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1375 // currentColumn());
1377 }
1378 if (cs>1) // column span
1379 {
1380 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1382 appendOpt("c="+QCString().setNum(cs));
1383 }
1384 if (c.isHeading())
1385 {
1386 appendSpec("bg=\\tableheadbgcolor");
1387 appendSpec("font=\\bfseries");
1388 }
1389 switch(va) // vertical alignment
1390 {
1391 case DocHtmlCell::Top:
1392 appendSpec("h");
1393 break;
1395 appendSpec("f");
1396 break;
1398 // default
1399 break;
1400 }
1401 writeCell();
1402
1403 visitChildren(c);
1404
1405 for (int i=0;i<cs-1;i++)
1406 {
1407 m_t << "&"; // placeholder for invisible cell
1408 }
1409
1410 if (!c.isLast()) m_t << "&";
1411}
Valignment valignment() const
Definition docnode.cpp:1980
uint32_t rowSpan() const
Definition docnode.cpp:1918
Alignment alignment() const
Definition docnode.cpp:1942
bool isLast() const
Definition docnode.h:1208
bool isHeading() const
Definition docnode.h:1206
uint32_t colSpan() const
Definition docnode.cpp:1930
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
void addRowSpan(ActiveRowSpan &&span)
size_t currentColumn() const

References addRowSpan(), DocHtmlCell::alignment(), DocHtmlCell::Bottom, DocHtmlCell::Center, DocHtmlCell::colSpan(), currentColumn(), QCString::isEmpty(), DocHtmlCell::isHeading(), DocHtmlCell::isLast(), m_hide, m_t, DocHtmlCell::Middle, DocHtmlCell::Right, DocHtmlCell::rowSpan(), rowSpans(), setCurrentColumn(), DocHtmlCell::Top, DocHtmlCell::valignment(), and visitChildren().

◆ operator()() [14/59]

void LatexDocVisitor::operator() ( const DocHtmlDescData & dd)

Definition at line 1179 of file latexdocvisitor.cpp.

1180{
1182 if (!m_insideItem) m_t << "\\hfill";
1183 m_t << " \\\\\n";
1184 visitChildren(dd);
1186}

References decIndentLevel(), incIndentLevel(), m_insideItem, m_t, and visitChildren().

◆ operator()() [15/59]

void LatexDocVisitor::operator() ( const DocHtmlDescList & dl)

Definition at line 1145 of file latexdocvisitor.cpp.

1146{
1147 if (m_hide) return;
1148 bool eq = classEqualsReflist(dl);
1149 if (eq)
1150 {
1151 m_t << "\n\\begin{DoxyRefList}";
1152 }
1153 else
1154 {
1155 if (listIsNested(dl)) m_t << "\n\\hfill";
1156 m_t << "\n\\begin{DoxyDescription}";
1157 }
1158 visitChildren(dl);
1159 if (eq)
1160 {
1161 m_t << "\n\\end{DoxyRefList}";
1162 }
1163 else
1164 {
1165 m_t << "\n\\end{DoxyDescription}";
1166 }
1167}
static bool listIsNested(const DocHtmlDescList &dl)
static bool classEqualsReflist(const DocHtmlDescList &dl)

References classEqualsReflist(), listIsNested(), m_hide, m_t, and visitChildren().

◆ operator()() [16/59]

void LatexDocVisitor::operator() ( const DocHtmlDescTitle & dt)

Definition at line 1169 of file latexdocvisitor.cpp.

1170{
1171 if (m_hide) return;
1172 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1174 visitChildren(dt);
1176 m_t << "}}]";
1177}
#define TRUE
Definition qcstring.h:37

References FALSE, m_hide, m_insideItem, m_t, TRUE, and visitChildren().

◆ operator()() [17/59]

void LatexDocVisitor::operator() ( const DocHtmlDetails & d)

Definition at line 1441 of file latexdocvisitor.cpp.

1442{
1443 if (m_hide) return;
1444 m_t << "\n\n";
1445 auto summary = d.summary();
1446 if (summary)
1447 {
1448 std::visit(*this,*summary);
1449 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1450 }
1451 visitChildren(d);
1452 if (summary)
1453 {
1454 m_t << "\\end{adjustwidth}\n";
1455 }
1456 else
1457 {
1458 m_t << "\n\n";
1459 }
1460}
const DocNodeVariant * summary() const
Definition docnode.h:873

References m_hide, m_t, DocHtmlDetails::summary(), and visitChildren().

◆ operator()() [18/59]

void LatexDocVisitor::operator() ( const DocHtmlHeader & header)

Definition at line 1462 of file latexdocvisitor.cpp.

1463{
1464 if (m_hide) return;
1465 m_t << "\\" << getSectionName(header.level()) << "*{";
1466 visitChildren(header);
1467 m_t << "}";
1468}
int level() const
Definition docnode.h:886
const char * getSectionName(int level) const

References getSectionName(), DocHtmlHeader::level(), m_hide, m_t, and visitChildren().

◆ operator()() [19/59]

void LatexDocVisitor::operator() ( const DocHtmlList & s)

Definition at line 1029 of file latexdocvisitor.cpp.

1030{
1031 if (m_hide) return;
1032 if (m_indentLevel>=maxIndentLevels-1) return;
1034 if (s.type()==DocHtmlList::Ordered)
1035 {
1036 bool first = true;
1037 m_t << "\n\\begin{DoxyEnumerate}";
1038 for (const auto &opt : s.attribs())
1039 {
1040 if (opt.name=="type")
1041 {
1042 if (opt.value=="1")
1043 {
1044 m_t << (first ? "[": ",");
1045 m_t << "label=\\arabic*";
1046 first = false;
1047 }
1048 else if (opt.value=="a")
1049 {
1050 m_t << (first ? "[": ",");
1051 m_t << "label=\\enumalphalphcnt*";
1052 first = false;
1053 }
1054 else if (opt.value=="A")
1055 {
1056 m_t << (first ? "[": ",");
1057 m_t << "label=\\enumAlphAlphcnt*";
1058 first = false;
1059 }
1060 else if (opt.value=="i")
1061 {
1062 m_t << (first ? "[": ",");
1063 m_t << "label=\\roman*";
1064 first = false;
1065 }
1066 else if (opt.value=="I")
1067 {
1068 m_t << (first ? "[": ",");
1069 m_t << "label=\\Roman*";
1070 first = false;
1071 }
1072 }
1073 else if (opt.name=="start")
1074 {
1075 m_t << (first ? "[": ",");
1076 bool ok = false;
1077 int val = opt.value.toInt(&ok);
1078 if (ok) m_t << "start=" << val;
1079 first = false;
1080 }
1081 }
1082 if (!first) m_t << "]\n";
1083 }
1084 else
1085 {
1086 m_t << "\n\\begin{DoxyItemize}";
1087 }
1088 visitChildren(s);
1089 if (m_indentLevel>=maxIndentLevels-1) return;
1090 if (s.type()==DocHtmlList::Ordered)
1091 m_t << "\n\\end{DoxyEnumerate}";
1092 else
1093 m_t << "\n\\end{DoxyItemize}";
1094}
const HtmlAttribList & attribs() const
Definition docnode.h:1015
Type type() const
Definition docnode.h:1014

References DocHtmlList::attribs(), indentLevel(), m_hide, m_indentLevel, m_listItemInfo, m_t, maxIndentLevels, DocHtmlList::Ordered, DocHtmlList::type(), and visitChildren().

◆ operator()() [20/59]

void LatexDocVisitor::operator() ( const DocHtmlListItem & l)

Definition at line 1096 of file latexdocvisitor.cpp.

1097{
1098 if (m_hide) return;
1099 if (m_listItemInfo[indentLevel()].isEnum)
1100 {
1101 for (const auto &opt : l.attribs())
1102 {
1103 if (opt.name=="value")
1104 {
1105 bool ok = false;
1106 int val = opt.value.toInt(&ok);
1107 if (ok)
1108 {
1109 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1110 }
1111 }
1112 }
1113 }
1114 m_t << "\n\\item ";
1116 visitChildren(l);
1118}
const HtmlAttribList & attribs() const
Definition docnode.h:1176
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6728

References DocHtmlListItem::attribs(), decIndentLevel(), incIndentLevel(), indentLevel(), integerToRoman(), m_hide, m_listItemInfo, m_t, and visitChildren().

◆ operator()() [21/59]

void LatexDocVisitor::operator() ( const DocHtmlRow & row)

Definition at line 1274 of file latexdocvisitor.cpp.

1275{
1276 if (m_hide) return;
1278
1279 visitChildren(row);
1280
1281 m_t << "\\\\";
1282
1283 size_t col = 1;
1284 for (auto &span : rowSpans())
1285 {
1286 if (span.rowSpan>0) span.rowSpan--;
1287 if (span.rowSpan<=0)
1288 {
1289 // inactive span
1290 }
1291 else if (span.column>col)
1292 {
1293 col = span.column+span.colSpan;
1294 }
1295 else
1296 {
1297 col = span.column+span.colSpan;
1298 }
1299 }
1300
1301 m_t << "\n";
1302}

References m_hide, m_t, rowSpans(), setCurrentColumn(), and visitChildren().

◆ operator()() [22/59]

void LatexDocVisitor::operator() ( const DocHtmlSummary & d)

Definition at line 1433 of file latexdocvisitor.cpp.

1434{
1435 if (m_hide) return;
1436 m_t << "{\\bfseries{";
1437 visitChildren(d);
1438 m_t << "}}";
1439}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/59]

void LatexDocVisitor::operator() ( const DocHtmlTable & t)

Definition at line 1223 of file latexdocvisitor.cpp.

1224{
1225 if (m_hide) return;
1227 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1228 if (c)
1229 {
1230 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1231 if (!c->file().isEmpty() && pdfHyperLinks)
1232 {
1233 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1234 << "}{}";
1235 }
1236 m_t << "\n";
1237 }
1238
1240 if (!isTableNested(t.parent()))
1241 {
1242 // write caption
1243 m_t << "{";
1244 if (c)
1245 {
1246 std::visit(*this, *t.caption());
1247 }
1248 m_t << "}";
1249 // write label
1250 m_t << "{";
1251 if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
1252 {
1253 m_t << stripPath(c->file()) << "_" << c->anchor();
1254 }
1255 m_t << "}";
1256 }
1257
1258 // write head row(s)
1259 m_t << "{" << t.numberHeaderRows() << "}\n";
1260
1262
1263 visitChildren(t);
1265 popTableState();
1266}
QCString anchor() const
Definition docnode.h:1241
QCString file() const
Definition docnode.h:1240
size_t numberHeaderRows() const
Definition docnode.cpp:2255
size_t numColumns() const
Definition docnode.h:1284
const DocNodeVariant * caption() const
Definition docnode.cpp:2250
DocNodeVariant * parent()
Definition docnode.h:90
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)
bool isTableNested(const DocNodeVariant *n) const

References DocHtmlCaption::anchor(), DocHtmlTable::caption(), Config_getBool, DocHtmlCaption::file(), QCString::isEmpty(), isTableNested(), m_hide, m_t, DocHtmlTable::numberHeaderRows(), DocHtmlTable::numColumns(), DocNode::parent(), popTableState(), pushTableState(), setNumCols(), stripPath(), visitChildren(), writeEndTableCommand(), and writeStartTableCommand().

◆ operator()() [24/59]

void LatexDocVisitor::operator() ( const DocImage & img)

Definition at line 1470 of file latexdocvisitor.cpp.

1471{
1472 if (img.type()==DocImage::Latex)
1473 {
1474 if (m_hide) return;
1475 QCString gfxName = img.name();
1476 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1477 {
1478 gfxName=gfxName.left(gfxName.length()-4);
1479 }
1480
1481 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1482 visitChildren(img);
1484 }
1485 else // other format -> skip
1486 {
1487 }
1488}
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
bool endsWith(const char *s) const
Definition qcstring.h:524
QCString left(size_t len) const
Definition qcstring.h:229
static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)

References QCString::endsWith(), DocImage::hasCaption(), DocImage::height(), DocImage::isInlineImage(), DocImage::Latex, QCString::left(), QCString::length(), m_hide, m_t, DocImage::name(), DocImage::type(), visitChildren(), visitPostEnd(), visitPreStart(), and DocImage::width().

◆ operator()() [25/59]

void LatexDocVisitor::operator() ( const DocInclude & inc)

Definition at line 527 of file latexdocvisitor.cpp.

528{
529 if (m_hide) return;
531 switch(inc.type())
532 {
534 {
535 m_ci.startCodeFragment("DoxyCodeInclude");
536 FileInfo cfi( inc.file().str() );
537 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
539 inc.text(),
540 langExt,
541 inc.stripCodeComments(),
542 CodeParserOptions()
543 .setExample(inc.isExample(), inc.exampleFile())
544 .setFileDef(fd.get())
545 .setInlineFragment(true)
546 );
547 m_ci.endCodeFragment("DoxyCodeInclude");
548 }
549 break;
551 {
552 m_ci.startCodeFragment("DoxyCodeInclude");
554 inc.text(),langExt,
555 inc.stripCodeComments(),
556 CodeParserOptions()
557 .setExample(inc.isExample(), inc.exampleFile())
558 .setInlineFragment(true)
559 .setShowLineNumbers(false)
560 );
561 m_ci.endCodeFragment("DoxyCodeInclude");
562 }
563 break;
571 break;
573 m_t << inc.text();
574 break;
576 if (isTableNested(inc.parent())) // in table
577 {
578 m_t << "\\begin{DoxyCode}{0}";
579 filter(inc.text(), true);
580 m_t << "\\end{DoxyCode}\n";
581 }
582 else
583 {
584 m_t << "\n\\begin{DoxyVerbInclude}\n";
585 m_t << inc.text();
586 m_t << "\\end{DoxyVerbInclude}\n";
587 }
588 break;
591 {
592 m_ci.startCodeFragment("DoxyCodeInclude");
594 inc.file(),
595 inc.blockId(),
596 inc.context(),
598 inc.trimLeft(),
600 );
601 m_ci.endCodeFragment("DoxyCodeInclude");
602 }
603 break;
604 }
605}
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.
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
CodeParserInterface & getCodeParser(const QCString &langExt)
const std::string & str() const
Definition qcstring.h:552
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5221

References DocInclude::blockId(), DocInclude::context(), createFileDef(), FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile(), DocInclude::extension(), DocInclude::file(), FileInfo::fileName(), filter(), DocVisitor::getCodeParser(), getLanguageFromFileName(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance(), DocInclude::isExample(), isTableNested(), DocInclude::LatexInclude, m_ci, m_hide, m_t, DocInclude::ManInclude, DocNode::parent(), CodeParserInterface::parseCode(), CodeFragmentManager::parseCodeFragment(), DocInclude::RtfInclude, CodeParserOptions::setFileDef(), CodeParserOptions::setInlineFragment(), CodeParserOptions::setShowLineNumbers(), DocInclude::Snippet, DocInclude::SnippetWithLines, QCString::str(), DocInclude::stripCodeComments(), DocInclude::text(), DocInclude::trimLeft(), DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/59]

void LatexDocVisitor::operator() ( const DocIncOperator & op)

Definition at line 607 of file latexdocvisitor.cpp.

608{
609 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
610 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
611 if (op.isFirst())
612 {
613 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
615 m_hide = TRUE;
616 }
617 QCString locLangExt = getFileNameExtension(op.includeFileName());
618 if (locLangExt.isEmpty()) locLangExt = m_langExt;
619 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
620 if (op.type()!=DocIncOperator::Skip)
621 {
622 m_hide = popHidden();
623 if (!m_hide)
624 {
625 std::unique_ptr<FileDef> fd;
626 if (!op.includeFileName().isEmpty())
627 {
628 FileInfo cfi( op.includeFileName().str() );
629 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
630 }
631
632 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
634 CodeParserOptions()
635 .setExample(op.isExample(),op.exampleFile())
636 .setFileDef(fd.get())
637 .setStartLine(op.line())
638 .setShowLineNumbers(op.showLineNo())
639 );
640 }
642 m_hide=TRUE;
643 }
644 if (op.isLast())
645 {
647 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
648 }
649 else
650 {
651 if (!m_hide) m_t << "\n";
652 }
653}
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
void pushHidden(bool hide)
bool popHidden()
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5263

References DocIncOperator::context(), createFileDef(), FileInfo::dirPath(), DocIncOperator::exampleFile(), FileInfo::fileName(), DocVisitor::getCodeParser(), getFileNameExtension(), getLanguageFromFileName(), DocIncOperator::includeFileName(), QCString::isEmpty(), DocIncOperator::isExample(), DocIncOperator::isFirst(), DocIncOperator::isLast(), DocIncOperator::line(), m_ci, m_hide, m_langExt, m_t, CodeParserInterface::parseCode(), DocVisitor::popHidden(), DocVisitor::pushHidden(), CodeParserOptions::setFileDef(), CodeParserOptions::setShowLineNumbers(), CodeParserOptions::setStartLine(), DocIncOperator::showLineNo(), DocIncOperator::Skip, QCString::str(), DocIncOperator::stripCodeComments(), DocIncOperator::text(), TRUE, and DocIncOperator::type().

◆ operator()() [27/59]

void LatexDocVisitor::operator() ( const DocIndexEntry & i)

Definition at line 674 of file latexdocvisitor.cpp.

675{
676 if (m_hide) return;
678}
QCString entry() const
Definition docnode.h:559
void latexWriteIndexItem(TextStream &m_t, const QCString &s1, const QCString &s2)

References DocIndexEntry::entry(), latexWriteIndexItem(), m_hide, and m_t.

◆ operator()() [28/59]

void LatexDocVisitor::operator() ( const DocInternal & i)

Definition at line 1413 of file latexdocvisitor.cpp.

1414{
1415 if (m_hide) return;
1416 visitChildren(i);
1417}

References m_hide, and visitChildren().

◆ operator()() [29/59]

void LatexDocVisitor::operator() ( const DocInternalRef & ref)

Definition at line 1817 of file latexdocvisitor.cpp.

1818{
1819 if (m_hide) return;
1820 startLink(QCString(),ref.file(),ref.anchor());
1821 visitChildren(ref);
1822 endLink(QCString(),ref.file(),ref.anchor());
1823}
QCString file() const
Definition docnode.h:820
QCString anchor() const
Definition docnode.h:822
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)

References DocInternalRef::anchor(), endLink(), DocInternalRef::file(), m_hide, startLink(), and visitChildren().

◆ operator()() [30/59]

void LatexDocVisitor::operator() ( const DocLineBreak & )

Definition at line 328 of file latexdocvisitor.cpp.

329{
330 if (m_hide) return;
331 if (m_insideItem)
332 {
333 m_t << "\\\\\n";
334 }
335 else
336 {
337 m_t << "~\\newline\n";
338 }
339}

References m_hide, m_insideItem, and m_t.

◆ operator()() [31/59]

void LatexDocVisitor::operator() ( const DocLink & lnk)

Definition at line 1569 of file latexdocvisitor.cpp.

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}

References DocLink::anchor(), endLink(), DocLink::file(), m_hide, DocLink::ref(), startLink(), and visitChildren().

◆ operator()() [32/59]

void LatexDocVisitor::operator() ( const DocLinkedWord & w)

Definition at line 236 of file latexdocvisitor.cpp.

237{
238 if (m_hide) return;
239 startLink(w.ref(),w.file(),w.anchor());
240 filter(w.word());
241 endLink(w.ref(),w.file(),w.anchor());
242}
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

References DocLinkedWord::anchor(), endLink(), DocLinkedWord::file(), filter(), m_hide, DocLinkedWord::ref(), startLink(), and DocLinkedWord::word().

◆ operator()() [33/59]

void LatexDocVisitor::operator() ( const DocMermaidFile & df)

Definition at line 1559 of file latexdocvisitor.cpp.

1560{
1561 if (m_hide) return;
1562 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1563 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1564 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1565 visitChildren(df);
1567}
void startMermaidFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endMermaidFile(bool hasCaption)
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:5887

References Config_getBool, Config_getString, copyFile(), endMermaidFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startMermaidFile(), stripPath(), visitChildren(), and DocDiagramFileBase::width().

◆ operator()() [34/59]

void LatexDocVisitor::operator() ( const DocMscFile & df)

Definition at line 1510 of file latexdocvisitor.cpp.

1511{
1512 if (m_hide) return;
1513 bool exists = false;
1514 std::string inBuf;
1515 if (readInputFile(df.file(),inBuf))
1516 {
1517 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1518 ".msc", // extension
1519 inBuf, // contents
1520 exists);
1521 if (!fileName.isEmpty())
1522 {
1523 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1524 visitChildren(df);
1525 endMscFile(df.hasCaption());
1526 }
1527 }
1528}
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void endMscFile(bool hasCaption)

References Config_getString, endMscFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startMscFile(), stripPath(), visitChildren(), DocDiagramFileBase::width(), and writeFileContents().

◆ operator()() [35/59]

void LatexDocVisitor::operator() ( const DocPara & p)

Definition at line 793 of file latexdocvisitor.cpp.

794{
795 if (m_hide) return;
796 visitChildren(p);
797 if (!p.isLast() && // omit <p> for last paragraph
798 !(p.parent() && // and for parameter sections
799 std::get_if<DocParamSect>(p.parent())
800 )
801 )
802 {
803 if (insideTable())
804 {
805 m_t << "~\\newline\n";
806 }
807 else
808 {
809 m_t << "\n\n";
810 }
811 }
812}
bool isLast() const
Definition docnode.h:1097

References insideTable(), DocPara::isLast(), m_hide, m_t, DocNode::parent(), and visitChildren().

◆ operator()() [36/59]

void LatexDocVisitor::operator() ( const DocParamList & pl)

Definition at line 1709 of file latexdocvisitor.cpp.

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}
const DocNodeList & parameters() const
Definition docnode.h:1135
const DocNodeList & paramTypes() const
Definition docnode.h:1136
DocParamSect::Direction direction() const
Definition docnode.h:1139
const DocNodeList & paragraphs() const
Definition docnode.h:1137
bool hasInOutSpecifier() const
Definition docnode.h:1078
bool hasTypeSpecifier() const
Definition docnode.h:1079
Type type() const
Definition docnode.h:1077

References DocParamList::direction(), DocParamSect::Exception, FALSE, DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), DocParamSect::In, DocParamSect::InOut, m_hide, m_insideItem, m_t, DocParamSect::Out, DocParamList::paragraphs(), DocParamSect::Param, DocParamList::parameters(), DocParamList::paramTypes(), DocNode::parent(), DocParamSect::RetVal, DocParamSect::TemplateParam, TRUE, DocParamSect::type(), DocParamSect::Unknown, and DocParamSect::Unspecified.

◆ operator()() [37/59]

void LatexDocVisitor::operator() ( const DocParamSect & s)

Definition at line 1650 of file latexdocvisitor.cpp.

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 << "{";
1664 break;
1666 m_t << "\n\\begin{DoxyRetVals}{";
1668 break;
1670 m_t << "\n\\begin{DoxyExceptions}{";
1672 break;
1674 m_t << "\n\\begin{DoxyTemplParams}{";
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}
virtual QCString trExceptions()=0
virtual QCString trParameters()=0
virtual QCString trTemplateParameters()=0
virtual QCString trReturnValues()=0
#define ASSERT(x)
Definition qcstring.h:39

References ASSERT, decIndentLevel(), DocParamSect::Exception, filter(), DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), incIndentLevel(), m_hide, m_lcg, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, DocParamSect::type(), and visitChildren().

◆ operator()() [38/59]

void LatexDocVisitor::operator() ( const DocParBlock & pb)

Definition at line 1845 of file latexdocvisitor.cpp.

1846{
1847 if (m_hide) return;
1848 visitChildren(pb);
1849}

References m_hide, and visitChildren().

◆ operator()() [39/59]

void LatexDocVisitor::operator() ( const DocPlantUmlFile & df)

Definition at line 1550 of file latexdocvisitor.cpp.

1551{
1552 if (m_hide) return;
1553 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1554 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1555 visitChildren(df);
1557}
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endPlantUmlFile(bool hasCaption)

References Config_getBool, Config_getString, copyFile(), endPlantUmlFile(), DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), DocDiagramFileBase::height(), m_hide, DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), startPlantUmlFile(), stripPath(), visitChildren(), and DocDiagramFileBase::width().

◆ operator()() [40/59]

void LatexDocVisitor::operator() ( const DocRef & ref)

Definition at line 1577 of file latexdocvisitor.cpp.

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}
QCString anchor() const
Definition docnode.h:794
SectionType sectionType() const
Definition docnode.h:796
QCString targetTitle() const
Definition docnode.h:795
bool isSubPage() const
Definition docnode.h:801
bool refToTable() const
Definition docnode.h:800
QCString file() const
Definition docnode.h:791
QCString ref() const
Definition docnode.h:793
bool refToSection() const
Definition docnode.h:799
bool hasLinkText() const
Definition docnode.h:797

References DocRef::anchor(), endLink(), DocRef::file(), filter(), DocRef::hasLinkText(), QCString::isEmpty(), DocRef::isSubPage(), m_hide, DocRef::ref(), DocRef::refToSection(), DocRef::refToTable(), DocRef::sectionType(), startLink(), DocRef::targetTitle(), and visitChildren().

◆ operator()() [41/59]

void LatexDocVisitor::operator() ( const DocRoot & r)

Definition at line 814 of file latexdocvisitor.cpp.

815{
816 visitChildren(r);
817}

References visitChildren().

◆ operator()() [42/59]

void LatexDocVisitor::operator() ( const DocSecRefItem & ref)

Definition at line 1605 of file latexdocvisitor.cpp.

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}
bool refToTable() const
Definition docnode.h:952
QCString file() const
Definition docnode.h:948
QCString anchor() const
Definition docnode.h:949
QCString ref() const
Definition docnode.h:951
bool isSubPage() const
Definition docnode.h:953

References DocSecRefItem::anchor(), endLink(), DocSecRefItem::file(), QCString::isEmpty(), DocSecRefItem::isSubPage(), m_hide, m_t, DocSecRefItem::ref(), DocSecRefItem::refToTable(), startLink(), stripPath(), and visitChildren().

◆ operator()() [43/59]

void LatexDocVisitor::operator() ( const DocSecRefList & l)

Definition at line 1636 of file latexdocvisitor.cpp.

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}

References decIndentLevel(), incIndentLevel(), m_hide, m_t, and visitChildren().

◆ operator()() [44/59]

void LatexDocVisitor::operator() ( const DocSection & s)

Definition at line 995 of file latexdocvisitor.cpp.

996{
997 if (m_hide) return;
998 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
999 if (pdfHyperlinks)
1000 {
1001 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1002 }
1003 m_t << "\\" << getSectionName(s.level()) << "{";
1004 if (pdfHyperlinks)
1005 {
1006 m_t << "\\texorpdfstring{";
1007 }
1008 if (s.title())
1009 {
1010 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1011 std::visit(*this,*s.title());
1013 }
1014 if (pdfHyperlinks)
1015 {
1016 m_t << "}{";
1017 if (s.title())
1018 {
1019 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1020 std::visit(*this,*s.title());
1022 }
1023 m_t << "}";
1024 }
1025 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1026 visitChildren(s);
1027}
QCString file() const
Definition docnode.h:931
int level() const
Definition docnode.h:927
QCString anchor() const
Definition docnode.h:929
const DocNodeVariant * title() const
Definition docnode.h:928
@ TEX
called through texorpdf as TeX (first) part
@ NO
not called through texorpdf

References DocSection::anchor(), Config_getBool, DocSection::file(), getSectionName(), DocSection::level(), m_hide, m_t, m_texOrPdf, NO, PDF, stripPath(), TEX, DocSection::title(), and visitChildren().

◆ operator()() [45/59]

void LatexDocVisitor::operator() ( const DocSeparator & sep)

Definition at line 1704 of file latexdocvisitor.cpp.

1705{
1706 m_t << " " << sep.chars() << " ";
1707}
QCString chars() const
Definition docnode.h:369

References DocSeparator::chars(), and m_t.

◆ operator()() [46/59]

void LatexDocVisitor::operator() ( const DocSimpleList & l)

Definition at line 974 of file latexdocvisitor.cpp.

975{
976 if (m_hide) return;
977 m_t << "\\begin{DoxyItemize}\n";
978 m_listItemInfo[indentLevel()].isEnum = false;
979 visitChildren(l);
980 m_t << "\\end{DoxyItemize}\n";
981}

References indentLevel(), m_hide, m_listItemInfo, m_t, and visitChildren().

◆ operator()() [47/59]

void LatexDocVisitor::operator() ( const DocSimpleListItem & li)

Definition at line 983 of file latexdocvisitor.cpp.

984{
985 if (m_hide) return;
986 m_t << "\\item ";
988 if (li.paragraph())
989 {
990 visit(*this,*li.paragraph());
991 }
993}
const DocNodeVariant * paragraph() const
Definition docnode.h:1163

References decIndentLevel(), incIndentLevel(), m_hide, m_t, and DocSimpleListItem::paragraph().

◆ operator()() [48/59]

void LatexDocVisitor::operator() ( const DocSimpleSect & s)

Definition at line 819 of file latexdocvisitor.cpp.

820{
821 if (m_hide) return;
822 switch(s.type())
823 {
825 m_t << "\\begin{DoxySeeAlso}{";
827 break;
829 m_t << "\\begin{DoxyReturn}{";
831 break;
833 m_t << "\\begin{DoxyAuthor}{";
835 break;
837 m_t << "\\begin{DoxyAuthor}{";
839 break;
841 m_t << "\\begin{DoxyVersion}{";
843 break;
845 m_t << "\\begin{DoxySince}{";
847 break;
849 m_t << "\\begin{DoxyDate}{";
851 break;
853 m_t << "\\begin{DoxyNote}{";
855 break;
857 m_t << "\\begin{DoxyWarning}{";
859 break;
861 m_t << "\\begin{DoxyPrecond}{";
863 break;
865 m_t << "\\begin{DoxyPostcond}{";
867 break;
869 m_t << "\\begin{DoxyCopyright}{";
871 break;
873 m_t << "\\begin{DoxyInvariant}{";
875 break;
877 m_t << "\\begin{DoxyRemark}{";
879 break;
881 m_t << "\\begin{DoxyAttention}{";
883 break;
885 m_t << "\\begin{DoxyImportant}{";
887 break;
889 m_t << "\\begin{DoxyParagraph}{";
890 break;
892 m_t << "\\begin{DoxyParagraph}{";
893 break;
894 case DocSimpleSect::Unknown: break;
895 }
896
897 if (s.title())
898 {
900 std::visit(*this,*s.title());
902 }
903 m_t << "}\n";
905 visitChildren(s);
906 switch(s.type())
907 {
909 m_t << "\n\\end{DoxySeeAlso}\n";
910 break;
912 m_t << "\n\\end{DoxyReturn}\n";
913 break;
915 m_t << "\n\\end{DoxyAuthor}\n";
916 break;
918 m_t << "\n\\end{DoxyAuthor}\n";
919 break;
921 m_t << "\n\\end{DoxyVersion}\n";
922 break;
924 m_t << "\n\\end{DoxySince}\n";
925 break;
927 m_t << "\n\\end{DoxyDate}\n";
928 break;
930 m_t << "\n\\end{DoxyNote}\n";
931 break;
933 m_t << "\n\\end{DoxyWarning}\n";
934 break;
936 m_t << "\n\\end{DoxyPrecond}\n";
937 break;
939 m_t << "\n\\end{DoxyPostcond}\n";
940 break;
942 m_t << "\n\\end{DoxyCopyright}\n";
943 break;
945 m_t << "\n\\end{DoxyInvariant}\n";
946 break;
948 m_t << "\n\\end{DoxyRemark}\n";
949 break;
951 m_t << "\n\\end{DoxyAttention}\n";
952 break;
954 m_t << "\n\\end{DoxyImportant}\n";
955 break;
957 m_t << "\n\\end{DoxyParagraph}\n";
958 break;
960 m_t << "\n\\end{DoxyParagraph}\n";
961 break;
962 default:
963 break;
964 }
966}
Type type() const
Definition docnode.h:1035
const DocNodeVariant * title() const
Definition docnode.h:1042
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trVersion()=0
virtual QCString trReturns()=0
virtual QCString trRemarks()=0
virtual QCString trNote()=0
virtual QCString trPostcondition()=0
virtual QCString trAttention()=0
virtual QCString trCopyright()=0
virtual QCString trDate()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
virtual QCString trSeeAlso()=0
virtual QCString trImportant()=0
virtual QCString trInvariant()=0

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, decIndentLevel(), FALSE, filter(), DocSimpleSect::Important, incIndentLevel(), DocSimpleSect::Invar, m_hide, m_insideItem, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, DocSimpleSect::See, DocSimpleSect::Since, theTranslator, DocSimpleSect::title(), TRUE, DocSimpleSect::type(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [49/59]

void LatexDocVisitor::operator() ( const DocSimpleSectSep & )

Definition at line 680 of file latexdocvisitor.cpp.

681{
682}

◆ operator()() [50/59]

void LatexDocVisitor::operator() ( const DocStyleChange & s)

Definition at line 350 of file latexdocvisitor.cpp.

351{
352 if (m_hide) return;
353 switch (s.style())
354 {
356 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
357 break;
361 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
362 break;
365 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
366 break;
368 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
369 break;
373 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
374 break;
376 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
377 break;
379 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
380 break;
382 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
383 break;
385 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
386 break;
388 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
389 break;
391 if (s.enable())
392 {
393 m_t << "\n\\begin{DoxyPre}";
395 }
396 else
397 {
399 m_t << "\\end{DoxyPre}\n";
400 }
401 break;
402 case DocStyleChange::Div: /* HTML only */ break;
403 case DocStyleChange::Span: /* HTML only */ break;
404 }
405}
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable(), FALSE, DocStyleChange::Ins, DocStyleChange::Italic, DocStyleChange::Kbd, m_hide, m_insidePre, m_t, DocStyleChange::Preformatted, DocStyleChange::S, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::style(), DocStyleChange::Subscript, DocStyleChange::Superscript, TRUE, DocStyleChange::Typewriter, and DocStyleChange::Underline.

◆ operator()() [51/59]

void LatexDocVisitor::operator() ( const DocSymbol & s)

Definition at line 257 of file latexdocvisitor.cpp.

258{
259 if (m_hide) return;
260 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
261 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
262 if (res)
263 {
265 {
266 if (pdfHyperlinks)
267 {
268 m_t << "\\texorpdfstring{$<$}{<}";
269 }
270 else
271 {
272 m_t << "$<$";
273 }
274 }
276 {
277 if (pdfHyperlinks)
278 {
279 m_t << "\\texorpdfstring{$>$}{>}";
280 }
281 else
282 {
283 m_t << "$>$";
284 }
285 }
286 else
287 {
288 m_t << res;
289 }
290 }
291 else
292 {
293 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
294 }
295}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
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.

References Config_getBool, err, HtmlEntityMapper::instance(), HtmlEntityMapper::latex(), m_hide, m_insidePre, m_t, HtmlEntityMapper::Sym_Greater, HtmlEntityMapper::Sym_gt, HtmlEntityMapper::Sym_Less, HtmlEntityMapper::Sym_lt, DocSymbol::symbol(), and TRUE.

◆ operator()() [52/59]

void LatexDocVisitor::operator() ( const DocText & t)

Definition at line 1825 of file latexdocvisitor.cpp.

1826{
1827 if (m_hide) return;
1828 visitChildren(t);
1829}

References m_hide, and visitChildren().

◆ operator()() [53/59]

void LatexDocVisitor::operator() ( const DocTitle & t)

Definition at line 968 of file latexdocvisitor.cpp.

969{
970 if (m_hide) return;
971 visitChildren(t);
972}

References m_hide, and visitChildren().

◆ operator()() [54/59]

void LatexDocVisitor::operator() ( const DocURL & u)

Definition at line 314 of file latexdocvisitor.cpp.

315{
316 if (m_hide) return;
317 if (Config_getBool(PDF_HYPERLINKS))
318 {
319 m_t << "\\href{";
320 if (u.isEmail()) m_t << "mailto:";
321 m_t << latexFilterURL(u.url()) << "}";
322 }
323 m_t << "{\\texttt{";
324 filter(u.url());
325 m_t << "}}";
326}
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193

References Config_getBool, filter(), DocURL::isEmail(), latexFilterURL(), m_hide, m_t, and DocURL::url().

◆ operator()() [55/59]

void LatexDocVisitor::operator() ( const DocVerbatim & s)

Definition at line 407 of file latexdocvisitor.cpp.

408{
409 if (m_hide) return;
410 QCString lang = m_langExt;
411 if (!s.language().isEmpty()) // explicit language setting
412 {
413 lang = s.language();
414 }
415 SrcLangExt langExt = getLanguageFromCodeLang(lang);
416 switch(s.type())
417 {
419 {
420 m_ci.startCodeFragment("DoxyCode");
421 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
422 Config_getBool(STRIP_CODE_COMMENTS),
423 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
424 m_ci.endCodeFragment("DoxyCode");
425 }
426 break;
428 filter(s.text(), true);
429 break;
431 m_t << "{\\ttfamily ";
432 filter(s.text(), true);
433 m_t << "}";
434 break;
436 if (isTableNested(s.parent())) // in table
437 {
438 m_t << "\\begin{DoxyCode}{0}";
439 filter(s.text(), true);
440 m_t << "\\end{DoxyCode}\n";
441 }
442 else
443 {
444 m_t << "\\begin{DoxyVerb}";
445 m_t << s.text();
446 m_t << "\\end{DoxyVerb}\n";
447 }
448 break;
454 /* nothing */
455 break;
457 m_t << s.text();
458 break;
459 case DocVerbatim::Dot:
460 {
461 bool exists = false;
462 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
463 ".dot", // extension
464 s.text(), // contents
465 exists);
466 if (!fileName.isEmpty())
467 {
468 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
469 visitChildren(s);
471 }
472 }
473 break;
474 case DocVerbatim::Msc:
475 {
476 bool exists = false;
477 auto fileName = writeFileContents(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
478 ".msc", // extension
479 "msc {"+s.text()+"}", // contents
480 exists);
481 if (!fileName.isEmpty())
482 {
483 writeMscFile(fileName, s, !exists);
484 }
485 }
486 break;
488 {
489 QCString latexOutput = Config_getString(LATEX_OUTPUT);
490 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
491 latexOutput,s.exampleFile(),s.text(),
493 s.engine(),s.srcFile(),s.srcLine(),true);
494
495 for (const auto &baseName: baseNameVector)
496 {
497 writePlantUMLFile(baseName, s);
498 }
499 }
500 break;
502 if (Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
503 {
504 QCString latexOutput = Config_getString(LATEX_OUTPUT);
505 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
506 QCString baseName = MermaidManager::instance().writeMermaidSource(
507 latexOutput,s.exampleFile(),s.text(),
509 s.srcFile(),s.srcLine());
510 writeMermaidFile(baseName, s);
511 }
512 break;
513 }
514}
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
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
void writeMermaidFile(const QCString &baseName, const DocVerbatim &s)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
QCString writeMermaidSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &srcFile, int srcLine)
Write a Mermaid source file and register it for CLI rendering.
Definition mermaid.cpp:53
static MermaidManager & instance()
Definition mermaid.cpp:32
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
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5239

References MermaidManager::Bitmap, DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, endDotFile(), DocVerbatim::engine(), DocVerbatim::exampleFile(), filter(), DocVisitor::getCodeParser(), getLanguageFromCodeLang(), DocVerbatim::hasCaption(), DocVerbatim::height(), DocVerbatim::HtmlOnly, MermaidManager::instance(), PlantumlManager::instance(), QCString::isEmpty(), DocVerbatim::isExample(), isTableNested(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language(), DocVerbatim::LatexOnly, m_ci, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Mermaid, DocVerbatim::Msc, DocNode::parent(), CodeParserInterface::parseCode(), MermaidManager::PDF, DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_EPS, DocVerbatim::RtfOnly, DocVerbatim::srcFile(), DocVerbatim::srcLine(), startDotFile(), DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::useBitmap(), DocVerbatim::Verbatim, visitChildren(), DocVerbatim::width(), writeFileContents(), writeMermaidFile(), MermaidManager::writeMermaidSource(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [56/59]

void LatexDocVisitor::operator() ( const DocVhdlFlow & )

Definition at line 1841 of file latexdocvisitor.cpp.

1842{
1843}

◆ operator()() [57/59]

void LatexDocVisitor::operator() ( const DocWhiteSpace & w)

Definition at line 244 of file latexdocvisitor.cpp.

245{
246 if (m_hide) return;
247 if (m_insidePre)
248 {
249 m_t << w.chars();
250 }
251 else
252 {
253 m_t << " ";
254 }
255}
QCString chars() const
Definition docnode.h:358

References DocWhiteSpace::chars(), m_hide, m_insidePre, and m_t.

◆ operator()() [58/59]

void LatexDocVisitor::operator() ( const DocWord & w)

Definition at line 230 of file latexdocvisitor.cpp.

231{
232 if (m_hide) return;
233 filter(w.word());
234}
QCString word() const
Definition docnode.h:156

References filter(), m_hide, and DocWord::word().

◆ operator()() [59/59]

void LatexDocVisitor::operator() ( const DocXRefItem & x)

Definition at line 1784 of file latexdocvisitor.cpp.

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}
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626

References DocXRefItem::anchor(), Config_getBool, decIndentLevel(), FALSE, DocXRefItem::file(), filter(), incIndentLevel(), QCString::isEmpty(), m_hide, m_insideItem, m_t, stripPath(), DocXRefItem::title(), TRUE, and visitChildren().

◆ popTableState()

void LatexDocVisitor::popTableState ( )
inlineprivate

Definition at line 213 of file latexdocvisitor.h.

214 {
215 m_tableStateStack.pop();
216 }

References m_tableStateStack.

Referenced by operator()().

◆ pushTableState()

void LatexDocVisitor::pushTableState ( )
inlineprivate

Definition at line 209 of file latexdocvisitor.h.

210 {
211 m_tableStateStack.emplace();
212 }

References m_tableStateStack.

Referenced by operator()().

◆ rowSpans()

RowSpanList & LatexDocVisitor::rowSpans ( )
inlineprivate

Definition at line 229 of file latexdocvisitor.h.

230 {
231 return !m_tableStateStack.empty() ? m_tableStateStack.top().rowSpans : m_emptyRowSpanList;
232 }
RowSpanList m_emptyRowSpanList

References m_emptyRowSpanList, and m_tableStateStack.

Referenced by operator()(), and operator()().

◆ setCurrentColumn()

void LatexDocVisitor::setCurrentColumn ( size_t col)
inlineprivate

Definition at line 221 of file latexdocvisitor.h.

222 {
223 if (!m_tableStateStack.empty()) m_tableStateStack.top().currentColumn = col;
224 }

References m_tableStateStack.

Referenced by operator()(), and operator()().

◆ setNumCols()

void LatexDocVisitor::setNumCols ( size_t num)
inlineprivate

Definition at line 225 of file latexdocvisitor.h.

226 {
227 if (!m_tableStateStack.empty()) m_tableStateStack.top().numCols = num;
228 }

References m_tableStateStack.

Referenced by operator()().

◆ startDiaFile()

void LatexDocVisitor::startDiaFile ( const QCString & fileName,
const QCString & width,
const QCString & height,
bool hasCaption,
const QCString & srcFile,
int srcLine,
bool newFile = true )
private

Definition at line 1990 of file latexdocvisitor.cpp.

1997{
1998 QCString baseName=makeBaseName(fileName,".dia");
1999 baseName.prepend("dia_");
2000
2001 QCString outDir = Config_getString(LATEX_OUTPUT);
2002 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2003 visitPreStart(m_t,hasCaption, baseName, width, height);
2004}
QCString & prepend(const char *s)
Definition qcstring.h:422
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4975

References Config_getString, EPS, m_t, makeBaseName(), QCString::prepend(), visitPreStart(), and writeDiaGraphFromFile().

Referenced by operator()().

◆ startDotFile()

void LatexDocVisitor::startDotFile ( const QCString & fileName,
const QCString & width,
const QCString & height,
bool hasCaption,
const QCString & srcFile,
int srcLine,
bool newFile = true )
private

Definition at line 1936 of file latexdocvisitor.cpp.

1943{
1944 QCString baseName=makeBaseName(fileName,".dot");
1945 baseName.prepend("dot_");
1946 QCString outDir = Config_getString(LATEX_OUTPUT);
1947 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1948 visitPreStart(m_t,hasCaption, baseName, width, height);
1949}
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230

References Config_getString, EPS, m_t, makeBaseName(), QCString::prepend(), visitPreStart(), and writeDotGraphFromFile().

Referenced by operator()(), and operator()().

◆ startLink()

void LatexDocVisitor::startLink ( const QCString & ref,
const QCString & file,
const QCString & anchor,
bool refToTable = false,
bool refToSection = false )
private

Definition at line 1864 of file latexdocvisitor.cpp.

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}

References Config_getBool, QCString::isEmpty(), m_t, m_texOrPdf, PDF, stripPath(), and TEX.

Referenced by operator()(), operator()(), operator()(), operator()(), and operator()().

◆ startMermaidFile()

void LatexDocVisitor::startMermaidFile ( const QCString & fileName,
const QCString & width,
const QCString & height,
bool hasCaption,
const QCString & srcFile,
int srcLine )
private

Definition at line 2080 of file latexdocvisitor.cpp.

2087{
2088 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2089 QCString outDir = Config_getString(LATEX_OUTPUT);
2090 std::string inBuf;
2091 readInputFile(fileName,inBuf);
2092
2093 QCString baseName = MermaidManager::instance().writeMermaidSource(
2094 outDir,QCString(),inBuf,
2096 srcFile,srcLine);
2097 QCString shortName = stripPath(baseName);
2098 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2099 if (shortName.find('.')==-1) shortName += usePDFLatex ? ".pdf" : ".png";
2101 visitPreStart(m_t,hasCaption, shortName, width, height);
2102}
void generateMermaidOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Register a generated Mermaid image with the index.
Definition mermaid.cpp:106
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43

References MermaidManager::Bitmap, Config_getBool, Config_getString, QCString::find(), MermaidManager::generateMermaidOutput(), MermaidManager::instance(), m_t, MermaidManager::PDF, readInputFile(), stripPath(), visitPreStart(), and MermaidManager::writeMermaidSource().

Referenced by operator()().

◆ startMscFile()

void LatexDocVisitor::startMscFile ( const QCString & fileName,
const QCString & width,
const QCString & height,
bool hasCaption,
const QCString & srcFile,
int srcLine,
bool newFile = true )
private

Definition at line 1957 of file latexdocvisitor.cpp.

1964{
1965 QCString baseName=makeBaseName(fileName,".msc");
1966 baseName.prepend("msc_");
1967
1968 QCString outDir = Config_getString(LATEX_OUTPUT);
1969 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1970 visitPreStart(m_t,hasCaption, baseName, width, height);
1971}
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157

References Config_getString, EPS, m_t, makeBaseName(), QCString::prepend(), visitPreStart(), and writeMscGraphFromFile().

Referenced by operator()().

◆ startPlantUmlFile()

void LatexDocVisitor::startPlantUmlFile ( const QCString & fileName,
const QCString & width,
const QCString & height,
bool hasCaption,
const QCString & srcFile,
int srcLine )
private

Definition at line 2027 of file latexdocvisitor.cpp.

2034{
2035 QCString outDir = Config_getString(LATEX_OUTPUT);
2036 std::string inBuf;
2037 readInputFile(fileName,inBuf);
2038
2039 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2040 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2041 outDir,QCString(),inBuf,
2043 QCString(),srcFile,srcLine,false);
2044 bool first = true;
2045 for (const auto &bName: baseNameVector)
2046 {
2047 QCString baseName = makeBaseName(bName,".pu");
2048 QCString shortName = stripPath(baseName);
2049 if (useBitmap)
2050 {
2051 if (shortName.find('.')==-1) shortName += ".png";
2052 }
2055 if (!first) endPlantUmlFile(hasCaption);
2056 first = false;
2057 visitPreStart(m_t,hasCaption, shortName, width, height);
2058 }
2059}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202

References Config_getString, endPlantUmlFile(), QCString::find(), PlantumlManager::generatePlantUMLOutput(), PlantumlManager::instance(), m_t, makeBaseName(), PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_EPS, readInputFile(), stripPath(), visitPreStart(), and PlantumlManager::writePlantUMLSource().

Referenced by operator()().

◆ visitCaption()

void LatexDocVisitor::visitCaption ( const DocNodeList & children)
private

Definition at line 210 of file latexdocvisitor.cpp.

211{
212 for (const auto &n : children)
213 {
214 std::visit(*this,n);
215 }
216}

Referenced by writeMermaidFile(), writeMscFile(), and writePlantUMLFile().

◆ visitChildren()

◆ writeEndTableCommand()

void LatexDocVisitor::writeEndTableCommand ( const DocNodeVariant * n)
private

Definition at line 1211 of file latexdocvisitor.cpp.

1212{
1213 if (isTableNested(n))
1214 {
1215 m_t << "\\end{DoxyTableNested}\n";
1216 }
1217 else
1218 {
1219 m_t << "\\end{DoxyTable}\n";
1220 }
1221}

References isTableNested(), and m_t.

Referenced by operator()().

◆ writeMermaidFile()

void LatexDocVisitor::writeMermaidFile ( const QCString & baseName,
const DocVerbatim & s )
private

Definition at line 2067 of file latexdocvisitor.cpp.

2068{
2069 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2070 QCString shortName = stripPath(baseName);
2071 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2072 if (shortName.find('.')==-1) shortName += usePDFLatex ? ".pdf" : ".png";
2073 QCString outDir = Config_getString(LATEX_OUTPUT);
2075 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2078}
const DocNodeList & children() const
Definition docnode.h:395
void visitCaption(const DocNodeList &children)

References MermaidManager::Bitmap, DocVerbatim::children(), Config_getBool, Config_getString, QCString::find(), MermaidManager::generateMermaidOutput(), DocVerbatim::hasCaption(), DocVerbatim::height(), MermaidManager::instance(), m_t, MermaidManager::PDF, stripPath(), visitCaption(), visitPostEnd(), visitPreStart(), and DocVerbatim::width().

Referenced by operator()().

◆ writeMscFile()

void LatexDocVisitor::writeMscFile ( const QCString & fileName,
const DocVerbatim & s,
bool newFile = true )
private

Definition at line 1980 of file latexdocvisitor.cpp.

1981{
1982 QCString shortName=makeBaseName(fileName,".msc");
1983 QCString outDir = Config_getString(LATEX_OUTPUT);
1984 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
1985 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1988}

References DocVerbatim::children(), Config_getString, EPS, DocVerbatim::hasCaption(), DocVerbatim::height(), m_t, makeBaseName(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), visitCaption(), visitPostEnd(), visitPreStart(), DocVerbatim::width(), and writeMscGraphFromFile().

Referenced by operator()().

◆ writePlantUMLFile()

void LatexDocVisitor::writePlantUMLFile ( const QCString & fileName,
const DocVerbatim & s )
private

◆ writeStartTableCommand()

void LatexDocVisitor::writeStartTableCommand ( const DocNodeVariant * n,
size_t cols )
private

Definition at line 1199 of file latexdocvisitor.cpp.

1200{
1201 if (isTableNested(n))
1202 {
1203 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1204 }
1205 else
1206 {
1207 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1208 }
1209}

References isTableNested(), and m_t.

Referenced by operator()().

Member Data Documentation

◆ m_ci

OutputCodeList& LatexDocVisitor::m_ci
private

Definition at line 181 of file latexdocvisitor.h.

Referenced by LatexDocVisitor(), operator()(), operator()(), and operator()().

◆ m_emptyRowSpanList

RowSpanList LatexDocVisitor::m_emptyRowSpanList
private

Definition at line 197 of file latexdocvisitor.h.

Referenced by rowSpans().

◆ m_hide

◆ m_hierarchyLevel

int LatexDocVisitor::m_hierarchyLevel
private

Definition at line 187 of file latexdocvisitor.h.

Referenced by getSectionName(), and LatexDocVisitor().

◆ m_indentLevel

int LatexDocVisitor::m_indentLevel = 0
private

◆ m_insideItem

bool LatexDocVisitor::m_insideItem
private

◆ m_insidePre

bool LatexDocVisitor::m_insidePre
private

Definition at line 183 of file latexdocvisitor.h.

Referenced by filter(), LatexDocVisitor(), operator()(), operator()(), and operator()().

◆ m_langExt

QCString LatexDocVisitor::m_langExt
private

Definition at line 186 of file latexdocvisitor.h.

Referenced by LatexDocVisitor(), operator()(), and operator()().

◆ m_lcg

LatexCodeGenerator& LatexDocVisitor::m_lcg
private

Definition at line 182 of file latexdocvisitor.h.

Referenced by filter(), isTableNested(), LatexDocVisitor(), and operator()().

◆ m_listItemInfo

LatexListItemInfo LatexDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 207 of file latexdocvisitor.h.

Referenced by operator()(), operator()(), operator()(), and operator()().

◆ m_t

◆ m_tableStateStack

std::stack<TableState> LatexDocVisitor::m_tableStateStack
private

◆ m_texOrPdf

TexOrPdf LatexDocVisitor::m_texOrPdf = TexOrPdf::NO
private

Definition at line 188 of file latexdocvisitor.h.

Referenced by endLink(), operator()(), operator()(), and startLink().

◆ maxIndentLevels

const int LatexDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 199 of file latexdocvisitor.h.

Referenced by incIndentLevel(), indentLevel(), operator()(), and operator()().


The documentation for this class was generated from the following files: