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

Concrete visitor implementation for LaTeX output. More...

#include <src/latexdocvisitor.h>

Inheritance diagram for LatexDocVisitor:
Collaboration diagram for LatexDocVisitor:

Classes

struct  ActiveRowSpan
struct  LatexListItemInfo
struct  TableState

Public Member Functions

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

Private Types

typedef std::vector< ActiveRowSpanRowSpanList

Private Member Functions

template<class T>
void visitChildren (const T &t)
void filter (const QCString &str, const bool retainNewLine=false)
void startLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)
void endLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
QCString escapeMakeIndexChars (const char *s)
void startDotFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endDotFile (bool hasCaption)
void startMscFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endMscFile (bool hasCaption)
void writeMscFile (const QCString &fileName, const DocVerbatim &s)
void startDiaFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endDiaFile (bool hasCaption)
void writeDiaFile (const QCString &fileName, const DocVerbatim &s)
void writePlantUMLFile (const QCString &fileName, const DocVerbatim &s)
void startPlantUmlFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endPlantUmlFile (bool hasCaption)
void 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)
size_t numCols () const
void setNumCols (size_t num)
bool inRowSpan () const
void setInRowSpan (bool b)
bool inColSpan () const
void setInColSpan (bool b)
bool firstRow () const
void setFirstRow (bool b)
RowSpanListrowSpans ()
void addRowSpan (ActiveRowSpan &&span)
bool insideTable () const
bool isTableNested (const DocNodeVariant *n) const
void writeStartTableCommand (const DocNodeVariant *n, size_t cols)
void writeEndTableCommand (const DocNodeVariant *n)

Private Attributes

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

Static Private Attributes

static const int maxIndentLevels = 13

Detailed Description

Concrete visitor implementation for LaTeX output.

Definition at line 37 of file latexdocvisitor.h.

Member Typedef Documentation

◆ RowSpanList

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

Definition at line 131 of file latexdocvisitor.h.

Constructor & Destructor Documentation

◆ LatexDocVisitor()

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

Definition at line 268 of file latexdocvisitor.cpp.

270 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
272 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
273{
274}
OutputCodeList & m_ci
LatexCodeGenerator & m_lcg
#define FALSE
Definition qcstring.h:34

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

Member Function Documentation

◆ addRowSpan()

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

Definition at line 260 of file latexdocvisitor.h.

261 {
262 if (!m_tableStateStack.empty()) m_tableStateStack.top().rowSpans.push_back(std::move(span));
263 }
std::stack< TableState > m_tableStateStack

References m_tableStateStack.

Referenced by operator()().

◆ currentColumn()

size_t LatexDocVisitor::currentColumn ( ) const
inlineprivate

Definition at line 216 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ decIndentLevel()

void LatexDocVisitor::decIndentLevel ( )
private

Definition at line 2166 of file latexdocvisitor.cpp.

2167{
2168 if (m_indentLevel>0)
2169 {
2170 m_indentLevel--;
2171 }
2172}

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

2081{
2082 if (m_hide) return;
2083 visitPostEnd(m_t,hasCaption);
2084}
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 2024 of file latexdocvisitor.cpp.

2025{
2026 if (m_hide) return;
2027 visitPostEnd(m_t,hasCaption);
2028}

References m_hide, m_t, and visitPostEnd().

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

◆ endLink()

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

Definition at line 1983 of file latexdocvisitor.cpp.

1984{
1985 m_t << "}";
1986 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1987 if (ref.isEmpty() && !pdfHyperLinks)
1988 {
1989 m_t << "{";
1991 m_t << "}{" << file;
1992 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1993 m_t << anchor << "}";
1994 if (refToSection)
1995 {
1996 m_t << "{" << sectionType.level() << "}";
1997 }
1998 }
1999 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
2000 {
2001 if (refToSection)
2002 {
2003 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
2004 }
2005 }
2006}
void filter(const QCString &str, const bool retainNewLine=false)
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
constexpr int level() const
Definition section.h:45
virtual QCString trPageAbbreviation()=0
#define Config_getBool(name)
Definition config.h:33
Translator * theTranslator
Definition language.cpp:71
@ PDF
called through texorpdf as PDF (second) part

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

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

◆ endMscFile()

void LatexDocVisitor::endMscFile ( bool hasCaption)
private

Definition at line 2046 of file latexdocvisitor.cpp.

2047{
2048 if (m_hide) return;
2049 visitPostEnd(m_t,hasCaption);
2050}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2146 of file latexdocvisitor.cpp.

2147{
2148 if (m_hide) return;
2149 visitPostEnd(m_t,hasCaption);
2150}

References m_hide, m_t, and visitPostEnd().

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

◆ escapeMakeIndexChars()

QCString LatexDocVisitor::escapeMakeIndexChars ( const char * s)
private

Definition at line 240 of file latexdocvisitor.cpp.

241{
242 QCString result;
243 const char *p=s;
244 char str[2]; str[1]=0;
245 char c = 0;
246 if (p)
247 {
248 while ((c=*p++))
249 {
250 switch (c)
251 {
252 case '!': m_t << "\"!"; break;
253 case '"': m_t << "\"\""; break;
254 case '@': m_t << "\"@"; break;
255 case '|': m_t << "\\texttt{\"|}"; break;
256 case '[': m_t << "["; break;
257 case ']': m_t << "]"; break;
258 case '{': m_t << "\\lcurly{}"; break;
259 case '}': m_t << "\\rcurly{}"; break;
260 default: str[0]=c; filter(str); break;
261 }
262 }
263 }
264 return result;
265}

References filter(), and m_t.

◆ filter()

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

Definition at line 1923 of file latexdocvisitor.cpp.

1924{
1925 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d m_insideTable=%d\n",qPrint(str),m_lcg.insideTabbing(),m_lcg.usedTableLevel()>0);
1927 m_lcg.insideTabbing(),
1930 m_lcg.usedTableLevel()>0, // insideTable
1931 false, // keepSpaces
1932 retainNewLine
1933 );
1934}
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline)

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

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

◆ firstRow()

bool LatexDocVisitor::firstRow ( ) const
inlineprivate

Definition at line 248 of file latexdocvisitor.h.

249 {
250 return !m_tableStateStack.empty() ? m_tableStateStack.top().firstRow : FALSE;
251 }

References FALSE, and m_tableStateStack.

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

◆ getSectionName()

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

Definition at line 59 of file latexdocvisitor.cpp.

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

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

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

◆ incIndentLevel()

void LatexDocVisitor::incIndentLevel ( )
private

Definition at line 2157 of file latexdocvisitor.cpp.

2158{
2159 m_indentLevel++;
2161 {
2162 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2163 }
2164}
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()().

◆ inColSpan()

bool LatexDocVisitor::inColSpan ( ) const
inlineprivate

Definition at line 240 of file latexdocvisitor.h.

241 {
242 return !m_tableStateStack.empty() ? m_tableStateStack.top().inColSpan : FALSE;
243 }

References FALSE, and m_tableStateStack.

Referenced by operator()().

◆ indentLevel()

int LatexDocVisitor::indentLevel ( ) const
private

Definition at line 2152 of file latexdocvisitor.cpp.

2153{
2154 return std::min(m_indentLevel,maxIndentLevels-1);
2155}

References m_indentLevel, and maxIndentLevels.

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

◆ inRowSpan()

bool LatexDocVisitor::inRowSpan ( ) const
inlineprivate

Definition at line 232 of file latexdocvisitor.h.

233 {
234 return !m_tableStateStack.empty() ? m_tableStateStack.top().inRowSpan : FALSE;
235 }

References FALSE, and m_tableStateStack.

Referenced by operator()().

◆ insideTable()

bool LatexDocVisitor::insideTable ( ) const
inlineprivate

Definition at line 264 of file latexdocvisitor.h.

265 {
266 return !m_tableStateStack.empty();
267 }

References m_tableStateStack.

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

◆ isTableNested()

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

Definition at line 1244 of file latexdocvisitor.cpp.

1245{
1246 bool isNested=m_lcg.usedTableLevel()>0;
1247 while (n && !isNested)
1248 {
1250 n = ::parent(n);
1251 }
1252 return isNested;
1253}
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1366
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:1330

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

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

◆ numCols()

size_t LatexDocVisitor::numCols ( ) const
inlineprivate

Definition at line 224 of file latexdocvisitor.h.

225 {
226 return !m_tableStateStack.empty() ? m_tableStateStack.top().numCols : 0;
227 }

References m_tableStateStack.

Referenced by operator()().

◆ operator()() [1/58]

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

Definition at line 567 of file latexdocvisitor.cpp.

568{
569 if (m_hide) return;
570 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
571 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
572 {
573 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
574 << "}%\n";
575 }
576}
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
QCString stripPath(const QCString &s)
Definition util.cpp:5461

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

◆ operator()() [2/58]

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

Definition at line 803 of file latexdocvisitor.cpp.

804{
805 if (m_hide) return;
806 if (m_indentLevel>=maxIndentLevels-1) return;
807 if (l.isEnumList())
808 {
809 m_t << "\n\\begin{DoxyEnumerate}";
810 m_listItemInfo[indentLevel()].isEnum = true;
811 }
812 else
813 {
814 m_listItemInfo[indentLevel()].isEnum = false;
815 m_t << "\n\\begin{DoxyItemize}";
816 }
817 visitChildren(l);
818 if (l.isEnumList())
819 {
820 m_t << "\n\\end{DoxyEnumerate}";
821 }
822 else
823 {
824 m_t << "\n\\end{DoxyItemize}";
825 }
826}
bool isEnumList() const
Definition docnode.h:580
LatexListItemInfo m_listItemInfo[maxIndentLevels]
void visitChildren(const T &t)

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

◆ operator()() [3/58]

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

Definition at line 828 of file latexdocvisitor.cpp.

829{
830 if (m_hide) return;
831 switch (li.itemNumber())
832 {
833 case DocAutoList::Unchecked: // unchecked
834 m_t << "\n\\item[\\DoxyUnchecked] ";
835 break;
836 case DocAutoList::Checked_x: // checked with x
837 case DocAutoList::Checked_X: // checked with X
838 m_t << "\n\\item[\\DoxyChecked] ";
839 break;
840 default:
841 m_t << "\n\\item ";
842 break;
843 }
845 visitChildren(li);
847}
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/58]

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

Definition at line 740 of file latexdocvisitor.cpp.

741{
742 if (m_hide) return;
743 auto opt = cite.option();
744 QCString txt;
745 if (opt.noCite())
746 {
747 if (!cite.file().isEmpty())
748 {
749 txt = cite.getText();
750 }
751 else
752 {
753 if (!opt.noPar()) txt += "[";
754 txt += cite.target();
755 if (!opt.noPar()) txt += "]";
756 }
757 m_t << "{\\bfseries ";
758 filter(txt);
759 m_t << "}";
760 }
761 else
762 {
763 if (!cite.file().isEmpty())
764 {
765 QCString anchor = cite.anchor();
766 QCString anchorPrefix = CitationManager::instance().anchorPrefix();
767 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
768
769 txt = "\\DoxyCite{" + anchor + "}";
770 if (opt.isNumber())
771 {
772 txt += "{number}";
773 }
774 else if (opt.isShortAuthor())
775 {
776 txt += "{shortauthor}";
777 }
778 else if (opt.isYear())
779 {
780 txt += "{year}";
781 }
782 if (!opt.noPar()) txt += "{1}";
783 else txt += "{0}";
784
785 m_t << txt;
786 }
787 else
788 {
789 if (!opt.noPar()) txt += "[";
790 txt += cite.target();
791 if (!opt.noPar()) txt += "]";
792 m_t << "{\\bfseries ";
793 filter(txt);
794 m_t << "}";
795 }
796 }
797}
QCString anchorPrefix() const
Definition cite.cpp:128
static CitationManager & instance()
Definition cite.cpp:86
QCString getText() const
Definition docnode.cpp:939
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString file() const
Definition docnode.h:248
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226

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

◆ operator()() [5/58]

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

Definition at line 1623 of file latexdocvisitor.cpp.

1624{
1625 if (m_hide) return;
1626 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1627 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1628 visitChildren(df);
1629 endDiaFile(df.hasCaption());
1630}
QCString height() const
Definition docnode.h:689
QCString srcFile() const
Definition docnode.h:691
QCString file() const
Definition docnode.h:685
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
QCString width() const
Definition docnode.h:688
void endDiaFile(bool hasCaption)
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
#define Config_getString(name)
Definition config.h:32
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:6370

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

◆ operator()() [6/58]

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

Definition at line 1605 of file latexdocvisitor.cpp.

1606{
1607 if (m_hide) return;
1608 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1609 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1610 visitChildren(df);
1611 endDotFile(df.hasCaption());
1612}
void endDotFile(bool hasCaption)
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)

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

◆ operator()() [7/58]

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

Definition at line 347 of file latexdocvisitor.cpp.

348{
349 if (m_hide) return;
350 QCString emojiName = EmojiEntityMapper::instance().name(s.index());
351 if (!emojiName.isEmpty())
352 {
353 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
354 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
355 filter(emojiName);
356 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
357 }
358 else
359 {
360 m_t << s.name();
361 }
362}
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2026
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978

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

◆ operator()() [8/58]

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

Definition at line 707 of file latexdocvisitor.cpp.

708{
709 if (m_hide) return;
710 QCString s = f.text();
711 const char *p = s.data();
712 char c = 0;
713 if (p)
714 {
715 while ((c=*p++))
716 {
717 switch (c)
718 {
719 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
720 default: m_t << c; break;
721 }
722 }
723 }
724}
QCString text() const
Definition docnode.h:533
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159

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

◆ operator()() [9/58]

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

Definition at line 384 of file latexdocvisitor.cpp.

385{
386 if (m_hide) return;
387 if (insideTable())
388 m_t << "\\DoxyHorRuler{1}\n";
389 else
390 m_t << "\\DoxyHorRuler{0}\n";
391}
bool insideTable() const

References insideTable(), m_hide, and m_t.

◆ operator()() [10/58]

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

Definition at line 1534 of file latexdocvisitor.cpp.

1535{
1536 if (m_hide) return;
1537 if (Config_getBool(PDF_HYPERLINKS))
1538 {
1539 m_t << "\\href{";
1540 m_t << latexFilterURL(href.url());
1541 m_t << "}";
1542 }
1543 m_t << "{\\texttt{";
1544 visitChildren(href);
1545 m_t << "}}";
1546}
QCString url() const
Definition docnode.h:830
QCString latexFilterURL(const QCString &s)

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

◆ operator()() [11/58]

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

Definition at line 1903 of file latexdocvisitor.cpp.

1904{
1905 if (m_hide) return;
1906 m_t << "\\begin{quote}\n";
1908 visitChildren(q);
1909 m_t << "\\end{quote}\n";
1911}

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

◆ operator()() [12/58]

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

Definition at line 1329 of file latexdocvisitor.cpp.

1330{
1331 if (m_hide) return;
1332 visitChildren(c);
1333}

References m_hide, and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1413 of file latexdocvisitor.cpp.

1414{
1415 if (m_hide) return;
1416
1417 const DocHtmlRow *row = std::get_if<DocHtmlRow>(c.parent());
1418
1420
1421 //Skip columns that span from above.
1422 for (const auto &span : rowSpans())
1423 {
1424 if (span.rowSpan>0 && span.column==currentColumn())
1425 {
1426 if (row && span.colSpan>1)
1427 {
1428 m_t << "\\multicolumn{" << span.colSpan << "}{";
1429 if (currentColumn() /*c.columnIndex()*/==1) // add extra | for first column
1430 {
1431 m_t << "|";
1432 }
1433 m_t << "l|}{" << (c.isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
1434 setCurrentColumn(currentColumn()+span.colSpan);
1435 }
1436 else
1437 {
1439 }
1440 m_t << "&";
1441 }
1442 }
1443
1444 int cs = c.colSpan();
1445 int a = c.alignment();
1446 if (cs>1 && row)
1447 {
1449 m_t << "\\multicolumn{" << cs << "}{";
1450 if (c.columnIndex()==1) // add extra | for first column
1451 {
1452 m_t << "|";
1453 }
1454 switch (a)
1455 {
1456 case DocHtmlCell::Right:
1457 m_t << "r|}{";
1458 break;
1460 m_t << "c|}{";
1461 break;
1462 default:
1463 m_t << "l|}{";
1464 break;
1465 }
1466 }
1467 int rs = c.rowSpan();
1468 int va = c.valignment();
1469 if (rs>0)
1470 {
1472 m_t << "\\multirow";
1473 switch(va)
1474 {
1475 case DocHtmlCell::Top:
1476 m_t << "[t]";
1477 break;
1479 m_t << "[b]";
1480 break;
1482 break; // No alignment option needed
1483 default:
1484 break;
1485 }
1486 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1487 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1488 // currentColumn());
1490 m_t << "{" << rs << "}{*}{";
1491 }
1492 if (a==DocHtmlCell::Center)
1493 {
1494 m_t << "\\PBS\\centering ";
1495 }
1496 else if (a==DocHtmlCell::Right)
1497 {
1498 m_t << "\\PBS\\raggedleft ";
1499 }
1500 if (c.isHeading())
1501 {
1502 m_t << "\\cellcolor{\\tableheadbgcolor}\\textbf{ ";
1503 }
1504 if (cs>1)
1505 {
1507 }
1508
1509 visitChildren(c);
1510
1511 if (c.isHeading())
1512 {
1513 m_t << "}";
1514 }
1515 if (inRowSpan())
1516 {
1518 m_t << "}";
1519 }
1520 if (inColSpan())
1521 {
1523 m_t << "}";
1524 }
1525 if (!c.isLast()) m_t << "&";
1526}
Valignment valignment() const
Definition docnode.cpp:1900
uint32_t columnIndex() const
Definition docnode.h:1209
uint32_t rowSpan() const
Definition docnode.cpp:1838
Alignment alignment() const
Definition docnode.cpp:1862
bool isLast() const
Definition docnode.h:1202
bool isHeading() const
Definition docnode.h:1200
uint32_t colSpan() const
Definition docnode.cpp:1850
DocNodeVariant * parent()
Definition docnode.h:90
RowSpanList & rowSpans()
void setCurrentColumn(size_t col)
void setInColSpan(bool b)
void addRowSpan(ActiveRowSpan &&span)
size_t currentColumn() const
bool inRowSpan() const
bool inColSpan() const
void setInRowSpan(bool b)
#define TRUE
Definition qcstring.h:37

References addRowSpan(), DocHtmlCell::alignment(), DocHtmlCell::Bottom, DocHtmlCell::Center, DocHtmlCell::colSpan(), DocHtmlCell::columnIndex(), currentColumn(), FALSE, inColSpan(), inRowSpan(), DocHtmlCell::isHeading(), DocHtmlCell::isLast(), m_hide, m_t, DocHtmlCell::Middle, DocNode::parent(), DocHtmlCell::Right, DocHtmlCell::rowSpan(), rowSpans(), setCurrentColumn(), setInColSpan(), setInRowSpan(), DocHtmlCell::Top, TRUE, DocHtmlCell::valignment(), and visitChildren().

◆ operator()() [14/58]

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

Definition at line 1235 of file latexdocvisitor.cpp.

1236{
1238 if (!m_insideItem) m_t << "\\hfill";
1239 m_t << " \\\\\n";
1240 visitChildren(dd);
1242}

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

◆ operator()() [15/58]

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

Definition at line 1201 of file latexdocvisitor.cpp.

1202{
1203 if (m_hide) return;
1204 bool eq = classEqualsReflist(dl);
1205 if (eq)
1206 {
1207 m_t << "\n\\begin{DoxyRefList}";
1208 }
1209 else
1210 {
1211 if (listIsNested(dl)) m_t << "\n\\hfill";
1212 m_t << "\n\\begin{DoxyDescription}";
1213 }
1214 visitChildren(dl);
1215 if (eq)
1216 {
1217 m_t << "\n\\end{DoxyRefList}";
1218 }
1219 else
1220 {
1221 m_t << "\n\\end{DoxyDescription}";
1222 }
1223}
static bool listIsNested(const DocHtmlDescList &dl)
static bool classEqualsReflist(const DocHtmlDescList &dl)

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

◆ operator()() [16/58]

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

Definition at line 1225 of file latexdocvisitor.cpp.

1226{
1227 if (m_hide) return;
1228 m_t << "\n\\item[";
1230 visitChildren(dt);
1232 m_t << "]";
1233}

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

◆ operator()() [17/58]

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

Definition at line 1556 of file latexdocvisitor.cpp.

1557{
1558 if (m_hide) return;
1559 m_t << "\n\n";
1560 auto summary = d.summary();
1561 if (summary)
1562 {
1563 std::visit(*this,*summary);
1564 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1565 }
1566 visitChildren(d);
1567 if (summary)
1568 {
1569 m_t << "\\end{adjustwidth}\n";
1570 }
1571 else
1572 {
1573 m_t << "\n\n";
1574 }
1575}
const DocNodeVariant * summary() const
Definition docnode.h:864

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

◆ operator()() [18/58]

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

Definition at line 1577 of file latexdocvisitor.cpp.

1578{
1579 if (m_hide) return;
1580 m_t << "\\" << getSectionName(header.level()) << "*{";
1581 visitChildren(header);
1582 m_t << "}";
1583}
int level() const
Definition docnode.h:877
const char * getSectionName(int level) const

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

◆ operator()() [19/58]

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

Definition at line 1085 of file latexdocvisitor.cpp.

1086{
1087 if (m_hide) return;
1088 if (m_indentLevel>=maxIndentLevels-1) return;
1090 if (s.type()==DocHtmlList::Ordered)
1091 {
1092 bool first = true;
1093 m_t << "\n\\begin{DoxyEnumerate}";
1094 for (const auto &opt : s.attribs())
1095 {
1096 if (opt.name=="type")
1097 {
1098 if (opt.value=="1")
1099 {
1100 m_t << (first ? "[": ",");
1101 m_t << "label=\\arabic*";
1102 first = false;
1103 }
1104 else if (opt.value=="a")
1105 {
1106 m_t << (first ? "[": ",");
1107 m_t << "label=\\enumalphalphcnt*";
1108 first = false;
1109 }
1110 else if (opt.value=="A")
1111 {
1112 m_t << (first ? "[": ",");
1113 m_t << "label=\\enumAlphAlphcnt*";
1114 first = false;
1115 }
1116 else if (opt.value=="i")
1117 {
1118 m_t << (first ? "[": ",");
1119 m_t << "label=\\roman*";
1120 first = false;
1121 }
1122 else if (opt.value=="I")
1123 {
1124 m_t << (first ? "[": ",");
1125 m_t << "label=\\Roman*";
1126 first = false;
1127 }
1128 }
1129 else if (opt.name=="start")
1130 {
1131 m_t << (first ? "[": ",");
1132 bool ok = false;
1133 int val = opt.value.toInt(&ok);
1134 if (ok) m_t << "start=" << val;
1135 first = false;
1136 }
1137 }
1138 if (!first) m_t << "]\n";
1139 }
1140 else
1141 {
1142 m_t << "\n\\begin{DoxyItemize}";
1143 }
1144 visitChildren(s);
1145 if (m_indentLevel>=maxIndentLevels-1) return;
1146 if (s.type()==DocHtmlList::Ordered)
1147 m_t << "\n\\end{DoxyEnumerate}";
1148 else
1149 m_t << "\n\\end{DoxyItemize}";
1150}
const HtmlAttribList & attribs() const
Definition docnode.h:1006
Type type() const
Definition docnode.h:1005

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

◆ operator()() [20/58]

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

Definition at line 1152 of file latexdocvisitor.cpp.

1153{
1154 if (m_hide) return;
1155 if (m_listItemInfo[indentLevel()].isEnum)
1156 {
1157 for (const auto &opt : l.attribs())
1158 {
1159 if (opt.name=="value")
1160 {
1161 bool ok = false;
1162 int val = opt.value.toInt(&ok);
1163 if (ok)
1164 {
1165 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1166 }
1167 }
1168 }
1169 }
1170 m_t << "\n\\item ";
1172 visitChildren(l);
1174}
const HtmlAttribList & attribs() const
Definition docnode.h:1170
QCString integerToRoman(int n, bool upper)
Definition util.cpp:7209

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

◆ operator()() [21/58]

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

Definition at line 1335 of file latexdocvisitor.cpp.

1336{
1337 if (m_hide) return;
1339
1340 visitChildren(row);
1341
1342 size_t c=currentColumn();
1343 while (c<=numCols()) // end of row while inside a row span?
1344 {
1345 for (const auto &span : rowSpans())
1346 {
1347 //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1348 // span->column, span->rowSpan,span->colSpan,row.rowIndex(),span->cell->rowIndex(),i,c);
1349 if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
1350 row.rowIndex()>span.cell.rowIndex() // but not the row that started the span
1351 )
1352 {
1353 m_t << "&";
1354 if (span.colSpan>1) // row span is also part of a column span
1355 {
1356 m_t << "\\multicolumn{" << span.colSpan << "}{";
1357 m_t << "}|}{}";
1358 }
1359 else // solitary row span
1360 {
1361 m_t << "\\multicolumn{1}{c|}{}";
1362 }
1363 }
1364 }
1365 c++;
1366 }
1367
1368 m_t << "\\\\";
1369
1370 size_t col = 1;
1371 for (auto &span : rowSpans())
1372 {
1373 if (span.rowSpan>0) span.rowSpan--;
1374 if (span.rowSpan<=0)
1375 {
1376 // inactive span
1377 }
1378 else if (span.column>col)
1379 {
1380 m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
1381 col = span.column+span.colSpan;
1382 }
1383 else
1384 {
1385 col = span.column+span.colSpan;
1386 }
1387 }
1388
1389 if (col <= numCols())
1390 {
1391 m_t << "\\cline{" << col << "-" << numCols() << "}";
1392 }
1393
1394 m_t << "\n";
1395
1396 const DocNodeVariant *n = ::parent(row.parent());
1397 if (row.isHeading() && row.rowIndex()==1 && !isTableNested(n))
1398 {
1399 if (firstRow())
1400 {
1401 m_t << "\\endfirsthead\n";
1402 m_t << "\\hline\n";
1403 m_t << "\\endfoot\n";
1404 m_t << "\\hline\n";
1405 }
1406 else
1407 {
1408 m_t << "\\endhead\n";
1409 }
1410 }
1411}
bool isHeading() const
Definition docnode.cpp:1922
uint32_t rowIndex() const
Definition docnode.h:1258
bool firstRow() const
bool isTableNested(const DocNodeVariant *n) const
size_t numCols() const
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile > DocNodeVariant
Definition docnode.h:67

References currentColumn(), firstRow(), DocHtmlRow::isHeading(), isTableNested(), m_hide, m_t, numCols(), DocNode::parent(), parent(), DocHtmlRow::rowIndex(), rowSpans(), setCurrentColumn(), and visitChildren().

◆ operator()() [22/58]

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

Definition at line 1548 of file latexdocvisitor.cpp.

1549{
1550 if (m_hide) return;
1551 m_t << "{\\bfseries{";
1552 visitChildren(d);
1553 m_t << "}}";
1554}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1281 of file latexdocvisitor.cpp.

1282{
1283 if (m_hide) return;
1285 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1286 if (c)
1287 {
1288 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1289 if (!c->file().isEmpty() && pdfHyperLinks)
1290 {
1291 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1292 << "}{}";
1293 }
1294 m_t << "\n";
1295 }
1296
1298
1299 if (c)
1300 {
1301 m_t << "\\caption{";
1302 std::visit(*this, *t.caption());
1303 m_t << "}";
1304 m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1305 m_t << "\\\\\n";
1306 }
1307
1309 m_t << "\\hline\n";
1310
1311 // check if first row is a heading and then render the row already here
1312 // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1313 // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1314 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1315 if (firstRow && firstRow->isHeading())
1316 {
1318 if (!isTableNested(t.parent()))
1319 {
1320 std::visit(*this,*t.firstRow());
1321 }
1323 }
1324 visitChildren(t);
1326 popTableState();
1327}
QCString anchor() const
Definition docnode.h:1235
QCString file() const
Definition docnode.h:1234
size_t numColumns() const
Definition docnode.h:1278
const DocNodeVariant * caption() const
Definition docnode.cpp:2141
const DocNodeVariant * firstRow() const
Definition docnode.cpp:2146
void setFirstRow(bool b)
void setNumCols(size_t num)
void writeStartTableCommand(const DocNodeVariant *n, size_t cols)
void writeEndTableCommand(const DocNodeVariant *n)

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

◆ operator()() [24/58]

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

Definition at line 1585 of file latexdocvisitor.cpp.

1586{
1587 if (img.type()==DocImage::Latex)
1588 {
1589 if (m_hide) return;
1590 QCString gfxName = img.name();
1591 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1592 {
1593 gfxName=gfxName.left(gfxName.length()-4);
1594 }
1595
1596 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1597 visitChildren(img);
1599 }
1600 else // other format -> skip
1601 {
1602 }
1603}
QCString name() const
Definition docnode.h:648
QCString height() const
Definition docnode.h:651
Type type() const
Definition docnode.h:647
QCString width() const
Definition docnode.h:650
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
bool endsWith(const char *s) const
Definition qcstring.h:509
QCString left(size_t len) const
Definition qcstring.h:214
static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)

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

◆ operator()() [25/58]

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

Definition at line 578 of file latexdocvisitor.cpp.

579{
580 if (m_hide) return;
582 switch(inc.type())
583 {
585 {
586 m_ci.startCodeFragment("DoxyCodeInclude");
587 FileInfo cfi( inc.file().str() );
588 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
590 inc.text(),
591 langExt,
592 inc.stripCodeComments(),
593 inc.isExample(),
594 inc.exampleFile(),
595 fd.get(), // fileDef,
596 -1, // start line
597 -1, // end line
598 FALSE, // inline fragment
599 nullptr, // memberDef
600 TRUE // show line numbers
601 );
602 m_ci.endCodeFragment("DoxyCodeInclude");
603 }
604 break;
606 {
607 m_ci.startCodeFragment("DoxyCodeInclude");
609 inc.text(),langExt,
610 inc.stripCodeComments(),
611 inc.isExample(),
612 inc.exampleFile(),
613 nullptr, // fileDef
614 -1, // startLine
615 -1, // endLine
616 TRUE, // inlineFragment
617 nullptr, // memberDef
618 FALSE
619 );
620 m_ci.endCodeFragment("DoxyCodeInclude");
621 }
622 break;
630 break;
632 m_t << inc.text();
633 break;
635 m_t << "\n\\begin{DoxyVerbInclude}\n";
636 m_t << inc.text();
637 m_t << "\\end{DoxyVerbInclude}\n";
638 break;
641 {
642 m_ci.startCodeFragment("DoxyCodeInclude");
644 inc.file(),
645 inc.blockId(),
646 inc.context(),
648 inc.trimLeft(),
650 );
651 m_ci.endCodeFragment("DoxyCodeInclude");
652 }
653 break;
654 }
655}
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
QCString blockId() const
Definition docnode.h:454
QCString extension() const
Definition docnode.h:450
bool stripCodeComments() const
Definition docnode.h:455
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
Type type() const
Definition docnode.h:451
QCString exampleFile() const
Definition docnode.h:457
QCString text() const
Definition docnode.h:452
QCString file() const
Definition docnode.h:449
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
QCString context() const
Definition docnode.h:453
CodeParserInterface & getCodeParser(const QCString &langExt)
const std::string & str() const
Definition qcstring.h:537
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5718

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

◆ operator()() [26/58]

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

Definition at line 657 of file latexdocvisitor.cpp.

658{
659 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
660 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
661 if (op.isFirst())
662 {
663 if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
665 m_hide = TRUE;
666 }
667 QCString locLangExt = getFileNameExtension(op.includeFileName());
668 if (locLangExt.isEmpty()) locLangExt = m_langExt;
669 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
670 if (op.type()!=DocIncOperator::Skip)
671 {
672 m_hide = popHidden();
673 if (!m_hide)
674 {
675 std::unique_ptr<FileDef> fd;
676 if (!op.includeFileName().isEmpty())
677 {
678 FileInfo cfi( op.includeFileName().str() );
679 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
680 }
681
682 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
684 op.isExample(),op.exampleFile(),
685 fd.get(), // fileDef
686 op.line(), // startLine
687 -1, // endLine
688 FALSE, // inline fragment
689 nullptr, // memberDef
690 op.showLineNo() // show line numbers
691 );
692 }
694 m_hide=TRUE;
695 }
696 if (op.isLast())
697 {
699 if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
700 }
701 else
702 {
703 if (!m_hide) m_t << "\n";
704 }
705}
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
QCString includeFileName() const
Definition docnode.h:509
QCString text() const
Definition docnode.h:499
QCString context() const
Definition docnode.h:501
QCString exampleFile() const
Definition docnode.h:508
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
void pushHidden(bool hide)
bool popHidden()
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5760

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

◆ operator()() [27/58]

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

Definition at line 726 of file latexdocvisitor.cpp.

727{
728 if (m_hide) return;
729 m_t << "\\index{";
731 m_t << "@{";
733 m_t << "}}";
734}
QCString entry() const
Definition docnode.h:559
QCString latexEscapeIndexChars(const QCString &s)
QCString latexEscapeLabelName(const QCString &s)

References DocIndexEntry::entry(), latexEscapeIndexChars(), latexEscapeLabelName(), m_hide, and m_t.

◆ operator()() [28/58]

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

Definition at line 1528 of file latexdocvisitor.cpp.

1529{
1530 if (m_hide) return;
1531 visitChildren(i);
1532}

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1889 of file latexdocvisitor.cpp.

1890{
1891 if (m_hide) return;
1892 startLink(QCString(),ref.file(),ref.anchor());
1893 visitChildren(ref);
1894 endLink(QCString(),ref.file(),ref.anchor());
1895}
QCString file() const
Definition docnode.h:811
QCString anchor() const
Definition docnode.h:813
void endLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false, SectionType sectionType=SectionType::Anchor)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=false, bool refToSection=false)

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

◆ operator()() [30/58]

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

Definition at line 378 of file latexdocvisitor.cpp.

379{
380 if (m_hide) return;
381 m_t << "~\\newline\n";
382}

References m_hide, and m_t.

◆ operator()() [31/58]

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

Definition at line 1641 of file latexdocvisitor.cpp.

1642{
1643 if (m_hide) return;
1644 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1645 visitChildren(lnk);
1646 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1647}

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

◆ operator()() [32/58]

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

Definition at line 286 of file latexdocvisitor.cpp.

287{
288 if (m_hide) return;
289 startLink(w.ref(),w.file(),w.anchor());
290 filter(w.word());
291 endLink(w.ref(),w.file(),w.anchor());
292}
QCString file() const
Definition docnode.h:171
QCString ref() const
Definition docnode.h:173
QCString word() const
Definition docnode.h:170
QCString anchor() const
Definition docnode.h:174

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

◆ operator()() [33/58]

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

Definition at line 1614 of file latexdocvisitor.cpp.

1615{
1616 if (m_hide) return;
1617 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1618 startMscFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1619 visitChildren(df);
1620 endMscFile(df.hasCaption());
1621}
void endMscFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)

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

◆ operator()() [34/58]

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

Definition at line 849 of file latexdocvisitor.cpp.

850{
851 if (m_hide) return;
852 visitChildren(p);
853 if (!p.isLast() && // omit <p> for last paragraph
854 !(p.parent() && // and for parameter sections
855 std::get_if<DocParamSect>(p.parent())
856 )
857 )
858 {
859 if (insideTable())
860 {
861 m_t << "~\\newline\n";
862 }
863 else
864 {
865 m_t << "\n\n";
866 }
867 }
868}
bool isLast() const
Definition docnode.h:1088

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

◆ operator()() [35/58]

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

Definition at line 1781 of file latexdocvisitor.cpp.

1782{
1783 if (m_hide) return;
1785 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1786 if (sect)
1787 {
1788 parentType = sect->type();
1789 }
1790 bool useTable = parentType==DocParamSect::Param ||
1791 parentType==DocParamSect::RetVal ||
1792 parentType==DocParamSect::Exception ||
1793 parentType==DocParamSect::TemplateParam;
1794 if (!useTable)
1795 {
1796 m_t << "\\item[";
1797 }
1798 if (sect && sect->hasInOutSpecifier())
1799 {
1801 {
1802 m_t << "\\mbox{\\texttt{";
1803 if (pl.direction()==DocParamSect::In)
1804 {
1805 m_t << "in";
1806 }
1807 else if (pl.direction()==DocParamSect::Out)
1808 {
1809 m_t << "out";
1810 }
1811 else if (pl.direction()==DocParamSect::InOut)
1812 {
1813 m_t << "in,out";
1814 }
1815 m_t << "}} ";
1816 }
1817 if (useTable) m_t << " & ";
1818 }
1819 if (sect && sect->hasTypeSpecifier())
1820 {
1821 for (const auto &type : pl.paramTypes())
1822 {
1823 std::visit(*this,type);
1824 }
1825 if (useTable) m_t << " & ";
1826 }
1827 m_t << "{\\em ";
1828 bool first=TRUE;
1829 for (const auto &param : pl.parameters())
1830 {
1831 if (!first) m_t << ","; else first=FALSE;
1833 std::visit(*this,param);
1835 }
1836 m_t << "}";
1837 if (useTable)
1838 {
1839 m_t << " & ";
1840 }
1841 else
1842 {
1843 m_t << "]";
1844 }
1845 for (const auto &par : pl.paragraphs())
1846 {
1847 std::visit(*this,par);
1848 }
1849 if (useTable)
1850 {
1851 m_t << "\\\\\n"
1852 << "\\hline\n";
1853 }
1854}
const DocNodeList & parameters() const
Definition docnode.h:1129
const DocNodeList & paramTypes() const
Definition docnode.h:1130
DocParamSect::Direction direction() const
Definition docnode.h:1133
const DocNodeList & paragraphs() const
Definition docnode.h:1131
bool hasInOutSpecifier() const
Definition docnode.h:1069
bool hasTypeSpecifier() const
Definition docnode.h:1070
Type type() const
Definition docnode.h:1068

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

◆ operator()() [36/58]

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

Definition at line 1722 of file latexdocvisitor.cpp.

1723{
1724 if (m_hide) return;
1725 bool hasInOutSpecs = s.hasInOutSpecifier();
1726 bool hasTypeSpecs = s.hasTypeSpecifier();
1727 m_lcg.incUsedTableLevel();
1728 switch(s.type())
1729 {
1731 m_t << "\n\\begin{DoxyParams}";
1732 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1733 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1734 m_t << "{";
1736 break;
1738 m_t << "\n\\begin{DoxyRetVals}{";
1740 break;
1742 m_t << "\n\\begin{DoxyExceptions}{";
1744 break;
1746 m_t << "\n\\begin{DoxyTemplParams}{";
1748 break;
1749 default:
1750 ASSERT(0);
1752 }
1753 m_t << "}\n";
1754 visitChildren(s);
1755 m_lcg.decUsedTableLevel();
1756 switch(s.type())
1757 {
1759 m_t << "\\end{DoxyParams}\n";
1760 break;
1762 m_t << "\\end{DoxyRetVals}\n";
1763 break;
1765 m_t << "\\end{DoxyExceptions}\n";
1766 break;
1768 m_t << "\\end{DoxyTemplParams}\n";
1769 break;
1770 default:
1771 ASSERT(0);
1773 }
1774}
virtual QCString trExceptions()=0
virtual QCString trParameters()=0
virtual QCString trTemplateParameters()=0
virtual QCString trReturnValues()=0
#define ASSERT(x)
Definition qcstring.h:39

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

◆ operator()() [37/58]

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

Definition at line 1917 of file latexdocvisitor.cpp.

1918{
1919 if (m_hide) return;
1920 visitChildren(pb);
1921}

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1632 of file latexdocvisitor.cpp.

1633{
1634 if (m_hide) return;
1635 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1636 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1637 visitChildren(df);
1639}
void startPlantUmlFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const QCString &srcFile, int srcLine)
void endPlantUmlFile(bool hasCaption)

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

◆ operator()() [39/58]

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

Definition at line 1649 of file latexdocvisitor.cpp.

1650{
1651 if (m_hide) return;
1652 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1653 // ref.anchor() for LaTeX/RTF
1654 if (ref.isSubPage())
1655 {
1656 startLink(ref.ref(),QCString(),ref.anchor());
1657 }
1658 else
1659 {
1660 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1661 }
1662 if (!ref.hasLinkText())
1663 {
1664 filter(ref.targetTitle());
1665 }
1666 visitChildren(ref);
1667 if (ref.isSubPage())
1668 {
1669 endLink(ref.ref(),QCString(),ref.anchor());
1670 }
1671 else
1672 {
1673 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1674 }
1675}
QCString anchor() const
Definition docnode.h:785
SectionType sectionType() const
Definition docnode.h:787
QCString targetTitle() const
Definition docnode.h:786
bool isSubPage() const
Definition docnode.h:792
bool refToTable() const
Definition docnode.h:791
QCString file() const
Definition docnode.h:782
QCString ref() const
Definition docnode.h:784
bool refToSection() const
Definition docnode.h:790
bool hasLinkText() const
Definition docnode.h:788

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

◆ operator()() [40/58]

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

Definition at line 870 of file latexdocvisitor.cpp.

871{
872 visitChildren(r);
873}

References visitChildren().

◆ operator()() [41/58]

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

Definition at line 1677 of file latexdocvisitor.cpp.

1678{
1679 if (m_hide) return;
1680 m_t << "\\item \\contentsline{section}{";
1681 if (ref.isSubPage())
1682 {
1683 startLink(ref.ref(),QCString(),ref.anchor());
1684 }
1685 else
1686 {
1687 if (!ref.file().isEmpty())
1688 {
1689 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1690 }
1691 }
1692 visitChildren(ref);
1693 if (ref.isSubPage())
1694 {
1695 endLink(ref.ref(),QCString(),ref.anchor());
1696 }
1697 else
1698 {
1699 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1700 }
1701 m_t << "}{\\ref{";
1702 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1703 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1704 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1705 m_t << "}}{}\n";
1706}
bool refToTable() const
Definition docnode.h:943
QCString file() const
Definition docnode.h:939
QCString anchor() const
Definition docnode.h:940
QCString ref() const
Definition docnode.h:942
bool isSubPage() const
Definition docnode.h:944

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

◆ operator()() [42/58]

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

Definition at line 1708 of file latexdocvisitor.cpp.

1709{
1710 if (m_hide) return;
1711 m_t << "\\footnotesize\n";
1712 m_t << "\\begin{multicols}{2}\n";
1713 m_t << "\\begin{DoxyCompactList}\n";
1715 visitChildren(l);
1717 m_t << "\\end{DoxyCompactList}\n";
1718 m_t << "\\end{multicols}\n";
1719 m_t << "\\normalsize\n";
1720}

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

◆ operator()() [43/58]

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

Definition at line 1051 of file latexdocvisitor.cpp.

1052{
1053 if (m_hide) return;
1054 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1055 if (pdfHyperlinks)
1056 {
1057 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1058 }
1059 m_t << "\\" << getSectionName(s.level()) << "{";
1060 if (pdfHyperlinks)
1061 {
1062 m_t << "\\texorpdfstring{";
1063 }
1064 if (s.title())
1065 {
1066 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1067 std::visit(*this,*s.title());
1069 }
1070 if (pdfHyperlinks)
1071 {
1072 m_t << "}{";
1073 if (s.title())
1074 {
1075 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1076 std::visit(*this,*s.title());
1078 }
1079 m_t << "}";
1080 }
1081 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1082 visitChildren(s);
1083}
QCString file() const
Definition docnode.h:922
int level() const
Definition docnode.h:918
QCString anchor() const
Definition docnode.h:920
const DocNodeVariant * title() const
Definition docnode.h:919
@ TEX
called through texorpdf as TeX (first) part
@ NO
not called through texorpdf

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

◆ operator()() [44/58]

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

Definition at line 1776 of file latexdocvisitor.cpp.

1777{
1778 m_t << " " << sep.chars() << " ";
1779}
QCString chars() const
Definition docnode.h:369

References DocSeparator::chars(), and m_t.

◆ operator()() [45/58]

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

Definition at line 1030 of file latexdocvisitor.cpp.

1031{
1032 if (m_hide) return;
1033 m_t << "\\begin{DoxyItemize}\n";
1034 m_listItemInfo[indentLevel()].isEnum = false;
1035 visitChildren(l);
1036 m_t << "\\end{DoxyItemize}\n";
1037}

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

◆ operator()() [46/58]

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

Definition at line 1039 of file latexdocvisitor.cpp.

1040{
1041 if (m_hide) return;
1042 m_t << "\\item ";
1044 if (li.paragraph())
1045 {
1046 visit(*this,*li.paragraph());
1047 }
1049}
const DocNodeVariant * paragraph() const
Definition docnode.h:1157

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

◆ operator()() [47/58]

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

Definition at line 875 of file latexdocvisitor.cpp.

876{
877 if (m_hide) return;
878 switch(s.type())
879 {
881 m_t << "\\begin{DoxySeeAlso}{";
883 break;
885 m_t << "\\begin{DoxyReturn}{";
887 break;
889 m_t << "\\begin{DoxyAuthor}{";
891 break;
893 m_t << "\\begin{DoxyAuthor}{";
895 break;
897 m_t << "\\begin{DoxyVersion}{";
899 break;
901 m_t << "\\begin{DoxySince}{";
903 break;
905 m_t << "\\begin{DoxyDate}{";
907 break;
909 m_t << "\\begin{DoxyNote}{";
911 break;
913 m_t << "\\begin{DoxyWarning}{";
915 break;
917 m_t << "\\begin{DoxyPrecond}{";
919 break;
921 m_t << "\\begin{DoxyPostcond}{";
923 break;
925 m_t << "\\begin{DoxyCopyright}{";
927 break;
929 m_t << "\\begin{DoxyInvariant}{";
931 break;
933 m_t << "\\begin{DoxyRemark}{";
935 break;
937 m_t << "\\begin{DoxyAttention}{";
939 break;
941 m_t << "\\begin{DoxyImportant}{";
943 break;
945 m_t << "\\begin{DoxyParagraph}{";
946 break;
948 m_t << "\\begin{DoxyParagraph}{";
949 break;
950 case DocSimpleSect::Unknown: break;
951 }
952
953 if (s.title())
954 {
956 std::visit(*this,*s.title());
958 }
959 m_t << "}\n";
961 visitChildren(s);
962 switch(s.type())
963 {
965 m_t << "\n\\end{DoxySeeAlso}\n";
966 break;
968 m_t << "\n\\end{DoxyReturn}\n";
969 break;
971 m_t << "\n\\end{DoxyAuthor}\n";
972 break;
974 m_t << "\n\\end{DoxyAuthor}\n";
975 break;
977 m_t << "\n\\end{DoxyVersion}\n";
978 break;
980 m_t << "\n\\end{DoxySince}\n";
981 break;
983 m_t << "\n\\end{DoxyDate}\n";
984 break;
986 m_t << "\n\\end{DoxyNote}\n";
987 break;
989 m_t << "\n\\end{DoxyWarning}\n";
990 break;
992 m_t << "\n\\end{DoxyPrecond}\n";
993 break;
995 m_t << "\n\\end{DoxyPostcond}\n";
996 break;
998 m_t << "\n\\end{DoxyCopyright}\n";
999 break;
1001 m_t << "\n\\end{DoxyInvariant}\n";
1002 break;
1004 m_t << "\n\\end{DoxyRemark}\n";
1005 break;
1007 m_t << "\n\\end{DoxyAttention}\n";
1008 break;
1010 m_t << "\n\\end{DoxyImportant}\n";
1011 break;
1013 m_t << "\n\\end{DoxyParagraph}\n";
1014 break;
1015 case DocSimpleSect::Rcs:
1016 m_t << "\n\\end{DoxyParagraph}\n";
1017 break;
1018 default:
1019 break;
1020 }
1022}
Type type() const
Definition docnode.h:1026
const DocNodeVariant * title() const
Definition docnode.h:1033
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trVersion()=0
virtual QCString trReturns()=0
virtual QCString trRemarks()=0
virtual QCString trNote()=0
virtual QCString trPostcondition()=0
virtual QCString trAttention()=0
virtual QCString trCopyright()=0
virtual QCString trDate()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
virtual QCString trSeeAlso()=0
virtual QCString trImportant()=0
virtual QCString trInvariant()=0

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

◆ operator()() [48/58]

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

Definition at line 736 of file latexdocvisitor.cpp.

737{
738}

◆ operator()() [49/58]

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

Definition at line 393 of file latexdocvisitor.cpp.

394{
395 if (m_hide) return;
396 switch (s.style())
397 {
399 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
400 break;
404 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
405 break;
408 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
409 break;
411 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
412 break;
416 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
417 break;
419 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
420 break;
422 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
423 break;
425 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
426 break;
428 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
429 break;
431 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
432 break;
434 if (s.enable())
435 {
436 m_t << "\n\\begin{DoxyPre}";
438 }
439 else
440 {
442 m_t << "\\end{DoxyPre}\n";
443 }
444 break;
445 case DocStyleChange::Div: /* HTML only */ break;
446 case DocStyleChange::Span: /* HTML only */ break;
447 }
448}
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309

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

◆ operator()() [50/58]

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

Definition at line 307 of file latexdocvisitor.cpp.

308{
309 if (m_hide) return;
310 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
311 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
312 if (res)
313 {
315 {
316 if (pdfHyperlinks)
317 {
318 m_t << "\\texorpdfstring{$<$}{<}";
319 }
320 else
321 {
322 m_t << "$<$";
323 }
324 }
326 {
327 if (pdfHyperlinks)
328 {
329 m_t << "\\texorpdfstring{$>$}{>}";
330 }
331 else
332 {
333 m_t << "$>$";
334 }
335 }
336 else
337 {
338 m_t << res;
339 }
340 }
341 else
342 {
343 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
344 }
345}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
const char * latex(SymType symb) const
Access routine to the LaTeX code of the HTML entity.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.

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

◆ operator()() [51/58]

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

Definition at line 1897 of file latexdocvisitor.cpp.

1898{
1899 if (m_hide) return;
1900 visitChildren(t);
1901}

References m_hide, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 1024 of file latexdocvisitor.cpp.

1025{
1026 if (m_hide) return;
1027 visitChildren(t);
1028}

References m_hide, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 364 of file latexdocvisitor.cpp.

365{
366 if (m_hide) return;
367 if (Config_getBool(PDF_HYPERLINKS))
368 {
369 m_t << "\\href{";
370 if (u.isEmail()) m_t << "mailto:";
371 m_t << latexFilterURL(u.url()) << "}";
372 }
373 m_t << "{\\texttt{";
374 filter(u.url());
375 m_t << "}}";
376}
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193

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

◆ operator()() [54/58]

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

Definition at line 450 of file latexdocvisitor.cpp.

451{
452 if (m_hide) return;
453 QCString lang = m_langExt;
454 if (!s.language().isEmpty()) // explicit language setting
455 {
456 lang = s.language();
457 }
458 SrcLangExt langExt = getLanguageFromCodeLang(lang);
459 switch(s.type())
460 {
462 {
463 m_ci.startCodeFragment("DoxyCode");
464 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
465 Config_getBool(STRIP_CODE_COMMENTS),
466 s.isExample(),s.exampleFile());
467 m_ci.endCodeFragment("DoxyCode");
468 }
469 break;
471 filter(s.text(), true);
472 break;
474 m_t << "{\\ttfamily ";
475 filter(s.text(), true);
476 m_t << "}";
477 break;
479 m_t << "\\begin{DoxyVerb}";
480 m_t << s.text();
481 m_t << "\\end{DoxyVerb}\n";
482 break;
488 /* nothing */
489 break;
491 m_t << s.text();
492 break;
493 case DocVerbatim::Dot:
494 {
495 static int dotindex = 1;
496 QCString fileName(4096, QCString::ExplicitSize);
497
498 fileName.sprintf("%s%d%s",
499 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
500 dotindex++,
501 ".dot"
502 );
503 std::ofstream file = Portable::openOutputStream(fileName);
504 if (!file.is_open())
505 {
506 err("Could not open file {} for writing\n",fileName);
507 }
508 else
509 {
510 file.write( s.text().data(), s.text().length() );
511 file.close();
512
513 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
514 visitChildren(s);
516
517 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
518 }
519 }
520 break;
521 case DocVerbatim::Msc:
522 {
523 static int mscindex = 1;
524 QCString baseName(4096, QCString::ExplicitSize);
525
526 baseName.sprintf("%s%d",
527 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
528 mscindex++
529 );
530 QCString fileName = baseName+".msc";
531 std::ofstream file = Portable::openOutputStream(fileName);
532 if (!file.is_open())
533 {
534 err("Could not open file {} for writing\n",fileName);
535 }
536 else
537 {
538 QCString text = "msc {";
539 text+=s.text();
540 text+="}";
541 file.write( text.data(), text.length() );
542 file.close();
543
544 writeMscFile(baseName, s);
545
546 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
547 }
548 }
549 break;
551 {
552 QCString latexOutput = Config_getString(LATEX_OUTPUT);
553 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
554 latexOutput,s.exampleFile(),s.text(),
556 s.engine(),s.srcFile(),s.srcLine(),true);
557
558 for (const auto &baseName: baseNameVector)
559 {
560 writePlantUMLFile(QCString(baseName), s);
561 }
562 }
563 break;
564 }
565}
QCString srcFile() const
Definition docnode.h:397
int srcLine() const
Definition docnode.h:398
QCString height() const
Definition docnode.h:392
bool hasCaption() const
Definition docnode.h:390
QCString language() const
Definition docnode.h:388
bool isExample() const
Definition docnode.h:385
QCString context() const
Definition docnode.h:384
Type type() const
Definition docnode.h:382
QCString text() const
Definition docnode.h:383
QCString exampleFile() const
Definition docnode.h:386
QCString engine() const
Definition docnode.h:393
bool useBitmap() const
Definition docnode.h:394
@ JavaDocLiteral
Definition docnode.h:378
QCString width() const
Definition docnode.h:391
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:31
static PlantumlManager & instance()
Definition plantuml.cpp:231
@ ExplicitSize
Definition qcstring.h:133
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
const char * qPrint(const char *s)
Definition qcstring.h:672
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5736

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), QCString::data(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, endDotFile(), DocVerbatim::engine(), err, DocVerbatim::exampleFile(), QCString::ExplicitSize, filter(), DocVisitor::getCodeParser(), getLanguageFromCodeLang(), DocVerbatim::hasCaption(), DocVerbatim::height(), DocVerbatim::HtmlOnly, PlantumlManager::instance(), QCString::isEmpty(), DocVerbatim::isExample(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language(), DocVerbatim::LatexOnly, QCString::length(), m_ci, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, Portable::openOutputStream(), CodeParserInterface::parseCode(), DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_EPS, qPrint(), Dir::remove(), DocVerbatim::RtfOnly, QCString::sprintf(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), startDotFile(), QCString::str(), DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::useBitmap(), DocVerbatim::Verbatim, visitChildren(), DocVerbatim::width(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [55/58]

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

Definition at line 1913 of file latexdocvisitor.cpp.

1914{
1915}

◆ operator()() [56/58]

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

Definition at line 294 of file latexdocvisitor.cpp.

295{
296 if (m_hide) return;
297 if (m_insidePre)
298 {
299 m_t << w.chars();
300 }
301 else
302 {
303 m_t << " ";
304 }
305}
QCString chars() const
Definition docnode.h:358

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

◆ operator()() [57/58]

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

Definition at line 280 of file latexdocvisitor.cpp.

281{
282 if (m_hide) return;
283 filter(w.word());
284}
QCString word() const
Definition docnode.h:156

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

◆ operator()() [58/58]

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

Definition at line 1856 of file latexdocvisitor.cpp.

1857{
1858 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1859 if (m_hide) return;
1860 if (x.title().isEmpty()) return;
1862 m_t << "\\begin{DoxyRefDesc}{";
1863 filter(x.title());
1864 m_t << "}\n";
1865 bool anonymousEnum = x.file()=="@";
1866 m_t << "\\item[";
1867 if (pdfHyperlinks && !anonymousEnum)
1868 {
1869 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1870 }
1871 else
1872 {
1873 m_t << "\\textbf{ ";
1874 }
1876 filter(x.title());
1878 if (pdfHyperlinks && !anonymousEnum)
1879 {
1880 m_t << "}";
1881 }
1882 m_t << "}]";
1883 visitChildren(x);
1884 if (x.title().isEmpty()) return;
1886 m_t << "\\end{DoxyRefDesc}\n";
1887}
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626

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

◆ popTableState()

void LatexDocVisitor::popTableState ( )
inlineprivate

Definition at line 212 of file latexdocvisitor.h.

213 {
214 m_tableStateStack.pop();
215 }

References m_tableStateStack.

Referenced by operator()().

◆ pushTableState()

void LatexDocVisitor::pushTableState ( )
inlineprivate

Definition at line 208 of file latexdocvisitor.h.

209 {
210 m_tableStateStack.emplace();
211 }

References m_tableStateStack.

Referenced by operator()().

◆ rowSpans()

RowSpanList & LatexDocVisitor::rowSpans ( )
inlineprivate

Definition at line 256 of file latexdocvisitor.h.

257 {
258 return !m_tableStateStack.empty() ? m_tableStateStack.top().rowSpans : m_emptyRowSpanList;
259 }
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 220 of file latexdocvisitor.h.

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

References m_tableStateStack.

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

◆ setFirstRow()

void LatexDocVisitor::setFirstRow ( bool b)
inlineprivate

Definition at line 252 of file latexdocvisitor.h.

253 {
254 if (!m_tableStateStack.empty()) m_tableStateStack.top().firstRow = b;
255 }

References m_tableStateStack.

Referenced by operator()().

◆ setInColSpan()

void LatexDocVisitor::setInColSpan ( bool b)
inlineprivate

Definition at line 244 of file latexdocvisitor.h.

245 {
246 if (!m_tableStateStack.empty()) m_tableStateStack.top().inColSpan = b;
247 }

References m_tableStateStack.

Referenced by operator()().

◆ setInRowSpan()

void LatexDocVisitor::setInRowSpan ( bool b)
inlineprivate

Definition at line 236 of file latexdocvisitor.h.

237 {
238 if (!m_tableStateStack.empty()) m_tableStateStack.top().inRowSpan = b;
239 }

References m_tableStateStack.

Referenced by operator()().

◆ setNumCols()

void LatexDocVisitor::setNumCols ( size_t num)
inlineprivate

Definition at line 228 of file latexdocvisitor.h.

229 {
230 if (!m_tableStateStack.empty()) m_tableStateStack.top().numCols = num;
231 }

References m_tableStateStack.

Referenced by operator()().

◆ startDiaFile()

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

Definition at line 2064 of file latexdocvisitor.cpp.

2071{
2072 QCString baseName=makeBaseName(fileName);
2073 baseName.prepend("dia_");
2074
2075 QCString outDir = Config_getString(LATEX_OUTPUT);
2076 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2077 visitPreStart(m_t,hasCaption, baseName, width, height);
2078}
QCString & prepend(const char *s)
Definition qcstring.h:407
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
static QCString makeBaseName(const QCString &name)

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

Referenced by operator()().

◆ startDotFile()

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

Definition at line 2008 of file latexdocvisitor.cpp.

2015{
2016 QCString baseName=makeBaseName(fileName);
2017 baseName.prepend("dot_");
2018 QCString outDir = Config_getString(LATEX_OUTPUT);
2019 QCString name = fileName;
2020 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
2021 visitPreStart(m_t,hasCaption, baseName, width, height);
2022}
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230

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

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

◆ startLink()

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

Definition at line 1936 of file latexdocvisitor.cpp.

1938{
1939 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1940 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1941 {
1942 if (refToTable)
1943 {
1944 m_t << "\\doxytablelink{";
1945 }
1946 else if (refToSection)
1947 {
1948 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1949 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxysectlink{";
1950 }
1951 else
1952 {
1953 if (m_texOrPdf == TexOrPdf::TEX) m_t << "\\protect";
1954 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxylink{";
1955 }
1956 if (refToTable || m_texOrPdf != TexOrPdf::PDF)
1957 {
1958 if (!file.isEmpty()) m_t << stripPath(file);
1959 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1960 if (!anchor.isEmpty()) m_t << anchor;
1961 m_t << "}";
1962 }
1963 m_t << "{";
1964 }
1965 else if (ref.isEmpty() && refToSection)
1966 {
1967 m_t << "\\doxysectref{";
1968 }
1969 else if (ref.isEmpty() && refToTable)
1970 {
1971 m_t << "\\doxytableref{";
1972 }
1973 else if (ref.isEmpty()) // internal non-PDF link
1974 {
1975 m_t << "\\doxyref{";
1976 }
1977 else // external link
1978 {
1979 m_t << "\\textbf{ ";
1980 }
1981}

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

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

◆ startMscFile()

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

Definition at line 2030 of file latexdocvisitor.cpp.

2037{
2038 QCString baseName=makeBaseName(fileName);
2039 baseName.prepend("msc_");
2040
2041 QCString outDir = Config_getString(LATEX_OUTPUT);
2042 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
2043 visitPreStart(m_t,hasCaption, baseName, width, height);
2044}
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157

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

Referenced by operator()().

◆ startPlantUmlFile()

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

Definition at line 2112 of file latexdocvisitor.cpp.

2119{
2120 QCString outDir = Config_getString(LATEX_OUTPUT);
2121 std::string inBuf;
2122 readInputFile(fileName,inBuf);
2123
2124 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2125 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
2126 outDir,QCString(),inBuf.c_str(),
2128 QCString(),srcFile,srcLine,false);
2129 bool first = true;
2130 for (const auto &bName: baseNameVector)
2131 {
2132 QCString baseName = makeBaseName(QCString(bName));
2133 QCString shortName = makeShortName(baseName);
2134 if (useBitmap)
2135 {
2136 if (shortName.find('.')==-1) shortName += ".png";
2137 }
2140 if (!first) endPlantUmlFile(hasCaption);
2141 first = false;
2142 visitPreStart(m_t,hasCaption, shortName, width, height);
2143 }
2144}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
static QCString makeShortName(const QCString &baseName)
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:6047

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

Referenced by operator()().

◆ visitCaption()

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

Definition at line 232 of file latexdocvisitor.cpp.

233{
234 for (const auto &n : children)
235 {
236 std::visit(*this,n);
237 }
238}

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

◆ visitChildren()

◆ writeDiaFile()

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

Definition at line 2087 of file latexdocvisitor.cpp.

2088{
2089 QCString shortName = makeShortName(baseName);
2090 QCString outDir = Config_getString(LATEX_OUTPUT);
2091 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2092 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2095}
const DocNodeList & children() const
Definition docnode.h:395
void visitCaption(const DocNodeList &children)

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

◆ writeEndTableCommand()

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

Definition at line 1268 of file latexdocvisitor.cpp.

1269{
1270 if (isTableNested(n))
1271 {
1272 m_t << "\\end{tabularx}}\n";
1273 }
1274 else
1275 {
1276 m_t << "\\end{longtabu}\n";
1277 }
1278 //return isNested ? "TabularNC" : "TabularC";
1279}

References isTableNested(), and m_t.

Referenced by operator()().

◆ writeMscFile()

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

Definition at line 2053 of file latexdocvisitor.cpp.

2054{
2055 QCString shortName = makeShortName(baseName);
2056 QCString outDir = Config_getString(LATEX_OUTPUT);
2057 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2058 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2061}

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

Referenced by operator()().

◆ writePlantUMLFile()

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

◆ writeStartTableCommand()

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

Definition at line 1255 of file latexdocvisitor.cpp.

1256{
1257 if (isTableNested(n))
1258 {
1259 m_t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1260 }
1261 else
1262 {
1263 m_t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1264 }
1265 //return isNested ? "TabularNC" : "TabularC";
1266}

References isTableNested(), and m_t.

Referenced by operator()().

Member Data Documentation

◆ m_ci

OutputCodeList& LatexDocVisitor::m_ci
private

Definition at line 177 of file latexdocvisitor.h.

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

◆ m_emptyRowSpanList

RowSpanList LatexDocVisitor::m_emptyRowSpanList
private

Definition at line 196 of file latexdocvisitor.h.

Referenced by rowSpans().

◆ m_hide

◆ m_hierarchyLevel

int LatexDocVisitor::m_hierarchyLevel
private

Definition at line 183 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 179 of file latexdocvisitor.h.

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

◆ m_langExt

QCString LatexDocVisitor::m_langExt
private

Definition at line 182 of file latexdocvisitor.h.

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

◆ m_lcg

LatexCodeGenerator& LatexDocVisitor::m_lcg
private

Definition at line 178 of file latexdocvisitor.h.

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

◆ m_listItemInfo

LatexListItemInfo LatexDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 206 of file latexdocvisitor.h.

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

◆ m_t

◆ m_tableStateStack

◆ m_texOrPdf

TexOrPdf LatexDocVisitor::m_texOrPdf = TexOrPdf::NO
private

Definition at line 184 of file latexdocvisitor.h.

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

◆ maxIndentLevels

const int LatexDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 198 of file latexdocvisitor.h.

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


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