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

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

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

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

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

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

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

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

References m_hide, m_t, and visitPostEnd().

Referenced by operator()().

◆ endPlantUmlFile()

void LatexDocVisitor::endPlantUmlFile ( bool hasCaption)
private

Definition at line 2085 of file latexdocvisitor.cpp.

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

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

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

2097{
2098 m_indentLevel++;
2100 {
2101 err("Maximum indent level (%d) exceeded while generating LaTeX output!\n",maxIndentLevels-1);
2102 }
2103}
static const int maxIndentLevels
#define err(fmt,...)
Definition message.h:84

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

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

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

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

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

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

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

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

736{
737 if (m_hide) return;
738 if (!cite.file().isEmpty())
739 {
740 //startLink(cite.ref(),cite.file(),cite.anchor());
741 QCString anchor = cite.anchor();
742 QCString anchorPrefix = CitationManager::instance().anchorPrefix();
743 anchor = anchor.mid(anchorPrefix.length()); // strip prefix
744 m_t << "\\cite{" << anchor << "}";
745 }
746 else
747 {
748 m_t << "{\\bfseries [";
749 filter(cite.text());
750 m_t << "]}";
751 }
752}
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 1568 of file latexdocvisitor.cpp.

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

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

1551{
1552 if (m_hide) return;
1553 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(LATEX_OUTPUT)+"/"+stripPath(df.file()));
1554 startDotFile(df.file(),df.width(),df.height(),df.hasCaption(),df.srcFile(),df.srcLine());
1555 visitChildren(df);
1556 endDotFile(df.hasCaption());
1557}
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:340
QCString name() const
Definition docnode.h:339
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 702 of file latexdocvisitor.cpp.

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

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

1849{
1850 if (m_hide) return;
1851 m_t << "\\begin{quote}\n";
1853 visitChildren(q);
1854 m_t << "\\end{quote}\n";
1856}

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

◆ operator()() [12/58]

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

Definition at line 1274 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1358 of file latexdocvisitor.cpp.

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

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

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

◆ operator()() [15/58]

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

Definition at line 1146 of file latexdocvisitor.cpp.

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

1171{
1172 if (m_hide) return;
1173 m_t << "\n\\item[";
1175 visitChildren(dt);
1177 m_t << "]";
1178}

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

◆ operator()() [17/58]

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

Definition at line 1501 of file latexdocvisitor.cpp.

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

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

◆ operator()() [18/58]

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

Definition at line 1522 of file latexdocvisitor.cpp.

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

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

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

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

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

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

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

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1226 of file latexdocvisitor.cpp.

1227{
1228 if (m_hide) return;
1230 const DocHtmlCaption *c = t.caption() ? &std::get<DocHtmlCaption>(*t.caption()) : nullptr;
1231 if (c)
1232 {
1233 bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS);
1234 if (!c->file().isEmpty() && pdfHyperLinks)
1235 {
1236 m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
1237 << "}{}";
1238 }
1239 m_t << "\n";
1240 }
1241
1243
1244 if (c)
1245 {
1246 m_t << "\\caption{";
1247 std::visit(*this, *t.caption());
1248 m_t << "}";
1249 m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
1250 m_t << "\\\\\n";
1251 }
1252
1254 m_t << "\\hline\n";
1255
1256 // check if first row is a heading and then render the row already here
1257 // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
1258 // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
1259 const DocHtmlRow *firstRow = std::get_if<DocHtmlRow>(t.firstRow());
1260 if (firstRow && firstRow->isHeading())
1261 {
1263 if (!tableIsNested(t.parent()))
1264 {
1265 std::visit(*this,*t.firstRow());
1266 }
1268 }
1269 visitChildren(t);
1271 popTableState();
1272}
QCString anchor() const
Definition docnode.h:1229
QCString file() const
Definition docnode.h:1228
size_t numColumns() const
Definition docnode.h:1272
const DocNodeVariant * caption() const
Definition docnode.cpp:2029
const DocNodeVariant * firstRow() const
Definition docnode.cpp:2034
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 1530 of file latexdocvisitor.cpp.

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

574{
575 if (m_hide) return;
577 switch(inc.type())
578 {
580 {
581 m_ci.startCodeFragment("DoxyCodeInclude");
582 FileInfo cfi( inc.file().str() );
583 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
585 inc.text(),
586 langExt,
587 inc.stripCodeComments(),
588 inc.isExample(),
589 inc.exampleFile(),
590 fd.get(), // fileDef,
591 -1, // start line
592 -1, // end line
593 FALSE, // inline fragment
594 nullptr, // memberDef
595 TRUE // show line numbers
596 );
597 m_ci.endCodeFragment("DoxyCodeInclude");
598 }
599 break;
601 {
602 m_ci.startCodeFragment("DoxyCodeInclude");
604 inc.text(),langExt,
605 inc.stripCodeComments(),
606 inc.isExample(),
607 inc.exampleFile(),
608 nullptr, // fileDef
609 -1, // startLine
610 -1, // endLine
611 TRUE, // inlineFragment
612 nullptr, // memberDef
613 FALSE
614 );
615 m_ci.endCodeFragment("DoxyCodeInclude");
616 }
617 break;
625 break;
627 m_t << inc.text();
628 break;
630 m_t << "\n\\begin{DoxyVerbInclude}\n";
631 m_t << inc.text();
632 m_t << "\\end{DoxyVerbInclude}\n";
633 break;
636 {
637 m_ci.startCodeFragment("DoxyCodeInclude");
639 inc.file(),
640 inc.blockId(),
641 inc.context(),
643 inc.trimLeft(),
645 );
646 m_ci.endCodeFragment("DoxyCodeInclude");
647 }
648 break;
649 }
650}
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:449
QCString extension() const
Definition docnode.h:445
bool stripCodeComments() const
Definition docnode.h:450
@ LatexInclude
Definition docnode.h:432
@ SnippetWithLines
Definition docnode.h:433
@ DontIncWithLines
Definition docnode.h:434
@ IncWithLines
Definition docnode.h:433
@ HtmlInclude
Definition docnode.h:432
@ VerbInclude
Definition docnode.h:432
@ DontInclude
Definition docnode.h:432
@ DocbookInclude
Definition docnode.h:434
Type type() const
Definition docnode.h:446
QCString exampleFile() const
Definition docnode.h:452
QCString text() const
Definition docnode.h:447
QCString file() const
Definition docnode.h:444
bool trimLeft() const
Definition docnode.h:454
bool isExample() const
Definition docnode.h:451
QCString context() const
Definition docnode.h:448
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:267
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549

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

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

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

722{
723 if (m_hide) return;
724 m_t << "\\index{";
726 m_t << "@{";
728 m_t << "}}";
729}
QCString entry() const
Definition docnode.h:554
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 1473 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1834 of file latexdocvisitor.cpp.

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

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

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

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

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

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

◆ operator()() [35/58]

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

Definition at line 1726 of file latexdocvisitor.cpp.

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

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

1668{
1669 if (m_hide) return;
1670 bool hasInOutSpecs = s.hasInOutSpecifier();
1671 bool hasTypeSpecs = s.hasTypeSpecifier();
1672 m_lcg.incUsedTableLevel();
1673 switch(s.type())
1674 {
1676 m_t << "\n\\begin{DoxyParams}";
1677 if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1678 else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1679 m_t << "{";
1681 break;
1683 m_t << "\n\\begin{DoxyRetVals}{";
1685 break;
1687 m_t << "\n\\begin{DoxyExceptions}{";
1689 break;
1691 m_t << "\n\\begin{DoxyTemplParams}{";
1693 break;
1694 default:
1695 ASSERT(0);
1697 }
1698 m_t << "}\n";
1699 visitChildren(s);
1700 m_lcg.decUsedTableLevel();
1701 switch(s.type())
1702 {
1704 m_t << "\\end{DoxyParams}\n";
1705 break;
1707 m_t << "\\end{DoxyRetVals}\n";
1708 break;
1710 m_t << "\\end{DoxyExceptions}\n";
1711 break;
1713 m_t << "\\end{DoxyTemplParams}\n";
1714 break;
1715 default:
1716 ASSERT(0);
1718 }
1719}
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 1862 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1577 of file latexdocvisitor.cpp.

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

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

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

816{
817 visitChildren(r);
818}

References visitChildren().

◆ operator()() [41/58]

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

Definition at line 1622 of file latexdocvisitor.cpp.

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

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

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

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

◆ operator()() [43/58]

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

Definition at line 996 of file latexdocvisitor.cpp.

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

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

References DocSeparator::chars(), and m_t.

◆ operator()() [45/58]

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

Definition at line 975 of file latexdocvisitor.cpp.

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

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

◆ operator()() [46/58]

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

Definition at line 984 of file latexdocvisitor.cpp.

985{
986 if (m_hide) return;
987 m_t << "\\item ";
989 if (li.paragraph())
990 {
991 visit(*this,*li.paragraph());
992 }
994}
const DocNodeVariant * paragraph() const
Definition docnode.h:1151

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

◆ operator()() [47/58]

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

Definition at line 820 of file latexdocvisitor.cpp.

821{
822 if (m_hide) return;
823 switch(s.type())
824 {
826 m_t << "\\begin{DoxySeeAlso}{";
828 break;
830 m_t << "\\begin{DoxyReturn}{";
832 break;
834 m_t << "\\begin{DoxyAuthor}{";
836 break;
838 m_t << "\\begin{DoxyAuthor}{";
840 break;
842 m_t << "\\begin{DoxyVersion}{";
844 break;
846 m_t << "\\begin{DoxySince}{";
848 break;
850 m_t << "\\begin{DoxyDate}{";
852 break;
854 m_t << "\\begin{DoxyNote}{";
856 break;
858 m_t << "\\begin{DoxyWarning}{";
860 break;
862 m_t << "\\begin{DoxyPrecond}{";
864 break;
866 m_t << "\\begin{DoxyPostcond}{";
868 break;
870 m_t << "\\begin{DoxyCopyright}{";
872 break;
874 m_t << "\\begin{DoxyInvariant}{";
876 break;
878 m_t << "\\begin{DoxyRemark}{";
880 break;
882 m_t << "\\begin{DoxyAttention}{";
884 break;
886 m_t << "\\begin{DoxyImportant}{";
888 break;
890 m_t << "\\begin{DoxyParagraph}{";
891 break;
893 m_t << "\\begin{DoxyParagraph}{";
894 break;
895 case DocSimpleSect::Unknown: break;
896 }
897
898 if (s.title())
899 {
901 std::visit(*this,*s.title());
903 }
904 m_t << "}\n";
906 visitChildren(s);
907 switch(s.type())
908 {
910 m_t << "\n\\end{DoxySeeAlso}\n";
911 break;
913 m_t << "\n\\end{DoxyReturn}\n";
914 break;
916 m_t << "\n\\end{DoxyAuthor}\n";
917 break;
919 m_t << "\n\\end{DoxyAuthor}\n";
920 break;
922 m_t << "\n\\end{DoxyVersion}\n";
923 break;
925 m_t << "\n\\end{DoxySince}\n";
926 break;
928 m_t << "\n\\end{DoxyDate}\n";
929 break;
931 m_t << "\n\\end{DoxyNote}\n";
932 break;
934 m_t << "\n\\end{DoxyWarning}\n";
935 break;
937 m_t << "\n\\end{DoxyPrecond}\n";
938 break;
940 m_t << "\n\\end{DoxyPostcond}\n";
941 break;
943 m_t << "\n\\end{DoxyCopyright}\n";
944 break;
946 m_t << "\n\\end{DoxyInvariant}\n";
947 break;
949 m_t << "\n\\end{DoxyRemark}\n";
950 break;
952 m_t << "\n\\end{DoxyAttention}\n";
953 break;
955 m_t << "\n\\end{DoxyImportant}\n";
956 break;
958 m_t << "\n\\end{DoxyParagraph}\n";
959 break;
961 m_t << "\n\\end{DoxyParagraph}\n";
962 break;
963 default:
964 break;
965 }
967}
Type type() const
Definition docnode.h:1020
const DocNodeVariant * title() const
Definition docnode.h:1027
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 731 of file latexdocvisitor.cpp.

732{
733}

◆ 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;
414 if (s.enable()) m_t << "{\\ttfamily "; else m_t << "}";
415 break;
417 if (s.enable()) m_t << "\\textsubscript{"; else m_t << "}";
418 break;
420 if (s.enable()) m_t << "\\textsuperscript{"; else m_t << "}";
421 break;
423 if (s.enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
424 break;
426 if (s.enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
427 break;
429 if (s.enable()) m_t << "{\\itshape "; else m_t << "}";
430 break;
432 if (s.enable())
433 {
434 m_t << "\n\\begin{DoxyPre}";
436 }
437 else
438 {
440 m_t << "\\end{DoxyPre}\n";
441 }
442 break;
443 case DocStyleChange::Div: /* HTML only */ break;
444 case DocStyleChange::Span: /* HTML only */ break;
445 }
446}
Style style() const
Definition docnode.h:302
bool enable() const
Definition docnode.h:304

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, 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: %s\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
343 }
344}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:327
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 1842 of file latexdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 969 of file latexdocvisitor.cpp.

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

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

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

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

1859{
1860}

◆ 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:353

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

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

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

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

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

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

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

1982{
1983 QCString baseName=makeBaseName(fileName);
1984 baseName.prepend("msc_");
1985
1986 QCString outDir = Config_getString(LATEX_OUTPUT);
1987 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::EPS,srcFile,srcLine);
1988 visitPreStart(m_t,hasCaption, baseName, width, height);
1989}
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:156

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

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

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

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

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

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: