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

Concrete visitor implementation for LaTeX output. More...

#include <src/latexdocvisitor.h>

Inheritance diagram for LatexDocVisitor:
Collaboration diagram for LatexDocVisitor:

Classes

struct  ActiveRowSpan
struct  TableState
struct  LatexListItemInfo

Public Member Functions

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

Private Types

typedef std::vector< ActiveRowSpan > RowSpanList

Private Member Functions

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

Private Attributes

TextStream & m_t
OutputCodeList & m_ci
LatexCodeGenerator & m_lcg
bool m_insidePre
bool m_insideItem
bool m_hide
bool m_captionTable
DString m_langExt
int m_hierarchyLevel
TexOrPdf m_texOrPdf = TexOrPdf::NO
std::stack< TableState > m_tableStateStack
RowSpanList m_emptyRowSpanList
int m_indentLevel = 0
LatexListItemInfo m_listItemInfo [maxIndentLevels]

Static Private Attributes

static const int maxIndentLevels = 13

Detailed Description

Concrete visitor implementation for LaTeX output.

Definition at line 37 of file latexdocvisitor.h.

Member Typedef Documentation

◆ RowSpanList

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

Definition at line 132 of file latexdocvisitor.h.

Constructor & Destructor Documentation

◆ LatexDocVisitor()

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

Definition at line 199 of file latexdocvisitor.cpp.

201 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(false),
202 m_insideItem(false), m_hide(false), m_captionTable(false),
203 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
204{
205}
OutputCodeList & m_ci
LatexCodeGenerator & m_lcg

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

Member Function Documentation

◆ addRowSpan()

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

Definition at line 234 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ currentColumn()

size_t LatexDocVisitor::currentColumn ( ) const
inlineprivate

Definition at line 218 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ decIndentLevel()

void LatexDocVisitor::decIndentLevel ( )
private

Definition at line 2118 of file latexdocvisitor.cpp.

2119{
2120 if (m_indentLevel>0)
2121 {
2122 m_indentLevel--;
2123 }
2124}

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

1999{
2000 if (m_hide) return;
2001 visitPostEnd(m_t,hasCaption);
2002}
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 1943 of file latexdocvisitor.cpp.

1944{
1945 if (m_hide) return;
1946 visitPostEnd(m_t,hasCaption);
1947}

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

1904{
1905 m_t << "}";
1906 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1907 if (ref.empty() && !pdfHyperLinks)
1908 {
1909 m_t << "{";
1911 m_t << "}{" << file;
1912 if (!file.empty() && !anchor.empty()) m_t << "_";
1913 m_t << anchor << "}";
1914 if (refToSection)
1915 {
1916 m_t << "{" << sectionType.level() << "}";
1917 }
1918 }
1919 if (ref.empty() && pdfHyperLinks) // internal PDF link
1920 {
1921 if (refToSection)
1922 {
1923 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1924 }
1925 }
1926}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
void filter(const DString &str, const bool retainNewLine=false, const bool citeEntry=false)
constexpr int level() const
Definition section.h:46
virtual DString trPageAbbreviation()=0
#define Config_getBool(name)
Definition config.h:33
Translator * theTranslator
Definition language.cpp:76
@ PDF
called through texorpdf as PDF (second) part

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

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

◆ endMermaidFile()

void LatexDocVisitor::endMermaidFile ( bool hasCaption)
private

Definition at line 2098 of file latexdocvisitor.cpp.

2099{
2100 if (m_hide) return;
2101 visitPostEnd(m_t,hasCaption);
2102}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endMscFile()

void LatexDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 1965 of file latexdocvisitor.cpp.

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

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2053 of file latexdocvisitor.cpp.

2054{
2055 if (m_hide) return;
2056 visitPostEnd(m_t,hasCaption);
2057}

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

1844{
1845 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1850 m_lcg.usedTableLevel()>0, // insideTable
1851 false, // keepSpaces
1852 retainNewLine
1853 );
1854}
int usedTableLevel() const
Definition latexgen.h:68
bool insideTabbing() const
Definition latexgen.h:73
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 50 of file latexdocvisitor.cpp.

51{
52 bool compactLatex = Config_getBool(COMPACT_LATEX);
53 int l = level;
54 if (compactLatex) l++;
55
57 {
58 l += m_hierarchyLevel; /* May be -1 if generating main page */
59 // Sections get special treatment because they inherit the parent's level
60 return LatexSections::name(l);
61 }
62 else if (l == LatexSections::maxLevels)
63 {
64 return g_paragraphLabel;
65 }
66 else
67 {
69 }
70}
static const char * g_subparagraphLabel
static const char * g_paragraphLabel
const char * name(int level)
Definition latexgen.h:368
constexpr int maxLevels
Definition latexgen.h:366

References Config_getBool, g_paragraphLabel, g_subparagraphLabel, m_hierarchyLevel, LatexSections::maxLevels, and LatexSections::name().

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

◆ incIndentLevel()

void LatexDocVisitor::incIndentLevel ( )
private

Definition at line 2109 of file latexdocvisitor.cpp.

2110{
2111 m_indentLevel++;
2113 {
2114 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2115 }
2116}
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 2104 of file latexdocvisitor.cpp.

2105{
2106 return std::min(m_indentLevel,maxIndentLevels-1);
2107}

References m_indentLevel, and maxIndentLevels.

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

◆ insideTable()

bool LatexDocVisitor::insideTable ( ) const
inlineprivate

Definition at line 238 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ isTableNested()

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

Definition at line 1178 of file latexdocvisitor.cpp.

1179{
1180 bool isNested=m_lcg.usedTableLevel()>0;
1181 while (n && !isNested)
1182 {
1184 n = ::parent(n);
1185 }
1186 return isNested;
1187}
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 501 of file latexdocvisitor.cpp.

502{
503 if (m_hide) return;
504 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
505 if (!anc.file().empty() && Config_getBool(PDF_HYPERLINKS))
506 {
507 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
508 << "}%\n";
509 }
510}
DString anchor() const
Definition docnode.h:232
DString file() const
Definition docnode.h:233
DString stripPath(const DString &s)
Definition util.cpp:3961

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

◆ operator()() [2/59]

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

Definition at line 737 of file latexdocvisitor.cpp.

738{
739 if (m_hide) return;
740 if (m_indentLevel>=maxIndentLevels-1) return;
741 if (l.isEnumList())
742 {
743 m_t << "\n\\begin{DoxyEnumerate}";
745 }
746 else
747 {
749 m_t << "\n\\begin{DoxyItemize}";
750 }
751 visitChildren(l);
752 if (l.isEnumList())
753 {
754 m_t << "\n\\end{DoxyEnumerate}";
755 }
756 else
757 {
758 m_t << "\n\\end{DoxyItemize}";
759 }
760}
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 762 of file latexdocvisitor.cpp.

763{
764 if (m_hide) return;
765 switch (li.itemNumber())
766 {
767 case DocAutoList::Unchecked: // unchecked
768 m_t << "\n\\item[\\DoxyUnchecked] ";
769 break;
770 case DocAutoList::Checked_x: // checked with x
771 case DocAutoList::Checked_X: // checked with X
772 m_t << "\n\\item[\\DoxyChecked] ";
773 break;
774 default:
775 m_t << "\n\\item ";
776 break;
777 }
779 visitChildren(li);
781}
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 669 of file latexdocvisitor.cpp.

670{
671 if (m_hide) return;
672 auto opt = cite.option();
673 DString txt;
674 if (m_texOrPdf == TexOrPdf::PDF || opt.noCite())
675 {
676 if (!cite.file().empty())
677 {
678 txt = cite.getText();
679 }
680 else
681 {
682 if (!opt.noPar()) txt += "[";
683 txt += cite.target();
684 if (!opt.noPar()) txt += "]";
685 }
686 m_t << "{\\bfseries ";
687 filter(txt);
688 m_t << "}";
689 }
690 else
691 {
692 if (!cite.file().empty())
693 {
694 DString anchor = cite.anchor();
695 DString anchorPrefix = CitationManager::instance().anchorPrefix();
696 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
697
698 if (m_texOrPdf == TexOrPdf::TEX) txt = "\\protect";
699 txt += "\\DoxyCite{" + anchor + "}";
700 if (opt.isNumber())
701 {
702 txt += "{number}";
703 }
704 else if (opt.isShortAuthor())
705 {
706 txt += "{shortauthor}";
707 }
708 else if (opt.isYear())
709 {
710 txt += "{year}";
711 }
712 if (!opt.noPar()) txt += "{1}";
713 else txt += "{0}";
714 m_t << txt;
715
716 txt = cite.getText();
717 m_t << "{\\bfseries ";
718 filter(txt);
719 m_t << "}";
720 }
721 else
722 {
723 if (!opt.noPar()) txt += "[";
724 txt += cite.target();
725 if (!opt.noPar()) txt += "]";
726 m_t << "{\\bfseries ";
727 filter(txt);
728 m_t << "}";
729 }
730 }
731}
static CitationManager & instance()
Definition cite.cpp:90
DString anchorPrefix() const
Definition cite.cpp:131
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
DString getText() const
Definition docnode.cpp:988
DString anchor() const
Definition docnode.h:251
CiteInfoOption option() const
Definition docnode.h:253
DString target() const
Definition docnode.h:252
DString file() const
Definition docnode.h:248
@ TEX
called through texorpdf as TeX (first) part

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

◆ operator()() [5/59]

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

Definition at line 1522 of file latexdocvisitor.cpp.

1523{
1524 if (m_hide) return;
1525 bool exists = false;
1526 std::string inBuf;
1527 if (readInputFile(df.file(),inBuf))
1528 {
1529 auto fileName = writeInlineGraph(Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1530 ".dia", // extension
1531 inBuf, // contents
1532 exists);
1533 if (!fileName.empty())
1534 {
1535 startDiaFile(fileName,df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine(),!exists);
1536 visitChildren(df);
1537 endDiaFile(df.hasCaption());
1538 }
1539 }
1540}
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:5398
bool readInputFile(const DString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:4375

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

◆ operator()() [6/59]

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

Definition at line 1482 of file latexdocvisitor.cpp.

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

279{
280 if (m_hide) return;
281 DString emojiName = EmojiEntityMapper::instance().name(s.index());
282 if (!emojiName.empty())
283 {
284 DString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
285 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
286 filter(emojiName);
287 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
288 }
289 else
290 {
291 m_t << s.name();
292 }
293}
int index() const
Definition docnode.h:345
DString name() const
Definition docnode.h:344
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2029
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1981

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

◆ operator()() [8/59]

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

Definition at line 640 of file latexdocvisitor.cpp.

641{
642 if (m_hide) return;
643 DString s = f.text();
644 const char *p = s.data();
645 char c = 0;
646 if (p)
647 {
648 while ((c=*p++))
649 {
650 switch (c)
651 {
652 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
653 default: m_t << c; break;
654 }
655 }
656 }
657}
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
DString text() const
Definition docnode.h:533

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

◆ operator()() [9/59]

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

Definition at line 326 of file latexdocvisitor.cpp.

327{
328 if (m_hide) return;
329 if (insideTable())
330 m_t << "\\DoxyHorRuler{1}\n";
331 else
332 m_t << "\\DoxyHorRuler{0}\n";
333}
bool insideTable() const

References insideTable(), m_hide, and m_t.

◆ operator()() [10/59]

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

Definition at line 1411 of file latexdocvisitor.cpp.

1412{
1413 if (m_hide) return;
1414 if (Config_getBool(PDF_HYPERLINKS))
1415 {
1416 m_t << "\\href{";
1417 m_t << latexFilterURL(href.url());
1418 m_t << "}";
1419 }
1420 m_t << "{\\texttt{";
1421 visitChildren(href);
1422 m_t << "}}";
1423}
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 1823 of file latexdocvisitor.cpp.

1824{
1825 if (m_hide) return;
1826 m_t << "\\begin{quote}\n";
1828 visitChildren(q);
1829 m_t << "\\end{quote}\n";
1831}

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

◆ operator()() [12/59]

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

Definition at line 1260 of file latexdocvisitor.cpp.

1261{
1262 if (m_hide) return;
1263 visitChildren(c);
1264}

References m_hide, and visitChildren().

◆ operator()() [13/59]

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

Definition at line 1296 of file latexdocvisitor.cpp.

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

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

◆ operator()() [14/59]

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

Definition at line 1169 of file latexdocvisitor.cpp.

1170{
1172 if (!m_insideItem) m_t << "\\hfill";
1173 m_t << " \\\\\n";
1174 visitChildren(dd);
1176}

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

◆ operator()() [15/59]

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

Definition at line 1135 of file latexdocvisitor.cpp.

1136{
1137 if (m_hide) return;
1138 bool eq = classEqualsReflist(dl);
1139 if (eq)
1140 {
1141 m_t << "\n\\begin{DoxyRefList}";
1142 }
1143 else
1144 {
1145 if (listIsNested(dl)) m_t << "\n\\hfill";
1146 m_t << "\n\\begin{DoxyDescription}";
1147 }
1148 visitChildren(dl);
1149 if (eq)
1150 {
1151 m_t << "\n\\end{DoxyRefList}";
1152 }
1153 else
1154 {
1155 m_t << "\n\\end{DoxyDescription}";
1156 }
1157}
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 1159 of file latexdocvisitor.cpp.

1160{
1161 if (m_hide) return;
1162 m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
1163 m_insideItem=true;
1164 visitChildren(dt);
1165 m_insideItem=false;
1166 m_t << "}}]";
1167}

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

◆ operator()() [17/59]

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

Definition at line 1433 of file latexdocvisitor.cpp.

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

1455{
1456 if (m_hide) return;
1457 m_t << "\\" << getSectionName(header.level()) << "*{";
1458 visitChildren(header);
1459 m_t << "}";
1460}
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 1019 of file latexdocvisitor.cpp.

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

1087{
1088 if (m_hide) return;
1089 if (m_listItemInfo[indentLevel()].isEnum)
1090 {
1091 for (const auto &opt : l.attribs())
1092 {
1093 if (opt.name=="value")
1094 {
1095 bool ok = false;
1096 int val = opt.value.toInt(&ok);
1097 if (ok)
1098 {
1099 m_t << "\n\\setcounter{DoxyEnumerate" << DString::integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1100 }
1101 }
1102 }
1103 }
1104 m_t << "\n\\item ";
1106 visitChildren(l);
1108}
static DString integerToRoman(int n, bool upper=true)
Definition dstring.cpp:638
const HtmlAttribList & attribs() const
Definition docnode.h:1175

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

◆ operator()() [21/59]

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

Definition at line 1266 of file latexdocvisitor.cpp.

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

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

◆ operator()() [22/59]

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

Definition at line 1425 of file latexdocvisitor.cpp.

1426{
1427 if (m_hide) return;
1428 m_t << "{\\bfseries{";
1429 visitChildren(d);
1430 m_t << "}}";
1431}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/59]

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

Definition at line 1213 of file latexdocvisitor.cpp.

1214{
1215 if (m_hide) return;
1217 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1218 if (c)
1219 {
1220 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1221 if (!c->file().empty() && pdfHyperLinks)
1222 {
1223 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1224 << "}{}";
1225 }
1226 m_t << "\n";
1227 }
1228
1230 if (!isTableNested(t.parent()))
1231 {
1232 // write caption
1233 m_t << "{";
1234 if (c)
1235 {
1236 m_captionTable = true;
1237 std::visit(*this, *t.caption());
1238 m_captionTable = false;
1239 }
1240 m_t << "}";
1241 // write label
1242 m_t << "{";
1243 if (c && (!stripPath(c->file()).empty() || !c->anchor().empty()))
1244 {
1245 m_t << stripPath(c->file()) << "_" << c->anchor();
1246 }
1247 m_t << "}";
1248 }
1249
1250 // write head row(s)
1251 m_t << "{" << t.numberHeaderRows() << "}\n";
1252
1254
1255 visitChildren(t);
1257 popTableState();
1258}
DString file() const
Definition docnode.h:1239
DString anchor() const
Definition docnode.h:1240
size_t numberHeaderRows() const
Definition docnode.cpp:2349
size_t numColumns() const
Definition docnode.h:1283
const DocNodeVariant * caption() const
Definition docnode.cpp:2344
DocNodeVariant * parent()
Definition docnode.h:89
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)
bool isTableNested(const DocNodeVariant *n) const

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

◆ operator()() [24/59]

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

Definition at line 1462 of file latexdocvisitor.cpp.

1463{
1464 if (img.type()==DocImage::Latex)
1465 {
1466 if (m_hide) return;
1467 DString gfxName = img.name();
1468 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1469 {
1470 gfxName=gfxName.left(gfxName.length()-4);
1471 }
1472
1473 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1474 visitChildren(img);
1476 }
1477 else // other format -> skip
1478 {
1479 }
1480}
DString left(size_t len) const
Definition dstring.h:306
bool endsWith(const char *s) const
Definition dstring.h:617
Type type() const
Definition docnode.h:647
DString width() const
Definition docnode.h:650
DString name() const
Definition docnode.h:648
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
DString height() const
Definition docnode.h:651
static void visitPreStart(TextStream &t, bool hasCaption, DString name, DString width, DString height, bool inlineImage=false)

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

◆ operator()() [25/59]

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

Definition at line 512 of file latexdocvisitor.cpp.

513{
514 if (m_hide) return;
516 switch(inc.type())
517 {
519 {
520 m_ci.startCodeFragment("DoxyCodeInclude");
521 FileInfo cfi( inc.file().str() );
522 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
524 inc.text(),
525 langExt,
526 inc.stripCodeComments(),
527 CodeParserOptions()
528 .setExample(inc.isExample(), inc.exampleFile())
529 .setFileDef(fd.get())
530 .setInlineFragment(true)
531 );
532 m_ci.endCodeFragment("DoxyCodeInclude");
533 }
534 break;
536 {
537 m_ci.startCodeFragment("DoxyCodeInclude");
539 inc.text(),langExt,
540 inc.stripCodeComments(),
541 CodeParserOptions()
542 .setExample(inc.isExample(), inc.exampleFile())
543 .setInlineFragment(true)
544 .setShowLineNumbers(false)
545 );
546 m_ci.endCodeFragment("DoxyCodeInclude");
547 }
548 break;
556 break;
558 m_t << inc.text();
559 break;
561 if (isTableNested(inc.parent())) // in table
562 {
563 m_t << "\\begin{DoxyCode}{0}";
564 filter(inc.text(), true);
565 m_t << "\\end{DoxyCode}\n";
566 }
567 else
568 {
569 m_t << "\n\\begin{DoxyVerbInclude}\n";
570 m_t << inc.text();
571 m_t << "\\end{DoxyVerbInclude}\n";
572 }
573 break;
576 {
577 m_ci.startCodeFragment("DoxyCodeInclude");
579 inc.file(),
580 inc.blockId(),
581 inc.context(),
583 inc.trimLeft(),
585 );
586 m_ci.endCodeFragment("DoxyCodeInclude");
587 }
588 break;
589 }
590}
static CodeFragmentManager & instance()
void parseCodeFragment(OutputCodeList &codeOutList, const DString &fileName, const DString &blockId, const DString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
virtual void parseCode(OutputCodeList &codeOutList, const DString &scopeName, const DString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
const std::string & str() const
Definition dstring.h:645
bool stripCodeComments() const
Definition docnode.h:455
DString blockId() const
Definition docnode.h:454
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
DString context() const
Definition docnode.h:453
Type type() const
Definition docnode.h:451
DString exampleFile() const
Definition docnode.h:457
DString text() const
Definition docnode.h:452
DString file() const
Definition docnode.h:449
DString extension() const
Definition docnode.h:450
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
CodeParserInterface & getCodeParser(const DString &langExt)
void startCodeFragment(const DString &style)
Definition outputlist.h:276
void endCodeFragment(const DString &style)
Definition outputlist.h:279
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Definition filedef.cpp:269
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4169

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

◆ operator()() [26/59]

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

Definition at line 592 of file latexdocvisitor.cpp.

593{
594 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
595 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
596 if (op.isFirst())
597 {
598 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
600 m_hide = true;
601 }
602 DString locLangExt = getFileNameExtension(op.includeFileName());
603 if (locLangExt.empty()) locLangExt = m_langExt;
604 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
605 if (op.type()!=DocIncOperator::Skip)
606 {
607 m_hide = popHidden();
608 if (!m_hide)
609 {
610 std::unique_ptr<FileDef> fd;
611 if (!op.includeFileName().empty())
612 {
613 FileInfo cfi( op.includeFileName().str() );
614 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
615 }
616
617 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
619 CodeParserOptions()
620 .setExample(op.isExample(),op.exampleFile())
621 .setFileDef(fd.get())
622 .setStartLine(op.line())
623 .setShowLineNumbers(op.showLineNo())
624 );
625 }
627 m_hide=true;
628 }
629 if (op.isLast())
630 {
632 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
633 }
634 else
635 {
636 if (!m_hide) m_t << "\n";
637 }
638}
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
DString text() const
Definition docnode.h:499
DString context() const
Definition docnode.h:501
DString exampleFile() const
Definition docnode.h:508
DString includeFileName() const
Definition docnode.h:509
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
void pushHidden(bool hide)
bool popHidden()
DString getFileNameExtension(const DString &fn)
Definition util.cpp:4211

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

◆ operator()() [27/59]

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

Definition at line 659 of file latexdocvisitor.cpp.

660{
661 if (m_hide) return;
663}
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 1405 of file latexdocvisitor.cpp.

1406{
1407 if (m_hide) return;
1408 visitChildren(i);
1409}

References m_hide, and visitChildren().

◆ operator()() [29/59]

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

Definition at line 1809 of file latexdocvisitor.cpp.

1810{
1811 if (m_hide) return;
1812 startLink(DString(),ref.file(),ref.anchor());
1813 visitChildren(ref);
1814 endLink(DString(),ref.file(),ref.anchor());
1815}
DString anchor() const
Definition docnode.h:822
DString file() const
Definition docnode.h:820
void startLink(const DString &ref, const DString &file, const DString &anchor, bool refToTable=false, bool refToSection=false)
void endLink(const DString &ref, const DString &file, const DString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)

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

◆ operator()() [30/59]

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

Definition at line 309 of file latexdocvisitor.cpp.

310{
311 if (m_hide) return;
312 if (m_insideItem)
313 {
314 m_t << "\\\\\n";
315 }
316 else if (m_captionTable)
317 {
318 m_t << "\\hspace{\\textwidth minus \\textwidth}\\mbox{}\\\\ ";
319 }
320 else
321 {
322 m_t << "~\\newline\n";
323 }
324}

References m_captionTable, m_hide, m_insideItem, and m_t.

◆ operator()() [31/59]

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

Definition at line 1561 of file latexdocvisitor.cpp.

1562{
1563 if (m_hide) return;
1564 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1565 visitChildren(lnk);
1566 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1567}

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

218{
219 if (m_hide) return;
220 startLink(w.ref(),w.file(),w.anchor());
221 filter(w.word());
222 endLink(w.ref(),w.file(),w.anchor());
223}
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 1551 of file latexdocvisitor.cpp.

1552{
1553 if (m_hide) return;
1554 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1555 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1556 startMermaidFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1557 visitChildren(df);
1559}
void startMermaidFile(const DString &fileName, const DString &width, const DString &height, bool hasCaption, const DString &srcFile, int srcLine)
void endMermaidFile(bool hasCaption)
bool copyFile(const DString &src, const DString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:4620

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

◆ operator()() [34/59]

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

Definition at line 1502 of file latexdocvisitor.cpp.

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

784{
785 if (m_hide) return;
786 visitChildren(p);
787 if (!p.isLast() && // omit <p> for last paragraph
788 !(p.parent() && // and for parameter sections
789 std::get_if<DocParamSect>(p.parent())
790 )
791 )
792 {
793 if (insideTable())
794 {
795 m_t << "~\\newline\n";
796 }
797 else
798 {
799 m_t << "\n\n";
800 }
801 }
802}
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 1701 of file latexdocvisitor.cpp.

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

1643{
1644 if (m_hide) return;
1645 bool hasInOutSpecs = s.hasInOutSpecifier();
1646 bool hasTypeSpecs = s.hasTypeSpecifier();
1648 switch(s.type())
1649 {
1651 m_t << "\n\\begin{DoxyParams}";
1652 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1653 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1654 m_t << "{";
1656 break;
1658 m_t << "\n\\begin{DoxyRetVals}{";
1660 break;
1662 m_t << "\n\\begin{DoxyExceptions}{";
1664 break;
1666 m_t << "\n\\begin{DoxyTemplParams}{";
1668 break;
1669 default:
1670 ASSERT(0);
1672 }
1673 m_t << "}\n";
1674 visitChildren(s);
1676 switch(s.type())
1677 {
1679 m_t << "\\end{DoxyParams}\n";
1680 break;
1682 m_t << "\\end{DoxyRetVals}\n";
1683 break;
1685 m_t << "\\end{DoxyExceptions}\n";
1686 break;
1688 m_t << "\\end{DoxyTemplParams}\n";
1689 break;
1690 default:
1691 ASSERT(0);
1693 }
1694}
void decUsedTableLevel()
Definition latexgen.h:67
void incUsedTableLevel()
Definition latexgen.h:66
virtual DString trExceptions()=0
virtual DString trParameters()=0
virtual DString trReturnValues()=0
virtual DString trTemplateParameters()=0
#define ASSERT(x)
Definition message.h:142

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

◆ operator()() [38/59]

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

Definition at line 1837 of file latexdocvisitor.cpp.

1838{
1839 if (m_hide) return;
1840 visitChildren(pb);
1841}

References m_hide, and visitChildren().

◆ operator()() [39/59]

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

Definition at line 1542 of file latexdocvisitor.cpp.

1543{
1544 if (m_hide) return;
1545 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1546 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1547 visitChildren(df);
1549}
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 1569 of file latexdocvisitor.cpp.

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

805{
806 visitChildren(r);
807}

References visitChildren().

◆ operator()() [42/59]

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

Definition at line 1597 of file latexdocvisitor.cpp.

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

1629{
1630 if (m_hide) return;
1631 m_t << "\\footnotesize\n";
1632 m_t << "\\begin{multicols}{2}\n";
1633 m_t << "\\begin{DoxyCompactList}\n";
1635 visitChildren(l);
1637 m_t << "\\end{DoxyCompactList}\n";
1638 m_t << "\\end{multicols}\n";
1639 m_t << "\\normalsize\n";
1640}

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

◆ operator()() [44/59]

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

Definition at line 985 of file latexdocvisitor.cpp.

986{
987 if (m_hide) return;
988 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
989 if (pdfHyperlinks)
990 {
991 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
992 }
993 m_t << "\\" << getSectionName(s.level()) << "{";
994 if (pdfHyperlinks)
995 {
996 m_t << "\\texorpdfstring{";
997 }
998 if (s.title())
999 {
1000 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1001 std::visit(*this,*s.title());
1003 }
1004 if (pdfHyperlinks)
1005 {
1006 m_t << "}{";
1007 if (s.title())
1008 {
1009 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1010 std::visit(*this,*s.title());
1012 }
1013 m_t << "}";
1014 }
1015 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1016 visitChildren(s);
1017}
DString file() const
Definition docnode.h:931
int level() const
Definition docnode.h:927
DString anchor() const
Definition docnode.h:929
const DocNodeVariant * title() const
Definition docnode.h:928
@ NO
not called through texorpdf

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

◆ operator()() [45/59]

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

Definition at line 1696 of file latexdocvisitor.cpp.

1697{
1698 m_t << " " << sep.chars() << " ";
1699}
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 964 of file latexdocvisitor.cpp.

965{
966 if (m_hide) return;
967 m_t << "\\begin{DoxyItemize}\n";
969 visitChildren(l);
970 m_t << "\\end{DoxyItemize}\n";
971}

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

974{
975 if (m_hide) return;
976 m_t << "\\item ";
978 if (li.paragraph())
979 {
980 visit(*this,*li.paragraph());
981 }
983}
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 809 of file latexdocvisitor.cpp.

810{
811 if (m_hide) return;
812 switch(s.type())
813 {
815 m_t << "\\begin{DoxySeeAlso}{";
817 break;
819 m_t << "\\begin{DoxyReturn}{";
821 break;
823 m_t << "\\begin{DoxyAuthor}{";
824 filter(theTranslator->trAuthor(true,true));
825 break;
827 m_t << "\\begin{DoxyAuthor}{";
828 filter(theTranslator->trAuthor(true,false));
829 break;
831 m_t << "\\begin{DoxyVersion}{";
833 break;
835 m_t << "\\begin{DoxySince}{";
837 break;
839 m_t << "\\begin{DoxyDate}{";
841 break;
843 m_t << "\\begin{DoxyNote}{";
845 break;
847 m_t << "\\begin{DoxyWarning}{";
849 break;
851 m_t << "\\begin{DoxyPrecond}{";
853 break;
855 m_t << "\\begin{DoxyPostcond}{";
857 break;
859 m_t << "\\begin{DoxyCopyright}{";
861 break;
863 m_t << "\\begin{DoxyInvariant}{";
865 break;
867 m_t << "\\begin{DoxyRemark}{";
869 break;
871 m_t << "\\begin{DoxyAttention}{";
873 break;
875 m_t << "\\begin{DoxyImportant}{";
877 break;
879 m_t << "\\begin{DoxyParagraph}{";
880 break;
882 m_t << "\\begin{DoxyParagraph}{";
883 break;
884 case DocSimpleSect::Unknown: break;
885 }
886
887 if (s.title())
888 {
889 m_insideItem=true;
890 std::visit(*this,*s.title());
891 m_insideItem=false;
892 }
893 m_t << "}\n";
895 visitChildren(s);
896 switch(s.type())
897 {
899 m_t << "\n\\end{DoxySeeAlso}\n";
900 break;
902 m_t << "\n\\end{DoxyReturn}\n";
903 break;
905 m_t << "\n\\end{DoxyAuthor}\n";
906 break;
908 m_t << "\n\\end{DoxyAuthor}\n";
909 break;
911 m_t << "\n\\end{DoxyVersion}\n";
912 break;
914 m_t << "\n\\end{DoxySince}\n";
915 break;
917 m_t << "\n\\end{DoxyDate}\n";
918 break;
920 m_t << "\n\\end{DoxyNote}\n";
921 break;
923 m_t << "\n\\end{DoxyWarning}\n";
924 break;
926 m_t << "\n\\end{DoxyPrecond}\n";
927 break;
929 m_t << "\n\\end{DoxyPostcond}\n";
930 break;
932 m_t << "\n\\end{DoxyCopyright}\n";
933 break;
935 m_t << "\n\\end{DoxyInvariant}\n";
936 break;
938 m_t << "\n\\end{DoxyRemark}\n";
939 break;
941 m_t << "\n\\end{DoxyAttention}\n";
942 break;
944 m_t << "\n\\end{DoxyImportant}\n";
945 break;
947 m_t << "\n\\end{DoxyParagraph}\n";
948 break;
950 m_t << "\n\\end{DoxyParagraph}\n";
951 break;
952 default:
953 break;
954 }
956}
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 665 of file latexdocvisitor.cpp.

666{
667}

◆ operator()() [50/59]

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

Definition at line 335 of file latexdocvisitor.cpp.

336{
337 if (m_hide) return;
338 switch (s.style())
339 {
341 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
342 break;
346 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
347 break;
350 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
351 break;
353 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
354 break;
358 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
359 break;
361 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
362 break;
364 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
365 break;
367 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
368 break;
370 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
371 break;
373 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
374 break;
376 if (s.enable())
377 {
378 m_t << "\n\\begin{DoxyPre}";
379 m_insidePre=true;
380 }
381 else
382 {
383 m_insidePre=false;
384 m_t << "\\end{DoxyPre}\n";
385 }
386 break;
387 case DocStyleChange::Div: /* HTML only */ break;
388 case DocStyleChange::Span: /* HTML only */ break;
389 }
390}
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 238 of file latexdocvisitor.cpp.

239{
240 if (m_hide) return;
241 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
242 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
243 if (res)
244 {
246 {
247 if (pdfHyperlinks)
248 {
249 m_t << "\\texorpdfstring{$<$}{<}";
250 }
251 else
252 {
253 m_t << "$<$";
254 }
255 }
257 {
258 if (pdfHyperlinks)
259 {
260 m_t << "\\texorpdfstring{$>$}{>}";
261 }
262 else
263 {
264 m_t << "$>$";
265 }
266 }
267 else
268 {
269 m_t << res;
270 }
271 }
272 else
273 {
274 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),true));
275 }
276}
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 1817 of file latexdocvisitor.cpp.

1818{
1819 if (m_hide) return;
1820 visitChildren(t);
1821}

References m_hide, and visitChildren().

◆ operator()() [53/59]

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

Definition at line 958 of file latexdocvisitor.cpp.

959{
960 if (m_hide) return;
961 visitChildren(t);
962}

References m_hide, and visitChildren().

◆ operator()() [54/59]

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

Definition at line 295 of file latexdocvisitor.cpp.

296{
297 if (m_hide) return;
298 if (Config_getBool(PDF_HYPERLINKS))
299 {
300 m_t << "\\href{";
301 if (u.isEmail()) m_t << "mailto:";
302 m_t << latexFilterURL(u.url()) << "}";
303 }
304 m_t << "{\\texttt{";
305 filter(u.url());
306 m_t << "}}";
307}
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 392 of file latexdocvisitor.cpp.

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

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

◆ operator()() [56/59]

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

Definition at line 1833 of file latexdocvisitor.cpp.

1834{
1835}

◆ operator()() [57/59]

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

Definition at line 225 of file latexdocvisitor.cpp.

226{
227 if (m_hide) return;
228 if (m_insidePre)
229 {
230 m_t << w.chars();
231 }
232 else
233 {
234 m_t << " ";
235 }
236}
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 211 of file latexdocvisitor.cpp.

212{
213 if (m_hide) return;
214 filter(w.word());
215}
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 1776 of file latexdocvisitor.cpp.

1777{
1778 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1779 if (m_hide) return;
1780 if (x.title().empty()) return;
1782 m_t << "\\begin{DoxyRefDesc}{";
1783 filter(x.title());
1784 m_t << "}\n";
1785 bool anonymousEnum = x.file()=="@";
1786 m_t << "\\item[";
1787 if (pdfHyperlinks && !anonymousEnum)
1788 {
1789 m_t << "\\doxymbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1790 }
1791 else
1792 {
1793 m_t << "\\textbf{ ";
1794 }
1795 m_insideItem=true;
1796 filter(x.title());
1797 m_insideItem=false;
1798 if (pdfHyperlinks && !anonymousEnum)
1799 {
1800 m_t << "}";
1801 }
1802 m_t << "}]";
1803 visitChildren(x);
1804 if (x.title().empty()) return;
1806 m_t << "\\end{DoxyRefDesc}\n";
1807}
DString anchor() const
Definition docnode.h:625
DString file() const
Definition docnode.h:624
DString title() const
Definition docnode.h:626

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

◆ popTableState()

void LatexDocVisitor::popTableState ( )
inlineprivate

Definition at line 214 of file latexdocvisitor.h.

215 {
216 m_tableStateStack.pop();
217 }

References m_tableStateStack.

Referenced by operator()().

◆ pushTableState()

void LatexDocVisitor::pushTableState ( )
inlineprivate

Definition at line 210 of file latexdocvisitor.h.

211 {
212 m_tableStateStack.emplace();
213 }

References m_tableStateStack.

Referenced by operator()().

◆ rowSpans()

RowSpanList & LatexDocVisitor::rowSpans ( )
inlineprivate

Definition at line 230 of file latexdocvisitor.h.

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

References m_emptyRowSpanList, and m_tableStateStack.

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

◆ setCurrentColumn()

void LatexDocVisitor::setCurrentColumn ( size_t col)
inlineprivate

Definition at line 222 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ setNumCols()

void LatexDocVisitor::setNumCols ( size_t num)
inlineprivate

Definition at line 226 of file latexdocvisitor.h.

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

References m_tableStateStack.

Referenced by operator()().

◆ startDiaFile()

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

Definition at line 1982 of file latexdocvisitor.cpp.

1989{
1990 DString baseName=makeBaseName(fileName,".dia");
1991 baseName.prepend("dia_");
1992
1993 DString outDir = Config_getString(LATEX_OUTPUT);
1994 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine,false);
1995 visitPreStart(m_t,hasCaption, baseName, width, height);
1996}
DString & prepend(const char *s)
Definition dstring.h:515
void writeDiaGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, DiaOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Definition dia.cpp:29
DString makeBaseName(const DString &name, const DString &ext)
Definition util.cpp:3975

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

Referenced by operator()().

◆ startDotFile()

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

Definition at line 1928 of file latexdocvisitor.cpp.

1935{
1936 DString baseName=makeBaseName(fileName,".dot");
1937 baseName.prepend("dot_");
1938 DString outDir = Config_getString(LATEX_OUTPUT);
1939 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine,false);
1940 visitPreStart(m_t,hasCaption, baseName, width, height);
1941}
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 1856 of file latexdocvisitor.cpp.

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

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

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

◆ startMermaidFile()

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

Definition at line 2074 of file latexdocvisitor.cpp.

2081{
2082 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2083 DString outDir = Config_getString(LATEX_OUTPUT);
2084 std::string inBuf;
2085 readInputFile(fileName,inBuf);
2086 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2087 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2088 auto imgExt = MermaidManager::imageExtension(imageFormat);
2090 outDir,DString(),inBuf,imageFormat,
2091 srcFile,srcLine);
2092 auto shortName = stripPath(baseName);
2093 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2094 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2095 visitPreStart(m_t,hasCaption, shortName, width, height);
2096}
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
static DString imageExtension(ImageFormat imageFormat)
Definition mermaid.cpp:48
void generateMermaidOutput(const DString &baseName, const DString &outDir, ImageFormat format, bool toIndex)
Register a generated Mermaid image with the index.
Definition mermaid.cpp:121

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

Referenced by operator()().

◆ startMscFile()

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

Definition at line 1949 of file latexdocvisitor.cpp.

1956{
1957 DString baseName=makeBaseName(fileName,".msc");
1958 baseName.prepend("msc_");
1959
1960 DString outDir = Config_getString(LATEX_OUTPUT);
1961 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine,false);
1962 visitPreStart(m_t,hasCaption, baseName, width, height);
1963}
void writeMscGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, MscOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Definition msc.cpp:160

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

Referenced by operator()().

◆ startPlantUmlFile()

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

Definition at line 2019 of file latexdocvisitor.cpp.

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

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

Referenced by operator()().

◆ visitCaption()

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

Definition at line 191 of file latexdocvisitor.cpp.

192{
193 for (const auto &n : children)
194 {
195 std::visit(*this,n);
196 }
197}

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

◆ visitChildren()

◆ writeEndTableCommand()

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

Definition at line 1201 of file latexdocvisitor.cpp.

1202{
1203 if (isTableNested(n))
1204 {
1205 m_t << "\\end{DoxyTableNested}\n";
1206 }
1207 else
1208 {
1209 m_t << "\\end{DoxyTable}\n";
1210 }
1211}

References isTableNested(), and m_t.

Referenced by operator()().

◆ writeMermaidFile()

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

Definition at line 2059 of file latexdocvisitor.cpp.

2060{
2061 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
2062 auto shortName = stripPath(baseName);
2063 auto outDir = Config_getString(LATEX_OUTPUT);
2064 auto outputFormat = MermaidManager::OutputFormat::LaTeX;
2065 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
2066 auto imgExt = MermaidManager::imageExtension(imageFormat);
2067 if (shortName.find('.')==DString::npos) shortName += "." + imgExt;
2068 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
2069 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2072}
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 1972 of file latexdocvisitor.cpp.

1973{
1974 DString shortName=makeBaseName(fileName,".msc");
1975 DString outDir = Config_getString(LATEX_OUTPUT);
1976 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine(),false);
1977 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
1980}

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

1190{
1191 if (isTableNested(n))
1192 {
1193 m_t << "\\begin{DoxyTableNested}{" << cols << "}";
1194 }
1195 else
1196 {
1197 m_t << "\n\\begin{DoxyTable}{" << cols << "}";
1198 }
1199}

References isTableNested(), and m_t.

Referenced by operator()().

Member Data Documentation

◆ m_captionTable

bool LatexDocVisitor::m_captionTable
private

Definition at line 186 of file latexdocvisitor.h.

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

◆ m_ci

OutputCodeList& LatexDocVisitor::m_ci
private

Definition at line 181 of file latexdocvisitor.h.

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

◆ m_emptyRowSpanList

RowSpanList LatexDocVisitor::m_emptyRowSpanList
private

Definition at line 198 of file latexdocvisitor.h.

Referenced by rowSpans().

◆ m_hide

◆ m_hierarchyLevel

int LatexDocVisitor::m_hierarchyLevel
private

Definition at line 188 of file latexdocvisitor.h.

Referenced by getSectionName(), and LatexDocVisitor().

◆ m_indentLevel

int LatexDocVisitor::m_indentLevel = 0
private

◆ m_insideItem

bool LatexDocVisitor::m_insideItem
private

◆ m_insidePre

bool LatexDocVisitor::m_insidePre
private

Definition at line 183 of file latexdocvisitor.h.

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

◆ m_langExt

DString LatexDocVisitor::m_langExt
private

Definition at line 187 of file latexdocvisitor.h.

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

◆ m_lcg

LatexCodeGenerator& LatexDocVisitor::m_lcg
private

Definition at line 182 of file latexdocvisitor.h.

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

◆ m_listItemInfo

LatexListItemInfo LatexDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 208 of file latexdocvisitor.h.

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

◆ m_t

◆ m_tableStateStack

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

◆ m_texOrPdf

TexOrPdf LatexDocVisitor::m_texOrPdf = TexOrPdf::NO
private

Definition at line 189 of file latexdocvisitor.h.

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

◆ maxIndentLevels

const int LatexDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 200 of file latexdocvisitor.h.

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


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