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

Concrete visitor implementation for HTML output. More...

#include <src/htmldocvisitor.h>

+ Inheritance diagram for HtmlDocVisitor:
+ Collaboration diagram for HtmlDocVisitor:

Public Member Functions

 HtmlDocVisitor (TextStream &t, OutputCodeList &ci, const Definition *ctx, const QCString &fn=QCString())
 
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 &)
 
void operator() (const DocHtmlList &)
 
void operator() (const DocHtmlListItem &)
 
void operator() (const DocHtmlDescList &)
 
void operator() (const DocHtmlDescTitle &)
 
void operator() (const DocHtmlDescData &)
 
void operator() (const DocHtmlTable &)
 
void operator() (const DocHtmlRow &)
 
void operator() (const DocHtmlCell &)
 
void operator() (const DocHtmlCaption &)
 
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 &)
 
void operator() (const DocRef &)
 
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 &)
 
template<class Node>
void forceEndParagraph (const Node &n)
 Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the paragraph.
 
template<class Node>
void forceStartParagraph (const Node &n)
 Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the paragraph.
 
- Public Member Functions inherited from DocVisitor
 DocVisitor ()
 
virtual ~DocVisitor ()
 
CodeParserInterfacegetCodeParser (const QCString &langExt)
 
void pushHidden (bool hide)
 
bool popHidden ()
 

Private Member Functions

template<class T>
void visitChildren (const T &t)
 
template<class T>
void visitCaption (TextStream &t, const T &n)
 
void writeObfuscatedMailAddress (const QCString &url)
 
void filter (const QCString &str, const bool retainNewline=false)
 
QCString filterQuotedCdataAttr (const QCString &str)
 Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be using the double quote ".
 
void startLink (const QCString &ref, const QCString &file, const QCString &relPath, const QCString &anchor, const QCString &tooltip="")
 
void endLink ()
 
void writeDotFile (const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
 
void writeMscFile (const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
 
void writeDiaFile (const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
 
void writePlantUMLFile (const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
 
template<class DocNode>
void forceEndParagraph (const DocNode &n)
 
template<class DocNode>
void forceStartParagraph (const DocNode &n)
 

Private Attributes

TextStreamm_t
 
OutputCodeListm_ci
 
bool m_insidePre = false
 
bool m_hide = false
 
bool m_insideTitle = false
 
const Definitionm_ctx
 
QCString m_fileName
 
QCString m_langExt
 

Detailed Description

Concrete visitor implementation for HTML output.

Definition at line 29 of file htmldocvisitor.h.

Constructor & Destructor Documentation

◆ HtmlDocVisitor()

HtmlDocVisitor::HtmlDocVisitor ( TextStream & t,
OutputCodeList & ci,
const Definition * ctx,
const QCString & fn = QCString() )

Definition at line 254 of file htmldocvisitor.cpp.

256 : m_t(t), m_ci(ci), m_ctx(ctx), m_fileName(fn)
257{
258 if (ctx) m_langExt=ctx->getDefFileExtension();
259}
virtual QCString getDefFileExtension() const =0
TextStream & m_t
OutputCodeList & m_ci
const Definition * m_ctx

References Definition::getDefFileExtension(), m_ci, m_ctx, m_fileName, m_langExt, and m_t.

Member Function Documentation

◆ endLink()

void HtmlDocVisitor::endLink ( )
private

Definition at line 2201 of file htmldocvisitor.cpp.

2202{
2203 m_t << "</a>";
2204}

References m_t.

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

◆ filter()

void HtmlDocVisitor::filter ( const QCString & str,
const bool retainNewline = false )
private

Definition at line 2091 of file htmldocvisitor.cpp.

2092{
2093 if (str.isEmpty()) return;
2094 const char *p=str.data();
2095 while (*p)
2096 {
2097 char c=*p++;
2098 switch(c)
2099 {
2100 case '\n': if(retainNewline) m_t << "<br/>"; m_t << c; break;
2101 case '<': m_t << "&lt;"; break;
2102 case '>': m_t << "&gt;"; break;
2103 case '&': m_t << "&amp;"; break;
2104 case '\\': if ((*p == '(') || (*p == ')'))
2105 m_t << "\\&zwj;" << *p++;
2106 else
2107 m_t << c;
2108 break;
2109 default:
2110 {
2111 uint8_t uc = static_cast<uint8_t>(c);
2112 if (uc<32 && !isspace(c)) // non-printable control characters
2113 {
2114 m_t << "&#x24" << hex[uc>>4] << hex[uc&0xF] << ";";
2115 }
2116 else
2117 {
2118 m_t << c;
2119 }
2120 }
2121 break;
2122 }
2123 }
2124}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
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
static constexpr auto hex

References QCString::data(), hex, QCString::isEmpty(), and m_t.

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

◆ filterQuotedCdataAttr()

QCString HtmlDocVisitor::filterQuotedCdataAttr ( const QCString & str)
private

Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be using the double quote ".

Definition at line 2128 of file htmldocvisitor.cpp.

2129{
2130 GrowBuf growBuf;
2131 if (str.isEmpty()) return str;
2132 const char *p=str.data();
2133 while (*p)
2134 {
2135 char c=*p++;
2136 switch(c)
2137 {
2138 case '&': growBuf.addStr("&amp;"); break;
2139 case '"': growBuf.addStr("&quot;"); break;
2140 case '<': growBuf.addStr("&lt;"); break;
2141 case '>': growBuf.addStr("&gt;"); break;
2142 case '\\':
2143 if ((*p == '(') || (*p == ')'))
2144 {
2145 growBuf.addStr("\\&zwj;");
2146 growBuf.addChar(*p++);
2147 }
2148 else
2149 {
2150 growBuf.addChar(c);
2151 }
2152 break;
2153 default:
2154 {
2155 uint8_t uc = static_cast<uint8_t>(c);
2156 if (uc<32 && !isspace(c)) // non-printable control characters
2157 {
2158 growBuf.addStr("&#x24");
2159 growBuf.addChar(hex[uc>>4]);
2160 growBuf.addChar(hex[uc&0xF]);
2161 growBuf.addStr(";");
2162 }
2163 else
2164 {
2165 growBuf.addChar(c);
2166 }
2167 }
2168 break;
2169 }
2170 }
2171 growBuf.addChar(0);
2172 return growBuf.get();
2173}
void addChar(char c)
Definition growbuf.h:69
void addStr(const QCString &s)
Definition growbuf.h:72
char * get()
Definition growbuf.h:114

References GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), GrowBuf::get(), hex, and QCString::isEmpty().

Referenced by operator()().

◆ forceEndParagraph() [1/2]

◆ forceEndParagraph() [2/2]

template<class Node>
void HtmlDocVisitor::forceEndParagraph ( const Node & n)

Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the paragraph.

This method will forcefully end the current paragraph and forceStartParagraph() will restart it.

Definition at line 2311 of file htmldocvisitor.cpp.

2312{
2313 const DocPara *para=std::get_if<DocPara>(n.parent());
2314 if (para)
2315 {
2316 const DocNodeList &children = para->children();
2317
2318 //printf("forceEndParagraph\n");
2319 //dumpDocNodeList(children);
2320
2321 auto it = std::find_if(std::begin(children),std::end(children),
2322 [&n](const auto &np) { return holds_value(&n,np); });
2323 if (it==std::end(children)) return;
2324 if (it==std::begin(children)) return; // first node in paragraph
2325 it = std::prev(it);
2326 bool found=false;
2327 while (!found)
2328 {
2329 found = !isInvisibleNode(*it);
2330 if (found) break;
2331 if (it!=std::begin(children))
2332 {
2333 --it;
2334 }
2335 else
2336 {
2337 break;
2338 }
2339 }
2340 if (!found) return; // first visible node in paragraph
2341 const DocNodeVariant &v = *it;
2342 if (mustBeOutsideParagraph(v)) return; // previous node already outside paragraph context
2343 bool styleOutsideParagraph=false;
2344 if (it!=std::begin(children))
2345 {
2346 it = std::prev(it);
2347 styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,it);
2348 }
2349 bool isFirst = false;
2350 bool isLast = false;
2351 getParagraphContext(*para,isFirst,isLast);
2352 //printf("forceEnd first=%d last=%d styleOutsideParagraph=%d\n",isFirst,isLast,styleOutsideParagraph);
2353 if (isFirst && isLast) return;
2354 if (styleOutsideParagraph) return;
2355
2356 //printf("adding </p>\n");
2357 m_t << "</p>";
2358 }
2359}
DocNodeList & children()
Definition docnode.h:142
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
static bool isInvisibleNode(const DocNodeVariant &node)
static contexts_t getParagraphContext(const DocPara &p, bool &isFirst, bool &isLast)
static bool mustBeOutsideParagraph(const DocNodeVariant &n)
static bool insideStyleChangeThatIsOutsideParagraph(const DocPara *para, DocNodeList::const_iterator it)
Returns TRUE if the child nodes in paragraph para until nodeIndex contain a style change node that is...
static bool holds_value(const Node *val, const DocNodeVariant &v)
bool found
Definition util.cpp:984

References DocCompoundNode::children(), found, getParagraphContext(), holds_value(), insideStyleChangeThatIsOutsideParagraph(), isInvisibleNode(), m_t, and mustBeOutsideParagraph().

◆ forceStartParagraph() [1/2]

◆ forceStartParagraph() [2/2]

template<class Node>
void HtmlDocVisitor::forceStartParagraph ( const Node & n)

Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the paragraph.

This method will forcefully start the paragraph, that was previously ended by forceEndParagraph().

Definition at line 2366 of file htmldocvisitor.cpp.

2367{
2368 //printf("> forceStartParagraph(%s)\n",docNodeName(n));
2369 const DocPara *para=nullptr;
2370 if (n.parent() && (para = std::get_if<DocPara>(n.parent()))) // if we are inside a paragraph
2371 {
2372 const DocNodeList &children = para->children();
2373
2374 auto it = std::find_if(std::begin(children),
2375 std::end(children),
2376 [&n](const auto &np)
2377 { return holds_value(&n,np); });
2378 if (it==std::end(children)) return;
2379 bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,it);
2380 //printf("it=%s (%p) styleOutsideParagraph=%d\n",
2381 // docNodeName(*it), (void *)&*it, styleOutsideParagraph);
2382 if (styleOutsideParagraph) return;
2383 it = std::next(it);
2384 while (it!=std::end(children) && isInvisibleNode(*it))
2385 {
2386 ++it;
2387 }
2388 if (it!=std::end(children))
2389 {
2390 const DocNodeVariant &v = *it;
2391 if (mustBeOutsideParagraph(v)) return; // next element also outside paragraph
2392 }
2393 else
2394 {
2395 return; // only whitespace at the end!
2396 }
2397
2398 bool needsTag = true;
2399 bool isFirst = false;
2400 bool isLast = false;
2401 getParagraphContext(*para,isFirst,isLast);
2402 if (isFirst && isLast) needsTag = false;
2403 //printf("forceStart first=%d last=%d needsTag=%d\n",isFirst,isLast,needsTag);
2404
2405 if (needsTag) m_t << "<p>";
2406 }
2407}

References DocCompoundNode::children(), getParagraphContext(), holds_value(), insideStyleChangeThatIsOutsideParagraph(), isInvisibleNode(), m_t, and mustBeOutsideParagraph().

◆ operator()() [1/58]

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

Definition at line 691 of file htmldocvisitor.cpp.

692{
693 if (m_hide) return;
694 m_t << "<a class=\"anchor\" id=\"" << anc.anchor() << "\"" << anc.attribs().toString() << "></a>";
695}
const HtmlAttribList & attribs() const
Definition docnode.h:234
QCString anchor() const
Definition docnode.h:231
QCString toString(QCString *pAltValue=nullptr) const
Definition htmlattrib.h:49

References DocAnchor::anchor(), DocAnchor::attribs(), m_hide, m_t, and HtmlAttribList::toString().

◆ operator()() [2/58]

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

Definition at line 1009 of file htmldocvisitor.cpp.

1010{
1011 //printf("DocAutoList::visitPre\n");
1012 if (m_hide) return;
1014 if (l.isEnumList())
1015 {
1016 //
1017 // Do list type based on depth:
1018 // 1.
1019 // a.
1020 // i.
1021 // A.
1022 // 1. (repeat)...
1023 //
1024 m_t << "<ol type=\"" << g_types[l.depth() % NUM_HTML_LIST_TYPES] << "\">";
1025 }
1026 else
1027 {
1028 if (l.isCheckedList())
1029 {
1030 m_t << "<ul class=\"check\">";
1031 }
1032 else
1033 {
1034 m_t << "<ul>";
1035 }
1036 }
1037 if (!l.isPreformatted()) m_t << "\n";
1038 visitChildren(l);
1039 if (l.isEnumList())
1040 {
1041 m_t << "</ol>";
1042 }
1043 else
1044 {
1045 m_t << "</ul>";
1046 }
1047 if (!l.isPreformatted()) m_t << "\n";
1049}
bool isCheckedList() const
Definition docnode.h:577
bool isEnumList() const
Definition docnode.h:575
int depth() const
Definition docnode.h:578
bool isPreformatted() const
Definition docnode.h:104
void forceStartParagraph(const DocNode &n)
void visitChildren(const T &t)
void forceEndParagraph(const DocNode &n)
static const char g_types[][NUM_HTML_LIST_TYPES]
static const int NUM_HTML_LIST_TYPES

References DocAutoList::depth(), forceEndParagraph(), forceStartParagraph(), g_types, DocAutoList::isCheckedList(), DocAutoList::isEnumList(), DocNode::isPreformatted(), m_hide, m_t, NUM_HTML_LIST_TYPES, and visitChildren().

◆ operator()() [3/58]

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

Definition at line 1051 of file htmldocvisitor.cpp.

1052{
1053 if (m_hide) return;
1054 switch (li.itemNumber())
1055 {
1056 case DocAutoList::Unchecked: // unchecked
1057 m_t << "<li class=\"unchecked\">";
1058 break;
1059 case DocAutoList::Checked_x: // checked with x
1060 case DocAutoList::Checked_X: // checked with X
1061 m_t << "<li class=\"checked\">";
1062 break;
1063 default:
1064 m_t << "<li>";
1065 break;
1066 }
1067 visitChildren(li);
1068 m_t << "</li>";
1069 if (!li.isPreformatted()) m_t << "\n";
1070}
int itemNumber() const
Definition docnode.h:593

References DocAutoList::Checked_X, DocAutoList::Checked_x, DocNode::isPreformatted(), DocAutoListItem::itemNumber(), m_hide, m_t, DocAutoList::Unchecked, and visitChildren().

◆ operator()() [4/58]

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

Definition at line 981 of file htmldocvisitor.cpp.

982{
983 if (m_hide) return;
984 if (!cite.file().isEmpty())
985 {
986 startLink(cite.ref(),cite.file(),cite.relPath(),cite.anchor());
987 }
988 else
989 {
990 m_t << "<b>[";
991 }
992 filter(cite.text());
993 if (!cite.file().isEmpty())
994 {
995 endLink();
996 }
997 else
998 {
999 m_t << "]</b>";
1000 }
1001}
QCString text() const
Definition docnode.h:251
QCString relPath() const
Definition docnode.h:248
QCString anchor() const
Definition docnode.h:250
QCString ref() const
Definition docnode.h:249
QCString file() const
Definition docnode.h:247
void startLink(const QCString &ref, const QCString &file, const QCString &relPath, const QCString &anchor, const QCString &tooltip="")
void filter(const QCString &str, const bool retainNewline=false)

References DocCite::anchor(), endLink(), DocCite::file(), filter(), QCString::isEmpty(), m_hide, m_t, DocCite::ref(), DocCite::relPath(), startLink(), and DocCite::text().

◆ operator()() [5/58]

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

Definition at line 1805 of file htmldocvisitor.cpp.

1806{
1807 if (m_hide) return;
1808 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1810 m_t << "<div class=\"diagraph\">\n";
1811 writeDiaFile(df.file(),df.relPath(),df.context(),df.srcFile(),df.srcLine());
1812 if (df.hasCaption())
1813 {
1814 m_t << "<div class=\"caption\">\n";
1815 }
1816 visitChildren(df);
1817 if (df.hasCaption())
1818 {
1819 m_t << "</div>\n";
1820 }
1821 m_t << "</div>\n";
1823}
QCString relPath() const
Definition docnode.h:680
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 context() const
Definition docnode.h:684
void writeDiaFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
QCString stripPath(const QCString &s)
Definition util.cpp:5448
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:6326

References Config_getBool, Config_getString, DocDiagramFileBase::context(), copyFile(), DocDiagramFileBase::file(), forceEndParagraph(), forceStartParagraph(), DocDiagramFileBase::hasCaption(), m_hide, m_t, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), and writeDiaFile().

◆ operator()() [6/58]

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

Definition at line 1765 of file htmldocvisitor.cpp.

1766{
1767 if (m_hide) return;
1768 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1770 m_t << "<div class=\"dotgraph\">\n";
1771 writeDotFile(df.file(),df.relPath(),df.context(),df.srcFile(),df.srcLine());
1772 if (df.hasCaption())
1773 {
1774 m_t << "<div class=\"caption\">\n";
1775 }
1776 visitChildren(df);
1777 if (df.hasCaption())
1778 {
1779 m_t << "</div>\n";
1780 }
1781 m_t << "</div>\n";
1783}
void writeDotFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)

References Config_getBool, Config_getString, DocDiagramFileBase::context(), copyFile(), DocDiagramFileBase::file(), forceEndParagraph(), forceStartParagraph(), DocDiagramFileBase::hasCaption(), m_hide, m_t, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), and writeDotFile().

◆ operator()() [7/58]

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

Definition at line 330 of file htmldocvisitor.cpp.

331{
332 if (m_hide) return;
333 const char *res = EmojiEntityMapper::instance().unicode(s.index());
334 if (res)
335 {
336 m_t << "<span class=\"emoji\">" << res << "</span>";
337 }
338 else
339 {
340 m_t << s.name();
341 }
342}
int index() const
Definition docnode.h:340
QCString name() const
Definition docnode.h:339
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:2016
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978

References DocEmoji::index(), EmojiEntityMapper::instance(), m_hide, m_t, DocEmoji::name(), and EmojiEntityMapper::unicode().

◆ operator()() [8/58]

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

Definition at line 846 of file htmldocvisitor.cpp.

847{
848 if (m_hide) return;
849 bool bDisplay = !f.isInline();
850 if (bDisplay)
851 {
853 m_t << "<p class=\"formulaDsp\">\n";
854 }
855
856 if (Config_getBool(USE_MATHJAX))
857 {
858 QCString text = f.text();
859 bool closeInline = FALSE;
860 if (!bDisplay && !text.isEmpty() && text.at(0)=='$' &&
861 text.at(text.length()-1)=='$')
862 {
863 closeInline=TRUE;
864 text = text.mid(1,text.length()-2);
865 m_t << "\\(";
866 }
867 else if (!bDisplay && !text.isEmpty())
868 {
869 closeInline=TRUE;
870 m_t << "\\(";
871 }
872 m_t << convertToHtml(text);
873 if (closeInline)
874 {
875 m_t << "\\)";
876 }
877 }
878 else
879 {
880 const Formula *formula = FormulaManager::instance().findFormula(f.id());
881
882 enum class ImageType { Light, Dark };
883 enum class Visibility { Always, Dark, Light, AutoDark, AutoLight };
884 auto writeFormula = [&](ImageType imgType,Visibility visibility) -> QCString {
885 // see https://chipcullen.com/how-to-have-dark-mode-image-that-works-with-user-choice for the design idea
886 TextStream t;
887 QCString extension = Config_getEnum(HTML_FORMULA_FORMAT)==HTML_FORMULA_FORMAT_t::svg ? ".svg":".png" ;
888 if (visibility==Visibility::AutoDark || visibility==Visibility::AutoLight)
889 {
890 t << "<picture>";
891 t << "<source srcset=\"" << f.relPath() << f.name();
892 if (visibility==Visibility::AutoDark)
893 {
894 t << extension;
895 t << "\" media=\"(prefers-color-scheme: light)\"";
896 }
897 else // AutoLight
898 {
899 t << "_dark";
900 t << extension;
901 t << "\" media=\"(prefers-color-scheme: dark)\"";
902 }
903 t << "/>";
904 }
905 t << "<img class=\"formula";
906 t << (bDisplay ? "Dsp" : "Inl");
907 if (visibility==Visibility::Light) t << " light-mode-visible";
908 else if (visibility==Visibility::Dark) t << " dark-mode-visible";
909 t << "\" alt=\"" << filterQuotedCdataAttr(f.text()) << "\"" << " src=\"" << f.relPath() << f.name();
910 if (imgType==ImageType::Dark) t << "_dark";
911 t << extension;
912 if (formula && formula->width()!=-1)
913 {
914 t << "\" width=\"";
915 t << formula->width();
916 }
917 if (formula && formula->height()!=-1)
918 {
919 t << "\" height=\"";
920 t << formula->height();
921 }
922 t << "\"/>";
923 if (visibility==Visibility::AutoDark || visibility==Visibility::AutoLight)
924 {
925 t << "</picture>";
926 }
927 return QCString(t.str());
928 };
929
930 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
931 switch(colorStyle)
932 {
933 case HTML_COLORSTYLE_t::LIGHT:
934 m_t << writeFormula(ImageType::Light,Visibility::Always);
935 break;
936 case HTML_COLORSTYLE_t::DARK:
937 m_t << writeFormula(ImageType::Dark, Visibility::Always);
938 break;
939 case HTML_COLORSTYLE_t::AUTO_LIGHT:
940 m_t << writeFormula(ImageType::Light, Visibility::AutoLight);
941 break;
942 case HTML_COLORSTYLE_t::AUTO_DARK:
943 m_t << writeFormula(ImageType::Dark, Visibility::AutoDark);
944 break;
945 case HTML_COLORSTYLE_t::TOGGLE:
946 // write the image twice and use javascript (darkmode_toggle.js) to show only one of them
947 m_t << writeFormula(ImageType::Light,Visibility::Light);
948 m_t << writeFormula(ImageType::Dark, Visibility::Dark);
949 break;
950 }
951 }
952 if (bDisplay)
953 {
954 m_t << "\n</p>\n";
956 }
957}
QCString text() const
Definition docnode.h:528
QCString name() const
Definition docnode.h:527
bool isInline() const
Definition docnode.h:531
int id() const
Definition docnode.h:530
QCString relPath() const
Definition docnode.h:529
int width() const
Definition formula.h:34
int height() const
Definition formula.h:35
const Formula * findFormula(int formulaId) const
Definition formula.cpp:705
static FormulaManager & instance()
Definition formula.cpp:54
QCString filterQuotedCdataAttr(const QCString &str)
Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be...
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
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:229
#define Config_getEnum(name)
Definition config.h:35
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4463

References QCString::at(), Config_getBool, Config_getEnum, convertToHtml(), FALSE, filterQuotedCdataAttr(), FormulaManager::findFormula(), forceEndParagraph(), forceStartParagraph(), Formula::height(), DocFormula::id(), FormulaManager::instance(), QCString::isEmpty(), DocFormula::isInline(), QCString::length(), m_hide, m_t, QCString::mid(), DocFormula::name(), DocFormula::relPath(), TextStream::str(), DocFormula::text(), TRUE, and Formula::width().

◆ operator()() [9/58]

void HtmlDocVisitor::operator() ( const DocHorRuler & hr)

Definition at line 417 of file htmldocvisitor.cpp.

418{
419 if (m_hide) return;
421 m_t << "<hr "<< hr.attribs().toString() << " />\n";
423}
const HtmlAttribList & attribs() const
Definition docnode.h:220

References DocHorRuler::attribs(), forceEndParagraph(), forceStartParagraph(), m_hide, m_t, and HtmlAttribList::toString().

◆ operator()() [10/58]

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

Definition at line 1606 of file htmldocvisitor.cpp.

1607{
1608 if (m_hide) return;
1609 if (href.url().startsWith("mailto:"))
1610 {
1612 }
1613 else
1614 {
1615 QCString url = correctURL(href.url(),href.relPath());
1616 m_t << "<a href=\"" << convertToHtml(url) << "\""
1617 << href.attribs().toString() << ">";
1618 }
1619 visitChildren(href);
1620 m_t << "</a>";
1621}
QCString url() const
Definition docnode.h:824
QCString relPath() const
Definition docnode.h:826
const HtmlAttribList & attribs() const
Definition docnode.h:827
void writeObfuscatedMailAddress(const QCString &url)
bool startsWith(const char *s) const
Definition qcstring.h:492
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:6414

References DocHRef::attribs(), convertToHtml(), correctURL(), m_hide, m_t, QCString::mid(), DocHRef::relPath(), QCString::startsWith(), HtmlAttribList::toString(), DocHRef::url(), visitChildren(), and writeObfuscatedMailAddress().

◆ operator()() [11/58]

void HtmlDocVisitor::operator() ( const DocHtmlBlockQuote & b)

Definition at line 2047 of file htmldocvisitor.cpp.

2048{
2049 if (m_hide) return;
2051 m_t << "<blockquote class=\"doxtable\"" << b.attribs().toString() << ">\n";
2052 visitChildren(b);
2053 m_t << "</blockquote>\n";
2055}
const HtmlAttribList & attribs() const
Definition docnode.h:1290

References DocHtmlBlockQuote::attribs(), forceEndParagraph(), forceStartParagraph(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [12/58]

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

Definition at line 1592 of file htmldocvisitor.cpp.

1593{
1594 if (m_hide) return;
1595 m_t << "<caption" << c.attribs().toString() << ">";
1596 visitChildren(c);
1597 m_t << "</caption>\n";
1598}
const HtmlAttribList & attribs() const
Definition docnode.h:1225

References DocHtmlCaption::attribs(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1577 of file htmldocvisitor.cpp.

1578{
1579 if (m_hide) return;
1580 if (c.isHeading())
1581 {
1582 m_t << "<th" << c.attribs().toString() << ">";
1583 }
1584 else
1585 {
1586 m_t << "<td" << c.attribs().toString() << ">";
1587 }
1588 visitChildren(c);
1589 if (c.isHeading()) m_t << "</th>"; else m_t << "</td>";
1590}
bool isHeading() const
Definition docnode.h:1194
const HtmlAttribList & attribs() const
Definition docnode.h:1199

References DocHtmlCell::attribs(), DocHtmlCell::isHeading(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [14/58]

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

Definition at line 1528 of file htmldocvisitor.cpp.

1529{
1530 if (m_hide) return;
1531 m_t << "<dd" << dd.attribs().toString() << ">";
1532 visitChildren(dd);
1533 m_t << "</dd>\n";
1534}
const HtmlAttribList & attribs() const
Definition docnode.h:1178

References DocHtmlDescData::attribs(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [15/58]

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

Definition at line 1510 of file htmldocvisitor.cpp.

1511{
1512 if (m_hide) return;
1514 m_t << "<dl" << dl.attribs().toString() << ">\n";
1515 visitChildren(dl);
1516 m_t << "</dl>\n";
1518}
const HtmlAttribList & attribs() const
Definition docnode.h:899

References DocHtmlDescList::attribs(), forceEndParagraph(), forceStartParagraph(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [16/58]

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

Definition at line 1520 of file htmldocvisitor.cpp.

1521{
1522 if (m_hide) return;
1523 m_t << "<dt" << dt.attribs().toString() << ">";
1524 visitChildren(dt);
1525 m_t << "</dt>\n";
1526}
const HtmlAttribList & attribs() const
Definition docnode.h:886

References DocHtmlDescTitle::attribs(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [17/58]

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

Definition at line 1631 of file htmldocvisitor.cpp.

1632{
1633 if (m_hide) return;
1635 m_t << "<details " << d.attribs().toString() << ">\n";
1636 auto summary = d.summary();
1637 if (summary)
1638 {
1639 std::visit(*this,*summary);
1640 }
1641 visitChildren(d);
1642 m_t << "</details>\n";
1644}
const HtmlAttribList & attribs() const
Definition docnode.h:855
const DocNodeVariant * summary() const
Definition docnode.h:858

References DocHtmlDetails::attribs(), forceEndParagraph(), forceStartParagraph(), m_hide, m_t, DocHtmlDetails::summary(), HtmlAttribList::toString(), and visitChildren().

◆ operator()() [18/58]

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

Definition at line 1646 of file htmldocvisitor.cpp.

1647{
1648 if (m_hide) return;
1649 forceEndParagraph(header);
1650 m_t << "<h" << header.level() << header.attribs().toString() << ">";
1651 visitChildren(header);
1652 m_t << "</h" << header.level() << ">\n";
1653 forceStartParagraph(header);
1654}
const HtmlAttribList & attribs() const
Definition docnode.h:872
int level() const
Definition docnode.h:871

References DocHtmlHeader::attribs(), forceEndParagraph(), forceStartParagraph(), DocHtmlHeader::level(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [19/58]

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

Definition at line 1475 of file htmldocvisitor.cpp.

1476{
1477 if (m_hide) return;
1479 if (s.type()==DocHtmlList::Ordered)
1480 {
1481 m_t << "<ol" << s.attribs().toString();
1482 }
1483 else
1484 {
1485 m_t << "<ul" << s.attribs().toString();
1486 }
1487 m_t << ">\n";
1488 visitChildren(s);
1489 if (s.type()==DocHtmlList::Ordered)
1490 {
1491 m_t << "</ol>";
1492 }
1493 else
1494 {
1495 m_t << "</ul>";
1496 }
1497 if (!s.isPreformatted()) m_t << "\n";
1499}
const HtmlAttribList & attribs() const
Definition docnode.h:1000
Type type() const
Definition docnode.h:999

References DocHtmlList::attribs(), forceEndParagraph(), forceStartParagraph(), DocNode::isPreformatted(), m_hide, m_t, DocHtmlList::Ordered, HtmlAttribList::toString(), DocHtmlList::type(), and visitChildren().

◆ operator()() [20/58]

void HtmlDocVisitor::operator() ( const DocHtmlListItem & i)

Definition at line 1501 of file htmldocvisitor.cpp.

1502{
1503 if (m_hide) return;
1504 m_t << "<li" << i.attribs().toString() << ">";
1505 if (!i.isPreformatted()) m_t << "\n";
1506 visitChildren(i);
1507 m_t << "</li>\n";
1508}
const HtmlAttribList & attribs() const
Definition docnode.h:1164

References DocHtmlListItem::attribs(), DocNode::isPreformatted(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [21/58]

void HtmlDocVisitor::operator() ( const DocHtmlRow & tr)

Definition at line 1569 of file htmldocvisitor.cpp.

1570{
1571 if (m_hide) return;
1572 m_t << "<tr" << tr.attribs().toString() << ">\n";
1573 visitChildren(tr);
1574 m_t << "</tr>\n";
1575}
const HtmlAttribList & attribs() const
Definition docnode.h:1246

References DocHtmlRow::attribs(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [22/58]

void HtmlDocVisitor::operator() ( const DocHtmlSummary & s)

Definition at line 1623 of file htmldocvisitor.cpp.

1624{
1625 if (m_hide) return;
1626 m_t << "<summary " << s.attribs().toString() << ">\n";
1627 visitChildren(s);
1628 m_t << "</summary>\n";
1629}
const HtmlAttribList & attribs() const
Definition docnode.h:842

References DocHtmlSummary::attribs(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1536 of file htmldocvisitor.cpp.

1537{
1538 if (m_hide) return;
1539
1541
1542 if (t.caption())
1543 {
1544 QCString anc = std::get<DocHtmlCaption>(*t.caption()).anchor();
1545 if (!anc.isEmpty())
1546 {
1547 m_t << "<a class=\"anchor\" id=\"" << anc << "\"></a>\n";
1548 }
1549 }
1550
1551 QCString attrs = t.attribs().toString();
1552 if (attrs.isEmpty())
1553 {
1554 m_t << "<table class=\"doxtable\">\n";
1555 }
1556 else
1557 {
1558 m_t << "<table" << t.attribs().toString() << ">\n";
1559 }
1560 if (t.caption())
1561 {
1562 std::visit(*this,*t.caption());
1563 }
1564 visitChildren(t);
1565 m_t << "</table>\n";
1567}
const DocNodeVariant * caption() const
Definition docnode.cpp:2038
const HtmlAttribList & attribs() const
Definition docnode.h:1269

References DocHtmlTable::attribs(), DocHtmlTable::caption(), forceEndParagraph(), forceStartParagraph(), QCString::isEmpty(), m_hide, m_t, HtmlAttribList::toString(), and visitChildren().

◆ operator()() [24/58]

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

Definition at line 1656 of file htmldocvisitor.cpp.

1657{
1658 if (img.type()==DocImage::Html)
1659 {
1660 bool inlineImage = img.isInlineImage();
1661 bool typeSVG = img.isSVG();
1662 QCString url = img.url();
1663
1664 if (!inlineImage)
1665 {
1666 forceEndParagraph(img);
1667 }
1668 if (m_hide) return;
1669 QCString baseName=makeShortName(img.name());
1670 if (!inlineImage) m_t << "<div class=\"image\">\n";
1671 QCString sizeAttribs;
1672 if (!img.width().isEmpty())
1673 {
1674 sizeAttribs+=" width=\""+img.width()+"\"";
1675 }
1676 if (!img.height().isEmpty()) // link to local file
1677 {
1678 sizeAttribs+=" height=\""+img.height()+"\"";
1679 }
1680 // 16 cases: url.isEmpty() | typeSVG | inlineImage | img.hasCaption()
1681
1682 HtmlAttribList attribs = img.attribs();
1683 if (typeSVG)
1684 {
1685 attribs.mergeAttribute("style","pointer-events: none;");
1686 }
1687 QCString alt;
1688 QCString attrs = attribs.toString(&alt);
1689 QCString src;
1690 if (url.isEmpty())
1691 {
1692 src = img.relPath()+img.name();
1693 }
1694 else
1695 {
1696 src = correctURL(url,img.relPath());
1697 }
1698 if (typeSVG && !inlineImage)
1699 {
1700 m_t << "<object type=\"image/svg+xml\" data=\"" << convertToHtml(src)
1701 << "\"" << sizeAttribs << attrs;
1702 if (inlineImage)
1703 {
1704 // skip closing tag
1705 }
1706 else
1707 {
1708 m_t << ">" << alt << "</object>\n";
1709 }
1710 }
1711 else
1712 {
1713 m_t << "<img src=\"" << convertToHtml(src) << "\" alt=\"" << alt << "\"" << sizeAttribs << attrs;
1714 if (inlineImage)
1715 {
1716 m_t << " class=\"inline\"";
1717 }
1718 else
1719 {
1720 m_t << "/>\n";
1721 }
1722 }
1723 if (img.hasCaption())
1724 {
1725 if (inlineImage)
1726 {
1727 m_t << " title=\"";
1728 m_insideTitle=true;
1729 }
1730 else
1731 {
1732 m_t << "<div class=\"caption\">\n";
1733 }
1734 }
1735 else if (inlineImage)
1736 {
1737 m_t << "/>";
1738 }
1739
1740 visitChildren(img);
1741
1742 if (img.hasCaption())
1743 {
1744 if (inlineImage)
1745 {
1746 m_t << "\"/>";
1747 m_insideTitle=false;
1748 }
1749 else // end <div class="caption">
1750 {
1751 m_t << "</div>";
1752 }
1753 }
1754 if (!inlineImage) // end <div class="image">
1755 {
1756 m_t << "</div>\n";
1758 }
1759 }
1760 else // other format -> skip
1761 {
1762 }
1763}
const HtmlAttribList & attribs() const
Definition docnode.h:650
QCString relPath() const
Definition docnode.h:646
QCString name() const
Definition docnode.h:642
QCString url() const
Definition docnode.h:647
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 isSVG() const
Definition docnode.cpp:1257
bool hasCaption() const
Definition docnode.h:643
void mergeAttribute(const QCString &optName, const QCString &optValue)
Definition htmlattrib.h:35
static QCString makeShortName(const QCString &baseName)

References DocImage::attribs(), convertToHtml(), correctURL(), forceEndParagraph(), forceStartParagraph(), DocImage::hasCaption(), DocImage::height(), DocImage::Html, QCString::isEmpty(), DocImage::isInlineImage(), DocImage::isSVG(), m_hide, m_insideTitle, m_t, makeShortName(), HtmlAttribList::mergeAttribute(), DocImage::name(), DocImage::relPath(), HtmlAttribList::toString(), DocImage::type(), DocImage::url(), visitChildren(), and DocImage::width().

◆ operator()() [25/58]

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

Definition at line 697 of file htmldocvisitor.cpp.

698{
699 if (m_hide) return;
701 switch(inc.type())
702 {
705 m_ci.startCodeFragment("DoxyCode");
707 inc.context(),
708 inc.text(),
709 langExt,
710 inc.stripCodeComments(),
711 inc.isExample(),
712 inc.exampleFile(),
713 nullptr, // fileDef
714 -1, // startLine
715 -1, // endLine
716 TRUE, // inlineFragment
717 nullptr, // memberDef
718 FALSE, // show line numbers
719 m_ctx // search context
720 );
721 m_ci.endCodeFragment("DoxyCode");
723 break;
725 {
727 m_ci.startCodeFragment("DoxyCode");
728 FileInfo cfi( inc.file().str() );
729 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
731 inc.context(),
732 inc.text(),
733 langExt,
734 inc.stripCodeComments(),
735 inc.isExample(),
736 inc.exampleFile(),
737 fd.get(), // fileDef,
738 -1, // start line
739 -1, // end line
740 true, // inline fragment
741 nullptr, // memberDef
742 true, // show line numbers
743 m_ctx // search context
744 );
745 m_ci.endCodeFragment("DoxyCode");
747 }
748 break;
756 break;
758 {
759 if (inc.isBlock()) forceEndParagraph(inc);
760 m_t << inc.text();
761 if (inc.isBlock()) forceStartParagraph(inc);
762 }
763 break;
766 m_t << "<pre class=\"fragment\">";
767 filter(inc.text());
768 m_t << "</pre>";
770 break;
774 m_ci.startCodeFragment("DoxyCode");
776 inc.file(),
777 inc.blockId(),
778 inc.context(),
780 inc.trimLeft(),
782 );
783 m_ci.endCodeFragment("DoxyCode");
785 break;
786 }
787}
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 isBlock() const
Definition docnode.h:453
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:5705

References DocInclude::blockId(), DocInclude::context(), createFileDef(), FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile(), DocInclude::extension(), FALSE, DocInclude::file(), FileInfo::fileName(), filter(), forceEndParagraph(), forceStartParagraph(), DocVisitor::getCodeParser(), getLanguageFromFileName(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance(), DocInclude::isBlock(), DocInclude::isExample(), DocInclude::LatexInclude, m_ci, m_ctx, 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 HtmlDocVisitor::operator() ( const DocIncOperator & op)

Definition at line 789 of file htmldocvisitor.cpp.

790{
791 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
792 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
793 if (op.isFirst())
794 {
796 if (!m_hide) m_ci.startCodeFragment("DoxyCode");
798 m_hide=TRUE;
799 }
800 QCString locLangExt = getFileNameExtension(op.includeFileName());
801 if (locLangExt.isEmpty()) locLangExt = m_langExt;
802 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
803 if (op.type()!=DocIncOperator::Skip)
804 {
805 m_hide = popHidden();
806 if (!m_hide)
807 {
808 std::unique_ptr<FileDef> fd;
809 if (!op.includeFileName().isEmpty())
810 {
811 FileInfo cfi( op.includeFileName().str() );
812 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
813 }
814 getCodeParser(locLangExt).parseCode(
815 m_ci,
816 op.context(),
817 op.text(),
818 langExt,
820 op.isExample(),
821 op.exampleFile(),
822 fd.get(), // fileDef
823 op.line(), // startLine
824 -1, // endLine
825 true, // inline fragment
826 nullptr, // memberDef
827 op.showLineNo(), // show line numbers
828 m_ctx // search context
829 );
830 }
832 m_hide=TRUE;
833 }
834 if (op.isLast())
835 {
836 m_hide = popHidden();
837 if (!m_hide) m_ci.endCodeFragment("DoxyCode");
839 }
840 else
841 {
842 if (!m_hide) m_t << "\n";
843 }
844}
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:5747

References DocIncOperator::context(), createFileDef(), FileInfo::dirPath(), DocIncOperator::exampleFile(), FileInfo::fileName(), forceEndParagraph(), forceStartParagraph(), DocVisitor::getCodeParser(), getFileNameExtension(), getLanguageFromFileName(), DocIncOperator::includeFileName(), QCString::isEmpty(), DocIncOperator::isExample(), DocIncOperator::isFirst(), DocIncOperator::isLast(), DocIncOperator::line(), m_ci, m_ctx, 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 HtmlDocVisitor::operator() ( const DocIndexEntry & e)

Definition at line 959 of file htmldocvisitor.cpp.

960{
961 QCString anchor = convertIndexWordToAnchor(e.entry());
962 if (e.member())
963 {
964 anchor.prepend(e.member()->anchor()+"_");
965 }
966 m_t << "<a id=\"" << anchor << "\" name=\"" << anchor << "\"></a>";
967 //printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n",
968 // qPrint(e.entry()),
969 // e.scope() ? qPrint(e.scope()->name()) : "<null>",
970 // e.member() ? qPrint(e.member()->name()) : "<null>"
971 // );
972 Doxygen::indexList->addIndexItem(e.scope(),e.member(),anchor,e.entry());
973}
virtual QCString anchor() const =0
QCString entry() const
Definition docnode.h:554
const Definition * scope() const
Definition docnode.h:552
const MemberDef * member() const
Definition docnode.h:553
static IndexList * indexList
Definition doxygen.h:134
void addIndexItem(const Definition *context, const MemberDef *md, const QCString &sectionAnchor=QCString(), const QCString &title=QCString())
Definition indexlist.h:120
QCString & prepend(const char *s)
Definition qcstring.h:407
static QCString convertIndexWordToAnchor(const QCString &word)

References Definition::anchor(), convertIndexWordToAnchor(), DocIndexEntry::entry(), Doxygen::indexList, m_t, DocIndexEntry::member(), QCString::prepend(), and DocIndexEntry::scope().

◆ operator()() [28/58]

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

Definition at line 1600 of file htmldocvisitor.cpp.

1601{
1602 if (m_hide) return;
1603 visitChildren(i);
1604}

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 2033 of file htmldocvisitor.cpp.

2034{
2035 if (m_hide) return;
2036 startLink(QCString(),ref.file(),ref.relPath(),ref.anchor());
2037 visitChildren(ref);
2038 endLink();
2039 m_t << " ";
2040}
QCString file() const
Definition docnode.h:805
QCString relPath() const
Definition docnode.h:806
QCString anchor() const
Definition docnode.h:807

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

◆ operator()() [30/58]

void HtmlDocVisitor::operator() ( const DocLineBreak & br)

Definition at line 411 of file htmldocvisitor.cpp.

412{
413 if (m_hide) return;
414 m_t << "<br "<< br.attribs().toString() << " />\n";
415}
const HtmlAttribList & attribs() const
Definition docnode.h:207

References DocLineBreak::attribs(), m_hide, m_t, and HtmlAttribList::toString().

◆ operator()() [31/58]

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

Definition at line 1858 of file htmldocvisitor.cpp.

1859{
1860 if (m_hide) return;
1861 startLink(lnk.ref(),lnk.file(),lnk.relPath(),lnk.anchor());
1862 visitChildren(lnk);
1863 endLink();
1864}

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

◆ operator()() [32/58]

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

Definition at line 285 of file htmldocvisitor.cpp.

286{
287 if (m_hide) return;
288 //printf("linked word: %s\n",qPrint(w.word()));
289 startLink(w.ref(),w.file(),w.relPath(),w.anchor(),w.tooltip());
290 filter(w.word());
291 endLink();
292}
QCString file() const
Definition docnode.h:170
QCString relPath() const
Definition docnode.h:171
QCString ref() const
Definition docnode.h:172
QCString word() const
Definition docnode.h:169
QCString anchor() const
Definition docnode.h:173
QCString tooltip() const
Definition docnode.h:174

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

◆ operator()() [33/58]

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

Definition at line 1785 of file htmldocvisitor.cpp.

1786{
1787 if (m_hide) return;
1788 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1790 m_t << "<div class=\"mscgraph\">\n";
1791 writeMscFile(df.file(),df.relPath(),df.context(),df.srcFile(),df.srcLine());
1792 if (df.hasCaption())
1793 {
1794 m_t << "<div class=\"caption\">\n";
1795 }
1796 visitChildren(df);
1797 if (df.hasCaption())
1798 {
1799 m_t << "</div>\n";
1800 }
1801 m_t << "</div>\n";
1803}
void writeMscFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)

References Config_getBool, Config_getString, DocDiagramFileBase::context(), copyFile(), DocDiagramFileBase::file(), forceEndParagraph(), forceStartParagraph(), DocDiagramFileBase::hasCaption(), m_hide, m_t, DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), and writeMscFile().

◆ operator()() [34/58]

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

Definition at line 1279 of file htmldocvisitor.cpp.

1280{
1281 if (m_hide) return;
1282
1283 //printf("> DocPara\n");
1284 //dumpDocNodeList(p.children());
1285
1286 bool needsTag = determineIfNeedsTag(p);
1287 //printf(" needsTag=%d\n",needsTag);
1288 bool needsTagBefore = needsTag;
1289 bool needsTagAfter = needsTag;
1290
1291 // if the first element of a paragraph is something that should be outside of
1292 // the paragraph (<ul>,<dl>,<table>,..) then that will already started the
1293 // paragraph and we don't need to do it here
1294 if (!p.children().empty())
1295 {
1296 auto it = std::find_if(std::begin(p.children()),std::end(p.children()),
1297 [](const auto &node) { return !isInvisibleNode(node); });
1298 if (it!=std::end(p.children()))
1299 {
1300 const DocNodeVariant &n = *it;
1302 {
1303 needsTagBefore = FALSE;
1304 }
1305 }
1306 }
1307
1308 // check if this paragraph is the first or last or intermediate child of a <li> or <dd>.
1309 // this allows us to mark the tag with a special class so we can
1310 // fix the otherwise ugly spacing.
1311 bool isFirst = false;
1312 bool isLast = false;
1313 contexts_t t = getParagraphContext(p,isFirst,isLast);
1314 //printf("startPara first=%d last=%d\n",isFirst,isLast);
1315 if (isFirst && isLast) needsTagBefore=FALSE;
1316
1317 //printf(" needsTagBefore=%d\n",needsTagBefore);
1318 // write the paragraph tag (if needed)
1319 if (needsTagBefore)
1320 {
1321 if (contexts(t))
1322 m_t << "<p class=\"" << contexts(t) << "\"" << p.attribs().toString() << ">";
1323 else
1324 m_t << "<p" << p.attribs().toString() << ">";
1325 }
1326
1327 visitChildren(p);
1328
1329 // if the last element of a paragraph is something that should be outside of
1330 // the paragraph (<ul>,<dl>,<table>) then that will already have ended the
1331 // paragraph and we don't need to do it here
1332 if (!p.children().empty())
1333 {
1334 auto it = std::prev(std::end(p.children()));
1335 for (;;)
1336 {
1337 const DocNodeVariant &n = *it;
1338 if (!isInvisibleNode(n))
1339 {
1341 {
1342 needsTagAfter = FALSE;
1343 }
1344 // stop searching if we found a node that is visible
1345 break;
1346 }
1347 if (it==std::begin(p.children()))
1348 {
1349 // stop searching if we are at the beginning of the list
1350 break;
1351 }
1352 else
1353 {
1354 --it;
1355 }
1356 }
1357 }
1358
1359 //printf("endPara first=%d last=%d\n",isFirst,isLast);
1360 if (isFirst && isLast) needsTagAfter=FALSE;
1361
1362 //printf(" needsTagAfter=%d\n",needsTagAfter);
1363 if (needsTagAfter) m_t << "</p>\n";
1364 //printf("< DocPara\n");
1365}
const HtmlAttribList & attribs() const
Definition docnode.h:1108
bool empty() const
checks whether the container is empty
Definition growvector.h:140
static bool determineIfNeedsTag(const DocPara &p)
static constexpr const char * contexts(contexts_t type)
contexts_t

References DocPara::attribs(), DocCompoundNode::children(), contexts(), determineIfNeedsTag(), GrowVector< T >::empty(), FALSE, getParagraphContext(), isInvisibleNode(), m_hide, m_t, mustBeOutsideParagraph(), HtmlAttribList::toString(), and visitChildren().

◆ operator()() [35/58]

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

Definition at line 1953 of file htmldocvisitor.cpp.

1954{
1955 //printf("DocParamList::visitPre\n");
1956 if (m_hide) return;
1957 m_t << " <tr>";
1958 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1959 if (sect && sect->hasInOutSpecifier())
1960 {
1961 m_t << "<td class=\"paramdir\">";
1963 {
1964 m_t << "[";
1965 if (pl.direction()==DocParamSect::In)
1966 {
1967 m_t << "in";
1968 }
1969 else if (pl.direction()==DocParamSect::Out)
1970 {
1971 m_t << "out";
1972 }
1973 else if (pl.direction()==DocParamSect::InOut)
1974 {
1975 m_t << "in,out";
1976 }
1977 m_t << "]";
1978 }
1979 m_t << "</td>";
1980 }
1981 if (sect && sect->hasTypeSpecifier())
1982 {
1983 m_t << "<td class=\"paramtype\">";
1984 for (const auto &type : pl.paramTypes())
1985 {
1986 std::visit(*this,type);
1987 }
1988 m_t << "</td>";
1989 }
1990 m_t << "<td class=\"paramname\">";
1991 bool first=TRUE;
1992 for (const auto &param : pl.parameters())
1993 {
1994 if (!first) m_t << ","; else first=FALSE;
1995 std::visit(*this,param);
1996 }
1997 m_t << "</td><td>";
1998 for (const auto &par : pl.paragraphs())
1999 {
2000 std::visit(*this,par);
2001 }
2002 m_t << "</td></tr>\n";
2003}
DocNodeVariant * parent()
Definition docnode.h:89
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

References DocParamList::direction(), FALSE, DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), DocParamSect::In, DocParamSect::InOut, m_hide, m_t, DocParamSect::Out, DocParamList::paragraphs(), DocParamList::parameters(), DocParamList::paramTypes(), DocNode::parent(), TRUE, and DocParamSect::Unspecified.

◆ operator()() [36/58]

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

Definition at line 1909 of file htmldocvisitor.cpp.

1910{
1911 if (m_hide) return;
1913 QCString className;
1914 QCString heading;
1915 switch(s.type())
1916 {
1918 heading=theTranslator->trParameters();
1919 className="params";
1920 break;
1922 heading=theTranslator->trReturnValues();
1923 className="retval";
1924 break;
1926 heading=theTranslator->trExceptions();
1927 className="exception";
1928 break;
1931 className="tparams";
1932 break;
1933 default:
1934 ASSERT(0);
1935 }
1936 m_t << "<dl class=\"" << className << "\"><dt>";
1937 m_t << heading;
1938 m_t << "</dt><dd>\n";
1939 m_t << " <table class=\"" << className << "\">\n";
1940 visitChildren(s);
1941 m_t << " </table>\n";
1942 m_t << " </dd>\n";
1943 m_t << "</dl>\n";
1945}
Type type() const
Definition docnode.h:1062
virtual QCString trExceptions()=0
virtual QCString trParameters()=0
virtual QCString trTemplateParameters()=0
virtual QCString trReturnValues()=0
Translator * theTranslator
Definition language.cpp:71
#define ASSERT(x)
Definition qcstring.h:39

References ASSERT, DocParamSect::Exception, forceEndParagraph(), forceStartParagraph(), m_hide, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, DocParamSect::type(), and visitChildren().

◆ operator()() [37/58]

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

Definition at line 2085 of file htmldocvisitor.cpp.

2086{
2087 if (m_hide) return;
2088 visitChildren(pb);
2089}

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1825 of file htmldocvisitor.cpp.

1826{
1827 if (m_hide) return;
1828 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1830 QCString htmlOutput = Config_getString(HTML_OUTPUT);
1831 QCString imgExt = getDotImageExtension();
1832 PlantumlManager::OutputFormat format = PlantumlManager::PUML_BITMAP; // default : PUML_BITMAP
1833 if (imgExt=="svg")
1834 {
1836 }
1837 std::string inBuf;
1838 readInputFile(df.file(),inBuf);
1839 QCString baseName = PlantumlManager::instance().writePlantUMLSource(
1840 htmlOutput,QCString(),
1841 inBuf.c_str(),format,QCString(),df.srcFile(),df.srcLine(),false);
1842 baseName=makeBaseName(baseName);
1843 m_t << "<div class=\"plantumlgraph\">\n";
1844 writePlantUMLFile(baseName,df.relPath(),QCString(),df.srcFile(),df.srcLine());
1845 if (df.hasCaption())
1846 {
1847 m_t << "<div class=\"caption\">\n";
1848 }
1849 visitChildren(df);
1850 if (df.hasCaption())
1851 {
1852 m_t << "</div>\n";
1853 }
1854 m_t << "</div>\n";
1856}
void writePlantUMLFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
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
OutputFormat
Plant UML output image formats.
Definition plantuml.h:44
static PlantumlManager & instance()
Definition plantuml.cpp:157
static QCString makeBaseName(const QCString &name)
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:5997
QCString getDotImageExtension()
Definition util.cpp:6776

References Config_getBool, Config_getString, copyFile(), DocDiagramFileBase::file(), forceEndParagraph(), forceStartParagraph(), getDotImageExtension(), DocDiagramFileBase::hasCaption(), PlantumlManager::instance(), m_hide, m_t, makeBaseName(), PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_SVG, readInputFile(), DocDiagramFileBase::relPath(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), writePlantUMLFile(), and PlantumlManager::writePlantUMLSource().

◆ operator()() [39/58]

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

Definition at line 1866 of file htmldocvisitor.cpp.

1867{
1868 if (m_hide) return;
1869 if (!ref.file().isEmpty())
1870 {
1871 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1872 // ref.anchor() for LaTeX/RTF
1873 startLink(ref.ref(),ref.file(),ref.relPath(),ref.isSubPage() ? QCString() : ref.anchor());
1874 }
1875 if (!ref.hasLinkText()) filter(ref.targetTitle());
1876 visitChildren(ref);
1877 if (!ref.file().isEmpty()) endLink();
1878 //m_t << " ";
1879}
QCString anchor() const
Definition docnode.h:779
QCString relPath() const
Definition docnode.h:777
QCString targetTitle() const
Definition docnode.h:780
bool isSubPage() const
Definition docnode.h:786
QCString file() const
Definition docnode.h:776
QCString ref() const
Definition docnode.h:778
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::relPath(), startLink(), DocRef::targetTitle(), and visitChildren().

◆ operator()() [40/58]

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

Definition at line 1367 of file htmldocvisitor.cpp.

1368{
1369 //printf("> DocRoot\n");
1370 //dumpDocNodeList(r.children());
1371 visitChildren(r);
1372 //printf("< DocRoot\n");
1373}

References visitChildren().

◆ operator()() [41/58]

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

Definition at line 1881 of file htmldocvisitor.cpp.

1882{
1883 if (m_hide) return;
1884 if (!ref.file().isEmpty())
1885 {
1886 m_t << "<li>";
1887 startLink(ref.ref(),ref.file(),ref.relPath(),ref.isSubPage() ? QCString() : ref.anchor());
1888 }
1889 visitChildren(ref);
1890 if (!ref.file().isEmpty())
1891 {
1892 endLink();
1893 m_t << "</li>\n";
1894 }
1895}
QCString relPath() const
Definition docnode.h:935
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::relPath(), startLink(), and visitChildren().

◆ operator()() [42/58]

void HtmlDocVisitor::operator() ( const DocSecRefList & s)

Definition at line 1897 of file htmldocvisitor.cpp.

1898{
1899 if (m_hide) return;
1901 m_t << "<div>\n";
1902 m_t << "<ul class=\"multicol\">\n";
1903 visitChildren(s);
1904 m_t << "</ul>\n";
1905 m_t << "</div>\n";
1907}

References forceEndParagraph(), forceStartParagraph(), m_hide, m_t, and visitChildren().

◆ operator()() [43/58]

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

Definition at line 1459 of file htmldocvisitor.cpp.

1460{
1461 if (m_hide) return;
1463 m_t << "<h" << s.level() << ">";
1464 m_t << "<a class=\"anchor\" id=\"" << s.anchor();
1465 m_t << "\"></a>\n";
1466 if (s.title())
1467 {
1468 std::visit(*this,*s.title());
1469 }
1470 m_t << "</h" << s.level() << ">\n";
1471 visitChildren(s);
1473}
int level() const
Definition docnode.h:912
QCString anchor() const
Definition docnode.h:914
const DocNodeVariant * title() const
Definition docnode.h:913

References DocSection::anchor(), forceEndParagraph(), forceStartParagraph(), DocSection::level(), m_hide, m_t, DocSection::title(), and visitChildren().

◆ operator()() [44/58]

void HtmlDocVisitor::operator() ( const DocSeparator & s)

Definition at line 1947 of file htmldocvisitor.cpp.

1948{
1949 if (m_hide) return;
1950 m_t << "&#160;" << s.chars() << "&#160;";
1951}
QCString chars() const
Definition docnode.h:364

References DocSeparator::chars(), m_hide, and m_t.

◆ operator()() [45/58]

void HtmlDocVisitor::operator() ( const DocSimpleList & sl)

Definition at line 1435 of file htmldocvisitor.cpp.

1436{
1437 if (m_hide) return;
1439 m_t << "<ul>";
1440 if (!sl.isPreformatted()) m_t << "\n";
1441 visitChildren(sl);
1442 m_t << "</ul>";
1443 if (!sl.isPreformatted()) m_t << "\n";
1445}

References forceEndParagraph(), forceStartParagraph(), DocNode::isPreformatted(), m_hide, m_t, and visitChildren().

◆ operator()() [46/58]

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

Definition at line 1447 of file htmldocvisitor.cpp.

1448{
1449 if (m_hide) return;
1450 m_t << "<li>";
1451 if (li.paragraph())
1452 {
1453 visit(*this,*li.paragraph());
1454 }
1455 m_t << "</li>";
1456 if (!li.isPreformatted()) m_t << "\n";
1457}
const DocNodeVariant * paragraph() const
Definition docnode.h:1151

References DocNode::isPreformatted(), m_hide, m_t, and DocSimpleListItem::paragraph().

◆ operator()() [47/58]

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

Definition at line 1375 of file htmldocvisitor.cpp.

1376{
1377 if (m_hide) return;
1379 m_t << "<dl class=\"section " << s.typeString() << "\"><dt>";
1380 switch(s.type())
1381 {
1382 case DocSimpleSect::See:
1383 m_t << theTranslator->trSeeAlso(); break;
1385 m_t << theTranslator->trReturns(); break;
1387 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
1389 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
1391 m_t << theTranslator->trVersion(); break;
1393 m_t << theTranslator->trSince(); break;
1395 m_t << theTranslator->trDate(); break;
1397 m_t << theTranslator->trNote(); break;
1399 m_t << theTranslator->trWarning(); break;
1400 case DocSimpleSect::Pre:
1401 m_t << theTranslator->trPrecondition(); break;
1403 m_t << theTranslator->trPostcondition(); break;
1405 m_t << theTranslator->trCopyright(); break;
1407 m_t << theTranslator->trInvariant(); break;
1409 m_t << theTranslator->trRemarks(); break;
1411 m_t << theTranslator->trAttention(); break;
1413 m_t << theTranslator->trImportant(); break;
1414 case DocSimpleSect::User: break;
1415 case DocSimpleSect::Rcs: break;
1416 case DocSimpleSect::Unknown: break;
1417 }
1418
1419 if (s.title())
1420 {
1421 std::visit(*this,*s.title());
1422 }
1423 m_t << "</dt><dd>";
1424 visitChildren(s);
1425 m_t << "</dd></dl>\n";
1427}
QCString typeString() const
Definition docnode.cpp:3017
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, FALSE, forceEndParagraph(), forceStartParagraph(), DocSimpleSect::Important, DocSimpleSect::Invar, m_hide, 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::typeString(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [48/58]

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

Definition at line 975 of file htmldocvisitor.cpp.

976{
977 m_t << "</dd>\n";
978 m_t << "<dd>\n";
979}

References m_t.

◆ operator()() [49/58]

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

Definition at line 425 of file htmldocvisitor.cpp.

426{
427 if (m_hide) return;
428 switch (s.style())
429 {
431 if (s.enable()) m_t << "<b" << s.attribs().toString() << ">"; else m_t << "</b>";
432 break;
434 if (s.enable()) m_t << "<s" << s.attribs().toString() << ">"; else m_t << "</s>";
435 break;
437 if (s.enable()) m_t << "<strike" << s.attribs().toString() << ">"; else m_t << "</strike>";
438 break;
440 if (s.enable()) m_t << "<del" << s.attribs().toString() << ">"; else m_t << "</del>";
441 break;
443 if (s.enable()) m_t << "<u" << s.attribs().toString() << ">"; else m_t << "</u>";
444 break;
446 if (s.enable()) m_t << "<ins" << s.attribs().toString() << ">"; else m_t << "</ins>";
447 break;
449 if (s.enable())
450 {
451 auto attribs = s.attribs();
452 if (s.tagName()=="a")
453 {
454 attribs.mergeAttribute("class","arg");
455 }
456 m_t << "<em" << attribs.toString() << ">";
457 }
458 else
459 {
460 m_t << "</em>";
461 }
462 break;
464 if (s.enable()) m_t << "<kbd" << s.attribs().toString() << ">"; else m_t << "</kbd>";
465 break;
467 if (s.enable())
468 {
469 auto attribs = s.attribs();
470 if (s.tagName()=="p")
471 {
472 attribs.mergeAttribute("class","param");
473 }
474 m_t << "<code" << attribs.toString() << ">";
475 }
476 else
477 {
478 m_t << "</code>";
479 }
480 break;
482 if (s.enable()) m_t << "<sub" << s.attribs().toString() << ">"; else m_t << "</sub>";
483 break;
485 if (s.enable()) m_t << "<sup" << s.attribs().toString() << ">"; else m_t << "</sup>";
486 break;
488 if (s.enable())
489 {
491 m_t << "<center" << s.attribs().toString() << ">";
492 }
493 else
494 {
495 m_t << "</center>";
497 }
498 break;
500 if (s.enable()) m_t << "<small" << s.attribs().toString() << ">"; else m_t << "</small>";
501 break;
503 if (s.enable()) m_t << "<cite" << s.attribs().toString() << ">"; else m_t << "</cite>";
504 break;
506 if (s.enable())
507 {
509 m_t << "<pre" << s.attribs().toString() << ">";
511 }
512 else
513 {
515 m_t << "</pre>";
517 }
518 break;
520 if (s.enable())
521 {
523 m_t << "<div" << s.attribs().toString() << ">";
524 }
525 else
526 {
527 m_t << "</div>";
529 }
530 break;
532 if (s.enable()) m_t << "<span" << s.attribs().toString() << ">"; else m_t << "</span>";
533 break;
534 }
535}
const HtmlAttribList & attribs() const
Definition docnode.h:306
QCString tagName() const
Definition docnode.h:307
Style style() const
Definition docnode.h:302
bool enable() const
Definition docnode.h:304

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

◆ operator()() [50/58]

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

Definition at line 307 of file htmldocvisitor.cpp.

308{
309 if (m_hide) return;
310 if (m_insideTitle &&
311 (s.symbol()==HtmlEntityMapper::Sym_Quot || s.symbol()==HtmlEntityMapper::Sym_quot)) // escape "'s inside title="..."
312 {
313 m_t << "&quot;";
314 }
315 else
316 {
317 const char *res = HtmlEntityMapper::instance().html(s.symbol());
318 if (res)
319 {
320 m_t << res;
321 }
322 else
323 {
324 err("HTML: non supported HTML-entity found: {}\n",
326 }
327 }
328}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:327
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * html(SymType symb, bool useInPrintf=FALSE) const
Access routine to the html code of the HTML entity.
#define err(fmt,...)
Definition message.h:127

References err, HtmlEntityMapper::html(), HtmlEntityMapper::instance(), m_hide, m_insideTitle, m_t, HtmlEntityMapper::Sym_Quot, HtmlEntityMapper::Sym_quot, DocSymbol::symbol(), and TRUE.

◆ operator()() [51/58]

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

Definition at line 2042 of file htmldocvisitor.cpp.

2043{
2044 visitChildren(t);
2045}

References visitChildren().

◆ operator()() [52/58]

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

Definition at line 1429 of file htmldocvisitor.cpp.

1430{
1431 if (m_hide) return;
1432 visitChildren(t);
1433}

References m_hide, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 372 of file htmldocvisitor.cpp.

373{
374 if (m_hide) return;
375 if (u.isEmail()) // mail address
376 {
377 QCString url = u.url();
378 // obfuscate the mail address link
380 if (!Config_getBool(OBFUSCATE_EMAILS))
381 {
382 m_t << url;
383 }
384 else
385 {
386 const char *p = url.data();
387 // also obfuscate the address as shown on the web page
388 uint32_t size=5;
389 while (*p)
390 {
391 for (uint32_t j=0;j<size && *p;j++)
392 {
393 p = writeUTF8Char(m_t,p);
394 }
395 if (*p) m_t << "<span class=\"obfuscator\">.nosp@m.</span>";
396 if (size==5) size=4; else size=5;
397 }
398 }
399 m_t << "</a>";
400 }
401 else // web address
402 {
403 m_t << "<a href=\"";
404 filter(u.url());
405 m_t << "\">";
406 filter(u.url());
407 m_t << "</a>";
408 }
409}
QCString url() const
Definition docnode.h:191
bool isEmail() const
Definition docnode.h:192
const char * writeUTF8Char(TextStream &t, const char *s)
Writes the UTF8 character pointed to by s to stream t and returns a pointer to the next character.
Definition utf8.cpp:197

References Config_getBool, QCString::data(), filter(), DocURL::isEmail(), m_hide, m_t, DocURL::url(), writeObfuscatedMailAddress(), and writeUTF8Char().

◆ operator()() [54/58]

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

Definition at line 539 of file htmldocvisitor.cpp.

540{
541 if (m_hide) return;
542 QCString lang = m_langExt;
543 if (!s.language().isEmpty()) // explicit language setting
544 {
545 lang = s.language();
546 }
547 SrcLangExt langExt = getLanguageFromCodeLang(lang);
548 switch(s.type())
549 {
552 m_ci.startCodeFragment("DoxyCode");
554 s.context(),
555 s.text(),
556 langExt,
557 Config_getBool(STRIP_CODE_COMMENTS),
558 s.isExample(),
559 s.exampleFile(),
560 nullptr, // fileDef
561 -1, // startLine
562 -1, // endLine
563 true, // inlineFragment
564 nullptr, // memberDef
565 true, // show line numbers
566 m_ctx // search context
567 );
568 m_ci.endCodeFragment("DoxyCode");
570 break;
573 m_t << "<pre class=\"fragment\">";
574 filter(s.text());
575 m_t << "</pre>";
577 break;
579 filter(s.text(), true);
580 break;
582 m_t << "<code class=\"JavaDocCode\">";
583 filter(s.text(), true);
584 m_t << "</code>";
585 break;
587 {
588 if (s.isBlock()) forceEndParagraph(s);
589 m_t << s.text();
590 if (s.isBlock()) forceStartParagraph(s);
591 }
592 break;
598 /* nothing */
599 break;
600
601 case DocVerbatim::Dot:
602 {
603 static int dotindex = 1;
604 QCString fileName(4096, QCString::ExplicitSize);
605
607 fileName.sprintf("%s%d%s",
608 qPrint(Config_getString(HTML_OUTPUT)+"/inline_dotgraph_"),
609 dotindex++,
610 ".dot"
611 );
612 std::ofstream file = Portable::openOutputStream(fileName);
613 if (!file.is_open())
614 {
615 err("Could not open file {} for writing\n",fileName);
616 }
617 else
618 {
619 QCString stext = s.text();
620 file.write( stext.data(), stext.length() );
621 file.close();
622
623 m_t << "<div class=\"dotgraph\">\n";
624 writeDotFile(fileName,s.relPath(),s.context(),s.srcFile(),s.srcLine());
625 visitCaption(m_t, s);
626 m_t << "</div>\n";
627
628 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
629 }
631 }
632 break;
633 case DocVerbatim::Msc:
634 {
636
637 static int mscindex = 1;
638 QCString baseName(4096, QCString::ExplicitSize);
639
640 baseName.sprintf("%s%d",
641 qPrint(Config_getString(HTML_OUTPUT)+"/inline_mscgraph_"),
642 mscindex++
643 );
644 std::ofstream file = Portable::openOutputStream(baseName.str()+".msc");
645 if (!file.is_open())
646 {
647 err("Could not open file {}.msc for writing\n",baseName);
648 }
649 else
650 {
651 QCString text = "msc {";
652 text+=s.text();
653 text+="}";
654
655 file.write( text.data(), text.length() );
656 file.close();
657
658 m_t << "<div class=\"mscgraph\">\n";
659 writeMscFile(baseName+".msc",s.relPath(),s.context(),s.srcFile(),s.srcLine());
660 visitCaption(m_t, s);
661 m_t << "</div>\n";
662
663 if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str()+".msc");
664 }
666 }
667 break;
669 {
671 QCString htmlOutput = Config_getString(HTML_OUTPUT);
672 QCString imgExt = getDotImageExtension();
673 PlantumlManager::OutputFormat format = PlantumlManager::PUML_BITMAP; // default : PUML_BITMAP
674 if (imgExt=="svg")
675 {
677 }
679 htmlOutput,s.exampleFile(),
680 s.text(),format,s.engine(),s.srcFile(),s.srcLine(),true);
681 m_t << "<div class=\"plantumlgraph\">\n";
682 writePlantUMLFile(baseName,s.relPath(),s.context(),s.srcFile(),s.srcLine());
683 visitCaption(m_t, s);
684 m_t << "</div>\n";
686 }
687 break;
688 }
689}
QCString srcFile() const
Definition docnode.h:392
int srcLine() const
Definition docnode.h:393
QCString language() const
Definition docnode.h:383
bool isBlock() const
Definition docnode.h:384
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
QCString relPath() const
Definition docnode.h:382
@ JavaDocLiteral
Definition docnode.h:373
void visitCaption(TextStream &t, const T &n)
@ 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:5723

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), QCString::data(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::engine(), err, DocVerbatim::exampleFile(), QCString::ExplicitSize, filter(), forceEndParagraph(), forceStartParagraph(), DocVisitor::getCodeParser(), getDotImageExtension(), getLanguageFromCodeLang(), DocVerbatim::HtmlOnly, PlantumlManager::instance(), DocVerbatim::isBlock(), QCString::isEmpty(), DocVerbatim::isExample(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language(), DocVerbatim::LatexOnly, QCString::length(), m_ci, m_ctx, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, Portable::openOutputStream(), CodeParserInterface::parseCode(), DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, PlantumlManager::PUML_SVG, qPrint(), DocVerbatim::relPath(), Dir::remove(), DocVerbatim::RtfOnly, QCString::sprintf(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), QCString::str(), DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::Verbatim, visitCaption(), writeDotFile(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [55/58]

void HtmlDocVisitor::operator() ( const DocVhdlFlow & vf)

Definition at line 2057 of file htmldocvisitor.cpp.

2058{
2059 if (m_hide) return;
2060 if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
2061 {
2063 QCString fname=FlowChart::convertNameToFileName();
2064 m_t << "<p>";
2066 m_t << " ";
2067 m_t << "<a href=\"";
2068 m_t << fname;
2069 m_t << ".svg\">";
2071 m_t << "</a>";
2072 if (vf.hasCaption())
2073 {
2074 m_t << "<br />";
2075 }
2076 }
2077 visitChildren(vf);
2078 if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
2079 {
2080 m_t << "</p>";
2082 }
2083}
virtual const QCString & name() const =0
bool hasCaption() const
Definition docnode.h:747
static QCString convertNameToFileName()
virtual QCString trFlowchart()=0
static const MemberDef * getFlowMember()

References FlowChart::convertNameToFileName(), forceEndParagraph(), forceStartParagraph(), VhdlDocGen::getFlowMember(), DocVhdlFlow::hasCaption(), m_hide, m_t, Definition::name(), theTranslator, and visitChildren().

◆ operator()() [56/58]

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

Definition at line 294 of file htmldocvisitor.cpp.

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

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

◆ operator()() [57/58]

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

Definition at line 279 of file htmldocvisitor.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 HtmlDocVisitor::operator() ( const DocXRefItem & x)

Definition at line 2005 of file htmldocvisitor.cpp.

2006{
2007 if (m_hide) return;
2008 if (x.title().isEmpty()) return;
2009
2011 bool anonymousEnum = x.file()=="@";
2012 if (!anonymousEnum)
2013 {
2014 QCString fn = x.file();
2016 m_t << "<dl class=\"" << x.key() << "\"><dt><b><a class=\"el\" href=\""
2017 << x.relPath() << fn
2018 << "#" << x.anchor() << "\">";
2019 }
2020 else
2021 {
2022 m_t << "<dl class=\"" << x.key() << "\"><dt><b>";
2023 }
2024 filter(x.title());
2025 if (!anonymousEnum) m_t << "</a>";
2026 m_t << "</b></dt><dd>";
2027 visitChildren(x);
2028 if (x.title().isEmpty()) return;
2029 m_t << "</dd></dl>\n";
2031}
QCString anchor() const
Definition docnode.h:619
QCString key() const
Definition docnode.h:622
QCString relPath() const
Definition docnode.h:621
QCString file() const
Definition docnode.h:618
QCString title() const
Definition docnode.h:620
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5399

References addHtmlExtensionIfMissing(), DocXRefItem::anchor(), DocXRefItem::file(), filter(), forceEndParagraph(), forceStartParagraph(), QCString::isEmpty(), DocXRefItem::key(), m_hide, m_t, DocXRefItem::relPath(), DocXRefItem::title(), and visitChildren().

◆ startLink()

void HtmlDocVisitor::startLink ( const QCString & ref,
const QCString & file,
const QCString & relPath,
const QCString & anchor,
const QCString & tooltip = "" )
private

Definition at line 2175 of file htmldocvisitor.cpp.

2178{
2179 //printf("HtmlDocVisitor: file=%s anchor=%s\n",qPrint(file),qPrint(anchor));
2180 if (!ref.isEmpty()) // link to entity imported via tag file
2181 {
2182 m_t << "<a class=\"elRef\" ";
2184 }
2185 else // local link
2186 {
2187 m_t << "<a class=\"el\" ";
2188 }
2189 m_t << "href=\"";
2190 QCString fn = file;
2192 m_t << createHtmlUrl(relPath,ref,true,
2193 m_fileName == Config_getString(HTML_OUTPUT)+"/"+fn,
2194 fn,
2195 anchor);
2196 m_t << "\"";
2197 if (!tooltip.isEmpty()) m_t << " title=\"" << convertToHtml(tooltip) << "\"";
2198 m_t << ">";
2199}
QCString externalLinkTarget(const bool parent)
Definition util.cpp:6178
QCString createHtmlUrl(const QCString &relPath, const QCString &ref, bool href, bool isLocalFile, const QCString &targetFileName, const QCString &anchor)
Definition util.cpp:6189

References addHtmlExtensionIfMissing(), Config_getString, convertToHtml(), createHtmlUrl(), externalLinkTarget(), QCString::isEmpty(), m_fileName, and m_t.

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

◆ visitCaption()

template<class T>
void HtmlDocVisitor::visitCaption ( TextStream & t,
const T & n )
private

Definition at line 262 of file htmldocvisitor.cpp.

263{
264 if (n.hasCaption())
265 {
266 t << "<div class=\"caption\">\n";
267 for (const auto &child : n.children())
268 {
269 std::visit(*this, child);
270 }
271 t << "</div>\n";
272 }
273}

Referenced by operator()().

◆ visitChildren()

◆ writeDiaFile()

void HtmlDocVisitor::writeDiaFile ( const QCString & fileName,
const QCString & relPath,
const QCString & context,
const QCString & srcFile,
int srcLine )
private

Definition at line 2230 of file htmldocvisitor.cpp.

2232{
2233 QCString baseName=makeBaseName(fileName);
2234 baseName.prepend("dia_");
2235 QCString outDir = Config_getString(HTML_OUTPUT);
2236 writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
2237
2238 m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />\n";
2239}
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26

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

Referenced by operator()().

◆ writeDotFile()

void HtmlDocVisitor::writeDotFile ( const QCString & fileName,
const QCString & relPath,
const QCString & context,
const QCString & srcFile,
int srcLine )
private

Definition at line 2206 of file htmldocvisitor.cpp.

2208{
2209 QCString baseName=makeBaseName(fn);
2210 baseName.prepend("dot_");
2211 QCString outDir = Config_getString(HTML_OUTPUT);
2212 writeDotGraphFromFile(fn,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
2213 writeDotImageMapFromFile(m_t,fn,outDir,relPath,baseName,context,-1,srcFile,srcLine);
2214}
void writeDotImageMapFromFile(TextStream &t, const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &baseName, const QCString &context, int graphId, const QCString &srcFile, int srcLine)
Definition dot.cpp:283
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230

References BITMAP, Config_getString, m_t, makeBaseName(), QCString::prepend(), writeDotGraphFromFile(), and writeDotImageMapFromFile().

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

◆ writeMscFile()

void HtmlDocVisitor::writeMscFile ( const QCString & fileName,
const QCString & relPath,
const QCString & context,
const QCString & srcFile,
int srcLine )
private

Definition at line 2216 of file htmldocvisitor.cpp.

2218{
2219 QCString baseName=makeBaseName(fileName);
2220 baseName.prepend("msc_");
2221 QCString outDir = Config_getString(HTML_OUTPUT);
2222 QCString imgExt = getDotImageExtension();
2224 if ("svg" == imgExt)
2225 mscFormat = MscOutputFormat::SVG;
2226 writeMscGraphFromFile(fileName,outDir,baseName,mscFormat,srcFile,srcLine);
2227 writeMscImageMapFromFile(m_t,fileName,outDir,relPath,baseName,context,mscFormat,srcFile,srcLine);
2228}
void writeMscImageMapFromFile(TextStream &t, const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &baseName, const QCString &context, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:233
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157
MscOutputFormat
Definition msc.h:22

References BITMAP, Config_getString, getDotImageExtension(), m_t, makeBaseName(), QCString::prepend(), SVG, writeMscGraphFromFile(), and writeMscImageMapFromFile().

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

◆ writeObfuscatedMailAddress()

void HtmlDocVisitor::writeObfuscatedMailAddress ( const QCString & url)
private

Definition at line 344 of file htmldocvisitor.cpp.

345{
346 if (!Config_getBool(OBFUSCATE_EMAILS))
347 {
348 m_t << "<a href=\"mailto:" << url << "\">";
349 }
350 else
351 {
352 m_t << "<a href=\"#\" onclick=\"location.href='mai'+'lto:'";
353 if (!url.isEmpty())
354 {
355 const char *p = url.data();
356 uint32_t size=3;
357 while (*p)
358 {
359 m_t << "+'";
360 for (uint32_t j=0;j<size && *p;j++)
361 {
362 p = writeUTF8Char(m_t,p);
363 }
364 m_t << "'";
365 if (size==3) size=2; else size=3;
366 }
367 }
368 m_t << "; return false;\">";
369 }
370}

References Config_getBool, QCString::data(), QCString::isEmpty(), m_t, and writeUTF8Char().

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

◆ writePlantUMLFile()

void HtmlDocVisitor::writePlantUMLFile ( const QCString & fileName,
const QCString & relPath,
const QCString & context,
const QCString & srcFile,
int srcLine )
private

Definition at line 2241 of file htmldocvisitor.cpp.

2243{
2244 QCString baseName=makeBaseName(fileName);
2245 QCString outDir = Config_getString(HTML_OUTPUT);
2246 QCString imgExt = getDotImageExtension();
2247 if (imgExt=="svg")
2248 {
2250 //m_t << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg" << "\" />\n";
2251 //m_t << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
2252 //m_t << "</iframe>\n";
2253 m_t << "<object type=\"image/svg+xml\" data=\"" << relPath << baseName << ".svg\"></object>\n";
2254 }
2255 else
2256 {
2258 m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />\n";
2259 }
2260}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:128

References Config_getString, PlantumlManager::generatePlantUMLOutput(), getDotImageExtension(), PlantumlManager::instance(), m_t, makeBaseName(), PlantumlManager::PUML_BITMAP, and PlantumlManager::PUML_SVG.

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

Member Data Documentation

◆ m_ci

OutputCodeList& HtmlDocVisitor::m_ci
private

Definition at line 145 of file htmldocvisitor.h.

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

◆ m_ctx

const Definition* HtmlDocVisitor::m_ctx
private

Definition at line 149 of file htmldocvisitor.h.

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

◆ m_fileName

QCString HtmlDocVisitor::m_fileName
private

Definition at line 150 of file htmldocvisitor.h.

Referenced by HtmlDocVisitor(), and startLink().

◆ m_hide

◆ m_insidePre

bool HtmlDocVisitor::m_insidePre = false
private

Definition at line 146 of file htmldocvisitor.h.

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

◆ m_insideTitle

bool HtmlDocVisitor::m_insideTitle = false
private

Definition at line 148 of file htmldocvisitor.h.

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

◆ m_langExt

QCString HtmlDocVisitor::m_langExt
private

Definition at line 151 of file htmldocvisitor.h.

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

◆ m_t


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