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 ()
CodeParserInterface & getCodeParser (const DString &langExt)
void pushHidden (bool hide)
bool popHidden ()

Private Types

typedef std::vector< ActiveRowSpan > RowSpanList

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)
RowSpanList & rowSpans ()
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

TextStream & m_t
OutputCodeList & m_ci
LatexCodeGenerator & m_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< TableState > m_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 2139 of file latexdocvisitor.cpp.

2140{
2141 if (m_indentLevel>0)
2142 {
2143 m_indentLevel--;
2144 }
2145}

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

2020{
2021 if (m_hide) return;
2022 visitPostEnd(m_t,hasCaption);
2023}
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 1964 of file latexdocvisitor.cpp.

1965{
1966 if (m_hide) return;
1967 visitPostEnd(m_t,hasCaption);
1968}

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

1925{
1926 m_t << "}";
1927 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1928 if (ref.empty() && !pdfHyperLinks)
1929 {
1930 m_t << "{";
1932 m_t << "}{" << file;
1933 if (!file.empty() && !anchor.empty()) m_t << "_";
1934 m_t << anchor << "}";
1935 if (refToSection)
1936 {
1937 m_t << "{" << sectionType.level() << "}";
1938 }
1939 }
1940 if (ref.empty() && pdfHyperLinks) // internal PDF link
1941 {
1942 if (refToSection)
1943 {
1944 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1945 }
1946 }
1947}
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 2119 of file latexdocvisitor.cpp.

2120{
2121 if (m_hide) return;
2122 visitPostEnd(m_t,hasCaption);
2123}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endMscFile()

void LatexDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 1986 of file latexdocvisitor.cpp.

1987{
1988 if (m_hide) return;
1989 visitPostEnd(m_t,hasCaption);
1990}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2074 of file latexdocvisitor.cpp.

2075{
2076 if (m_hide) return;
2077 visitPostEnd(m_t,hasCaption);
2078}

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

1865{
1866 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1871 m_lcg.usedTableLevel()>0, // insideTable
1872 false, // keepSpaces
1873 retainNewLine
1874 );
1875}
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 2130 of file latexdocvisitor.cpp.

2131{
2132 m_indentLevel++;
2134 {
2135 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2136 }
2137}
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 2125 of file latexdocvisitor.cpp.

2126{
2127 return std::min(m_indentLevel,maxIndentLevels-1);
2128}

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

1200{
1201 bool isNested=m_lcg.usedTableLevel()>0;
1202 while (n && !isNested)
1203 {
1205 n = ::parent(n);
1206 }
1207 return isNested;
1208}
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:3961

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

759{
760 if (m_hide) return;
761 if (m_indentLevel>=maxIndentLevels-1) return;
762 if (l.isEnumList())
763 {
764 m_t << "\n\\begin{DoxyEnumerate}";
766 }
767 else
768 {
770 m_t << "\n\\begin{DoxyItemize}";
771 }
772 visitChildren(l);
773 if (l.isEnumList())
774 {
775 m_t << "\n\\end{DoxyEnumerate}";
776 }
777 else
778 {
779 m_t << "\n\\end{DoxyItemize}";
780 }
781}
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 783 of file latexdocvisitor.cpp.

784{
785 if (m_hide) return;
786 switch (li.itemNumber())
787 {
788 case DocAutoList::Unchecked: // unchecked
789 m_t << "\n\\item[\\DoxyUnchecked] ";
790 break;
791 case DocAutoList::Checked_x: // checked with x
792 case DocAutoList::Checked_X: // checked with X
793 m_t << "\n\\item[\\DoxyChecked] ";
794 break;
795 default:
796 m_t << "\n\\item ";
797 break;
798 }
800 visitChildren(li);
802}
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 (m_texOrPdf == TexOrPdf::PDF || 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 if (m_texOrPdf == TexOrPdf::TEX) txt = "\\protect";
720 txt += "\\DoxyCite{" + anchor + "}";
721 if (opt.isNumber())
722 {
723 txt += "{number}";
724 }
725 else if (opt.isShortAuthor())
726 {
727 txt += "{shortauthor}";
728 }
729 else if (opt.isYear())
730 {
731 txt += "{year}";
732 }
733 if (!opt.noPar()) txt += "{1}";
734 else txt += "{0}";
735 m_t << txt;
736
737 txt = cite.getText();
738 m_t << "{\\bfseries ";
739 filter(txt);
740 m_t << "}";
741 }
742 else
743 {
744 if (!opt.noPar()) txt += "[";
745 txt += cite.target();
746 if (!opt.noPar()) txt += "]";
747 m_t << "{\\bfseries ";
748 filter(txt);
749 m_t << "}";
750 }
751 }
752}
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:988
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
@ TEX
called through texorpdf as TeX (first) part

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

◆ operator()() [5/59]

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

Definition at line 1543 of file latexdocvisitor.cpp.

1544{
1545 if (m_hide) return;
1546 bool exists = false;
1547 std::string inBuf;
1548 if (readInputFile(df.file(),inBuf))
1549 {
1550 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1551 ".dia", // extension
1552 inBuf, // contents
1553 exists);
1554 if (!fileName.empty())
1555 {
1556 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1557 visitChildren(df);
1558 endDiaFile(df.hasCaption());
1559 }
1560 }
1561}
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:5374
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:4375

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

1504{
1505 if (m_hide) return;
1506 bool exists = false;
1507 std::string inBuf;
1508 if (readInputFile(df.file(),inBuf))
1509 {
1510 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1511 ".dot", // extension
1512 inBuf, // contents
1513 exists);
1514 if (!fileName.empty())
1515 {
1516 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1517 visitChildren(df);
1518 endDotFile(df.hasCaption());
1519 }
1520 }
1521}
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 1432 of file latexdocvisitor.cpp.

1433{
1434 if (m_hide) return;
1435 if (Config_getBool(PDF_HYPERLINKS))
1436 {
1437 m_t << "\\href{";
1438 m_t << latexFilterURL(href.url());
1439 m_t << "}";
1440 }
1441 m_t << "{\\texttt{";
1442 visitChildren(href);
1443 m_t << "}}";
1444}
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 1844 of file latexdocvisitor.cpp.

1845{
1846 if (m_hide) return;
1847 m_t << "\\begin{quote}\n";
1849 visitChildren(q);
1850 m_t << "\\end{quote}\n";
1852}

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

◆ operator()() [12/59]

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

Definition at line 1281 of file latexdocvisitor.cpp.

1282{
1283 if (m_hide) return;
1284 visitChildren(c);
1285}

References m_hide, and visitChildren().

◆ operator()() [13/59]

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

Definition at line 1317 of file latexdocvisitor.cpp.

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

1191{
1193 if (!m_insideItem) m_t << "\\hfill";
1194 m_t << " \\\\\n";
1195 visitChildren(dd);
1197}

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

◆ operator()() [15/59]

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

Definition at line 1156 of file latexdocvisitor.cpp.

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

1181{
1182 if (m_hide) return;
1183 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1184 m_insideItem=true;
1185 visitChildren(dt);
1186 m_insideItem=false;
1187 m_t << "}}]";
1188}

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

◆ operator()() [17/59]

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

Definition at line 1454 of file latexdocvisitor.cpp.

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

1476{
1477 if (m_hide) return;
1478 m_t << "\\" << getSectionName(header.level()) << "*{";
1479 visitChildren(header);
1480 m_t << "}";
1481}
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 1040 of file latexdocvisitor.cpp.

1041{
1042 if (m_hide) return;
1043 if (m_indentLevel>=maxIndentLevels-1) return;
1045 if (s.type()==DocHtmlList::Ordered)
1046 {
1047 bool first = true;
1048 m_t << "\n\\begin{DoxyEnumerate}";
1049 for (const auto &opt : s.attribs())
1050 {
1051 if (opt.name=="type")
1052 {
1053 if (opt.value=="1")
1054 {
1055 m_t << (first ? "[": ",");
1056 m_t << "label=\\arabic*";
1057 first = false;
1058 }
1059 else if (opt.value=="a")
1060 {
1061 m_t << (first ? "[": ",");
1062 m_t << "label=\\enumalphalphcnt*";
1063 first = false;
1064 }
1065 else if (opt.value=="A")
1066 {
1067 m_t << (first ? "[": ",");
1068 m_t << "label=\\enumAlphAlphcnt*";
1069 first = false;
1070 }
1071 else if (opt.value=="i")
1072 {
1073 m_t << (first ? "[": ",");
1074 m_t << "label=\\roman*";
1075 first = false;
1076 }
1077 else if (opt.value=="I")
1078 {
1079 m_t << (first ? "[": ",");
1080 m_t << "label=\\Roman*";
1081 first = false;
1082 }
1083 }
1084 else if (opt.name=="start")
1085 {
1086 m_t << (first ? "[": ",");
1087 bool ok = false;
1088 int val = opt.value.toInt(&ok);
1089 if (ok) m_t << "start=" << val;
1090 first = false;
1091 }
1092 }
1093 if (!first) m_t << "]\n";
1094 }
1095 else
1096 {
1097 m_t << "\n\\begin{DoxyItemize}";
1098 }
1099 visitChildren(s);
1100 if (m_indentLevel>=maxIndentLevels-1) return;
1101 if (s.type()==DocHtmlList::Ordered)
1102 m_t << "\n\\end{DoxyEnumerate}";
1103 else
1104 m_t << "\n\\end{DoxyItemize}";
1105}
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 1107 of file latexdocvisitor.cpp.

1108{
1109 if (m_hide) return;
1110 if (m_listItemInfo[indentLevel()].isEnum)
1111 {
1112 for (const auto &opt : l.attribs())
1113 {
1114 if (opt.name=="value")
1115 {
1116 bool ok = false;
1117 int val = opt.value.toInt(&ok);
1118 if (ok)
1119 {
1120 m_t << "\n\\setcounter{DoxyEnumerate" << DString::integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1121 }
1122 }
1123 }
1124 }
1125 m_t << "\n\\item ";
1127 visitChildren(l);
1129}
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 1287 of file latexdocvisitor.cpp.

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

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

◆ operator()() [22/59]

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

Definition at line 1446 of file latexdocvisitor.cpp.

1447{
1448 if (m_hide) return;
1449 m_t << "{\\bfseries{";
1450 visitChildren(d);
1451 m_t << "}}";
1452}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/59]

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

Definition at line 1234 of file latexdocvisitor.cpp.

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

1484{
1485 if (img.type()==DocImage::Latex)
1486 {
1487 if (m_hide) return;
1488 DString gfxName = img.name();
1489 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1490 {
1491 gfxName=gfxName.left(gfxName.length()-4);
1492 }
1493
1494 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1495 visitChildren(img);
1497 }
1498 else // other format -> skip
1499 {
1500 }
1501}
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:269
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4169

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:4211

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

1427{
1428 if (m_hide) return;
1429 visitChildren(i);
1430}

References m_hide, and visitChildren().

◆ operator()() [29/59]

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

Definition at line 1830 of file latexdocvisitor.cpp.

1831{
1832 if (m_hide) return;
1833 startLink(DString(),ref.file(),ref.anchor());
1834 visitChildren(ref);
1835 endLink(DString(),ref.file(),ref.anchor());
1836}
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 1582 of file latexdocvisitor.cpp.

1583{
1584 if (m_hide) return;
1585 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1586 visitChildren(lnk);
1587 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1588}

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

1573{
1574 if (m_hide) return;
1575 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1576 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1577 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1578 visitChildren(df);
1580}
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:4620

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

1524{
1525 if (m_hide) return;
1526 bool exists = false;
1527 std::string inBuf;
1528 if (readInputFile(df.file(),inBuf))
1529 {
1530 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1531 ".msc", // extension
1532 inBuf, // contents
1533 exists);
1534 if (!fileName.empty())
1535 {
1536 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1537 visitChildren(df);
1538 endMscFile(df.hasCaption());
1539 }
1540 }
1541}
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 804 of file latexdocvisitor.cpp.

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

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

1664{
1665 if (m_hide) return;
1666 bool hasInOutSpecs = s.hasInOutSpecifier();
1667 bool hasTypeSpecs = s.hasTypeSpecifier();
1669 switch(s.type())
1670 {
1672 m_t << "\n\\begin{DoxyParams}";
1673 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1674 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1675 m_t << "{";
1677 break;
1679 m_t << "\n\\begin{DoxyRetVals}{";
1681 break;
1683 m_t << "\n\\begin{DoxyExceptions}{";
1685 break;
1687 m_t << "\n\\begin{DoxyTemplParams}{";
1689 break;
1690 default:
1691 ASSERT(0);
1693 }
1694 m_t << "}\n";
1695 visitChildren(s);
1697 switch(s.type())
1698 {
1700 m_t << "\\end{DoxyParams}\n";
1701 break;
1703 m_t << "\\end{DoxyRetVals}\n";
1704 break;
1706 m_t << "\\end{DoxyExceptions}\n";
1707 break;
1709 m_t << "\\end{DoxyTemplParams}\n";
1710 break;
1711 default:
1712 ASSERT(0);
1714 }
1715}
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 1858 of file latexdocvisitor.cpp.

1859{
1860 if (m_hide) return;
1861 visitChildren(pb);
1862}

References m_hide, and visitChildren().

◆ operator()() [39/59]

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

Definition at line 1563 of file latexdocvisitor.cpp.

1564{
1565 if (m_hide) return;
1566 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1567 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1568 visitChildren(df);
1570}
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 1590 of file latexdocvisitor.cpp.

1591{
1592 if (m_hide) return;
1593 // when ref.isSubPage()==true we use ref.file() for HTML and
1594 // ref.anchor() for LaTeX/RTF
1595 if (ref.isSubPage())
1596 {
1597 startLink(ref.ref(),DString(),ref.anchor());
1598 }
1599 else
1600 {
1601 if (!ref.file().empty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1602 }
1603 if (!ref.hasLinkText())
1604 {
1605 filter(ref.targetTitle());
1606 }
1607 visitChildren(ref);
1608 if (ref.isSubPage())
1609 {
1610 endLink(ref.ref(),DString(),ref.anchor());
1611 }
1612 else
1613 {
1614 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1615 }
1616}
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 825 of file latexdocvisitor.cpp.

826{
827 visitChildren(r);
828}

References visitChildren().

◆ operator()() [42/59]

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

Definition at line 1618 of file latexdocvisitor.cpp.

1619{
1620 if (m_hide) return;
1621 m_t << "\\item \\contentsline{section}{";
1622 if (ref.isSubPage())
1623 {
1624 startLink(ref.ref(),DString(),ref.anchor());
1625 }
1626 else
1627 {
1628 if (!ref.file().empty())
1629 {
1630 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1631 }
1632 }
1633 visitChildren(ref);
1634 if (ref.isSubPage())
1635 {
1636 endLink(ref.ref(),DString(),ref.anchor());
1637 }
1638 else
1639 {
1640 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1641 }
1642 m_t << "}{\\ref{";
1643 if (!ref.file().empty()) m_t << stripPath(ref.file());
1644 if (!ref.file().empty() && !ref.anchor().empty()) m_t << "_";
1645 if (!ref.anchor().empty()) m_t << ref.anchor();
1646 m_t << "}}{}\n";
1647}
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 1649 of file latexdocvisitor.cpp.

1650{
1651 if (m_hide) return;
1652 m_t << "\\footnotesize\n";
1653 m_t << "\\begin{multicols}{2}\n";
1654 m_t << "\\begin{DoxyCompactList}\n";
1656 visitChildren(l);
1658 m_t << "\\end{DoxyCompactList}\n";
1659 m_t << "\\end{multicols}\n";
1660 m_t << "\\normalsize\n";
1661}

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

◆ operator()() [44/59]

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

Definition at line 1006 of file latexdocvisitor.cpp.

1007{
1008 if (m_hide) return;
1009 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1010 if (pdfHyperlinks)
1011 {
1012 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1013 }
1014 m_t << "\\" << getSectionName(s.level()) << "{";
1015 if (pdfHyperlinks)
1016 {
1017 m_t << "\\texorpdfstring{";
1018 }
1019 if (s.title())
1020 {
1021 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1022 std::visit(*this,*s.title());
1024 }
1025 if (pdfHyperlinks)
1026 {
1027 m_t << "}{";
1028 if (s.title())
1029 {
1030 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1031 std::visit(*this,*s.title());
1033 }
1034 m_t << "}";
1035 }
1036 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1037 visitChildren(s);
1038}
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
@ 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 1717 of file latexdocvisitor.cpp.

1718{
1719 m_t << " " << sep.chars() << " ";
1720}
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 985 of file latexdocvisitor.cpp.

986{
987 if (m_hide) return;
988 m_t << "\\begin{DoxyItemize}\n";
990 visitChildren(l);
991 m_t << "\\end{DoxyItemize}\n";
992}

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

995{
996 if (m_hide) return;
997 m_t << "\\item ";
999 if (li.paragraph())
1000 {
1001 visit(*this,*li.paragraph());
1002 }
1004}
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 830 of file latexdocvisitor.cpp.

831{
832 if (m_hide) return;
833 switch(s.type())
834 {
836 m_t << "\\begin{DoxySeeAlso}{";
838 break;
840 m_t << "\\begin{DoxyReturn}{";
842 break;
844 m_t << "\\begin{DoxyAuthor}{";
845 filter(theTranslator->trAuthor(true,true));
846 break;
848 m_t << "\\begin{DoxyAuthor}{";
849 filter(theTranslator->trAuthor(true,false));
850 break;
852 m_t << "\\begin{DoxyVersion}{";
854 break;
856 m_t << "\\begin{DoxySince}{";
858 break;
860 m_t << "\\begin{DoxyDate}{";
862 break;
864 m_t << "\\begin{DoxyNote}{";
866 break;
868 m_t << "\\begin{DoxyWarning}{";
870 break;
872 m_t << "\\begin{DoxyPrecond}{";
874 break;
876 m_t << "\\begin{DoxyPostcond}{";
878 break;
880 m_t << "\\begin{DoxyCopyright}{";
882 break;
884 m_t << "\\begin{DoxyInvariant}{";
886 break;
888 m_t << "\\begin{DoxyRemark}{";
890 break;
892 m_t << "\\begin{DoxyAttention}{";
894 break;
896 m_t << "\\begin{DoxyImportant}{";
898 break;
900 m_t << "\\begin{DoxyParagraph}{";
901 break;
903 m_t << "\\begin{DoxyParagraph}{";
904 break;
905 case DocSimpleSect::Unknown: break;
906 }
907
908 if (s.title())
909 {
910 m_insideItem=true;
911 std::visit(*this,*s.title());
912 m_insideItem=false;
913 }
914 m_t << "}\n";
916 visitChildren(s);
917 switch(s.type())
918 {
920 m_t << "\n\\end{DoxySeeAlso}\n";
921 break;
923 m_t << "\n\\end{DoxyReturn}\n";
924 break;
926 m_t << "\n\\end{DoxyAuthor}\n";
927 break;
929 m_t << "\n\\end{DoxyAuthor}\n";
930 break;
932 m_t << "\n\\end{DoxyVersion}\n";
933 break;
935 m_t << "\n\\end{DoxySince}\n";
936 break;
938 m_t << "\n\\end{DoxyDate}\n";
939 break;
941 m_t << "\n\\end{DoxyNote}\n";
942 break;
944 m_t << "\n\\end{DoxyWarning}\n";
945 break;
947 m_t << "\n\\end{DoxyPrecond}\n";
948 break;
950 m_t << "\n\\end{DoxyPostcond}\n";
951 break;
953 m_t << "\n\\end{DoxyCopyright}\n";
954 break;
956 m_t << "\n\\end{DoxyInvariant}\n";
957 break;
959 m_t << "\n\\end{DoxyRemark}\n";
960 break;
962 m_t << "\n\\end{DoxyAttention}\n";
963 break;
965 m_t << "\n\\end{DoxyImportant}\n";
966 break;
968 m_t << "\n\\end{DoxyParagraph}\n";
969 break;
971 m_t << "\n\\end{DoxyParagraph}\n";
972 break;
973 default:
974 break;
975 }
977}
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 1838 of file latexdocvisitor.cpp.

1839{
1840 if (m_hide) return;
1841 visitChildren(t);
1842}

References m_hide, and visitChildren().

◆ operator()() [53/59]

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

Definition at line 979 of file latexdocvisitor.cpp.

980{
981 if (m_hide) return;
982 visitChildren(t);
983}

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:4187

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

1855{
1856}

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

1798{
1799 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1800 if (m_hide) return;
1801 if (x.title().empty()) return;
1803 m_t << "\\begin{DoxyRefDesc}{";
1804 filter(x.title());
1805 m_t << "}\n";
1806 bool anonymousEnum = x.file()=="@";
1807 m_t << "\\item[";
1808 if (pdfHyperlinks && !anonymousEnum)
1809 {
1810 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1811 }
1812 else
1813 {
1814 m_t << "\\textbf{ ";
1815 }
1816 m_insideItem=true;
1817 filter(x.title());
1818 m_insideItem=false;
1819 if (pdfHyperlinks && !anonymousEnum)
1820 {
1821 m_t << "}";
1822 }
1823 m_t << "}]";
1824 visitChildren(x);
1825 if (x.title().empty()) return;
1827 m_t << "\\end{DoxyRefDesc}\n";
1828}
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 2003 of file latexdocvisitor.cpp.

2010{
2011 DString baseName=makeBaseName(fileName,".dia");
2012 baseName.prepend("dia_");
2013
2014 DString outDir = Config_getString(LATEX_OUTPUT);
2015 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine,false);
2016 visitPreStart(m_t,hasCaption, baseName, width, height);
2017}
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:3975

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

1956{
1957 DString baseName=makeBaseName(fileName,".dot");
1958 baseName.prepend("dot_");
1959 DString outDir = Config_getString(LATEX_OUTPUT);
1960 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine,false);
1961 visitPreStart(m_t,hasCaption, baseName, width, height);
1962}
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 1877 of file latexdocvisitor.cpp.

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

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

2102{
2103 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2104 DString outDir = Config_getString(LATEX_OUTPUT);
2105 std::string inBuf;
2106 readInputFile(fileName,inBuf);
2107 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2108 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2109 auto imgExt = MermaidManager::imageExtension(imageFormat);
2111 outDir,DString(),inBuf,imageFormat,
2112 srcFile,srcLine);
2113 auto shortName = stripPath(baseName);
2114 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2115 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2116 visitPreStart(m_t,hasCaption, shortName, width, height);
2117}
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 1970 of file latexdocvisitor.cpp.

1977{
1978 DString baseName=makeBaseName(fileName,".msc");
1979 baseName.prepend("msc_");
1980
1981 DString outDir = Config_getString(LATEX_OUTPUT);
1982 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine,false);
1983 visitPreStart(m_t,hasCaption, baseName, width, height);
1984}
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 2040 of file latexdocvisitor.cpp.

2047{
2048 DString outDir = Config_getString(LATEX_OUTPUT);
2049 std::string inBuf;
2050 readInputFile(fileName,inBuf);
2051
2052 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2053 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2054 outDir,DString(),inBuf,
2056 DString(),srcFile,srcLine,false);
2057 bool first = true;
2058 for (const auto &bName: baseNameVector)
2059 {
2060 DString baseName = makeBaseName(bName,".pu");
2061 DString shortName = stripPath(baseName);
2062 if (useBitmap)
2063 {
2064 if (shortName.find('.')==DString::npos) shortName += ".png";
2065 }
2068 if (!first) endPlantUmlFile(hasCaption);
2069 first = false;
2070 visitPreStart(m_t,hasCaption, shortName, width, height);
2071 }
2072}
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 1222 of file latexdocvisitor.cpp.

1223{
1224 if (isTableNested(n))
1225 {
1226 m_t << "\\end{DoxyTableNested}\n";
1227 }
1228 else
1229 {
1230 m_t << "\\end{DoxyTable}\n";
1231 }
1232}

References isTableNested(), and m_t.

Referenced by operator()().

◆ writeMermaidFile()

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

Definition at line 2080 of file latexdocvisitor.cpp.

2081{
2082 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2083 auto shortName = stripPath(baseName);
2084 auto outDir = Config_getString(LATEX_OUTPUT);
2085 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2086 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2087 auto imgExt = MermaidManager::imageExtension(imageFormat);
2088 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2089 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2090 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2093}
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 1993 of file latexdocvisitor.cpp.

1994{
1995 DString shortName=makeBaseName(fileName,".msc");
1996 DString outDir = Config_getString(LATEX_OUTPUT);
1997 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine(),false);
1998 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2001}

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

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

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()(), 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: