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

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

269 : m_t(t), m_ci(ci), m_lcg(lcg), m_insidePre(FALSE),
271 m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
272{
273}
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 2106 of file latexdocvisitor.cpp.

2107{
2108 if (m_indentLevel>0)
2109 {
2110 m_indentLevel--;
2111 }
2112}

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

2027{
2028 if (m_hide) return;
2029 visitPostEnd(m_t,hasCaption);
2030}
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 1970 of file latexdocvisitor.cpp.

1971{
1972 if (m_hide) return;
1973 visitPostEnd(m_t,hasCaption);
1974}

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

1930{
1931 m_t << "}";
1932 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1933 if (ref.isEmpty() && !pdfHyperLinks)
1934 {
1935 m_t << "{";
1937 m_t << "}{" << file;
1938 if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1939 m_t << anchor << "}";
1940 if (refToSection)
1941 {
1942 m_t << "{" << sectionType.level() << "}";
1943 }
1944 }
1945 if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1946 {
1947 if (refToSection)
1948 {
1949 if (m_texOrPdf != TexOrPdf::PDF) m_t << "{" << sectionType.level() << "}";
1950 }
1951 }
1952}
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 1992 of file latexdocvisitor.cpp.

1993{
1994 if (m_hide) return;
1995 visitPostEnd(m_t,hasCaption);
1996}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2086 of file latexdocvisitor.cpp.

2087{
2088 if (m_hide) return;
2089 visitPostEnd(m_t,hasCaption);
2090}

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ escapeMakeIndexChars()

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

Definition at line 239 of file latexdocvisitor.cpp.

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

References filter(), and m_t.

◆ filter()

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

Definition at line 1869 of file latexdocvisitor.cpp.

1870{
1871 //printf("LatexDocVisitor::filter(%s) m_insideTabbing=%d\n",qPrint(str),m_ci.insideTabbing());
1873 m_lcg.insideTabbing(),
1876 m_lcg.usedTableLevel()>0, // insideTable
1877 false, // keepSpaces
1878 retainNewLine
1879 );
1880}
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 58 of file latexdocvisitor.cpp.

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

2098{
2099 m_indentLevel++;
2101 {
2102 err("Maximum indent level ({}) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2103 }
2104}
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 2092 of file latexdocvisitor.cpp.

2093{
2094 return std::min(m_indentLevel,maxIndentLevels-1);
2095}

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()().

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

564{
565 if (m_hide) return;
566 m_t << "\\label{" << stripPath(anc.file()) << "_" << anc.anchor() << "}%\n";
567 if (!anc.file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
568 {
569 m_t << "\\Hypertarget{" << stripPath(anc.file()) << "_" << anc.anchor()
570 << "}%\n";
571 }
572}
QCString anchor() const
Definition docnode.h:231
QCString file() const
Definition docnode.h:232
QCString stripPath(const QCString &s)
Definition util.cpp:5464

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

760{
761 if (m_hide) return;
762 if (m_indentLevel>=maxIndentLevels-1) return;
763 if (l.isEnumList())
764 {
765 m_t << "\n\\begin{DoxyEnumerate}";
766 m_listItemInfo[indentLevel()].isEnum = true;
767 }
768 else
769 {
770 m_listItemInfo[indentLevel()].isEnum = false;
771 m_t << "\n\\begin{DoxyItemize}";
772 }
773 visitChildren(l);
774 if (l.isEnumList())
775 {
776 m_t << "\n\\end{DoxyEnumerate}";
777 }
778 else
779 {
780 m_t << "\n\\end{DoxyItemize}";
781 }
782}
bool isEnumList() const
Definition docnode.h:576
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 784 of file latexdocvisitor.cpp.

785{
786 if (m_hide) return;
787 switch (li.itemNumber())
788 {
789 case DocAutoList::Unchecked: // unchecked
790 m_t << "\n\\item[\\DoxyUnchecked] ";
791 break;
792 case DocAutoList::Checked_x: // checked with x
793 case DocAutoList::Checked_X: // checked with X
794 m_t << "\n\\item[\\DoxyChecked] ";
795 break;
796 default:
797 m_t << "\n\\item ";
798 break;
799 }
801 visitChildren(li);
803}
int itemNumber() const
Definition docnode.h:594

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

737{
738 if (m_hide) return;
739 if (!cite.file().isEmpty())
740 {
741 //startLink(cite.ref(),cite.file(),cite.anchor());
742 QCString anchor = cite.anchor();
743 QCString anchorPrefix = CitationManager::instance().anchorPrefix();
744 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
745 m_t << "\\cite{" << anchor << "}";
746 }
747 else
748 {
749 m_t << "{\\bfseries [";
750 filter(cite.text());
751 m_t << "]}";
752 }
753}
QCString anchorPrefix() const
Definition cite.cpp:122
static CitationManager & instance()
Definition cite.cpp:80
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:247
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(), CitationManager::instance(), QCString::isEmpty(), QCString::length(), m_hide, m_t, QCString::mid(), and DocCite::text().

◆ operator()() [5/58]

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

Definition at line 1569 of file latexdocvisitor.cpp.

1570{
1571 if (m_hide) return;
1572 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1573 startDiaFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1574 visitChildren(df);
1575 endDiaFile(df.hasCaption());
1576}
QCString height() const
Definition docnode.h:684
QCString srcFile() const
Definition docnode.h:686
QCString file() const
Definition docnode.h:680
int srcLine() const
Definition docnode.h:687
bool hasCaption() const
Definition docnode.h:682
QCString width() const
Definition docnode.h:683
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:6336

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

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

347{
348 if (m_hide) return;
349 QCString emojiName = EmojiEntityMapper::instance().name(s.index());
350 if (!emojiName.isEmpty())
351 {
352 QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end
353 if (m_texOrPdf != TexOrPdf::PDF) m_t << "\\doxygenemoji{";
354 filter(emojiName);
355 if (m_texOrPdf != TexOrPdf::PDF) m_t << "}{" << imageName << "}";
356 }
357 else
358 {
359 m_t << s.name();
360 }
361}
int index() const
Definition docnode.h:341
QCString name() const
Definition docnode.h:340
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 703 of file latexdocvisitor.cpp.

704{
705 if (m_hide) return;
706 QCString s = f.text();
707 const char *p = s.data();
708 char c = 0;
709 if (p)
710 {
711 while ((c=*p++))
712 {
713 switch (c)
714 {
715 case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
716 default: m_t << c; break;
717 }
718 }
719 }
720}
QCString text() const
Definition docnode.h:529
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 383 of file latexdocvisitor.cpp.

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

References insideTable(), m_hide, and m_t.

◆ operator()() [10/58]

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

Definition at line 1480 of file latexdocvisitor.cpp.

1481{
1482 if (m_hide) return;
1483 if (Config_getBool(PDF_HYPERLINKS))
1484 {
1485 m_t << "\\href{";
1486 m_t << latexFilterURL(href.url());
1487 m_t << "}";
1488 }
1489 m_t << "{\\texttt{ ";
1490 visitChildren(href);
1491 m_t << "}}";
1492}
QCString url() const
Definition docnode.h:825
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 1849 of file latexdocvisitor.cpp.

1850{
1851 if (m_hide) return;
1852 m_t << "\\begin{quote}\n";
1854 visitChildren(q);
1855 m_t << "\\end{quote}\n";
1857}

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

◆ operator()() [12/58]

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

Definition at line 1275 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1359 of file latexdocvisitor.cpp.

1360{
1361 if (m_hide) return;
1362
1363 const DocHtmlRow *row = std::get_if<DocHtmlRow>(c.parent());
1364
1366
1367 //Skip columns that span from above.
1368 for (const auto &span : rowSpans())
1369 {
1370 if (span.rowSpan>0 && span.column==currentColumn())
1371 {
1372 if (row && span.colSpan>1)
1373 {
1374 m_t << "\\multicolumn{" << span.colSpan << "}{";
1375 if (currentColumn() /*c.columnIndex()*/==1) // add extra | for first column
1376 {
1377 m_t << "|";
1378 }
1379 m_t << "l|}{" << (c.isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
1380 setCurrentColumn(currentColumn()+span.colSpan);
1381 }
1382 else
1383 {
1385 }
1386 m_t << "&";
1387 }
1388 }
1389
1390 int cs = c.colSpan();
1391 int a = c.alignment();
1392 if (cs>1 && row)
1393 {
1395 m_t << "\\multicolumn{" << cs << "}{";
1396 if (c.columnIndex()==1) // add extra | for first column
1397 {
1398 m_t << "|";
1399 }
1400 switch (a)
1401 {
1402 case DocHtmlCell::Right:
1403 m_t << "r|}{";
1404 break;
1406 m_t << "c|}{";
1407 break;
1408 default:
1409 m_t << "l|}{";
1410 break;
1411 }
1412 }
1413 int rs = c.rowSpan();
1414 int va = c.valignment();
1415 if (rs>0)
1416 {
1418 m_t << "\\multirow";
1419 switch(va)
1420 {
1421 case DocHtmlCell::Top:
1422 m_t << "[t]";
1423 break;
1425 m_t << "[b]";
1426 break;
1428 break; // No alignment option needed
1429 default:
1430 break;
1431 }
1432 //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1433 // c.rowIndex(),c.columnIndex(),c.rowSpan(),c.colSpan(),
1434 // currentColumn());
1436 m_t << "{" << rs << "}{*}{";
1437 }
1438 if (a==DocHtmlCell::Center)
1439 {
1440 m_t << "\\PBS\\centering ";
1441 }
1442 else if (a==DocHtmlCell::Right)
1443 {
1444 m_t << "\\PBS\\raggedleft ";
1445 }
1446 if (c.isHeading())
1447 {
1448 m_t << "\\cellcolor{\\tableheadbgcolor}\\textbf{ ";
1449 }
1450 if (cs>1)
1451 {
1453 }
1454
1455 visitChildren(c);
1456
1457 if (c.isHeading())
1458 {
1459 m_t << "}";
1460 }
1461 if (inRowSpan())
1462 {
1464 m_t << "}";
1465 }
1466 if (inColSpan())
1467 {
1469 m_t << "}";
1470 }
1471 if (!c.isLast()) m_t << "&";
1472}
Valignment valignment() const
Definition docnode.cpp:1876
uint32_t columnIndex() const
Definition docnode.h:1204
uint32_t rowSpan() const
Definition docnode.cpp:1814
Alignment alignment() const
Definition docnode.cpp:1838
bool isLast() const
Definition docnode.h:1197
bool isHeading() const
Definition docnode.h:1195
uint32_t colSpan() const
Definition docnode.cpp:1826
DocNodeVariant * parent()
Definition docnode.h:89
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 1181 of file latexdocvisitor.cpp.

1182{
1184 if (!m_insideItem) m_t << "\\hfill";
1185 m_t << " \\\\\n";
1186 visitChildren(dd);
1188}

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

◆ operator()() [15/58]

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

Definition at line 1147 of file latexdocvisitor.cpp.

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

1172{
1173 if (m_hide) return;
1174 m_t << "\n\\item[";
1176 visitChildren(dt);
1178 m_t << "]";
1179}

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

◆ operator()() [17/58]

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

Definition at line 1502 of file latexdocvisitor.cpp.

1503{
1504 if (m_hide) return;
1505 m_t << "\n\n";
1506 auto summary = d.summary();
1507 if (summary)
1508 {
1509 std::visit(*this,*summary);
1510 m_t << "\\begin{adjustwidth}{1em}{0em}\n";
1511 }
1512 visitChildren(d);
1513 if (summary)
1514 {
1515 m_t << "\\end{adjustwidth}\n";
1516 }
1517 else
1518 {
1519 m_t << "\n\n";
1520 }
1521}
const DocNodeVariant * summary() const
Definition docnode.h:859

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

◆ operator()() [18/58]

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

Definition at line 1523 of file latexdocvisitor.cpp.

1524{
1525 if (m_hide) return;
1526 m_t << "\\" << getSectionName(header.level()) << "*{";
1527 visitChildren(header);
1528 m_t << "}";
1529}
int level() const
Definition docnode.h:872
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 1031 of file latexdocvisitor.cpp.

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

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

1099{
1100 if (m_hide) return;
1101 if (m_listItemInfo[indentLevel()].isEnum)
1102 {
1103 for (const auto &opt : l.attribs())
1104 {
1105 if (opt.name=="value")
1106 {
1107 bool ok = false;
1108 int val = opt.value.toInt(&ok);
1109 if (ok)
1110 {
1111 m_t << "\n\\setcounter{DoxyEnumerate" << integerToRoman(indentLevel()+1,false) << "}{" << (val - 1) << "}";
1112 }
1113 }
1114 }
1115 }
1116 m_t << "\n\\item ";
1118 visitChildren(l);
1120}
const HtmlAttribList & attribs() const
Definition docnode.h:1165
QCString integerToRoman(int n, bool upper)
Definition util.cpp:7175

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

1282{
1283 if (m_hide) return;
1285
1286 visitChildren(row);
1287
1288 size_t c=currentColumn();
1289 while (c<=numCols()) // end of row while inside a row span?
1290 {
1291 for (const auto &span : rowSpans())
1292 {
1293 //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1294 // span->column, span->rowSpan,span->colSpan,row.rowIndex(),span->cell->rowIndex(),i,c);
1295 if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
1296 row.rowIndex()>span.cell.rowIndex() // but not the row that started the span
1297 )
1298 {
1299 m_t << "&";
1300 if (span.colSpan>1) // row span is also part of a column span
1301 {
1302 m_t << "\\multicolumn{" << span.colSpan << "}{";
1303 m_t << "}|}{}";
1304 }
1305 else // solitary row span
1306 {
1307 m_t << "\\multicolumn{1}{c|}{}";
1308 }
1309 }
1310 }
1311 c++;
1312 }
1313
1314 m_t << "\\\\";
1315
1316 size_t col = 1;
1317 for (auto &span : rowSpans())
1318 {
1319 if (span.rowSpan>0) span.rowSpan--;
1320 if (span.rowSpan<=0)
1321 {
1322 // inactive span
1323 }
1324 else if (span.column>col)
1325 {
1326 m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
1327 col = span.column+span.colSpan;
1328 }
1329 else
1330 {
1331 col = span.column+span.colSpan;
1332 }
1333 }
1334
1335 if (col <= numCols())
1336 {
1337 m_t << "\\cline{" << col << "-" << numCols() << "}";
1338 }
1339
1340 m_t << "\n";
1341
1342 const DocNodeVariant *n = ::parent(row.parent());
1343 if (row.isHeading() && row.rowIndex()==1 && !tableIsNested(n))
1344 {
1345 if (firstRow())
1346 {
1347 m_t << "\\endfirsthead\n";
1348 m_t << "\\hline\n";
1349 m_t << "\\endfoot\n";
1350 m_t << "\\hline\n";
1351 }
1352 else
1353 {
1354 m_t << "\\endhead\n";
1355 }
1356 }
1357}
bool isHeading() const
Definition docnode.cpp:1898
uint32_t rowIndex() const
Definition docnode.h:1253
bool firstRow() 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:66
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:1325
static bool tableIsNested(const DocNodeVariant *n)

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

◆ operator()() [22/58]

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

Definition at line 1494 of file latexdocvisitor.cpp.

1495{
1496 if (m_hide) return;
1497 m_t << "{\\bfseries{";
1498 visitChildren(d);
1499 m_t << "}}";
1500}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1227 of file latexdocvisitor.cpp.

1228{
1229 if (m_hide) return;
1231 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1232 if (c)
1233 {
1234 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1235 if (!c->file().isEmpty() && pdfHyperLinks)
1236 {
1237 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1238 << "}{}";
1239 }
1240 m_t << "\n";
1241 }
1242
1244
1245 if (c)
1246 {
1247 m_t << "\\caption{";
1248 std::visit(*this, *t.caption());
1249 m_t << "}";
1250 m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1251 m_t << "\\\\\n";
1252 }
1253
1255 m_t << "\\hline\n";
1256
1257 // check if first row is a heading and then render the row already here
1258 // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1259 // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1260 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1261 if (firstRow && firstRow->isHeading())
1262 {
1264 if (!tableIsNested(t.parent()))
1265 {
1266 std::visit(*this,*t.firstRow());
1267 }
1269 }
1270 visitChildren(t);
1272 popTableState();
1273}
QCString anchor() const
Definition docnode.h:1230
QCString file() const
Definition docnode.h:1229
size_t numColumns() const
Definition docnode.h:1273
const DocNodeVariant * caption() const
Definition docnode.cpp:2044
const DocNodeVariant * firstRow() const
Definition docnode.cpp:2049
void setFirstRow(bool b)
void setNumCols(size_t num)
static void writeStartTableCommand(TextStream &t, const DocNodeVariant *n, size_t cols)
static void writeEndTableCommand(TextStream &t, const DocNodeVariant *n)

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

◆ operator()() [24/58]

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

Definition at line 1531 of file latexdocvisitor.cpp.

1532{
1533 if (img.type()==DocImage::Latex)
1534 {
1535 if (m_hide) return;
1536 QCString gfxName = img.name();
1537 if (gfxName.endsWith(".eps") || gfxName.endsWith(".pdf"))
1538 {
1539 gfxName=gfxName.left(gfxName.length()-4);
1540 }
1541
1542 visitPreStart(m_t,img.hasCaption(), gfxName, img.width(), img.height(), img.isInlineImage());
1543 visitChildren(img);
1545 }
1546 else // other format -> skip
1547 {
1548 }
1549}
QCString name() const
Definition docnode.h:643
QCString height() const
Definition docnode.h:646
Type type() const
Definition docnode.h:642
QCString width() const
Definition docnode.h:645
bool isInlineImage() const
Definition docnode.h:649
bool hasCaption() const
Definition docnode.h:644
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 574 of file latexdocvisitor.cpp.

575{
576 if (m_hide) return;
578 switch(inc.type())
579 {
581 {
582 m_ci.startCodeFragment("DoxyCodeInclude");
583 FileInfo cfi( inc.file().str() );
584 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
586 inc.text(),
587 langExt,
588 inc.stripCodeComments(),
589 inc.isExample(),
590 inc.exampleFile(),
591 fd.get(), // fileDef,
592 -1, // start line
593 -1, // end line
594 FALSE, // inline fragment
595 nullptr, // memberDef
596 TRUE // show line numbers
597 );
598 m_ci.endCodeFragment("DoxyCodeInclude");
599 }
600 break;
602 {
603 m_ci.startCodeFragment("DoxyCodeInclude");
605 inc.text(),langExt,
606 inc.stripCodeComments(),
607 inc.isExample(),
608 inc.exampleFile(),
609 nullptr, // fileDef
610 -1, // startLine
611 -1, // endLine
612 TRUE, // inlineFragment
613 nullptr, // memberDef
614 FALSE
615 );
616 m_ci.endCodeFragment("DoxyCodeInclude");
617 }
618 break;
626 break;
628 m_t << inc.text();
629 break;
631 m_t << "\n\\begin{DoxyVerbInclude}\n";
632 m_t << inc.text();
633 m_t << "\\end{DoxyVerbInclude}\n";
634 break;
637 {
638 m_ci.startCodeFragment("DoxyCodeInclude");
640 inc.file(),
641 inc.blockId(),
642 inc.context(),
644 inc.trimLeft(),
646 );
647 m_ci.endCodeFragment("DoxyCodeInclude");
648 }
649 break;
650 }
651}
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:450
QCString extension() const
Definition docnode.h:446
bool stripCodeComments() const
Definition docnode.h:451
@ LatexInclude
Definition docnode.h:433
@ SnippetWithLines
Definition docnode.h:434
@ DontIncWithLines
Definition docnode.h:435
@ IncWithLines
Definition docnode.h:434
@ HtmlInclude
Definition docnode.h:433
@ VerbInclude
Definition docnode.h:433
@ DontInclude
Definition docnode.h:433
@ DocbookInclude
Definition docnode.h:435
Type type() const
Definition docnode.h:447
QCString exampleFile() const
Definition docnode.h:453
QCString text() const
Definition docnode.h:448
QCString file() const
Definition docnode.h:445
bool trimLeft() const
Definition docnode.h:455
bool isExample() const
Definition docnode.h:452
QCString context() const
Definition docnode.h:449
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:5721

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

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

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

723{
724 if (m_hide) return;
725 m_t << "\\index{";
727 m_t << "@{";
729 m_t << "}}";
730}
QCString entry() const
Definition docnode.h:555
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 1474 of file latexdocvisitor.cpp.

1475{
1476 if (m_hide) return;
1477 visitChildren(i);
1478}

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1835 of file latexdocvisitor.cpp.

1836{
1837 if (m_hide) return;
1838 startLink(QCString(),ref.file(),ref.anchor());
1839 visitChildren(ref);
1840 endLink(QCString(),ref.file(),ref.anchor());
1841}
QCString file() const
Definition docnode.h:806
QCString anchor() const
Definition docnode.h:808
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 377 of file latexdocvisitor.cpp.

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

References m_hide, and m_t.

◆ operator()() [31/58]

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

Definition at line 1587 of file latexdocvisitor.cpp.

1588{
1589 if (m_hide) return;
1590 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1591 visitChildren(lnk);
1592 endLink(lnk.ref(),lnk.file(),lnk.anchor());
1593}

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

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

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

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

806{
807 if (m_hide) return;
808 visitChildren(p);
809 if (!p.isLast() && // omit <p> for last paragraph
810 !(p.parent() && // and for parameter sections
811 std::get_if<DocParamSect>(p.parent())
812 )
813 ) m_t << "\n\n";
814}
bool isLast() const
Definition docnode.h:1083

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

◆ operator()() [35/58]

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

Definition at line 1727 of file latexdocvisitor.cpp.

1728{
1729 if (m_hide) return;
1731 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1732 if (sect)
1733 {
1734 parentType = sect->type();
1735 }
1736 bool useTable = parentType==DocParamSect::Param ||
1737 parentType==DocParamSect::RetVal ||
1738 parentType==DocParamSect::Exception ||
1739 parentType==DocParamSect::TemplateParam;
1740 if (!useTable)
1741 {
1742 m_t << "\\item[";
1743 }
1744 if (sect && sect->hasInOutSpecifier())
1745 {
1747 {
1748 m_t << "\\mbox{\\texttt{ ";
1749 if (pl.direction()==DocParamSect::In)
1750 {
1751 m_t << "in";
1752 }
1753 else if (pl.direction()==DocParamSect::Out)
1754 {
1755 m_t << "out";
1756 }
1757 else if (pl.direction()==DocParamSect::InOut)
1758 {
1759 m_t << "in,out";
1760 }
1761 m_t << "}} ";
1762 }
1763 if (useTable) m_t << " & ";
1764 }
1765 if (sect && sect->hasTypeSpecifier())
1766 {
1767 for (const auto &type : pl.paramTypes())
1768 {
1769 std::visit(*this,type);
1770 }
1771 if (useTable) m_t << " & ";
1772 }
1773 m_t << "{\\em ";
1774 bool first=TRUE;
1775 for (const auto &param : pl.parameters())
1776 {
1777 if (!first) m_t << ","; else first=FALSE;
1779 std::visit(*this,param);
1781 }
1782 m_t << "}";
1783 if (useTable)
1784 {
1785 m_t << " & ";
1786 }
1787 else
1788 {
1789 m_t << "]";
1790 }
1791 for (const auto &par : pl.paragraphs())
1792 {
1793 std::visit(*this,par);
1794 }
1795 if (useTable)
1796 {
1797 m_t << "\\\\\n"
1798 << "\\hline\n";
1799 }
1800}
const DocNodeList & parameters() const
Definition docnode.h:1124
const DocNodeList & paramTypes() const
Definition docnode.h:1125
DocParamSect::Direction direction() const
Definition docnode.h:1128
const DocNodeList & paragraphs() const
Definition docnode.h:1126
bool hasInOutSpecifier() const
Definition docnode.h:1064
bool hasTypeSpecifier() const
Definition docnode.h:1065
Type type() const
Definition docnode.h:1063

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

1669{
1670 if (m_hide) return;
1671 bool hasInOutSpecs = s.hasInOutSpecifier();
1672 bool hasTypeSpecs = s.hasTypeSpecifier();
1673 m_lcg.incUsedTableLevel();
1674 switch(s.type())
1675 {
1677 m_t << "\n\\begin{DoxyParams}";
1678 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1679 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1680 m_t << "{";
1682 break;
1684 m_t << "\n\\begin{DoxyRetVals}{";
1686 break;
1688 m_t << "\n\\begin{DoxyExceptions}{";
1690 break;
1692 m_t << "\n\\begin{DoxyTemplParams}{";
1694 break;
1695 default:
1696 ASSERT(0);
1698 }
1699 m_t << "}\n";
1700 visitChildren(s);
1701 m_lcg.decUsedTableLevel();
1702 switch(s.type())
1703 {
1705 m_t << "\\end{DoxyParams}\n";
1706 break;
1708 m_t << "\\end{DoxyRetVals}\n";
1709 break;
1711 m_t << "\\end{DoxyExceptions}\n";
1712 break;
1714 m_t << "\\end{DoxyTemplParams}\n";
1715 break;
1716 default:
1717 ASSERT(0);
1719 }
1720}
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 1863 of file latexdocvisitor.cpp.

1864{
1865 if (m_hide) return;
1866 visitChildren(pb);
1867}

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1578 of file latexdocvisitor.cpp.

1579{
1580 if (m_hide) return;
1581 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1582 startPlantUmlFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1583 visitChildren(df);
1585}
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 1595 of file latexdocvisitor.cpp.

1596{
1597 if (m_hide) return;
1598 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1599 // ref.anchor() for LaTeX/RTF
1600 if (ref.isSubPage())
1601 {
1602 startLink(ref.ref(),QCString(),ref.anchor());
1603 }
1604 else
1605 {
1606 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection());
1607 }
1608 if (!ref.hasLinkText())
1609 {
1610 filter(ref.targetTitle());
1611 }
1612 visitChildren(ref);
1613 if (ref.isSubPage())
1614 {
1615 endLink(ref.ref(),QCString(),ref.anchor());
1616 }
1617 else
1618 {
1619 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable(),ref.refToSection(),ref.sectionType());
1620 }
1621}
QCString anchor() const
Definition docnode.h:780
SectionType sectionType() const
Definition docnode.h:782
QCString targetTitle() const
Definition docnode.h:781
bool isSubPage() const
Definition docnode.h:787
bool refToTable() const
Definition docnode.h:786
QCString file() const
Definition docnode.h:777
QCString ref() const
Definition docnode.h:779
bool refToSection() const
Definition docnode.h:785
bool hasLinkText() const
Definition docnode.h:783

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

817{
818 visitChildren(r);
819}

References visitChildren().

◆ operator()() [41/58]

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

Definition at line 1623 of file latexdocvisitor.cpp.

1624{
1625 if (m_hide) return;
1626 m_t << "\\item \\contentsline{section}{";
1627 if (ref.isSubPage())
1628 {
1629 startLink(ref.ref(),QCString(),ref.anchor());
1630 }
1631 else
1632 {
1633 if (!ref.file().isEmpty())
1634 {
1635 startLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1636 }
1637 }
1638 visitChildren(ref);
1639 if (ref.isSubPage())
1640 {
1641 endLink(ref.ref(),QCString(),ref.anchor());
1642 }
1643 else
1644 {
1645 if (!ref.file().isEmpty()) endLink(ref.ref(),ref.file(),ref.anchor(),ref.refToTable());
1646 }
1647 m_t << "}{\\ref{";
1648 if (!ref.file().isEmpty()) m_t << stripPath(ref.file());
1649 if (!ref.file().isEmpty() && !ref.anchor().isEmpty()) m_t << "_";
1650 if (!ref.anchor().isEmpty()) m_t << ref.anchor();
1651 m_t << "}}{}\n";
1652}
bool refToTable() const
Definition docnode.h:938
QCString file() const
Definition docnode.h:934
QCString anchor() const
Definition docnode.h:935
QCString ref() const
Definition docnode.h:937
bool isSubPage() const
Definition docnode.h:939

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

1655{
1656 if (m_hide) return;
1657 m_t << "\\footnotesize\n";
1658 m_t << "\\begin{multicols}{2}\n";
1659 m_t << "\\begin{DoxyCompactList}\n";
1661 visitChildren(l);
1663 m_t << "\\end{DoxyCompactList}\n";
1664 m_t << "\\end{multicols}\n";
1665 m_t << "\\normalsize\n";
1666}

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

◆ operator()() [43/58]

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

Definition at line 997 of file latexdocvisitor.cpp.

998{
999 if (m_hide) return;
1000 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1001 if (pdfHyperlinks)
1002 {
1003 m_t << "\\hypertarget{" << stripPath(s.file()) << "_" << s.anchor() << "}{}";
1004 }
1005 m_t << "\\" << getSectionName(s.level()) << "{";
1006 if (pdfHyperlinks)
1007 {
1008 m_t << "\\texorpdfstring{";
1009 }
1010 if (s.title())
1011 {
1012 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::TEX;
1013 std::visit(*this,*s.title());
1015 }
1016 if (pdfHyperlinks)
1017 {
1018 m_t << "}{";
1019 if (s.title())
1020 {
1021 if (pdfHyperlinks) m_texOrPdf = TexOrPdf::PDF;
1022 std::visit(*this,*s.title());
1024 }
1025 m_t << "}";
1026 }
1027 m_t << "}\\label{" << stripPath(s.file()) << "_" << s.anchor() << "}\n";
1028 visitChildren(s);
1029}
QCString file() const
Definition docnode.h:917
int level() const
Definition docnode.h:913
QCString anchor() const
Definition docnode.h:915
const DocNodeVariant * title() const
Definition docnode.h:914
@ 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 1722 of file latexdocvisitor.cpp.

1723{
1724 m_t << " " << sep.chars() << " ";
1725}
QCString chars() const
Definition docnode.h:365

References DocSeparator::chars(), and m_t.

◆ operator()() [45/58]

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

Definition at line 976 of file latexdocvisitor.cpp.

977{
978 if (m_hide) return;
979 m_t << "\\begin{DoxyItemize}\n";
980 m_listItemInfo[indentLevel()].isEnum = false;
981 visitChildren(l);
982 m_t << "\\end{DoxyItemize}\n";
983}

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

◆ operator()() [46/58]

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

Definition at line 985 of file latexdocvisitor.cpp.

986{
987 if (m_hide) return;
988 m_t << "\\item ";
990 if (li.paragraph())
991 {
992 visit(*this,*li.paragraph());
993 }
995}
const DocNodeVariant * paragraph() const
Definition docnode.h:1152

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

◆ operator()() [47/58]

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

Definition at line 821 of file latexdocvisitor.cpp.

822{
823 if (m_hide) return;
824 switch(s.type())
825 {
827 m_t << "\\begin{DoxySeeAlso}{";
829 break;
831 m_t << "\\begin{DoxyReturn}{";
833 break;
835 m_t << "\\begin{DoxyAuthor}{";
837 break;
839 m_t << "\\begin{DoxyAuthor}{";
841 break;
843 m_t << "\\begin{DoxyVersion}{";
845 break;
847 m_t << "\\begin{DoxySince}{";
849 break;
851 m_t << "\\begin{DoxyDate}{";
853 break;
855 m_t << "\\begin{DoxyNote}{";
857 break;
859 m_t << "\\begin{DoxyWarning}{";
861 break;
863 m_t << "\\begin{DoxyPrecond}{";
865 break;
867 m_t << "\\begin{DoxyPostcond}{";
869 break;
871 m_t << "\\begin{DoxyCopyright}{";
873 break;
875 m_t << "\\begin{DoxyInvariant}{";
877 break;
879 m_t << "\\begin{DoxyRemark}{";
881 break;
883 m_t << "\\begin{DoxyAttention}{";
885 break;
887 m_t << "\\begin{DoxyImportant}{";
889 break;
891 m_t << "\\begin{DoxyParagraph}{";
892 break;
894 m_t << "\\begin{DoxyParagraph}{";
895 break;
896 case DocSimpleSect::Unknown: break;
897 }
898
899 if (s.title())
900 {
902 std::visit(*this,*s.title());
904 }
905 m_t << "}\n";
907 visitChildren(s);
908 switch(s.type())
909 {
911 m_t << "\n\\end{DoxySeeAlso}\n";
912 break;
914 m_t << "\n\\end{DoxyReturn}\n";
915 break;
917 m_t << "\n\\end{DoxyAuthor}\n";
918 break;
920 m_t << "\n\\end{DoxyAuthor}\n";
921 break;
923 m_t << "\n\\end{DoxyVersion}\n";
924 break;
926 m_t << "\n\\end{DoxySince}\n";
927 break;
929 m_t << "\n\\end{DoxyDate}\n";
930 break;
932 m_t << "\n\\end{DoxyNote}\n";
933 break;
935 m_t << "\n\\end{DoxyWarning}\n";
936 break;
938 m_t << "\n\\end{DoxyPrecond}\n";
939 break;
941 m_t << "\n\\end{DoxyPostcond}\n";
942 break;
944 m_t << "\n\\end{DoxyCopyright}\n";
945 break;
947 m_t << "\n\\end{DoxyInvariant}\n";
948 break;
950 m_t << "\n\\end{DoxyRemark}\n";
951 break;
953 m_t << "\n\\end{DoxyAttention}\n";
954 break;
956 m_t << "\n\\end{DoxyImportant}\n";
957 break;
959 m_t << "\n\\end{DoxyParagraph}\n";
960 break;
962 m_t << "\n\\end{DoxyParagraph}\n";
963 break;
964 default:
965 break;
966 }
968}
Type type() const
Definition docnode.h:1021
const DocNodeVariant * title() const
Definition docnode.h:1028
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 732 of file latexdocvisitor.cpp.

733{
734}

◆ operator()() [49/58]

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

Definition at line 392 of file latexdocvisitor.cpp.

393{
394 if (m_hide) return;
395 switch (s.style())
396 {
398 if (s.enable()) m_t << "{\\bfseries{"; else m_t << "}}";
399 break;
403 if (s.enable()) m_t << "\\sout{"; else m_t << "}";
404 break;
407 if (s.enable()) m_t << "\\uline{"; else m_t << "}";
408 break;
410 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
411 break;
415 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
416 break;
418 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
419 break;
421 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
422 break;
424 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
425 break;
427 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
428 break;
430 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
431 break;
433 if (s.enable())
434 {
435 m_t << "\n\\begin{DoxyPre}";
437 }
438 else
439 {
441 m_t << "\\end{DoxyPre}\n";
442 }
443 break;
444 case DocStyleChange::Div: /* HTML only */ break;
445 case DocStyleChange::Span: /* HTML only */ break;
446 }
447}
Style style() const
Definition docnode.h:303
bool enable() const
Definition docnode.h:305

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

307{
308 if (m_hide) return;
309 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
310 const char *res = HtmlEntityMapper::instance().latex(s.symbol());
311 if (res)
312 {
314 {
315 if (pdfHyperlinks)
316 {
317 m_t << "\\texorpdfstring{$<$}{<}";
318 }
319 else
320 {
321 m_t << "$<$";
322 }
323 }
325 {
326 if (pdfHyperlinks)
327 {
328 m_t << "\\texorpdfstring{$>$}{>}";
329 }
330 else
331 {
332 m_t << "$>$";
333 }
334 }
335 else
336 {
337 m_t << res;
338 }
339 }
340 else
341 {
342 err("LaTeX: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
343 }
344}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:328
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 1843 of file latexdocvisitor.cpp.

1844{
1845 if (m_hide) return;
1846 visitChildren(t);
1847}

References m_hide, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 970 of file latexdocvisitor.cpp.

971{
972 if (m_hide) return;
973 visitChildren(t);
974}

References m_hide, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 363 of file latexdocvisitor.cpp.

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

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

450{
451 if (m_hide) return;
452 QCString lang = m_langExt;
453 if (!s.language().isEmpty()) // explicit language setting
454 {
455 lang = s.language();
456 }
457 SrcLangExt langExt = getLanguageFromCodeLang(lang);
458 switch(s.type())
459 {
461 {
462 m_ci.startCodeFragment("DoxyCode");
463 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
464 Config_getBool(STRIP_CODE_COMMENTS),
465 s.isExample(),s.exampleFile());
466 m_ci.endCodeFragment("DoxyCode");
467 }
468 break;
470 filter(s.text(), true);
471 break;
473 m_t << "{\\ttfamily ";
474 filter(s.text(), true);
475 m_t << "}";
476 break;
478 m_t << "\\begin{DoxyVerb}";
479 m_t << s.text();
480 m_t << "\\end{DoxyVerb}\n";
481 break;
487 /* nothing */
488 break;
490 m_t << s.text();
491 break;
492 case DocVerbatim::Dot:
493 {
494 static int dotindex = 1;
495 QCString fileName(4096, QCString::ExplicitSize);
496
497 fileName.sprintf("%s%d%s",
498 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
499 dotindex++,
500 ".dot"
501 );
502 std::ofstream file = Portable::openOutputStream(fileName);
503 if (!file.is_open())
504 {
505 err("Could not open file {} for writing\n",fileName);
506 }
507 else
508 {
509 file.write( s.text().data(), s.text().length() );
510 file.close();
511
512 startDotFile(fileName,s.width(),s.height(),s.hasCaption(),s.srcFile(),s.srcLine());
513 visitChildren(s);
515
516 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
517 }
518 }
519 break;
520 case DocVerbatim::Msc:
521 {
522 static int mscindex = 1;
523 QCString baseName(4096, QCString::ExplicitSize);
524
525 baseName.sprintf("%s%d",
526 qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
527 mscindex++
528 );
529 QCString fileName = baseName+".msc";
530 std::ofstream file = Portable::openOutputStream(fileName);
531 if (!file.is_open())
532 {
533 err("Could not open file {} for writing\n",fileName);
534 }
535 else
536 {
537 QCString text = "msc {";
538 text+=s.text();
539 text+="}";
540 file.write( text.data(), text.length() );
541 file.close();
542
543 writeMscFile(baseName, s);
544
545 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
546 }
547 }
548 break;
550 {
551 QCString latexOutput = Config_getString(LATEX_OUTPUT);
553 latexOutput,s.exampleFile(),s.text(),
555 s.engine(),s.srcFile(),s.srcLine(),true);
556
557 writePlantUMLFile(baseName, s);
558 }
559 break;
560 }
561}
QCString srcFile() const
Definition docnode.h:393
int srcLine() const
Definition docnode.h:394
QCString height() const
Definition docnode.h:388
bool hasCaption() const
Definition docnode.h:386
QCString language() const
Definition docnode.h:384
bool isExample() const
Definition docnode.h:381
QCString context() const
Definition docnode.h:380
Type type() const
Definition docnode.h:378
QCString text() const
Definition docnode.h:379
QCString exampleFile() const
Definition docnode.h:382
QCString engine() const
Definition docnode.h:389
bool useBitmap() const
Definition docnode.h:390
@ JavaDocLiteral
Definition docnode.h:374
QCString width() const
Definition docnode.h:387
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
QCString 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:28
static PlantumlManager & instance()
Definition plantuml.cpp:157
@ 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:5739

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

1860{
1861}

◆ operator()() [56/58]

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

Definition at line 293 of file latexdocvisitor.cpp.

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

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

◆ operator()() [57/58]

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

Definition at line 279 of file latexdocvisitor.cpp.

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

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

◆ operator()() [58/58]

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

Definition at line 1802 of file latexdocvisitor.cpp.

1803{
1804 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1805 if (m_hide) return;
1806 if (x.title().isEmpty()) return;
1808 m_t << "\\begin{DoxyRefDesc}{";
1809 filter(x.title());
1810 m_t << "}\n";
1811 bool anonymousEnum = x.file()=="@";
1812 m_t << "\\item[";
1813 if (pdfHyperlinks && !anonymousEnum)
1814 {
1815 m_t << "\\mbox{\\hyperlink{" << stripPath(x.file()) << "_" << x.anchor() << "}{";
1816 }
1817 else
1818 {
1819 m_t << "\\textbf{ ";
1820 }
1822 filter(x.title());
1824 if (pdfHyperlinks && !anonymousEnum)
1825 {
1826 m_t << "}";
1827 }
1828 m_t << "}]";
1829 visitChildren(x);
1830 if (x.title().isEmpty()) return;
1832 m_t << "\\end{DoxyRefDesc}\n";
1833}
QCString anchor() const
Definition docnode.h:620
QCString file() const
Definition docnode.h:619
QCString title() const
Definition docnode.h:621

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

2017{
2018 QCString baseName=makeBaseName(fileName);
2019 baseName.prepend("dia_");
2020
2021 QCString outDir = Config_getString(LATEX_OUTPUT);
2022 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::EPS,srcFile,srcLine);
2023 visitPreStart(m_t,hasCaption, baseName, width, height);
2024}
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 1954 of file latexdocvisitor.cpp.

1961{
1962 QCString baseName=makeBaseName(fileName);
1963 baseName.prepend("dot_");
1964 QCString outDir = Config_getString(LATEX_OUTPUT);
1965 QCString name = fileName;
1966 writeDotGraphFromFile(name,outDir,baseName,GraphOutputFormat::EPS,srcFile,srcLine);
1967 visitPreStart(m_t,hasCaption, baseName, width, height);
1968}
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 1882 of file latexdocvisitor.cpp.

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

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

1983{
1984 QCString baseName=makeBaseName(fileName);
1985 baseName.prepend("msc_");
1986
1987 QCString outDir = Config_getString(LATEX_OUTPUT);
1988 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1989 visitPreStart(m_t,hasCaption, baseName, width, height);
1990}
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 2058 of file latexdocvisitor.cpp.

2065{
2066 QCString outDir = Config_getString(LATEX_OUTPUT);
2067 std::string inBuf;
2068 readInputFile(fileName,inBuf);
2069
2070 bool useBitmap = inBuf.find("@startditaa") != std::string::npos;
2071 QCString baseName = PlantumlManager::instance().writePlantUMLSource(
2072 outDir,QCString(),inBuf.c_str(),
2074 QCString(),srcFile,srcLine,false);
2075 baseName=makeBaseName(baseName);
2076 QCString shortName = makeShortName(baseName);
2077 if (useBitmap)
2078 {
2079 if (shortName.find('.')==-1) shortName += ".png";
2080 }
2083 visitPreStart(m_t,hasCaption, shortName, width, height);
2084}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:128
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:6013

References Config_getString, 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 231 of file latexdocvisitor.cpp.

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

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

◆ visitChildren()

◆ writeDiaFile()

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

Definition at line 2033 of file latexdocvisitor.cpp.

2034{
2035 QCString shortName = makeShortName(baseName);
2036 QCString outDir = Config_getString(LATEX_OUTPUT);
2037 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::EPS,s.srcFile(),s.srcLine());
2038 visitPreStart(m_t, s.hasCaption(), shortName, s.width(), s.height());
2041}
const DocNodeList & children() const
Definition docnode.h:391
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().

◆ writeMscFile()

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

Definition at line 1999 of file latexdocvisitor.cpp.

2000{
2001 QCString shortName = makeShortName(baseName);
2002 QCString outDir = Config_getString(LATEX_OUTPUT);
2003 writeMscGraphFromFile(baseName+".msc",outDir,shortName,MscOutputFormat::EPS,s.srcFile(),s.srcLine());
2004 visitPreStart(m_t, s.hasCaption(), shortName, s.width(),s.height());
2007}

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

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