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

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 DString &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 DString &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 DString &str, const bool retainNewLine=false, const bool citeEntry=false)
void startLink (const DString &ref, const DString &file, const DString &anchor, bool refToTable=false, bool refToSection=false)
void endLink (const DString &ref, const DString &file, const DString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void startDotFile (const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine, bool newFile=true)
void endDotFile (bool hasCaption)
void startMscFile (const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine, bool newFile=true)
void endMscFile (bool hasCaption)
void writeMscFile (const DString &fileName, const DocVerbatim &s, bool newFile=true)
void startDiaFile (const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine, bool newFile=true)
void endDiaFile (bool hasCaption)
void writePlantUMLFile (const DString &fileName, const DocVerbatim &s)
void startPlantUmlFile (const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine)
void endPlantUmlFile (bool hasCaption)
void writeMermaidFile (const DString &baseName, const DocVerbatim &s)
void startMermaidFile (const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &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
bool m_captionTable
DString 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 DString & langExt,
int hierarchyLevel = 0 )

Definition at line 220 of file latexdocvisitor.cpp.

222 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(false),
223 m_insideItem(false), m_hide(false), m_captionTable(false),
224 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
225{
226}
OutputCodeList & m_ci
LatexCodeGenerator & m_lcg

References m_captionTable, 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 234 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ currentColumn()

size_t LatexDocVisitor::currentColumn ( ) const
inlineprivate

Definition at line 218 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ decIndentLevel()

void LatexDocVisitor::decIndentLevel ( )
private

Definition at line 2134 of file latexdocvisitor.cpp.

2135{
2136 if (m_indentLevel>0)
2137 {
2138 m_indentLevel--;
2139 }
2140}

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 2014 of file latexdocvisitor.cpp.

2015{
2016 if (m_hide) return;
2017 visitPostEnd(m_t,hasCaption);
2018}
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 1959 of file latexdocvisitor.cpp.

1960{
1961 if (m_hide) return;
1962 visitPostEnd(m_t,hasCaption);
1963}

References m_hide, m_t, and visitPostEnd().

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

◆ endLink()

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

Definition at line 1919 of file latexdocvisitor.cpp.

1920{
1921 m_t << "}";
1922 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1923 if (ref.empty() && !pdfHyperLinks)
1924 {
1925 m_t << "{";
1927 m_t << "}{" << file;
1928 if (!file.empty() && !anchor.empty()) m_t << "_";
1929 m_t << anchor << "}";
1930 if (refToSection)
1931 {
1932 m_t << "{" << sectionType.level() << "}";
1933 }
1934 }
1935 if (ref.empty() && pdfHyperLinks) // internal PDF link
1936 {
1937 if (refToSection)
1938 {
1939 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1940 }
1941 }
1942}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
void filter(const DString &str, const bool retainNewLine=false, const bool citeEntry=false)
constexpr int level() const
Definition section.h:46
virtual DString trPageAbbreviation()=0
#define Config_getBool(name)
Definition config.h:33
Translator * theTranslator
Definition language.cpp:76
@ PDF
called through texorpdf as PDF (second) part

References Config_getBool, DString::empty(), filter(), SectionType::level(), m_t, m_texOrPdf, PDF, theTranslator, and Translator::trPageAbbreviation().

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

◆ endMermaidFile()

void LatexDocVisitor::endMermaidFile ( bool hasCaption)
private

Definition at line 2114 of file latexdocvisitor.cpp.

2115{
2116 if (m_hide) return;
2117 visitPostEnd(m_t,hasCaption);
2118}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endMscFile()

void LatexDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 1981 of file latexdocvisitor.cpp.

1982{
1983 if (m_hide) return;
1984 visitPostEnd(m_t,hasCaption);
1985}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2069 of file latexdocvisitor.cpp.

2070{
2071 if (m_hide) return;
2072 visitPostEnd(m_t,hasCaption);
2073}

References m_hide, m_t, and visitPostEnd().

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

◆ filter()

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

Definition at line 1859 of file latexdocvisitor.cpp.

1860{
1861 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1866 m_lcg.usedTableLevel()>0, // insideTable
1867 false, // keepSpaces
1868 retainNewLine
1869 );
1870}
int usedTableLevel() const
Definition latexgen.h:65
bool insideTabbing() const
Definition latexgen.h:70
void filterLatexString(TextStream &t, const DString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)

References filterLatexString(), LatexCodeGenerator::insideTabbing(), m_insideItem, m_insidePre, m_lcg, m_t, and LatexCodeGenerator::usedTableLevel().

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 62 of file latexdocvisitor.cpp.

63{
64 bool compactLatex = Config_getBool(COMPACT_LATEX);
65 int l = level;
66 if (compactLatex) l++;
67
68 if (l < g_maxLevels)
69 {
70 l += m_hierarchyLevel; /* May be -1 if generating main page */
71 // Sections get special treatment because they inherit the parent's level
72 if (l >= g_maxLevels)
73 {
74 l = g_maxLevels - 1;
75 }
76 else if (l < 0)
77 {
78 /* Should not happen; level is always >= 1 and hierarchyLevel >= -1 */
79 l = 0;
80 }
81 return g_secLabels[l];
82 }
83 else if (l == 7)
84 {
85 return g_paragraphLabel;
86 }
87 else
88 {
90 }
91}
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 2125 of file latexdocvisitor.cpp.

2126{
2127 m_indentLevel++;
2129 {
2130 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2131 }
2132}
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 2120 of file latexdocvisitor.cpp.

2121{
2122 return std::min(m_indentLevel,maxIndentLevels-1);
2123}

References m_indentLevel, and maxIndentLevels.

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

◆ insideTable()

bool LatexDocVisitor::insideTable ( ) const
inlineprivate

Definition at line 238 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ isTableNested()

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

Definition at line 1194 of file latexdocvisitor.cpp.

1195{
1196 bool isNested=m_lcg.usedTableLevel()>0;
1197 while (n && !isNested)
1198 {
1200 n = ::parent(n);
1201 }
1202 return isNested;
1203}
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1371
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:1335

References holds_one_of_alternatives(), m_lcg, parent(), and LatexCodeGenerator::usedTableLevel().

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

◆ operator()() [1/59]

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

Definition at line 522 of file latexdocvisitor.cpp.

523{
524 if (m_hide) return;
525 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
526 if (!anc.file().empty() && Config_getBool(PDF_HYPERLINKS))
527 {
528 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
529 << "}%\n";
530 }
531}
DString anchor() const
Definition docnode.h:232
DString file() const
Definition docnode.h:233
DString stripPath(const DString &s)
Definition util.cpp:3960

References DocAnchor::anchor(), Config_getBool, DString::empty(), DocAnchor::file(), m_hide, m_t, and stripPath().

◆ operator()() [2/59]

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

Definition at line 753 of file latexdocvisitor.cpp.

754{
755 if (m_hide) return;
756 if (m_indentLevel>=maxIndentLevels-1) return;
757 if (l.isEnumList())
758 {
759 m_t << "\n\\begin{DoxyEnumerate}";
761 }
762 else
763 {
765 m_t << "\n\\begin{DoxyItemize}";
766 }
767 visitChildren(l);
768 if (l.isEnumList())
769 {
770 m_t << "\n\\end{DoxyEnumerate}";
771 }
772 else
773 {
774 m_t << "\n\\end{DoxyItemize}";
775 }
776}
bool isEnumList() const
Definition docnode.h:580
LatexListItemInfo m_listItemInfo[maxIndentLevels]
void visitChildren(const T &t)

References indentLevel(), LatexDocVisitor::LatexListItemInfo::isEnum, 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 778 of file latexdocvisitor.cpp.

779{
780 if (m_hide) return;
781 switch (li.itemNumber())
782 {
783 case DocAutoList::Unchecked: // unchecked
784 m_t << "\n\\item[\\DoxyUnchecked] ";
785 break;
786 case DocAutoList::Checked_x: // checked with x
787 case DocAutoList::Checked_X: // checked with X
788 m_t << "\n\\item[\\DoxyChecked] ";
789 break;
790 default:
791 m_t << "\n\\item ";
792 break;
793 }
795 visitChildren(li);
797}
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 690 of file latexdocvisitor.cpp.

691{
692 if (m_hide) return;
693 auto opt = cite.option();
694 DString txt;
695 if (opt.noCite())
696 {
697 if (!cite.file().empty())
698 {
699 txt = cite.getText();
700 }
701 else
702 {
703 if (!opt.noPar()) txt += "[";
704 txt += cite.target();
705 if (!opt.noPar()) txt += "]";
706 }
707 m_t << "{\\bfseries ";
708 filter(txt);
709 m_t << "}";
710 }
711 else
712 {
713 if (!cite.file().empty())
714 {
715 DString anchor = cite.anchor();
716 DString anchorPrefix = CitationManager::instance().anchorPrefix();
717 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
718
719 txt = "\\DoxyCite{" + anchor + "}";
720 if (opt.isNumber())
721 {
722 txt += "{number}";
723 }
724 else if (opt.isShortAuthor())
725 {
726 txt += "{shortauthor}";
727 }
728 else if (opt.isYear())
729 {
730 txt += "{year}";
731 }
732 if (!opt.noPar()) txt += "{1}";
733 else txt += "{0}";
734
735 m_t << txt;
736 }
737 else
738 {
739 if (!opt.noPar()) txt += "[";
740 txt += cite.target();
741 if (!opt.noPar()) txt += "]";
742 m_t << "{\\bfseries ";
743 filter(txt);
744 m_t << "}";
745 }
746 }
747}
static CitationManager & instance()
Definition cite.cpp:90
DString anchorPrefix() const
Definition cite.cpp:131
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
DString getText() const
Definition docnode.cpp:979
DString anchor() const
Definition docnode.h:251
CiteInfoOption option() const
Definition docnode.h:253
DString target() const
Definition docnode.h:252
DString file() const
Definition docnode.h:248

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

◆ operator()() [5/59]

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

Definition at line 1538 of file latexdocvisitor.cpp.

1539{
1540 if (m_hide) return;
1541 bool exists = false;
1542 std::string inBuf;
1543 if (readInputFile(df.file(),inBuf))
1544 {
1545 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1546 ".dia", // extension
1547 inBuf, // contents
1548 exists);
1549 if (!fileName.empty())
1550 {
1551 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1552 visitChildren(df);
1553 endDiaFile(df.hasCaption());
1554 }
1555 }
1556}
DString file() const
Definition docnode.h:685
DString srcFile() const
Definition docnode.h:691
DString width() const
Definition docnode.h:688
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
DString height() const
Definition docnode.h:689
void endDiaFile(bool hasCaption)
void startDiaFile(const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine, bool newFile=true)
#define Config_getString(name)
Definition config.h:32
DString writeInlineGraph(const DString &baseName, const DString &extension, const DString &content, bool &exists)
Definition util.cpp:5358
bool readInputFile(const DString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:4374

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

◆ operator()() [6/59]

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

Definition at line 1498 of file latexdocvisitor.cpp.

1499{
1500 if (m_hide) return;
1501 bool exists = false;
1502 std::string inBuf;
1503 if (readInputFile(df.file(),inBuf))
1504 {
1505 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1506 ".dot", // extension
1507 inBuf, // contents
1508 exists);
1509 if (!fileName.empty())
1510 {
1511 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1512 visitChildren(df);
1513 endDotFile(df.hasCaption());
1514 }
1515 }
1516}
void endDotFile(bool hasCaption)
void startDotFile(const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &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 writeInlineGraph().

◆ operator()() [7/59]

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

Definition at line 299 of file latexdocvisitor.cpp.

300{
301 if (m_hide) return;
302 DString emojiName = EmojiEntityMapper::instance().name(s.index());
303 if (!emojiName.empty())
304 {
305 DString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
306 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
307 filter(emojiName);
308 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
309 }
310 else
311 {
312 m_t << s.name();
313 }
314}
int index() const
Definition docnode.h:345
DString name() const
Definition docnode.h:344
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2029
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1981

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

◆ operator()() [8/59]

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

Definition at line 661 of file latexdocvisitor.cpp.

662{
663 if (m_hide) return;
664 DString s = f.text();
665 const char *p = s.data();
666 char c = 0;
667 if (p)
668 {
669 while ((c=*p++))
670 {
671 switch (c)
672 {
673 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
674 default: m_t << c; break;
675 }
676 }
677 }
678}
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
DString text() const
Definition docnode.h:533

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

◆ operator()() [9/59]

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

Definition at line 347 of file latexdocvisitor.cpp.

348{
349 if (m_hide) return;
350 if (insideTable())
351 m_t << "\\DoxyHorRuler{1}\n";
352 else
353 m_t << "\\DoxyHorRuler{0}\n";
354}
bool insideTable() const

References insideTable(), m_hide, and m_t.

◆ operator()() [10/59]

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

Definition at line 1427 of file latexdocvisitor.cpp.

1428{
1429 if (m_hide) return;
1430 if (Config_getBool(PDF_HYPERLINKS))
1431 {
1432 m_t << "\\href{";
1433 m_t << latexFilterURL(href.url());
1434 m_t << "}";
1435 }
1436 m_t << "{\\texttt{";
1437 visitChildren(href);
1438 m_t << "}}";
1439}
DString url() const
Definition docnode.h:839
DString latexFilterURL(const DString &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 1839 of file latexdocvisitor.cpp.

1840{
1841 if (m_hide) return;
1842 m_t << "\\begin{quote}\n";
1844 visitChildren(q);
1845 m_t << "\\end{quote}\n";
1847}

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

◆ operator()() [12/59]

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

Definition at line 1276 of file latexdocvisitor.cpp.

1277{
1278 if (m_hide) return;
1279 visitChildren(c);
1280}

References m_hide, and visitChildren().

◆ operator()() [13/59]

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

Definition at line 1312 of file latexdocvisitor.cpp.

1313{
1314 if (m_hide) return;
1315 //printf("Cell(r=%u,c=%u) rowSpan=%d colSpan=%d currentColumn()=%zu\n",c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),currentColumn());
1316
1318
1319 DString cellOpts;
1320 DString cellSpec;
1321 auto appendOpt = [&cellOpts](const DString &s)
1322 {
1323 if (!cellOpts.empty()) cellOpts+=",";
1324 cellOpts+=s;
1325 };
1326 auto appendSpec = [&cellSpec](const DString &s)
1327 {
1328 if (!cellSpec.empty()) cellSpec+=",";
1329 cellSpec+=s;
1330 };
1331 auto writeCell = [this,&cellOpts,&cellSpec]()
1332 {
1333 if (!cellOpts.empty() || !cellSpec.empty())
1334 {
1335 m_t << "\\SetCell";
1336 if (!cellOpts.empty())
1337 {
1338 m_t << "[" << cellOpts << "]";
1339 }
1340 m_t << "{" << cellSpec << "}";
1341 }
1342 };
1343
1344 // skip over columns that have a row span starting at an earlier row
1345 for (const auto &span : rowSpans())
1346 {
1347 //printf("span(r=%u,c=%u): column=%zu colSpan=%zu,rowSpan=%zu currentColumn()=%zu\n",
1348 // span.cell.rowIndex(),span.cell.columnIndex(),
1349 // span.column,span.colSpan,span.rowSpan,
1350 // currentColumn());
1351 if (span.rowSpan>0 && span.column==currentColumn())
1352 {
1353 setCurrentColumn(currentColumn()+span.colSpan);
1354 for (size_t i=0;i<span.colSpan;i++)
1355 {
1356 m_t << "&";
1357 }
1358 }
1359 }
1360
1361 int cs = c.colSpan();
1362 int ha = c.alignment();
1363 int rs = c.rowSpan();
1364 int va = c.valignment();
1365
1366 switch (ha) // horizontal alignment
1367 {
1368 case DocHtmlCell::Right:
1369 appendSpec("r");
1370 break;
1372 appendSpec("c");
1373 break;
1374 default:
1375 // default
1376 break;
1377 }
1378 if (rs>0) // row span
1379 {
1380 appendOpt("r="+DString().setNum(rs));
1381 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%zu\n",
1382 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1383 // currentColumn());
1385 }
1386 if (cs>1) // column span
1387 {
1388 // update column to the end of the span, needs to be done *after* calling addRowSpan()
1390 appendOpt("c="+DString().setNum(cs));
1391 }
1392 if (c.isHeading())
1393 {
1394 appendSpec("bg=\\tableheadbgcolor");
1395 appendSpec("font=\\bfseries");
1396 }
1397 switch(va) // vertical alignment
1398 {
1399 case DocHtmlCell::Top:
1400 appendSpec("h");
1401 break;
1403 appendSpec("f");
1404 break;
1406 // default
1407 break;
1408 }
1409 writeCell();
1410
1411 visitChildren(c);
1412
1413 for (int i=0;i<cs-1;i++)
1414 {
1415 m_t << "&"; // placeholder for invisible cell
1416 }
1417
1418 if (!c.isLast()) m_t << "&";
1419}
Valignment valignment() const
Definition docnode.cpp:2064
uint32_t rowSpan() const
Definition docnode.cpp:2002
Alignment alignment() const
Definition docnode.cpp:2026
bool isLast() const
Definition docnode.h:1207
bool isHeading() const
Definition docnode.h:1205
uint32_t colSpan() const
Definition docnode.cpp:2014
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(), DString::empty(), 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 1185 of file latexdocvisitor.cpp.

1186{
1188 if (!m_insideItem) m_t << "\\hfill";
1189 m_t << " \\\\\n";
1190 visitChildren(dd);
1192}

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

◆ operator()() [15/59]

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

Definition at line 1151 of file latexdocvisitor.cpp.

1152{
1153 if (m_hide) return;
1154 bool eq = classEqualsReflist(dl);
1155 if (eq)
1156 {
1157 m_t << "\n\\begin{DoxyRefList}";
1158 }
1159 else
1160 {
1161 if (listIsNested(dl)) m_t << "\n\\hfill";
1162 m_t << "\n\\begin{DoxyDescription}";
1163 }
1164 visitChildren(dl);
1165 if (eq)
1166 {
1167 m_t << "\n\\end{DoxyRefList}";
1168 }
1169 else
1170 {
1171 m_t << "\n\\end{DoxyDescription}";
1172 }
1173}
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 1175 of file latexdocvisitor.cpp.

1176{
1177 if (m_hide) return;
1178 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1179 m_insideItem=true;
1180 visitChildren(dt);
1181 m_insideItem=false;
1182 m_t << "}}]";
1183}

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

◆ operator()() [17/59]

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

Definition at line 1449 of file latexdocvisitor.cpp.

1450{
1451 if (m_hide) return;
1452 m_t << "\n\n";
1453 auto summary = d.summary();
1454 if (summary)
1455 {
1456 std::visit(*this,*summary);
1457 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1458 }
1459 visitChildren(d);
1460 if (summary)
1461 {
1462 m_t << "\\end{adjustwidth}\n";
1463 }
1464 else
1465 {
1466 m_t << "\n\n";
1467 }
1468}
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 1470 of file latexdocvisitor.cpp.

1471{
1472 if (m_hide) return;
1473 m_t << "\\" << getSectionName(header.level()) << "*{";
1474 visitChildren(header);
1475 m_t << "}";
1476}
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 1035 of file latexdocvisitor.cpp.

1036{
1037 if (m_hide) return;
1038 if (m_indentLevel>=maxIndentLevels-1) return;
1040 if (s.type()==DocHtmlList::Ordered)
1041 {
1042 bool first = true;
1043 m_t << "\n\\begin{DoxyEnumerate}";
1044 for (const auto &opt : s.attribs())
1045 {
1046 if (opt.name=="type")
1047 {
1048 if (opt.value=="1")
1049 {
1050 m_t << (first ? "[": ",");
1051 m_t << "label=\\arabic*";
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=="A")
1061 {
1062 m_t << (first ? "[": ",");
1063 m_t << "label=\\enumAlphAlphcnt*";
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 else if (opt.value=="I")
1073 {
1074 m_t << (first ? "[": ",");
1075 m_t << "label=\\Roman*";
1076 first = false;
1077 }
1078 }
1079 else if (opt.name=="start")
1080 {
1081 m_t << (first ? "[": ",");
1082 bool ok = false;
1083 int val = opt.value.toInt(&ok);
1084 if (ok) m_t << "start=" << val;
1085 first = false;
1086 }
1087 }
1088 if (!first) m_t << "]\n";
1089 }
1090 else
1091 {
1092 m_t << "\n\\begin{DoxyItemize}";
1093 }
1094 visitChildren(s);
1095 if (m_indentLevel>=maxIndentLevels-1) return;
1096 if (s.type()==DocHtmlList::Ordered)
1097 m_t << "\n\\end{DoxyEnumerate}";
1098 else
1099 m_t << "\n\\end{DoxyItemize}";
1100}
const HtmlAttribList & attribs() const
Definition docnode.h:1015
Type type() const
Definition docnode.h:1014

References DocHtmlList::attribs(), indentLevel(), LatexDocVisitor::LatexListItemInfo::isEnum, 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 1102 of file latexdocvisitor.cpp.

1103{
1104 if (m_hide) return;
1105 if (m_listItemInfo[indentLevel()].isEnum)
1106 {
1107 for (const auto &opt : l.attribs())
1108 {
1109 if (opt.name=="value")
1110 {
1111 bool ok = false;
1112 int val = opt.value.toInt(&ok);
1113 if (ok)
1114 {
1115 m_t << "\n\\setcounter{DoxyEnumerate" << DString::integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1116 }
1117 }
1118 }
1119 }
1120 m_t << "\n\\item ";
1122 visitChildren(l);
1124}
static DString integerToRoman(int n, bool upper=true)
Definition dstring.cpp:638
const HtmlAttribList & attribs() const
Definition docnode.h:1175

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

◆ operator()() [21/59]

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

Definition at line 1282 of file latexdocvisitor.cpp.

1283{
1284 if (m_hide) return;
1286
1287 visitChildren(row);
1288
1289 m_t << "\\\\";
1290
1291 size_t col = 1;
1292 for (auto &span : rowSpans())
1293 {
1294 if (span.rowSpan>0) span.rowSpan--;
1295 if (span.rowSpan<=0)
1296 {
1297 // inactive span
1298 }
1299 else if (span.column>col)
1300 {
1301 col = span.column+span.colSpan;
1302 }
1303 else
1304 {
1305 col = span.column+span.colSpan;
1306 }
1307 }
1308
1309 m_t << "\n";
1310}

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

◆ operator()() [22/59]

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

Definition at line 1441 of file latexdocvisitor.cpp.

1442{
1443 if (m_hide) return;
1444 m_t << "{\\bfseries{";
1445 visitChildren(d);
1446 m_t << "}}";
1447}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/59]

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

Definition at line 1229 of file latexdocvisitor.cpp.

1230{
1231 if (m_hide) return;
1233 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1234 if (c)
1235 {
1236 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1237 if (!c->file().empty() && pdfHyperLinks)
1238 {
1239 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1240 << "}{}";
1241 }
1242 m_t << "\n";
1243 }
1244
1246 if (!isTableNested(t.parent()))
1247 {
1248 // write caption
1249 m_t << "{";
1250 if (c)
1251 {
1252 m_captionTable = true;
1253 std::visit(*this, *t.caption());
1254 m_captionTable = false;
1255 }
1256 m_t << "}";
1257 // write label
1258 m_t << "{";
1259 if (c && (!stripPath(c->file()).empty() || !c->anchor().empty()))
1260 {
1261 m_t << stripPath(c->file()) << "_" << c->anchor();
1262 }
1263 m_t << "}";
1264 }
1265
1266 // write head row(s)
1267 m_t << "{" << t.numberHeaderRows() << "}\n";
1268
1270
1271 visitChildren(t);
1273 popTableState();
1274}
DString file() const
Definition docnode.h:1239
DString anchor() const
Definition docnode.h:1240
size_t numberHeaderRows() const
Definition docnode.cpp:2339
size_t numColumns() const
Definition docnode.h:1283
const DocNodeVariant * caption() const
Definition docnode.cpp:2334
DocNodeVariant * parent()
Definition docnode.h:89
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, DString::empty(), DocHtmlCaption::file(), isTableNested(), m_captionTable, 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 1478 of file latexdocvisitor.cpp.

1479{
1480 if (img.type()==DocImage::Latex)
1481 {
1482 if (m_hide) return;
1483 DString gfxName = img.name();
1484 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1485 {
1486 gfxName=gfxName.left(gfxName.length()-4);
1487 }
1488
1489 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1490 visitChildren(img);
1492 }
1493 else // other format -> skip
1494 {
1495 }
1496}
DString left(size_t len) const
Definition dstring.h:306
bool endsWith(const char *s) const
Definition dstring.h:617
Type type() const
Definition docnode.h:647
DString width() const
Definition docnode.h:650
DString name() const
Definition docnode.h:648
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
DString height() const
Definition docnode.h:651
static void visitPreStart(TextStream &t, bool hasCaption, DString name, DString width, DString height, bool inlineImage=false)

References DString::endsWith(), DocImage::hasCaption(), DocImage::height(), DocImage::isInlineImage(), DocImage::Latex, DString::left(), DString::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 533 of file latexdocvisitor.cpp.

534{
535 if (m_hide) return;
537 switch(inc.type())
538 {
540 {
541 m_ci.startCodeFragment("DoxyCodeInclude");
542 FileInfo cfi( inc.file().str() );
543 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
545 inc.text(),
546 langExt,
547 inc.stripCodeComments(),
548 CodeParserOptions()
549 .setExample(inc.isExample(), inc.exampleFile())
550 .setFileDef(fd.get())
551 .setInlineFragment(true)
552 );
553 m_ci.endCodeFragment("DoxyCodeInclude");
554 }
555 break;
557 {
558 m_ci.startCodeFragment("DoxyCodeInclude");
560 inc.text(),langExt,
561 inc.stripCodeComments(),
562 CodeParserOptions()
563 .setExample(inc.isExample(), inc.exampleFile())
564 .setInlineFragment(true)
565 .setShowLineNumbers(false)
566 );
567 m_ci.endCodeFragment("DoxyCodeInclude");
568 }
569 break;
577 break;
579 m_t << inc.text();
580 break;
582 if (isTableNested(inc.parent())) // in table
583 {
584 m_t << "\\begin{DoxyCode}{0}";
585 filter(inc.text(), true);
586 m_t << "\\end{DoxyCode}\n";
587 }
588 else
589 {
590 m_t << "\n\\begin{DoxyVerbInclude}\n";
591 m_t << inc.text();
592 m_t << "\\end{DoxyVerbInclude}\n";
593 }
594 break;
597 {
598 m_ci.startCodeFragment("DoxyCodeInclude");
600 inc.file(),
601 inc.blockId(),
602 inc.context(),
604 inc.trimLeft(),
606 );
607 m_ci.endCodeFragment("DoxyCodeInclude");
608 }
609 break;
610 }
611}
static CodeFragmentManager & instance()
void parseCodeFragment(OutputCodeList &codeOutList, const DString &fileName, const DString &blockId, const DString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
virtual void parseCode(OutputCodeList &codeOutList, const DString &scopeName, const DString &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.
const std::string & str() const
Definition dstring.h:645
bool stripCodeComments() const
Definition docnode.h:455
DString blockId() const
Definition docnode.h:454
@ 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
DString context() const
Definition docnode.h:453
Type type() const
Definition docnode.h:451
DString exampleFile() const
Definition docnode.h:457
DString text() const
Definition docnode.h:452
DString file() const
Definition docnode.h:449
DString extension() const
Definition docnode.h:450
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
CodeParserInterface & getCodeParser(const DString &langExt)
void startCodeFragment(const DString &style)
Definition outputlist.h:276
void endCodeFragment(const DString &style)
Definition outputlist.h:279
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Definition filedef.cpp:267
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4168

References DocInclude::blockId(), DocInclude::context(), createFileDef(), FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, OutputCodeList::endCodeFragment(), 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, OutputCodeList::startCodeFragment(), DString::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 613 of file latexdocvisitor.cpp.

614{
615 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
616 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
617 if (op.isFirst())
618 {
619 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
621 m_hide = true;
622 }
623 DString locLangExt = getFileNameExtension(op.includeFileName());
624 if (locLangExt.empty()) locLangExt = m_langExt;
625 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
626 if (op.type()!=DocIncOperator::Skip)
627 {
628 m_hide = popHidden();
629 if (!m_hide)
630 {
631 std::unique_ptr<FileDef> fd;
632 if (!op.includeFileName().empty())
633 {
634 FileInfo cfi( op.includeFileName().str() );
635 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
636 }
637
638 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
640 CodeParserOptions()
641 .setExample(op.isExample(),op.exampleFile())
642 .setFileDef(fd.get())
643 .setStartLine(op.line())
644 .setShowLineNumbers(op.showLineNo())
645 );
646 }
648 m_hide=true;
649 }
650 if (op.isLast())
651 {
653 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
654 }
655 else
656 {
657 if (!m_hide) m_t << "\n";
658 }
659}
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
DString text() const
Definition docnode.h:499
DString context() const
Definition docnode.h:501
DString exampleFile() const
Definition docnode.h:508
DString includeFileName() const
Definition docnode.h:509
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()
DString getFileNameExtension(const DString &fn)
Definition util.cpp:4210

References DocIncOperator::context(), createFileDef(), FileInfo::dirPath(), DString::empty(), OutputCodeList::endCodeFragment(), DocIncOperator::exampleFile(), FileInfo::fileName(), DocVisitor::getCodeParser(), getFileNameExtension(), getLanguageFromFileName(), DocIncOperator::includeFileName(), 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, OutputCodeList::startCodeFragment(), DString::str(), DocIncOperator::stripCodeComments(), DocIncOperator::text(), and DocIncOperator::type().

◆ operator()() [27/59]

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

Definition at line 680 of file latexdocvisitor.cpp.

681{
682 if (m_hide) return;
684}
DString entry() const
Definition docnode.h:559
void latexWriteIndexItem(TextStream &m_t, const DString &s1, const DString &s2)

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

◆ operator()() [28/59]

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

Definition at line 1421 of file latexdocvisitor.cpp.

1422{
1423 if (m_hide) return;
1424 visitChildren(i);
1425}

References m_hide, and visitChildren().

◆ operator()() [29/59]

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

Definition at line 1825 of file latexdocvisitor.cpp.

1826{
1827 if (m_hide) return;
1828 startLink(DString(),ref.file(),ref.anchor());
1829 visitChildren(ref);
1830 endLink(DString(),ref.file(),ref.anchor());
1831}
DString anchor() const
Definition docnode.h:822
DString file() const
Definition docnode.h:820
void startLink(const DString &ref, const DString &file, const DString &anchor, bool refToTable=false, bool refToSection=false)
void endLink(const DString &ref, const DString &file, const DString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)

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

◆ operator()() [30/59]

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

Definition at line 330 of file latexdocvisitor.cpp.

331{
332 if (m_hide) return;
333 if (m_insideItem)
334 {
335 m_t << "\\\\\n";
336 }
337 else if (m_captionTable)
338 {
339 m_t << "\\hspace{\\textwidth minus \\textwidth}\\mbox{}\\\\ ";
340 }
341 else
342 {
343 m_t << "~\\newline\n";
344 }
345}

References m_captionTable, m_hide, m_insideItem, and m_t.

◆ operator()() [31/59]

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

Definition at line 1577 of file latexdocvisitor.cpp.

1578{
1579 if (m_hide) return;
1580 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1581 visitChildren(lnk);
1582 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1583}

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 238 of file latexdocvisitor.cpp.

239{
240 if (m_hide) return;
241 startLink(w.ref(),w.file(),w.anchor());
242 filter(w.word());
243 endLink(w.ref(),w.file(),w.anchor());
244}
DString word() const
Definition docnode.h:170
DString anchor() const
Definition docnode.h:174
DString ref() const
Definition docnode.h:173
DString file() const
Definition docnode.h:171

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 1567 of file latexdocvisitor.cpp.

1568{
1569 if (m_hide) return;
1570 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1571 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1572 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1573 visitChildren(df);
1575}
void startMermaidFile(const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine)
void endMermaidFile(bool hasCaption)
bool copyFile(const DString &src, const DString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:4619

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 1518 of file latexdocvisitor.cpp.

1519{
1520 if (m_hide) return;
1521 bool exists = false;
1522 std::string inBuf;
1523 if (readInputFile(df.file(),inBuf))
1524 {
1525 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1526 ".msc", // extension
1527 inBuf, // contents
1528 exists);
1529 if (!fileName.empty())
1530 {
1531 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1532 visitChildren(df);
1533 endMscFile(df.hasCaption());
1534 }
1535 }
1536}
void startMscFile(const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &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 writeInlineGraph().

◆ operator()() [35/59]

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

Definition at line 799 of file latexdocvisitor.cpp.

800{
801 if (m_hide) return;
802 visitChildren(p);
803 if (!p.isLast() && // omit <p> for last paragraph
804 !(p.parent() && // and for parameter sections
805 std::get_if<DocParamSect>(p.parent())
806 )
807 )
808 {
809 if (insideTable())
810 {
811 m_t << "~\\newline\n";
812 }
813 else
814 {
815 m_t << "\n\n";
816 }
817 }
818}
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 1717 of file latexdocvisitor.cpp.

1718{
1719 if (m_hide) return;
1721 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1722 if (sect)
1723 {
1724 parentType = sect->type();
1725 }
1726 bool useTable = parentType==DocParamSect::Param ||
1727 parentType==DocParamSect::RetVal ||
1728 parentType==DocParamSect::Exception ||
1729 parentType==DocParamSect::TemplateParam;
1730 if (!useTable)
1731 {
1732 m_t << "\\item[";
1733 }
1734 if (sect && sect->hasInOutSpecifier())
1735 {
1737 {
1738 m_t << "\\doxymbox{\\texttt{";
1739 if (pl.direction()==DocParamSect::In)
1740 {
1741 m_t << "in";
1742 }
1743 else if (pl.direction()==DocParamSect::Out)
1744 {
1745 m_t << "out";
1746 }
1747 else if (pl.direction()==DocParamSect::InOut)
1748 {
1749 m_t << "in,out";
1750 }
1751 m_t << "}} ";
1752 }
1753 if (useTable) m_t << " & ";
1754 }
1755 if (sect && sect->hasTypeSpecifier())
1756 {
1757 for (const auto &type : pl.paramTypes())
1758 {
1759 std::visit(*this,type);
1760 }
1761 if (useTable) m_t << " & ";
1762 }
1763 m_t << "{\\em ";
1764 bool first=true;
1765 for (const auto &param : pl.parameters())
1766 {
1767 if (!first) m_t << ","; else first=false;
1768 m_insideItem=true;
1769 std::visit(*this,param);
1770 m_insideItem=false;
1771 }
1772 m_t << "}";
1773 if (useTable)
1774 {
1775 m_t << " & ";
1776 }
1777 else
1778 {
1779 m_t << "]";
1780 }
1781 for (const auto &par : pl.paragraphs())
1782 {
1783 std::visit(*this,par);
1784 }
1785 if (useTable)
1786 {
1787 m_t << "\\\\\n"
1788 << "\\hline\n";
1789 }
1790}
const DocNodeList & parameters() const
Definition docnode.h:1134
const DocNodeList & paramTypes() const
Definition docnode.h:1135
DocParamSect::Direction direction() const
Definition docnode.h:1138
const DocNodeList & paragraphs() const
Definition docnode.h:1136
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, 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, DocParamSect::type(), DocParamSect::Unknown, and DocParamSect::Unspecified.

◆ operator()() [37/59]

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

Definition at line 1658 of file latexdocvisitor.cpp.

1659{
1660 if (m_hide) return;
1661 bool hasInOutSpecs = s.hasInOutSpecifier();
1662 bool hasTypeSpecs = s.hasTypeSpecifier();
1664 switch(s.type())
1665 {
1667 m_t << "\n\\begin{DoxyParams}";
1668 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1669 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1670 m_t << "{";
1672 break;
1674 m_t << "\n\\begin{DoxyRetVals}{";
1676 break;
1678 m_t << "\n\\begin{DoxyExceptions}{";
1680 break;
1682 m_t << "\n\\begin{DoxyTemplParams}{";
1684 break;
1685 default:
1686 ASSERT(0);
1688 }
1689 m_t << "}\n";
1690 visitChildren(s);
1692 switch(s.type())
1693 {
1695 m_t << "\\end{DoxyParams}\n";
1696 break;
1698 m_t << "\\end{DoxyRetVals}\n";
1699 break;
1701 m_t << "\\end{DoxyExceptions}\n";
1702 break;
1704 m_t << "\\end{DoxyTemplParams}\n";
1705 break;
1706 default:
1707 ASSERT(0);
1709 }
1710}
void decUsedTableLevel()
Definition latexgen.h:64
void incUsedTableLevel()
Definition latexgen.h:63
virtual DString trExceptions()=0
virtual DString trParameters()=0
virtual DString trReturnValues()=0
virtual DString trTemplateParameters()=0
#define ASSERT(x)
Definition message.h:142

References ASSERT, decIndentLevel(), LatexCodeGenerator::decUsedTableLevel(), DocParamSect::Exception, filter(), DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), incIndentLevel(), LatexCodeGenerator::incUsedTableLevel(), m_hide, m_lcg, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, Translator::trExceptions(), Translator::trParameters(), Translator::trReturnValues(), Translator::trTemplateParameters(), DocParamSect::type(), and visitChildren().

◆ operator()() [38/59]

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

Definition at line 1853 of file latexdocvisitor.cpp.

1854{
1855 if (m_hide) return;
1856 visitChildren(pb);
1857}

References m_hide, and visitChildren().

◆ operator()() [39/59]

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

Definition at line 1558 of file latexdocvisitor.cpp.

1559{
1560 if (m_hide) return;
1561 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1562 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1563 visitChildren(df);
1565}
void startPlantUmlFile(const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &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 1585 of file latexdocvisitor.cpp.

1586{
1587 if (m_hide) return;
1588 // when ref.isSubPage()==true we use ref.file() for HTML and
1589 // ref.anchor() for LaTeX/RTF
1590 if (ref.isSubPage())
1591 {
1592 startLink(ref.ref(),DString(),ref.anchor());
1593 }
1594 else
1595 {
1596 if (!ref.file().empty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1597 }
1598 if (!ref.hasLinkText())
1599 {
1600 filter(ref.targetTitle());
1601 }
1602 visitChildren(ref);
1603 if (ref.isSubPage())
1604 {
1605 endLink(ref.ref(),DString(),ref.anchor());
1606 }
1607 else
1608 {
1609 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1610 }
1611}
DString ref() const
Definition docnode.h:793
SectionType sectionType() const
Definition docnode.h:796
DString file() const
Definition docnode.h:791
bool isSubPage() const
Definition docnode.h:801
bool refToTable() const
Definition docnode.h:800
DString anchor() const
Definition docnode.h:794
bool refToSection() const
Definition docnode.h:799
bool hasLinkText() const
Definition docnode.h:797
DString targetTitle() const
Definition docnode.h:795

References DocRef::anchor(), DString::empty(), endLink(), DocRef::file(), filter(), DocRef::hasLinkText(), 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 820 of file latexdocvisitor.cpp.

821{
822 visitChildren(r);
823}

References visitChildren().

◆ operator()() [42/59]

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

Definition at line 1613 of file latexdocvisitor.cpp.

1614{
1615 if (m_hide) return;
1616 m_t << "\\item \\contentsline{section}{";
1617 if (ref.isSubPage())
1618 {
1619 startLink(ref.ref(),DString(),ref.anchor());
1620 }
1621 else
1622 {
1623 if (!ref.file().empty())
1624 {
1625 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1626 }
1627 }
1628 visitChildren(ref);
1629 if (ref.isSubPage())
1630 {
1631 endLink(ref.ref(),DString(),ref.anchor());
1632 }
1633 else
1634 {
1635 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1636 }
1637 m_t << "}{\\ref{";
1638 if (!ref.file().empty()) m_t << stripPath(ref.file());
1639 if (!ref.file().empty() && !ref.anchor().empty()) m_t << "_";
1640 if (!ref.anchor().empty()) m_t << ref.anchor();
1641 m_t << "}}{}\n";
1642}
bool refToTable() const
Definition docnode.h:952
DString anchor() const
Definition docnode.h:949
DString ref() const
Definition docnode.h:951
DString file() const
Definition docnode.h:948
bool isSubPage() const
Definition docnode.h:953

References DocSecRefItem::anchor(), DString::empty(), endLink(), DocSecRefItem::file(), 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 1644 of file latexdocvisitor.cpp.

1645{
1646 if (m_hide) return;
1647 m_t << "\\footnotesize\n";
1648 m_t << "\\begin{multicols}{2}\n";
1649 m_t << "\\begin{DoxyCompactList}\n";
1651 visitChildren(l);
1653 m_t << "\\end{DoxyCompactList}\n";
1654 m_t << "\\end{multicols}\n";
1655 m_t << "\\normalsize\n";
1656}

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

◆ operator()() [44/59]

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

Definition at line 1001 of file latexdocvisitor.cpp.

1002{
1003 if (m_hide) return;
1004 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1005 if (pdfHyperlinks)
1006 {
1007 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1008 }
1009 m_t << "\\" << getSectionName(s.level()) << "{";
1010 if (pdfHyperlinks)
1011 {
1012 m_t << "\\texorpdfstring{";
1013 }
1014 if (s.title())
1015 {
1016 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1017 std::visit(*this,*s.title());
1019 }
1020 if (pdfHyperlinks)
1021 {
1022 m_t << "}{";
1023 if (s.title())
1024 {
1025 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1026 std::visit(*this,*s.title());
1028 }
1029 m_t << "}";
1030 }
1031 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1032 visitChildren(s);
1033}
DString file() const
Definition docnode.h:931
int level() const
Definition docnode.h:927
DString 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 1712 of file latexdocvisitor.cpp.

1713{
1714 m_t << " " << sep.chars() << " ";
1715}
DString chars() const
Definition docnode.h:369

References DocSeparator::chars(), and m_t.

◆ operator()() [46/59]

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

Definition at line 980 of file latexdocvisitor.cpp.

981{
982 if (m_hide) return;
983 m_t << "\\begin{DoxyItemize}\n";
985 visitChildren(l);
986 m_t << "\\end{DoxyItemize}\n";
987}

References indentLevel(), LatexDocVisitor::LatexListItemInfo::isEnum, m_hide, m_listItemInfo, m_t, and visitChildren().

◆ operator()() [47/59]

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

Definition at line 989 of file latexdocvisitor.cpp.

990{
991 if (m_hide) return;
992 m_t << "\\item ";
994 if (li.paragraph())
995 {
996 visit(*this,*li.paragraph());
997 }
999}
const DocNodeVariant * paragraph() const
Definition docnode.h:1162

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

◆ operator()() [48/59]

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

Definition at line 825 of file latexdocvisitor.cpp.

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

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, decIndentLevel(), 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(), Translator::trAttention(), Translator::trAuthor(), Translator::trCopyright(), Translator::trDate(), Translator::trImportant(), Translator::trInvariant(), Translator::trNote(), Translator::trPostcondition(), Translator::trPrecondition(), Translator::trRemarks(), Translator::trReturns(), Translator::trSeeAlso(), Translator::trSince(), Translator::trVersion(), Translator::trWarning(), DocSimpleSect::type(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [49/59]

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

Definition at line 686 of file latexdocvisitor.cpp.

687{
688}

◆ operator()() [50/59]

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

Definition at line 356 of file latexdocvisitor.cpp.

357{
358 if (m_hide) return;
359 switch (s.style())
360 {
362 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
363 break;
367 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
368 break;
371 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
372 break;
374 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
375 break;
379 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
380 break;
382 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
383 break;
385 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
386 break;
388 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
389 break;
391 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
392 break;
394 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
395 break;
397 if (s.enable())
398 {
399 m_t << "\n\\begin{DoxyPre}";
400 m_insidePre=true;
401 }
402 else
403 {
404 m_insidePre=false;
405 m_t << "\\end{DoxyPre}\n";
406 }
407 break;
408 case DocStyleChange::Div: /* HTML only */ break;
409 case DocStyleChange::Span: /* HTML only */ break;
410 }
411}
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(), 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, DocStyleChange::Typewriter, and DocStyleChange::Underline.

◆ operator()() [51/59]

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

Definition at line 259 of file latexdocvisitor.cpp.

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

◆ operator()() [52/59]

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

Definition at line 1833 of file latexdocvisitor.cpp.

1834{
1835 if (m_hide) return;
1836 visitChildren(t);
1837}

References m_hide, and visitChildren().

◆ operator()() [53/59]

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

Definition at line 974 of file latexdocvisitor.cpp.

975{
976 if (m_hide) return;
977 visitChildren(t);
978}

References m_hide, and visitChildren().

◆ operator()() [54/59]

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

Definition at line 316 of file latexdocvisitor.cpp.

317{
318 if (m_hide) return;
319 if (Config_getBool(PDF_HYPERLINKS))
320 {
321 m_t << "\\href{";
322 if (u.isEmail()) m_t << "mailto:";
323 m_t << latexFilterURL(u.url()) << "}";
324 }
325 m_t << "{\\texttt{";
326 filter(u.url());
327 m_t << "}}";
328}
DString 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 413 of file latexdocvisitor.cpp.

414{
415 if (m_hide) return;
416 DString lang = m_langExt;
417 if (!s.language().empty()) // explicit language setting
418 {
419 lang = s.language();
420 }
421 SrcLangExt langExt = getLanguageFromCodeLang(lang);
422 switch(s.type())
423 {
425 {
426 m_ci.startCodeFragment("DoxyCode");
427 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
428 Config_getBool(STRIP_CODE_COMMENTS),
429 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
430 m_ci.endCodeFragment("DoxyCode");
431 }
432 break;
434 filter(s.text(), true);
435 break;
437 m_t << "{\\ttfamily ";
438 filter(s.text(), true);
439 m_t << "}";
440 break;
442 if (isTableNested(s.parent())) // in table
443 {
444 m_t << "\\begin{DoxyCode}{0}";
445 filter(s.text(), true);
446 m_t << "\\end{DoxyCode}\n";
447 }
448 else
449 {
450 m_t << "\\begin{DoxyVerb}";
451 m_t << s.text();
452 m_t << "\\end{DoxyVerb}\n";
453 }
454 break;
460 /* nothing */
461 break;
463 m_t << s.text();
464 break;
465 case DocVerbatim::Dot:
466 {
467 bool exists = false;
468 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
469 ".dot", // extension
470 s.text(), // contents
471 exists);
472 if (!fileName.empty())
473 {
474 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
475 visitChildren(s);
477 }
478 }
479 break;
480 case DocVerbatim::Msc:
481 {
482 bool exists = false;
483 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
484 ".msc", // extension
485 "msc {"+s.text()+"}", // contents
486 exists);
487 if (!fileName.empty())
488 {
489 writeMscFile(fileName, s, !exists);
490 }
491 }
492 break;
494 {
495 DString latexOutput = Config_getString(LATEX_OUTPUT);
496 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
497 latexOutput,s.exampleFile(),s.text(),
499 s.engine(),s.srcFile(),s.srcLine(),true);
500
501 for (const auto &baseName: baseNameVector)
502 {
503 writePlantUMLFile(baseName, s);
504 }
505 }
506 break;
508 if (Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
509 {
510 auto latexOutput = Config_getString(LATEX_OUTPUT);
511 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
512 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
513 DString baseName = MermaidManager::instance().writeMermaidSource(
514 latexOutput,s.exampleFile(),s.text(),imageFormat,
515 s.srcFile(),s.srcLine());
516 writeMermaidFile(baseName, s);
517 }
518 break;
519 }
520}
DString text() const
Definition docnode.h:383
int srcLine() const
Definition docnode.h:398
bool hasCaption() const
Definition docnode.h:390
DString height() const
Definition docnode.h:392
DString language() const
Definition docnode.h:388
bool isExample() const
Definition docnode.h:385
Type type() const
Definition docnode.h:382
DString exampleFile() const
Definition docnode.h:386
bool useBitmap() const
Definition docnode.h:394
DString width() const
Definition docnode.h:391
DString srcFile() const
Definition docnode.h:397
DString context() const
Definition docnode.h:384
DString engine() const
Definition docnode.h:393
@ JavaDocLiteral
Definition docnode.h:378
void writePlantUMLFile(const DString &fileName, const DocVerbatim &s)
void writeMscFile(const DString &fileName, const DocVerbatim &s, bool newFile=true)
void writeMermaidFile(const DString &baseName, const DocVerbatim &s)
static MermaidManager & instance()
Definition mermaid.cpp:38
static ImageFormat convertToImageFormat(OutputFormat outputFormat)
Definition mermaid.cpp:59
DString writeMermaidSource(const DString &outDirArg, const DString &fileName, const DString &content, ImageFormat format, const DString &srcFile, int srcLine)
Write a Mermaid source file and register it for CLI rendering.
Definition mermaid.cpp:75
StringVector writePlantUMLSource(const DString &outDirArg, const DString &fileName, const DString &content, OutputFormat format, const DString &engine, const DString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:37
static PlantumlManager & instance()
Definition plantuml.cpp:236
SrcLangExt getLanguageFromCodeLang(DString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:4186

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

◆ operator()() [56/59]

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

Definition at line 1849 of file latexdocvisitor.cpp.

1850{
1851}

◆ operator()() [57/59]

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

Definition at line 246 of file latexdocvisitor.cpp.

247{
248 if (m_hide) return;
249 if (m_insidePre)
250 {
251 m_t << w.chars();
252 }
253 else
254 {
255 m_t << " ";
256 }
257}
DString 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 232 of file latexdocvisitor.cpp.

233{
234 if (m_hide) return;
235 filter(w.word());
236}
DString 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 1792 of file latexdocvisitor.cpp.

1793{
1794 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1795 if (m_hide) return;
1796 if (x.title().empty()) return;
1798 m_t << "\\begin{DoxyRefDesc}{";
1799 filter(x.title());
1800 m_t << "}\n";
1801 bool anonymousEnum = x.file()=="@";
1802 m_t << "\\item[";
1803 if (pdfHyperlinks && !anonymousEnum)
1804 {
1805 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1806 }
1807 else
1808 {
1809 m_t << "\\textbf{ ";
1810 }
1811 m_insideItem=true;
1812 filter(x.title());
1813 m_insideItem=false;
1814 if (pdfHyperlinks && !anonymousEnum)
1815 {
1816 m_t << "}";
1817 }
1818 m_t << "}]";
1819 visitChildren(x);
1820 if (x.title().empty()) return;
1822 m_t << "\\end{DoxyRefDesc}\n";
1823}
DString anchor() const
Definition docnode.h:625
DString file() const
Definition docnode.h:624
DString title() const
Definition docnode.h:626

References DocXRefItem::anchor(), Config_getBool, decIndentLevel(), DString::empty(), DocXRefItem::file(), filter(), incIndentLevel(), m_hide, m_insideItem, m_t, stripPath(), DocXRefItem::title(), and visitChildren().

◆ popTableState()

void LatexDocVisitor::popTableState ( )
inlineprivate

Definition at line 214 of file latexdocvisitor.h.

215 {
216 m_tableStateStack.pop();
217 }

References m_tableStateStack.

Referenced by operator()().

◆ pushTableState()

void LatexDocVisitor::pushTableState ( )
inlineprivate

Definition at line 210 of file latexdocvisitor.h.

211 {
212 m_tableStateStack.emplace();
213 }

References m_tableStateStack.

Referenced by operator()().

◆ rowSpans()

RowSpanList & LatexDocVisitor::rowSpans ( )
inlineprivate

Definition at line 230 of file latexdocvisitor.h.

231 {
232 return !m_tableStateStack.empty() ? m_tableStateStack.top().rowSpans : m_emptyRowSpanList;
233 }
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 222 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ setNumCols()

void LatexDocVisitor::setNumCols ( size_t num)
inlineprivate

Definition at line 226 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ startDiaFile()

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

Definition at line 1998 of file latexdocvisitor.cpp.

2005{
2006 DString baseName=makeBaseName(fileName,".dia");
2007 baseName.prepend("dia_");
2008
2009 DString outDir = Config_getString(LATEX_OUTPUT);
2010 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine,false);
2011 visitPreStart(m_t,hasCaption, baseName, width, height);
2012}
DString & prepend(const char *s)
Definition dstring.h:515
void writeDiaGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, DiaOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Definition dia.cpp:29
DString makeBaseName(const DString &name, const DString &ext)
Definition util.cpp:3974

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

Referenced by operator()().

◆ startDotFile()

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

Definition at line 1944 of file latexdocvisitor.cpp.

1951{
1952 DString baseName=makeBaseName(fileName,".dot");
1953 baseName.prepend("dot_");
1954 DString outDir = Config_getString(LATEX_OUTPUT);
1955 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine,false);
1956 visitPreStart(m_t,hasCaption, baseName, width, height);
1957}
void writeDotGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, GraphOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Definition dot.cpp:196

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

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

◆ startLink()

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

Definition at line 1872 of file latexdocvisitor.cpp.

1874{
1875 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1876 if (ref.empty() && pdfHyperLinks) // internal PDF link
1877 {
1878 if (refToTable)
1879 {
1880 m_t << "\\doxytablelink{";
1881 }
1882 else if (refToSection)
1883 {
1884 if (m_texOrPdf == TexOrPdf::TEX || m_captionTable) m_t << "\\protect";
1885 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1886 }
1887 else
1888 {
1889 if (m_texOrPdf == TexOrPdf::TEX || m_captionTable) m_t << "\\protect";
1890 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1891 }
1892 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1893 {
1894 if (!file.empty()) m_t << stripPath(file);
1895 if (!file.empty() && !anchor.empty()) m_t << "_";
1896 if (!anchor.empty()) m_t << anchor;
1897 m_t << "}";
1898 }
1899 m_t << "{";
1900 }
1901 else if (ref.empty() && refToSection)
1902 {
1903 m_t << "\\doxysectref{";
1904 }
1905 else if (ref.empty() && refToTable)
1906 {
1907 m_t << "\\doxytableref{";
1908 }
1909 else if (ref.empty()) // internal non-PDF link
1910 {
1911 m_t << "\\doxyref{";
1912 }
1913 else // external link
1914 {
1915 m_t << "\\textbf{ ";
1916 }
1917}

References Config_getBool, DString::empty(), m_captionTable, m_t, m_texOrPdf, PDF, stripPath(), and TEX.

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

◆ startMermaidFile()

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

Definition at line 2090 of file latexdocvisitor.cpp.

2097{
2098 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2099 DString outDir = Config_getString(LATEX_OUTPUT);
2100 std::string inBuf;
2101 readInputFile(fileName,inBuf);
2102 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2103 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2104 auto imgExt = MermaidManager::imageExtension(imageFormat);
2106 outDir,DString(),inBuf,imageFormat,
2107 srcFile,srcLine);
2108 auto shortName = stripPath(baseName);
2109 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2110 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2111 visitPreStart(m_t,hasCaption, shortName, width, height);
2112}
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
static DString imageExtension(ImageFormat imageFormat)
Definition mermaid.cpp:48
void generateMermaidOutput(const DString &baseName, const DString &outDir, ImageFormat format, bool toIndex)
Register a generated Mermaid image with the index.
Definition mermaid.cpp:121

References Config_getBool, Config_getString, MermaidManager::convertToImageFormat(), MermaidManager::generateMermaidOutput(), MermaidManager::imageExtension(), MermaidManager::instance(), MermaidManager::LaTeX, m_t, DString::npos, readInputFile(), stripPath(), visitPreStart(), and MermaidManager::writeMermaidSource().

Referenced by operator()().

◆ startMscFile()

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

Definition at line 1965 of file latexdocvisitor.cpp.

1972{
1973 DString baseName=makeBaseName(fileName,".msc");
1974 baseName.prepend("msc_");
1975
1976 DString outDir = Config_getString(LATEX_OUTPUT);
1977 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine,false);
1978 visitPreStart(m_t,hasCaption, baseName, width, height);
1979}
void writeMscGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, MscOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Definition msc.cpp:160

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

Referenced by operator()().

◆ startPlantUmlFile()

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

Definition at line 2035 of file latexdocvisitor.cpp.

2042{
2043 DString outDir = Config_getString(LATEX_OUTPUT);
2044 std::string inBuf;
2045 readInputFile(fileName,inBuf);
2046
2047 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2048 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2049 outDir,DString(),inBuf,
2051 DString(),srcFile,srcLine,false);
2052 bool first = true;
2053 for (const auto &bName: baseNameVector)
2054 {
2055 DString baseName = makeBaseName(bName,".pu");
2056 DString shortName = stripPath(baseName);
2057 if (useBitmap)
2058 {
2059 if (shortName.find('.')==DString::npos) shortName += ".png";
2060 }
2063 if (!first) endPlantUmlFile(hasCaption);
2064 first = false;
2065 visitPreStart(m_t,hasCaption, shortName, width, height);
2066 }
2067}
size_t find(char c, size_t pos=0) const
Definition dstring.h:239
void generatePlantUMLOutput(const DString &baseName, const DString &outDir, OutputFormat format, bool toIndex)
Convert a PlantUML file to an image.
Definition plantuml.cpp:207

References Config_getString, endPlantUmlFile(), DString::find(), PlantumlManager::generatePlantUMLOutput(), PlantumlManager::instance(), m_t, makeBaseName(), DString::npos, 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 212 of file latexdocvisitor.cpp.

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

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

◆ visitChildren()

◆ writeEndTableCommand()

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

Definition at line 1217 of file latexdocvisitor.cpp.

1218{
1219 if (isTableNested(n))
1220 {
1221 m_t << "\\end{DoxyTableNested}\n";
1222 }
1223 else
1224 {
1225 m_t << "\\end{DoxyTable}\n";
1226 }
1227}

References isTableNested(), and m_t.

Referenced by operator()().

◆ writeMermaidFile()

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

Definition at line 2075 of file latexdocvisitor.cpp.

2076{
2077 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2078 auto shortName = stripPath(baseName);
2079 auto outDir = Config_getString(LATEX_OUTPUT);
2080 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2081 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2082 auto imgExt = MermaidManager::imageExtension(imageFormat);
2083 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2084 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2085 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2088}
const DocNodeList & children() const
Definition docnode.h:395
void visitCaption(const DocNodeList &children)

References DocVerbatim::children(), Config_getBool, Config_getString, MermaidManager::convertToImageFormat(), MermaidManager::generateMermaidOutput(), DocVerbatim::hasCaption(), DocVerbatim::height(), MermaidManager::imageExtension(), MermaidManager::instance(), MermaidManager::LaTeX, m_t, DString::npos, stripPath(), visitCaption(), visitPostEnd(), visitPreStart(), and DocVerbatim::width().

Referenced by operator()().

◆ writeMscFile()

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

Definition at line 1988 of file latexdocvisitor.cpp.

1989{
1990 DString shortName=makeBaseName(fileName,".msc");
1991 DString outDir = Config_getString(LATEX_OUTPUT);
1992 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine(),false);
1993 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1996}

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 DString & fileName,
const DocVerbatim & s )
private

◆ writeStartTableCommand()

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

Definition at line 1205 of file latexdocvisitor.cpp.

1206{
1207 if (isTableNested(n))
1208 {
1209 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1210 }
1211 else
1212 {
1213 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1214 }
1215}

References isTableNested(), and m_t.

Referenced by operator()().

Member Data Documentation

◆ m_captionTable

bool LatexDocVisitor::m_captionTable
private

Definition at line 186 of file latexdocvisitor.h.

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

◆ 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 198 of file latexdocvisitor.h.

Referenced by rowSpans().

◆ m_hide

◆ m_hierarchyLevel

int LatexDocVisitor::m_hierarchyLevel
private

Definition at line 188 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

DString LatexDocVisitor::m_langExt
private

Definition at line 187 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 208 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 189 of file latexdocvisitor.h.

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

◆ maxIndentLevels

const int LatexDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 200 of file latexdocvisitor.h.

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


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