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

Concrete visitor implementation for LaTeX output. More...

#include <src/latexdocvisitor.h>

Inheritance diagram for LatexDocVisitor:
Collaboration diagram for LatexDocVisitor:

Classes

struct  ActiveRowSpan
struct  TableState
struct  LatexListItemInfo

Public Member Functions

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

Private Types

typedef std::vector< ActiveRowSpanRowSpanList

Private Member Functions

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

Private Attributes

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

Static Private Attributes

static const int maxIndentLevels = 13

Detailed Description

Concrete visitor implementation for LaTeX output.

Definition at line 37 of file latexdocvisitor.h.

Member Typedef Documentation

◆ RowSpanList

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

Definition at line 132 of file latexdocvisitor.h.

Constructor & Destructor Documentation

◆ LatexDocVisitor()

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

Definition at line 217 of file latexdocvisitor.cpp.

219 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(false),
220 m_insideItem(false), m_hide(false),
221 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
222{
223}
OutputCodeList & m_ci
LatexCodeGenerator & m_lcg

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

Member Function Documentation

◆ addRowSpan()

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

Definition at line 233 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ currentColumn()

size_t LatexDocVisitor::currentColumn ( ) const
inlineprivate

Definition at line 217 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ decIndentLevel()

void LatexDocVisitor::decIndentLevel ( )
private

Definition at line 2125 of file latexdocvisitor.cpp.

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

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

2006{
2007 if (m_hide) return;
2008 visitPostEnd(m_t,hasCaption);
2009}
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 1950 of file latexdocvisitor.cpp.

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

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

1911{
1912 m_t << "}";
1913 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1914 if (ref.empty() && !pdfHyperLinks)
1915 {
1916 m_t << "{";
1918 m_t << "}{" << file;
1919 if (!file.empty() && !anchor.empty()) m_t << "_";
1920 m_t << anchor << "}";
1921 if (refToSection)
1922 {
1923 m_t << "{" << sectionType.level() << "}";
1924 }
1925 }
1926 if (ref.empty() && pdfHyperLinks) // internal PDF link
1927 {
1928 if (refToSection)
1929 {
1930 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1931 }
1932 }
1933}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:153
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:71
@ 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 2105 of file latexdocvisitor.cpp.

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

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endMscFile()

void LatexDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 1972 of file latexdocvisitor.cpp.

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

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2060 of file latexdocvisitor.cpp.

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

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

1851{
1852 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1857 m_lcg.usedTableLevel()>0, // insideTable
1858 false, // keepSpaces
1859 retainNewLine
1860 );
1861}
int usedTableLevel() const
Definition latexgen.h:66
bool insideTabbing() const
Definition latexgen.h:71
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 59 of file latexdocvisitor.cpp.

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

2117{
2118 m_indentLevel++;
2120 {
2121 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2122 }
2123}
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 2111 of file latexdocvisitor.cpp.

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

References m_indentLevel, and maxIndentLevels.

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

◆ insideTable()

bool LatexDocVisitor::insideTable ( ) const
inlineprivate

Definition at line 237 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ isTableNested()

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

Definition at line 1187 of file latexdocvisitor.cpp.

1188{
1189 bool isNested=m_lcg.usedTableLevel()>0;
1190 while (n && !isNested)
1191 {
1193 n = ::parent(n);
1194 }
1195 return isNested;
1196}
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 515 of file latexdocvisitor.cpp.

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

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

747{
748 if (m_hide) return;
749 if (m_indentLevel>=maxIndentLevels-1) return;
750 if (l.isEnumList())
751 {
752 m_t << "\n\\begin{DoxyEnumerate}";
754 }
755 else
756 {
758 m_t << "\n\\begin{DoxyItemize}";
759 }
760 visitChildren(l);
761 if (l.isEnumList())
762 {
763 m_t << "\n\\end{DoxyEnumerate}";
764 }
765 else
766 {
767 m_t << "\n\\end{DoxyItemize}";
768 }
769}
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 771 of file latexdocvisitor.cpp.

772{
773 if (m_hide) return;
774 switch (li.itemNumber())
775 {
776 case DocAutoList::Unchecked: // unchecked
777 m_t << "\n\\item[\\DoxyUnchecked] ";
778 break;
779 case DocAutoList::Checked_x: // checked with x
780 case DocAutoList::Checked_X: // checked with X
781 m_t << "\n\\item[\\DoxyChecked] ";
782 break;
783 default:
784 m_t << "\n\\item ";
785 break;
786 }
788 visitChildren(li);
790}
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 683 of file latexdocvisitor.cpp.

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

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

◆ operator()() [5/59]

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

Definition at line 1529 of file latexdocvisitor.cpp.

1530{
1531 if (m_hide) return;
1532 bool exists = false;
1533 std::string inBuf;
1534 if (readInputFile(df.file(),inBuf))
1535 {
1536 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1537 ".dia", // extension
1538 inBuf, // contents
1539 exists);
1540 if (!fileName.empty())
1541 {
1542 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1543 visitChildren(df);
1544 endDiaFile(df.hasCaption());
1545 }
1546 }
1547}
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:6155
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:4874

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

1490{
1491 if (m_hide) return;
1492 bool exists = false;
1493 std::string inBuf;
1494 if (readInputFile(df.file(),inBuf))
1495 {
1496 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1497 ".dot", // extension
1498 inBuf, // contents
1499 exists);
1500 if (!fileName.empty())
1501 {
1502 startDotFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1503 visitChildren(df);
1504 endDotFile(df.hasCaption());
1505 }
1506 }
1507}
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 296 of file latexdocvisitor.cpp.

297{
298 if (m_hide) return;
299 DString emojiName = EmojiEntityMapper::instance().name(s.index());
300 if (!emojiName.empty())
301 {
302 DString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
303 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
304 filter(emojiName);
305 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
306 }
307 else
308 {
309 m_t << s.name();
310 }
311}
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:2026
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978

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

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

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

References insideTable(), m_hide, and m_t.

◆ operator()() [10/59]

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

Definition at line 1418 of file latexdocvisitor.cpp.

1419{
1420 if (m_hide) return;
1421 if (Config_getBool(PDF_HYPERLINKS))
1422 {
1423 m_t << "\\href{";
1424 m_t << latexFilterURL(href.url());
1425 m_t << "}";
1426 }
1427 m_t << "{\\texttt{";
1428 visitChildren(href);
1429 m_t << "}}";
1430}
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 1830 of file latexdocvisitor.cpp.

1831{
1832 if (m_hide) return;
1833 m_t << "\\begin{quote}\n";
1835 visitChildren(q);
1836 m_t << "\\end{quote}\n";
1838}

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

◆ operator()() [12/59]

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

Definition at line 1267 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [13/59]

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

Definition at line 1303 of file latexdocvisitor.cpp.

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

References LatexDocVisitor::ActiveRowSpan::ActiveRowSpan(), addRowSpan(), DocHtmlCell::alignment(), DocHtmlCell::Bottom, DocHtmlCell::Center, DocHtmlCell::colSpan(), currentColumn(), DString::DString(), 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 1178 of file latexdocvisitor.cpp.

1179{
1181 if (!m_insideItem) m_t << "\\hfill";
1182 m_t << " \\\\\n";
1183 visitChildren(dd);
1185}

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

◆ operator()() [15/59]

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

Definition at line 1144 of file latexdocvisitor.cpp.

1145{
1146 if (m_hide) return;
1147 bool eq = classEqualsReflist(dl);
1148 if (eq)
1149 {
1150 m_t << "\n\\begin{DoxyRefList}";
1151 }
1152 else
1153 {
1154 if (listIsNested(dl)) m_t << "\n\\hfill";
1155 m_t << "\n\\begin{DoxyDescription}";
1156 }
1157 visitChildren(dl);
1158 if (eq)
1159 {
1160 m_t << "\n\\end{DoxyRefList}";
1161 }
1162 else
1163 {
1164 m_t << "\n\\end{DoxyDescription}";
1165 }
1166}
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 1168 of file latexdocvisitor.cpp.

1169{
1170 if (m_hide) return;
1171 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1172 m_insideItem=true;
1173 visitChildren(dt);
1174 m_insideItem=false;
1175 m_t << "}}]";
1176}

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

◆ operator()() [17/59]

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

Definition at line 1440 of file latexdocvisitor.cpp.

1441{
1442 if (m_hide) return;
1443 m_t << "\n\n";
1444 auto summary = d.summary();
1445 if (summary)
1446 {
1447 std::visit(*this,*summary);
1448 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1449 }
1450 visitChildren(d);
1451 if (summary)
1452 {
1453 m_t << "\\end{adjustwidth}\n";
1454 }
1455 else
1456 {
1457 m_t << "\n\n";
1458 }
1459}
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 1461 of file latexdocvisitor.cpp.

1462{
1463 if (m_hide) return;
1464 m_t << "\\" << getSectionName(header.level()) << "*{";
1465 visitChildren(header);
1466 m_t << "}";
1467}
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 1028 of file latexdocvisitor.cpp.

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

1096{
1097 if (m_hide) return;
1098 if (m_listItemInfo[indentLevel()].isEnum)
1099 {
1100 for (const auto &opt : l.attribs())
1101 {
1102 if (opt.name=="value")
1103 {
1104 bool ok = false;
1105 int val = opt.value.toInt(&ok);
1106 if (ok)
1107 {
1108 m_t << "\n\\setcounter{DoxyEnumerate" << DString::integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1109 }
1110 }
1111 }
1112 }
1113 m_t << "\n\\item ";
1115 visitChildren(l);
1117}
static DString integerToRoman(int n, bool upper=true)
Definition dstring.cpp:633
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 1273 of file latexdocvisitor.cpp.

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

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

◆ operator()() [22/59]

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

Definition at line 1432 of file latexdocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [23/59]

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

Definition at line 1222 of file latexdocvisitor.cpp.

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

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

◆ operator()() [24/59]

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

Definition at line 1469 of file latexdocvisitor.cpp.

1470{
1471 if (img.type()==DocImage::Latex)
1472 {
1473 if (m_hide) return;
1474 DString gfxName = img.name();
1475 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1476 {
1477 gfxName=gfxName.left(gfxName.length()-4);
1478 }
1479
1480 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1481 visitChildren(img);
1483 }
1484 else // other format -> skip
1485 {
1486 }
1487}
DString left(size_t len) const
Definition dstring.h:311
bool endsWith(const char *s) const
Definition dstring.h:606
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 526 of file latexdocvisitor.cpp.

527{
528 if (m_hide) return;
530 switch(inc.type())
531 {
533 {
534 m_ci.startCodeFragment("DoxyCodeInclude");
535 FileInfo cfi( inc.file().str() );
536 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
538 inc.text(),
539 langExt,
540 inc.stripCodeComments(),
541 CodeParserOptions()
542 .setExample(inc.isExample(), inc.exampleFile())
543 .setFileDef(fd.get())
544 .setInlineFragment(true)
545 );
546 m_ci.endCodeFragment("DoxyCodeInclude");
547 }
548 break;
550 {
551 m_ci.startCodeFragment("DoxyCodeInclude");
553 inc.text(),langExt,
554 inc.stripCodeComments(),
555 CodeParserOptions()
556 .setExample(inc.isExample(), inc.exampleFile())
557 .setInlineFragment(true)
558 .setShowLineNumbers(false)
559 );
560 m_ci.endCodeFragment("DoxyCodeInclude");
561 }
562 break;
570 break;
572 m_t << inc.text();
573 break;
575 if (isTableNested(inc.parent())) // in table
576 {
577 m_t << "\\begin{DoxyCode}{0}";
578 filter(inc.text(), true);
579 m_t << "\\end{DoxyCode}\n";
580 }
581 else
582 {
583 m_t << "\n\\begin{DoxyVerbInclude}\n";
584 m_t << inc.text();
585 m_t << "\\end{DoxyVerbInclude}\n";
586 }
587 break;
590 {
591 m_ci.startCodeFragment("DoxyCodeInclude");
593 inc.file(),
594 inc.blockId(),
595 inc.context(),
597 inc.trimLeft(),
599 );
600 m_ci.endCodeFragment("DoxyCodeInclude");
601 }
602 break;
603 }
604}
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:634
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:280
void endCodeFragment(const DString &style)
Definition outputlist.h:283
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Definition filedef.cpp:268
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4536

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

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

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

674{
675 if (m_hide) return;
677}
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 1412 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [29/59]

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

Definition at line 1816 of file latexdocvisitor.cpp.

1817{
1818 if (m_hide) return;
1819 startLink(DString(),ref.file(),ref.anchor());
1820 visitChildren(ref);
1821 endLink(DString(),ref.file(),ref.anchor());
1822}
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(), DString::DString(), endLink(), DocInternalRef::file(), m_hide, startLink(), and visitChildren().

◆ operator()() [30/59]

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

Definition at line 327 of file latexdocvisitor.cpp.

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

References m_hide, m_insideItem, and m_t.

◆ operator()() [31/59]

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

Definition at line 1568 of file latexdocvisitor.cpp.

1569{
1570 if (m_hide) return;
1571 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1572 visitChildren(lnk);
1573 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1574}

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

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

1559{
1560 if (m_hide) return;
1561 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1562 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1563 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1564 visitChildren(df);
1566}
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:5179

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

1510{
1511 if (m_hide) return;
1512 bool exists = false;
1513 std::string inBuf;
1514 if (readInputFile(df.file(),inBuf))
1515 {
1516 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1517 ".msc", // extension
1518 inBuf, // contents
1519 exists);
1520 if (!fileName.empty())
1521 {
1522 startMscFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1523 visitChildren(df);
1524 endMscFile(df.hasCaption());
1525 }
1526 }
1527}
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 792 of file latexdocvisitor.cpp.

793{
794 if (m_hide) return;
795 visitChildren(p);
796 if (!p.isLast() && // omit <p> for last paragraph
797 !(p.parent() && // and for parameter sections
798 std::get_if<DocParamSect>(p.parent())
799 )
800 )
801 {
802 if (insideTable())
803 {
804 m_t << "~\\newline\n";
805 }
806 else
807 {
808 m_t << "\n\n";
809 }
810 }
811}
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 1708 of file latexdocvisitor.cpp.

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

1650{
1651 if (m_hide) return;
1652 bool hasInOutSpecs = s.hasInOutSpecifier();
1653 bool hasTypeSpecs = s.hasTypeSpecifier();
1655 switch(s.type())
1656 {
1658 m_t << "\n\\begin{DoxyParams}";
1659 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1660 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1661 m_t << "{";
1663 break;
1665 m_t << "\n\\begin{DoxyRetVals}{";
1667 break;
1669 m_t << "\n\\begin{DoxyExceptions}{";
1671 break;
1673 m_t << "\n\\begin{DoxyTemplParams}{";
1675 break;
1676 default:
1677 ASSERT(0);
1679 }
1680 m_t << "}\n";
1681 visitChildren(s);
1683 switch(s.type())
1684 {
1686 m_t << "\\end{DoxyParams}\n";
1687 break;
1689 m_t << "\\end{DoxyRetVals}\n";
1690 break;
1692 m_t << "\\end{DoxyExceptions}\n";
1693 break;
1695 m_t << "\\end{DoxyTemplParams}\n";
1696 break;
1697 default:
1698 ASSERT(0);
1700 }
1701}
void decUsedTableLevel()
Definition latexgen.h:65
void incUsedTableLevel()
Definition latexgen.h:64
virtual DString trExceptions()=0
virtual DString trParameters()=0
virtual DString trReturnValues()=0
virtual DString trTemplateParameters()=0
#define ASSERT(x)
Definition dstring.h:29

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

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

References m_hide, and visitChildren().

◆ operator()() [39/59]

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

Definition at line 1549 of file latexdocvisitor.cpp.

1550{
1551 if (m_hide) return;
1552 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1553 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1554 visitChildren(df);
1556}
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 1576 of file latexdocvisitor.cpp.

1577{
1578 if (m_hide) return;
1579 // when ref.isSubPage()==true we use ref.file() for HTML and
1580 // ref.anchor() for LaTeX/RTF
1581 if (ref.isSubPage())
1582 {
1583 startLink(ref.ref(),DString(),ref.anchor());
1584 }
1585 else
1586 {
1587 if (!ref.file().empty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1588 }
1589 if (!ref.hasLinkText())
1590 {
1591 filter(ref.targetTitle());
1592 }
1593 visitChildren(ref);
1594 if (ref.isSubPage())
1595 {
1596 endLink(ref.ref(),DString(),ref.anchor());
1597 }
1598 else
1599 {
1600 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1601 }
1602}
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 813 of file latexdocvisitor.cpp.

814{
815 visitChildren(r);
816}

References visitChildren().

◆ operator()() [42/59]

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

Definition at line 1604 of file latexdocvisitor.cpp.

1605{
1606 if (m_hide) return;
1607 m_t << "\\item \\contentsline{section}{";
1608 if (ref.isSubPage())
1609 {
1610 startLink(ref.ref(),DString(),ref.anchor());
1611 }
1612 else
1613 {
1614 if (!ref.file().empty())
1615 {
1616 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1617 }
1618 }
1619 visitChildren(ref);
1620 if (ref.isSubPage())
1621 {
1622 endLink(ref.ref(),DString(),ref.anchor());
1623 }
1624 else
1625 {
1626 if (!ref.file().empty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1627 }
1628 m_t << "}{\\ref{";
1629 if (!ref.file().empty()) m_t << stripPath(ref.file());
1630 if (!ref.file().empty() && !ref.anchor().empty()) m_t << "_";
1631 if (!ref.anchor().empty()) m_t << ref.anchor();
1632 m_t << "}}{}\n";
1633}
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 1635 of file latexdocvisitor.cpp.

1636{
1637 if (m_hide) return;
1638 m_t << "\\footnotesize\n";
1639 m_t << "\\begin{multicols}{2}\n";
1640 m_t << "\\begin{DoxyCompactList}\n";
1642 visitChildren(l);
1644 m_t << "\\end{DoxyCompactList}\n";
1645 m_t << "\\end{multicols}\n";
1646 m_t << "\\normalsize\n";
1647}

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

◆ operator()() [44/59]

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

Definition at line 994 of file latexdocvisitor.cpp.

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

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

◆ operator()() [45/59]

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

Definition at line 1703 of file latexdocvisitor.cpp.

1704{
1705 m_t << " " << sep.chars() << " ";
1706}
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 973 of file latexdocvisitor.cpp.

974{
975 if (m_hide) return;
976 m_t << "\\begin{DoxyItemize}\n";
978 visitChildren(l);
979 m_t << "\\end{DoxyItemize}\n";
980}

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

983{
984 if (m_hide) return;
985 m_t << "\\item ";
987 if (li.paragraph())
988 {
989 visit(*this,*li.paragraph());
990 }
992}
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 818 of file latexdocvisitor.cpp.

819{
820 if (m_hide) return;
821 switch(s.type())
822 {
824 m_t << "\\begin{DoxySeeAlso}{";
826 break;
828 m_t << "\\begin{DoxyReturn}{";
830 break;
832 m_t << "\\begin{DoxyAuthor}{";
833 filter(theTranslator->trAuthor(true,true));
834 break;
836 m_t << "\\begin{DoxyAuthor}{";
837 filter(theTranslator->trAuthor(true,false));
838 break;
840 m_t << "\\begin{DoxyVersion}{";
842 break;
844 m_t << "\\begin{DoxySince}{";
846 break;
848 m_t << "\\begin{DoxyDate}{";
850 break;
852 m_t << "\\begin{DoxyNote}{";
854 break;
856 m_t << "\\begin{DoxyWarning}{";
858 break;
860 m_t << "\\begin{DoxyPrecond}{";
862 break;
864 m_t << "\\begin{DoxyPostcond}{";
866 break;
868 m_t << "\\begin{DoxyCopyright}{";
870 break;
872 m_t << "\\begin{DoxyInvariant}{";
874 break;
876 m_t << "\\begin{DoxyRemark}{";
878 break;
880 m_t << "\\begin{DoxyAttention}{";
882 break;
884 m_t << "\\begin{DoxyImportant}{";
886 break;
888 m_t << "\\begin{DoxyParagraph}{";
889 break;
891 m_t << "\\begin{DoxyParagraph}{";
892 break;
893 case DocSimpleSect::Unknown: break;
894 }
895
896 if (s.title())
897 {
898 m_insideItem=true;
899 std::visit(*this,*s.title());
900 m_insideItem=false;
901 }
902 m_t << "}\n";
904 visitChildren(s);
905 switch(s.type())
906 {
908 m_t << "\n\\end{DoxySeeAlso}\n";
909 break;
911 m_t << "\n\\end{DoxyReturn}\n";
912 break;
914 m_t << "\n\\end{DoxyAuthor}\n";
915 break;
917 m_t << "\n\\end{DoxyAuthor}\n";
918 break;
920 m_t << "\n\\end{DoxyVersion}\n";
921 break;
923 m_t << "\n\\end{DoxySince}\n";
924 break;
926 m_t << "\n\\end{DoxyDate}\n";
927 break;
929 m_t << "\n\\end{DoxyNote}\n";
930 break;
932 m_t << "\n\\end{DoxyWarning}\n";
933 break;
935 m_t << "\n\\end{DoxyPrecond}\n";
936 break;
938 m_t << "\n\\end{DoxyPostcond}\n";
939 break;
941 m_t << "\n\\end{DoxyCopyright}\n";
942 break;
944 m_t << "\n\\end{DoxyInvariant}\n";
945 break;
947 m_t << "\n\\end{DoxyRemark}\n";
948 break;
950 m_t << "\n\\end{DoxyAttention}\n";
951 break;
953 m_t << "\n\\end{DoxyImportant}\n";
954 break;
956 m_t << "\n\\end{DoxyParagraph}\n";
957 break;
959 m_t << "\n\\end{DoxyParagraph}\n";
960 break;
961 default:
962 break;
963 }
965}
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 679 of file latexdocvisitor.cpp.

680{
681}

◆ operator()() [50/59]

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

Definition at line 349 of file latexdocvisitor.cpp.

350{
351 if (m_hide) return;
352 switch (s.style())
353 {
355 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
356 break;
360 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
361 break;
364 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
365 break;
367 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
368 break;
372 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
373 break;
375 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
376 break;
378 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
379 break;
381 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
382 break;
384 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
385 break;
387 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
388 break;
390 if (s.enable())
391 {
392 m_t << "\n\\begin{DoxyPre}";
393 m_insidePre=true;
394 }
395 else
396 {
397 m_insidePre=false;
398 m_t << "\\end{DoxyPre}\n";
399 }
400 break;
401 case DocStyleChange::Div: /* HTML only */ break;
402 case DocStyleChange::Span: /* HTML only */ break;
403 }
404}
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 256 of file latexdocvisitor.cpp.

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

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

References m_hide, and visitChildren().

◆ operator()() [53/59]

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

Definition at line 967 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [54/59]

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

Definition at line 313 of file latexdocvisitor.cpp.

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

407{
408 if (m_hide) return;
409 DString lang = m_langExt;
410 if (!s.language().empty()) // explicit language setting
411 {
412 lang = s.language();
413 }
414 SrcLangExt langExt = getLanguageFromCodeLang(lang);
415 switch(s.type())
416 {
418 {
419 m_ci.startCodeFragment("DoxyCode");
420 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
421 Config_getBool(STRIP_CODE_COMMENTS),
422 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
423 m_ci.endCodeFragment("DoxyCode");
424 }
425 break;
427 filter(s.text(), true);
428 break;
430 m_t << "{\\ttfamily ";
431 filter(s.text(), true);
432 m_t << "}";
433 break;
435 if (isTableNested(s.parent())) // in table
436 {
437 m_t << "\\begin{DoxyCode}{0}";
438 filter(s.text(), true);
439 m_t << "\\end{DoxyCode}\n";
440 }
441 else
442 {
443 m_t << "\\begin{DoxyVerb}";
444 m_t << s.text();
445 m_t << "\\end{DoxyVerb}\n";
446 }
447 break;
453 /* nothing */
454 break;
456 m_t << s.text();
457 break;
458 case DocVerbatim::Dot:
459 {
460 bool exists = false;
461 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_", // baseName
462 ".dot", // extension
463 s.text(), // contents
464 exists);
465 if (!fileName.empty())
466 {
467 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine(),!exists);
468 visitChildren(s);
470 }
471 }
472 break;
473 case DocVerbatim::Msc:
474 {
475 bool exists = false;
476 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_", // baseName
477 ".msc", // extension
478 "msc {"+s.text()+"}", // contents
479 exists);
480 if (!fileName.empty())
481 {
482 writeMscFile(fileName, s, !exists);
483 }
484 }
485 break;
487 {
488 DString latexOutput = Config_getString(LATEX_OUTPUT);
489 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
490 latexOutput,s.exampleFile(),s.text(),
492 s.engine(),s.srcFile(),s.srcLine(),true);
493
494 for (const auto &baseName: baseNameVector)
495 {
496 writePlantUMLFile(baseName, s);
497 }
498 }
499 break;
501 if (Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
502 {
503 auto latexOutput = Config_getString(LATEX_OUTPUT);
504 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
505 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
506 DString baseName = MermaidManager::instance().writeMermaidSource(
507 latexOutput,s.exampleFile(),s.text(),imageFormat,
508 s.srcFile(),s.srcLine());
509 writeMermaidFile(baseName, s);
510 }
511 break;
512 }
513}
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:33
static ImageFormat convertToImageFormat(OutputFormat outputFormat)
Definition mermaid.cpp:54
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:70
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:31
static PlantumlManager & instance()
Definition plantuml.cpp:230
SrcLangExt getLanguageFromCodeLang(DString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:4554

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

1841{
1842}

◆ operator()() [57/59]

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

Definition at line 243 of file latexdocvisitor.cpp.

244{
245 if (m_hide) return;
246 if (m_insidePre)
247 {
248 m_t << w.chars();
249 }
250 else
251 {
252 m_t << " ";
253 }
254}
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 229 of file latexdocvisitor.cpp.

230{
231 if (m_hide) return;
232 filter(w.word());
233}
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 1783 of file latexdocvisitor.cpp.

1784{
1785 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1786 if (m_hide) return;
1787 if (x.title().empty()) return;
1789 m_t << "\\begin{DoxyRefDesc}{";
1790 filter(x.title());
1791 m_t << "}\n";
1792 bool anonymousEnum = x.file()=="@";
1793 m_t << "\\item[";
1794 if (pdfHyperlinks && !anonymousEnum)
1795 {
1796 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1797 }
1798 else
1799 {
1800 m_t << "\\textbf{ ";
1801 }
1802 m_insideItem=true;
1803 filter(x.title());
1804 m_insideItem=false;
1805 if (pdfHyperlinks && !anonymousEnum)
1806 {
1807 m_t << "}";
1808 }
1809 m_t << "}]";
1810 visitChildren(x);
1811 if (x.title().empty()) return;
1813 m_t << "\\end{DoxyRefDesc}\n";
1814}
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 213 of file latexdocvisitor.h.

214 {
215 m_tableStateStack.pop();
216 }

References m_tableStateStack.

Referenced by operator()().

◆ pushTableState()

void LatexDocVisitor::pushTableState ( )
inlineprivate

Definition at line 209 of file latexdocvisitor.h.

210 {
211 m_tableStateStack.emplace();
212 }

References m_tableStateStack.

Referenced by operator()().

◆ rowSpans()

RowSpanList & LatexDocVisitor::rowSpans ( )
inlineprivate

Definition at line 229 of file latexdocvisitor.h.

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

References m_emptyRowSpanList, and m_tableStateStack.

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

◆ setCurrentColumn()

void LatexDocVisitor::setCurrentColumn ( size_t col)
inlineprivate

Definition at line 221 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ setNumCols()

void LatexDocVisitor::setNumCols ( size_t num)
inlineprivate

Definition at line 225 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ startDiaFile()

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

Definition at line 1989 of file latexdocvisitor.cpp.

1996{
1997 DString baseName=makeBaseName(fileName,".dia");
1998 baseName.prepend("dia_");
1999
2000 DString outDir = Config_getString(LATEX_OUTPUT);
2001 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine,false);
2002 visitPreStart(m_t,hasCaption, baseName, width, height);
2003}
DString & prepend(const char *s)
Definition dstring.h:504
void writeDiaGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, DiaOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Definition dia.cpp:28
DString makeBaseName(const DString &name, const DString &ext)
Definition util.cpp:4303

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

1942{
1943 DString baseName=makeBaseName(fileName,".dot");
1944 baseName.prepend("dot_");
1945 DString outDir = Config_getString(LATEX_OUTPUT);
1946 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine,false);
1947 visitPreStart(m_t,hasCaption, baseName, width, height);
1948}
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 1863 of file latexdocvisitor.cpp.

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

References Config_getBool, DString::empty(), 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 2081 of file latexdocvisitor.cpp.

2088{
2089 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2090 DString outDir = Config_getString(LATEX_OUTPUT);
2091 std::string inBuf;
2092 readInputFile(fileName,inBuf);
2093 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2094 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2095 auto imgExt = MermaidManager::imageExtension(imageFormat);
2097 outDir,DString(),inBuf,imageFormat,
2098 srcFile,srcLine);
2099 auto shortName = stripPath(baseName);
2100 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2101 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2102 visitPreStart(m_t,hasCaption, shortName, width, height);
2103}
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:183
static DString imageExtension(ImageFormat imageFormat)
Definition mermaid.cpp:43
void generateMermaidOutput(const DString &baseName, const DString &outDir, ImageFormat format, bool toIndex)
Register a generated Mermaid image with the index.
Definition mermaid.cpp:116

References Config_getBool, Config_getString, MermaidManager::convertToImageFormat(), DString::DString(), 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 1956 of file latexdocvisitor.cpp.

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

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

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

References Config_getString, DString::DString(), 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 209 of file latexdocvisitor.cpp.

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

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

◆ visitChildren()

◆ writeEndTableCommand()

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

Definition at line 1210 of file latexdocvisitor.cpp.

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

References isTableNested(), and m_t.

Referenced by operator()().

◆ writeMermaidFile()

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

Definition at line 2066 of file latexdocvisitor.cpp.

2067{
2068 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2069 auto shortName = stripPath(baseName);
2070 auto outDir = Config_getString(LATEX_OUTPUT);
2071 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2072 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2073 auto imgExt = MermaidManager::imageExtension(imageFormat);
2074 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2075 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2076 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2079}
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 1979 of file latexdocvisitor.cpp.

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

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

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

References isTableNested(), and m_t.

Referenced by operator()().

Member Data Documentation

◆ m_ci

OutputCodeList& LatexDocVisitor::m_ci
private

Definition at line 181 of file latexdocvisitor.h.

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

◆ m_emptyRowSpanList

RowSpanList LatexDocVisitor::m_emptyRowSpanList
private

Definition at line 197 of file latexdocvisitor.h.

Referenced by rowSpans().

◆ m_hide

◆ m_hierarchyLevel

int LatexDocVisitor::m_hierarchyLevel
private

Definition at line 187 of file latexdocvisitor.h.

Referenced by getSectionName(), and LatexDocVisitor().

◆ m_indentLevel

int LatexDocVisitor::m_indentLevel = 0
private

◆ m_insideItem

bool LatexDocVisitor::m_insideItem
private

◆ m_insidePre

bool LatexDocVisitor::m_insidePre
private

Definition at line 183 of file latexdocvisitor.h.

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

◆ m_langExt

DString LatexDocVisitor::m_langExt
private

Definition at line 186 of file latexdocvisitor.h.

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

◆ m_lcg

LatexCodeGenerator& LatexDocVisitor::m_lcg
private

Definition at line 182 of file latexdocvisitor.h.

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

◆ m_listItemInfo

LatexListItemInfo LatexDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 207 of file latexdocvisitor.h.

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

◆ m_t

◆ m_tableStateStack

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

◆ m_texOrPdf

TexOrPdf LatexDocVisitor::m_texOrPdf = TexOrPdf::NO
private

Definition at line 188 of file latexdocvisitor.h.

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

◆ maxIndentLevels

const int LatexDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 199 of file latexdocvisitor.h.

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


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