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 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 312 of file htmldocvisitor.cpp.

314 : m_t(t), m_ci(ci), m_ctx(ctx), m_fileName(fn)
315{
316 if (ctx) m_langExt=ctx->getDefFileExtension();
317}
virtual QCString getDefFileExtension() const =0
TextStream & m_t
OutputCodeList & m_ci
const Definition * m_ctx

References Definition::getDefFileExtension(), and m_langExt.

Member Function Documentation

◆ endLink()

void HtmlDocVisitor::endLink ( )
private

Definition at line 2198 of file htmldocvisitor.cpp.

2199{
2200 m_t << "</a>";
2201}

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 2088 of file htmldocvisitor.cpp.

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

2126{
2127 GrowBuf growBuf;
2128 if (str.isEmpty()) return str;
2129 const char *p=str.data();
2130 while (*p)
2131 {
2132 char c=*p++;
2133 switch(c)
2134 {
2135 case '&': growBuf.addStr("&amp;"); break;
2136 case '"': growBuf.addStr("&quot;"); break;
2137 case '<': growBuf.addStr("&lt;"); break;
2138 case '>': growBuf.addStr("&gt;"); break;
2139 case '\\':
2140 if ((*p == '(') || (*p == ')'))
2141 {
2142 growBuf.addStr("\\&zwj;");
2143 growBuf.addChar(*p++);
2144 }
2145 else
2146 {
2147 growBuf.addChar(c);
2148 }
2149 break;
2150 default:
2151 {
2152 uint8_t uc = static_cast<uint8_t>(c);
2153 if (uc<32 && !isspace(c)) // non-printable control characters
2154 {
2155 growBuf.addStr("&#x24");
2156 growBuf.addChar(hex[uc>>4]);
2157 growBuf.addChar(hex[uc&0xF]);
2158 growBuf.addStr(";");
2159 }
2160 else
2161 {
2162 growBuf.addChar(c);
2163 }
2164 }
2165 break;
2166 }
2167 }
2168 growBuf.addChar(0);
2169 return growBuf.get();
2170}
Class representing a string buffer optimised for growing.
Definition growbuf.h:28
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 2308 of file htmldocvisitor.cpp.

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

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 2363 of file htmldocvisitor.cpp.

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

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

◆ operator()() [1/57]

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

Definition at line 720 of file htmldocvisitor.cpp.

721{
722 if (m_hide) return;
723 m_t << "<a class=\"anchor\" id=\"" << anc.anchor() << "\"" << htmlAttribsToString(anc.attribs()) << "></a>";
724}
const HtmlAttribList & attribs() const
Definition docnode.h:233
QCString anchor() const
Definition docnode.h:230
static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAltValue=nullptr)

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

◆ operator()() [2/57]

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

Definition at line 1035 of file htmldocvisitor.cpp.

1036{
1037 //printf("DocAutoList::visitPre\n");
1038 if (m_hide) return;
1040 if (l.isEnumList())
1041 {
1042 //
1043 // Do list type based on depth:
1044 // 1.
1045 // a.
1046 // i.
1047 // A.
1048 // 1. (repeat)...
1049 //
1050 m_t << "<ol type=\"" << types[l.depth() % NUM_HTML_LIST_TYPES] << "\">";
1051 }
1052 else
1053 {
1054 if (l.isCheckedList())
1055 {
1056 m_t << "<ul class=\"check\">";
1057 }
1058 else
1059 {
1060 m_t << "<ul>";
1061 }
1062 }
1063 if (!l.isPreformatted()) m_t << "\n";
1064 visitChildren(l);
1065 if (l.isEnumList())
1066 {
1067 m_t << "</ol>";
1068 }
1069 else
1070 {
1071 m_t << "</ul>";
1072 }
1073 if (!l.isPreformatted()) m_t << "\n";
1075}
bool isCheckedList() const
Definition docnode.h:554
bool isEnumList() const
Definition docnode.h:552
int depth() const
Definition docnode.h:555
bool isPreformatted() const
Definition docnode.h:103
void forceStartParagraph(const DocNode &n)
void visitChildren(const T &t)
void forceEndParagraph(const DocNode &n)
static const char types[][NUM_HTML_LIST_TYPES]
static const int NUM_HTML_LIST_TYPES

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

◆ operator()() [3/57]

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

Definition at line 1077 of file htmldocvisitor.cpp.

1078{
1079 if (m_hide) return;
1080 switch (li.itemNumber())
1081 {
1082 case DocAutoList::Unchecked: // unchecked
1083 m_t << "<li class=\"unchecked\">";
1084 break;
1085 case DocAutoList::Checked_x: // checked with x
1086 case DocAutoList::Checked_X: // checked with X
1087 m_t << "<li class=\"checked\">";
1088 break;
1089 default:
1090 m_t << "<li>";
1091 break;
1092 }
1093 visitChildren(li);
1094 m_t << "</li>";
1095 if (!li.isPreformatted()) m_t << "\n";
1096}
int itemNumber() const
Definition docnode.h:570

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

◆ operator()() [4/57]

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

Definition at line 1007 of file htmldocvisitor.cpp.

1008{
1009 if (m_hide) return;
1010 if (!cite.file().isEmpty())
1011 {
1012 startLink(cite.ref(),cite.file(),cite.relPath(),cite.anchor());
1013 }
1014 else
1015 {
1016 m_t << "<b>[";
1017 }
1018 filter(cite.text());
1019 if (!cite.file().isEmpty())
1020 {
1021 endLink();
1022 }
1023 else
1024 {
1025 m_t << "]</b>";
1026 }
1027}
QCString text() const
Definition docnode.h:250
QCString relPath() const
Definition docnode.h:247
QCString anchor() const
Definition docnode.h:249
QCString ref() const
Definition docnode.h:248
QCString file() const
Definition docnode.h:246
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/57]

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

Definition at line 1835 of file htmldocvisitor.cpp.

1836{
1837 if (m_hide) return;
1838 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1840 m_t << "<div class=\"diagraph\">\n";
1841 writeDiaFile(df.file(),df.relPath(),df.context(),df.srcFile(),df.srcLine());
1842 if (df.hasCaption())
1843 {
1844 m_t << "<div class=\"caption\">\n";
1845 }
1846 visitChildren(df);
1847 if (df.hasCaption())
1848 {
1849 m_t << "</div>\n";
1850 }
1851 m_t << "</div>\n";
1853}
QCString relPath() const
Definition docnode.h:657
QCString srcFile() const
Definition docnode.h:662
QCString file() const
Definition docnode.h:656
int srcLine() const
Definition docnode.h:663
bool hasCaption() const
Definition docnode.h:658
QCString context() const
Definition docnode.h:661
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:5216
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:6092

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/57]

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

Definition at line 1795 of file htmldocvisitor.cpp.

1796{
1797 if (m_hide) return;
1798 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1800 m_t << "<div class=\"dotgraph\">\n";
1801 writeDotFile(df.file(),df.relPath(),df.context(),df.srcFile(),df.srcLine());
1802 if (df.hasCaption())
1803 {
1804 m_t << "<div class=\"caption\">\n";
1805 }
1806 visitChildren(df);
1807 if (df.hasCaption())
1808 {
1809 m_t << "</div>\n";
1810 }
1811 m_t << "</div>\n";
1813}
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/57]

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

Definition at line 388 of file htmldocvisitor.cpp.

389{
390 if (m_hide) return;
391 const char *res = EmojiEntityMapper::instance().unicode(s.index());
392 if (res)
393 {
394 m_t << "<span class=\"emoji\">" << res << "</span>";
395 }
396 else
397 {
398 m_t << s.name();
399 }
400}
int index() const
Definition docnode.h:324
QCString name() const
Definition docnode.h:323
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:1958
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1920

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

◆ operator()() [8/57]

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

Definition at line 872 of file htmldocvisitor.cpp.

873{
874 if (m_hide) return;
875 bool bDisplay = !f.isInline();
876 if (bDisplay)
877 {
879 m_t << "<p class=\"formulaDsp\">\n";
880 }
881
882 if (Config_getBool(USE_MATHJAX))
883 {
884 QCString text = f.text();
885 bool closeInline = FALSE;
886 if (!bDisplay && !text.isEmpty() && text.at(0)=='$' &&
887 text.at(text.length()-1)=='$')
888 {
889 closeInline=TRUE;
890 text = text.mid(1,text.length()-2);
891 m_t << "\\(";
892 }
893 else if (!bDisplay && !text.isEmpty())
894 {
895 closeInline=TRUE;
896 m_t << "\\(";
897 }
898 m_t << convertToHtml(text);
899 if (closeInline)
900 {
901 m_t << "\\)";
902 }
903 }
904 else
905 {
906 const Formula *formula = FormulaManager::instance().findFormula(f.id());
907
908 enum class ImageType { Light, Dark };
909 enum class Visibility { Always, Dark, Light, AutoDark, AutoLight };
910 auto writeFormula = [&](ImageType imgType,Visibility visibility) -> QCString {
911 // see https://chipcullen.com/how-to-have-dark-mode-image-that-works-with-user-choice for the design idea
912 TextStream t;
913 QCString extension = Config_getEnum(HTML_FORMULA_FORMAT)==HTML_FORMULA_FORMAT_t::svg ? ".svg":".png" ;
914 if (visibility==Visibility::AutoDark || visibility==Visibility::AutoLight)
915 {
916 t << "<picture>";
917 t << "<source srcset=\"" << f.relPath() << f.name();
918 if (visibility==Visibility::AutoDark)
919 {
920 t << extension;
921 t << "\" media=\"(prefers-color-scheme: light)\"";
922 }
923 else // AutoLight
924 {
925 t << "_dark";
926 t << extension;
927 t << "\" media=\"(prefers-color-scheme: dark)\"";
928 }
929 t << "/>";
930 }
931 t << "<img class=\"formula";
932 t << (bDisplay ? "Dsp" : "Inl");
933 if (visibility==Visibility::Light) t << " light-mode-visible";
934 else if (visibility==Visibility::Dark) t << " dark-mode-visible";
935 t << "\" alt=\"" << filterQuotedCdataAttr(f.text()) << "\"" << " src=\"" << f.relPath() << f.name();
936 if (imgType==ImageType::Dark) t << "_dark";
937 t << extension;
938 if (formula && formula->width()!=-1)
939 {
940 t << "\" width=\"";
941 t << formula->width();
942 }
943 if (formula && formula->height()!=-1)
944 {
945 t << "\" height=\"";
946 t << formula->height();
947 }
948 t << "\"/>";
949 if (visibility==Visibility::AutoDark || visibility==Visibility::AutoLight)
950 {
951 t << "</picture>";
952 }
953 return QCString(t.str());
954 };
955
956 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
957 switch(colorStyle)
958 {
959 case HTML_COLORSTYLE_t::LIGHT:
960 m_t << writeFormula(ImageType::Light,Visibility::Always);
961 break;
962 case HTML_COLORSTYLE_t::DARK:
963 m_t << writeFormula(ImageType::Dark, Visibility::Always);
964 break;
965 case HTML_COLORSTYLE_t::AUTO_LIGHT:
966 m_t << writeFormula(ImageType::Light, Visibility::AutoLight);
967 break;
968 case HTML_COLORSTYLE_t::AUTO_DARK:
969 m_t << writeFormula(ImageType::Dark, Visibility::AutoDark);
970 break;
971 case HTML_COLORSTYLE_t::TOGGLE:
972 // write the image twice and use javascript (darkmode_toggle.js) to show only one of them
973 m_t << writeFormula(ImageType::Light,Visibility::Light);
974 m_t << writeFormula(ImageType::Dark, Visibility::Dark);
975 break;
976 }
977 }
978 if (bDisplay)
979 {
980 m_t << "\n</p>\n";
982 }
983}
QCString text() const
Definition docnode.h:505
QCString name() const
Definition docnode.h:504
bool isInline() const
Definition docnode.h:508
int id() const
Definition docnode.h:507
QCString relPath() const
Definition docnode.h:506
Class representing a LaTeX formula as found in the documentation.
Definition formula.h:29
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...
This is an alternative implementation of QCString.
Definition qcstring.h:94
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:146
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:219
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:558
Text streaming class that buffers data.
Definition textstream.h:36
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:4256

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/57]

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

Definition at line 474 of file htmldocvisitor.cpp.

475{
476 if (m_hide) return;
478 m_t << "<hr "<< htmlAttribsToString(hr.attribs()) << " />\n";
480}
const HtmlAttribList & attribs() const
Definition docnode.h:219

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

◆ operator()() [10/57]

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

Definition at line 1632 of file htmldocvisitor.cpp.

1633{
1634 if (m_hide) return;
1635 if (href.url().startsWith("mailto:"))
1636 {
1638 }
1639 else
1640 {
1641 QCString url = correctURL(href.url(),href.relPath());
1642 m_t << "<a href=\"" << convertToHtml(url) << "\""
1643 << htmlAttribsToString(href.attribs()) << ">";
1644 }
1645 visitChildren(href);
1646 m_t << "</a>";
1647}
QCString url() const
Definition docnode.h:792
QCString relPath() const
Definition docnode.h:794
const HtmlAttribList & attribs() const
Definition docnode.h:795
void writeObfuscatedMailAddress(const QCString &url)
bool startsWith(const char *s) const
Definition qcstring.h:483
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:6180

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

◆ operator()() [11/57]

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

Definition at line 2044 of file htmldocvisitor.cpp.

2045{
2046 if (m_hide) return;
2048 m_t << "<blockquote class=\"doxtable\"" << htmlAttribsToString(b.attribs()) << ">\n";
2049 visitChildren(b);
2050 m_t << "</blockquote>\n";
2052}
const HtmlAttribList & attribs() const
Definition docnode.h:1258

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

◆ operator()() [12/57]

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

Definition at line 1618 of file htmldocvisitor.cpp.

1619{
1620 if (m_hide) return;
1621 m_t << "<caption" << htmlAttribsToString(c.attribs()) << ">";
1622 visitChildren(c);
1623 m_t << "</caption>\n";
1624}
const HtmlAttribList & attribs() const
Definition docnode.h:1193

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

◆ operator()() [13/57]

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

Definition at line 1603 of file htmldocvisitor.cpp.

1604{
1605 if (m_hide) return;
1606 if (c.isHeading())
1607 {
1608 m_t << "<th" << htmlAttribsToString(c.attribs()) << ">";
1609 }
1610 else
1611 {
1612 m_t << "<td" << htmlAttribsToString(c.attribs()) << ">";
1613 }
1614 visitChildren(c);
1615 if (c.isHeading()) m_t << "</th>"; else m_t << "</td>";
1616}
bool isHeading() const
Definition docnode.h:1162
const HtmlAttribList & attribs() const
Definition docnode.h:1167

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

◆ operator()() [14/57]

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

Definition at line 1554 of file htmldocvisitor.cpp.

1555{
1556 if (m_hide) return;
1557 m_t << "<dd" << htmlAttribsToString(dd.attribs()) << ">";
1558 visitChildren(dd);
1559 m_t << "</dd>\n";
1560}
const HtmlAttribList & attribs() const
Definition docnode.h:1146

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

◆ operator()() [15/57]

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

Definition at line 1536 of file htmldocvisitor.cpp.

1537{
1538 if (m_hide) return;
1540 m_t << "<dl" << htmlAttribsToString(dl.attribs()) << ">\n";
1541 visitChildren(dl);
1542 m_t << "</dl>\n";
1544}
const HtmlAttribList & attribs() const
Definition docnode.h:867

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

◆ operator()() [16/57]

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

Definition at line 1546 of file htmldocvisitor.cpp.

1547{
1548 if (m_hide) return;
1549 m_t << "<dt" << htmlAttribsToString(dt.attribs()) << ">";
1550 visitChildren(dt);
1551 m_t << "</dt>\n";
1552}
const HtmlAttribList & attribs() const
Definition docnode.h:854

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

◆ operator()() [17/57]

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

Definition at line 1657 of file htmldocvisitor.cpp.

1658{
1659 if (m_hide) return;
1661 m_t << "<details " << htmlAttribsToString(d.attribs()) << ">\n";
1662 auto summary = d.summary();
1663 if (summary)
1664 {
1665 std::visit(*this,*summary);
1666 }
1667 visitChildren(d);
1668 m_t << "</details>\n";
1670}
const HtmlAttribList & attribs() const
Definition docnode.h:823
const DocNodeVariant * summary() const
Definition docnode.h:826

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

◆ operator()() [18/57]

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

Definition at line 1672 of file htmldocvisitor.cpp.

1673{
1674 if (m_hide) return;
1675 forceEndParagraph(header);
1676 m_t << "<h" << header.level() << htmlAttribsToString(header.attribs()) << ">";
1677 visitChildren(header);
1678 m_t << "</h" << header.level() << ">\n";
1679 forceStartParagraph(header);
1680}
const HtmlAttribList & attribs() const
Definition docnode.h:840
int level() const
Definition docnode.h:839

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

◆ operator()() [19/57]

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

Definition at line 1501 of file htmldocvisitor.cpp.

1502{
1503 if (m_hide) return;
1505 if (s.type()==DocHtmlList::Ordered)
1506 {
1507 m_t << "<ol" << htmlAttribsToString(s.attribs());
1508 }
1509 else
1510 {
1511 m_t << "<ul" << htmlAttribsToString(s.attribs());
1512 }
1513 m_t << ">\n";
1514 visitChildren(s);
1515 if (s.type()==DocHtmlList::Ordered)
1516 {
1517 m_t << "</ol>";
1518 }
1519 else
1520 {
1521 m_t << "</ul>";
1522 }
1523 if (!s.isPreformatted()) m_t << "\n";
1525}
const HtmlAttribList & attribs() const
Definition docnode.h:968
Type type() const
Definition docnode.h:967

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

◆ operator()() [20/57]

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

Definition at line 1527 of file htmldocvisitor.cpp.

1528{
1529 if (m_hide) return;
1530 m_t << "<li" << htmlAttribsToString(i.attribs()) << ">";
1531 if (!i.isPreformatted()) m_t << "\n";
1532 visitChildren(i);
1533 m_t << "</li>\n";
1534}
const HtmlAttribList & attribs() const
Definition docnode.h:1132

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

◆ operator()() [21/57]

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

Definition at line 1595 of file htmldocvisitor.cpp.

1596{
1597 if (m_hide) return;
1598 m_t << "<tr" << htmlAttribsToString(tr.attribs()) << ">\n";
1599 visitChildren(tr);
1600 m_t << "</tr>\n";
1601}
const HtmlAttribList & attribs() const
Definition docnode.h:1214

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

◆ operator()() [22/57]

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

Definition at line 1649 of file htmldocvisitor.cpp.

1650{
1651 if (m_hide) return;
1652 m_t << "<summary " << htmlAttribsToString(s.attribs()) << ">\n";
1653 visitChildren(s);
1654 m_t << "</summary>\n";
1655}
const HtmlAttribList & attribs() const
Definition docnode.h:810

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

◆ operator()() [23/57]

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

Definition at line 1562 of file htmldocvisitor.cpp.

1563{
1564 if (m_hide) return;
1565
1567
1568 if (t.caption())
1569 {
1570 QCString anc = std::get<DocHtmlCaption>(*t.caption()).anchor();
1571 if (!anc.isEmpty())
1572 {
1573 m_t << "<a class=\"anchor\" id=\"" << anc << "\"></a>\n";
1574 }
1575 }
1576
1578 if (attrs.isEmpty())
1579 {
1580 m_t << "<table class=\"doxtable\">\n";
1581 }
1582 else
1583 {
1584 m_t << "<table" << htmlAttribsToString(t.attribs()) << ">\n";
1585 }
1586 if (t.caption())
1587 {
1588 std::visit(*this,*t.caption());
1589 }
1590 visitChildren(t);
1591 m_t << "</table>\n";
1593}
const DocNodeVariant * caption() const
Definition docnode.cpp:1949
const HtmlAttribList & attribs() const
Definition docnode.h:1237

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

◆ operator()() [24/57]

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

Definition at line 1682 of file htmldocvisitor.cpp.

1683{
1684 if (img.type()==DocImage::Html)
1685 {
1686 bool inlineImage = img.isInlineImage();
1687 bool typeSVG = img.isSVG();
1688 QCString url = img.url();
1689
1690 if (!inlineImage)
1691 {
1692 forceEndParagraph(img);
1693 }
1694 if (m_hide) return;
1695 QCString baseName=makeShortName(img.name());
1696 if (!inlineImage) m_t << "<div class=\"image\">\n";
1697 QCString sizeAttribs;
1698 if (!img.width().isEmpty())
1699 {
1700 sizeAttribs+=" width=\""+img.width()+"\"";
1701 }
1702 if (!img.height().isEmpty()) // link to local file
1703 {
1704 sizeAttribs+=" height=\""+img.height()+"\"";
1705 }
1706 // 16 cases: url.isEmpty() | typeSVG | inlineImage | img.hasCaption()
1707
1708 HtmlAttribList extraAttribs;
1709 if (typeSVG)
1710 {
1711 HtmlAttrib opt;
1712 opt.name = "style";
1713 opt.value = "pointer-events: none;";
1714 extraAttribs.push_back(opt);
1715 }
1716 QCString alt;
1717 mergeHtmlAttributes(img.attribs(),extraAttribs);
1718 QCString attrs = htmlAttribsToString(extraAttribs,&alt);
1719 QCString src;
1720 if (url.isEmpty())
1721 {
1722 src = img.relPath()+img.name();
1723 }
1724 else
1725 {
1726 src = correctURL(url,img.relPath());
1727 }
1728 if (typeSVG && !inlineImage)
1729 {
1730 m_t << "<object type=\"image/svg+xml\" data=\"" << convertToHtml(src)
1731 << "\"" << sizeAttribs << attrs;
1732 if (inlineImage)
1733 {
1734 // skip closing tag
1735 }
1736 else
1737 {
1738 m_t << ">" << alt << "</object>\n";
1739 }
1740 }
1741 else
1742 {
1743 m_t << "<img src=\"" << convertToHtml(src) << "\" alt=\"" << alt << "\"" << sizeAttribs << attrs;
1744 if (inlineImage)
1745 {
1746 m_t << " class=\"inline\"";
1747 }
1748 else
1749 {
1750 m_t << "/>\n";
1751 }
1752 }
1753 if (img.hasCaption())
1754 {
1755 if (inlineImage)
1756 {
1757 m_t << " title=\"";
1758 m_insideTitle=true;
1759 }
1760 else
1761 {
1762 m_t << "<div class=\"caption\">\n";
1763 }
1764 }
1765 else if (inlineImage)
1766 {
1767 m_t << "/>";
1768 }
1769
1770 visitChildren(img);
1771
1772 if (img.hasCaption())
1773 {
1774 if (inlineImage)
1775 {
1776 m_t << "\"/>";
1777 m_insideTitle=false;
1778 }
1779 else // end <div class="caption">
1780 {
1781 m_t << "</div>";
1782 }
1783 }
1784 if (!inlineImage) // end <div class="image">
1785 {
1786 m_t << "</div>\n";
1788 }
1789 }
1790 else // other format -> skip
1791 {
1792 }
1793}
const HtmlAttribList & attribs() const
Definition docnode.h:627
QCString relPath() const
Definition docnode.h:623
QCString name() const
Definition docnode.h:619
QCString url() const
Definition docnode.h:624
QCString height() const
Definition docnode.h:622
Type type() const
Definition docnode.h:618
QCString width() const
Definition docnode.h:621
bool isInlineImage() const
Definition docnode.h:625
bool isSVG() const
Definition docnode.cpp:1181
bool hasCaption() const
Definition docnode.h:620
Class representing a list of HTML attributes.
Definition htmlattrib.h:31
static QCString makeShortName(const QCString &baseName)
static void mergeHtmlAttributes(const HtmlAttribList &attribs, HtmlAttribList &mergeInto)
Class representing a HTML attribute.
Definition htmlattrib.h:24
QCString value
Definition htmlattrib.h:26
QCString name
Definition htmlattrib.h:25

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

◆ operator()() [25/57]

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

Definition at line 726 of file htmldocvisitor.cpp.

727{
728 if (m_hide) return;
730 switch(inc.type())
731 {
734 m_ci.startCodeFragment("DoxyCode");
736 inc.context(),
737 inc.text(),
738 langExt,
739 inc.isExample(),
740 inc.exampleFile(),
741 nullptr, // fileDef
742 -1, // startLine
743 -1, // endLine
744 TRUE, // inlineFragment
745 nullptr, // memberDef
746 FALSE, // show line numbers
747 m_ctx // search context
748 );
749 m_ci.endCodeFragment("DoxyCode");
751 break;
753 {
755 m_ci.startCodeFragment("DoxyCode");
756 FileInfo cfi( inc.file().str() );
757 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
759 inc.context(),
760 inc.text(),
761 langExt,
762 inc.isExample(),
763 inc.exampleFile(),
764 fd.get(), // fileDef,
765 -1, // start line
766 -1, // end line
767 FALSE, // inline fragment
768 nullptr, // memberDef
769 TRUE, // show line numbers
770 m_ctx // search context
771 );
772 m_ci.endCodeFragment("DoxyCode");
774 }
775 break;
783 break;
785 {
786 if (inc.isBlock()) forceEndParagraph(inc);
787 m_t << inc.text();
788 if (inc.isBlock()) forceStartParagraph(inc);
789 }
790 break;
793 m_t << "<pre class=\"fragment\">";
794 filter(inc.text());
795 m_t << "</pre>";
797 break;
802 m_ci.startCodeFragment("DoxyCode");
804 inc.file(),
805 inc.blockId(),
806 inc.context(),
809 );
810 m_ci.endCodeFragment("DoxyCode");
812 break;
813 }
814}
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, 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:432
QCString extension() const
Definition docnode.h:428
bool isBlock() const
Definition docnode.h:435
@ LatexInclude
Definition docnode.h:416
@ SnippetTrimLeft
Definition docnode.h:419
@ SnippetWithLines
Definition docnode.h:417
@ DontIncWithLines
Definition docnode.h:418
@ IncWithLines
Definition docnode.h:417
@ HtmlInclude
Definition docnode.h:416
@ VerbInclude
Definition docnode.h:416
@ DontInclude
Definition docnode.h:416
@ DocbookInclude
Definition docnode.h:418
Type type() const
Definition docnode.h:429
QCString exampleFile() const
Definition docnode.h:434
QCString text() const
Definition docnode.h:430
QCString file() const
Definition docnode.h:427
bool isExample() const
Definition docnode.h:433
QCString context() const
Definition docnode.h:431
CodeParserInterface & getCodeParser(const QCString &langExt)
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
void endCodeFragment(const QCString &style)
Definition outputlist.h:258
void startCodeFragment(const QCString &style)
Definition outputlist.h:255
const std::string & str() const
Definition qcstring.h:517
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:263
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5472

References DocInclude::blockId(), DocInclude::context(), createFileDef(), FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, OutputCodeList::endCodeFragment(), 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::SnippetTrimLeft, DocInclude::SnippetWithLines, OutputCodeList::startCodeFragment(), QCString::str(), DocInclude::text(), TRUE, DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/57]

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

Definition at line 816 of file htmldocvisitor.cpp.

817{
818 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
819 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
820 if (op.isFirst())
821 {
823 if (!m_hide) m_ci.startCodeFragment("DoxyCode");
825 m_hide=TRUE;
826 }
828 if (locLangExt.isEmpty()) locLangExt = m_langExt;
829 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
830 if (op.type()!=DocIncOperator::Skip)
831 {
832 m_hide = popHidden();
833 if (!m_hide)
834 {
835 std::unique_ptr<FileDef> fd;
836 if (!op.includeFileName().isEmpty())
837 {
838 FileInfo cfi( op.includeFileName().str() );
839 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
840 }
841 getCodeParser(locLangExt).parseCode(
842 m_ci,
843 op.context(),
844 op.text(),
845 langExt,
846 op.isExample(),
847 op.exampleFile(),
848 fd.get(), // fileDef
849 op.line(), // startLine
850 -1, // endLine
851 FALSE, // inline fragment
852 nullptr, // memberDef
853 op.showLineNo(), // show line numbers
854 m_ctx // search context
855 );
856 }
858 m_hide=TRUE;
859 }
860 if (op.isLast())
861 {
862 m_hide = popHidden();
863 if (!m_hide) m_ci.endCodeFragment("DoxyCode");
865 }
866 else
867 {
868 if (!m_hide) m_t << "\n";
869 }
870}
bool isLast() const
Definition docnode.h:477
QCString includeFileName() const
Definition docnode.h:482
QCString text() const
Definition docnode.h:473
QCString context() const
Definition docnode.h:475
QCString exampleFile() const
Definition docnode.h:481
int line() const
Definition docnode.h:471
Type type() const
Definition docnode.h:459
bool isFirst() const
Definition docnode.h:476
bool showLineNo() const
Definition docnode.h:472
bool isExample() const
Definition docnode.h:480
void pushHidden(bool hide)
bool popHidden()
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5514

References DocIncOperator::context(), createFileDef(), FileInfo::dirPath(), OutputCodeList::endCodeFragment(), DocIncOperator::exampleFile(), FALSE, 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, OutputCodeList::startCodeFragment(), QCString::str(), DocIncOperator::text(), TRUE, and DocIncOperator::type().

◆ operator()() [27/57]

void HtmlDocVisitor::operator() ( const DocIndexEntry & e)

Definition at line 985 of file htmldocvisitor.cpp.

986{
988 if (e.member())
989 {
990 anchor.prepend(e.member()->anchor()+"_");
991 }
992 m_t << "<a id=\"" << anchor << "\" name=\"" << anchor << "\"></a>";
993 //printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n",
994 // qPrint(e.entry()),
995 // e.scope() ? qPrint(e.scope()->name()) : "<null>",
996 // e.member() ? qPrint(e.member()->name()) : "<null>"
997 // );
998 Doxygen::indexList->addIndexItem(e.scope(),e.member(),anchor,e.entry());
999}
virtual QCString anchor() const =0
QCString entry() const
Definition docnode.h:531
const Definition * scope() const
Definition docnode.h:529
const MemberDef * member() const
Definition docnode.h:530
static IndexList * indexList
Definition doxygen.h:124
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:398
static QCString convertIndexWordToAnchor(const QCString &word)

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

◆ operator()() [28/57]

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

Definition at line 1626 of file htmldocvisitor.cpp.

1627{
1628 if (m_hide) return;
1629 visitChildren(i);
1630}

References m_hide, and visitChildren().

◆ operator()() [29/57]

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

Definition at line 2030 of file htmldocvisitor.cpp.

2031{
2032 if (m_hide) return;
2033 startLink(QCString(),ref.file(),ref.relPath(),ref.anchor());
2034 visitChildren(ref);
2035 endLink();
2036 m_t << " ";
2037}
QCString file() const
Definition docnode.h:773
QCString relPath() const
Definition docnode.h:774
QCString anchor() const
Definition docnode.h:775

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

◆ operator()() [30/57]

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

Definition at line 468 of file htmldocvisitor.cpp.

469{
470 if (m_hide) return;
471 m_t << "<br "<< htmlAttribsToString(br.attribs()) << " />\n";
472}
const HtmlAttribList & attribs() const
Definition docnode.h:206

References DocLineBreak::attribs(), htmlAttribsToString(), m_hide, and m_t.

◆ operator()() [31/57]

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

Definition at line 1855 of file htmldocvisitor.cpp.

1856{
1857 if (m_hide) return;
1858 startLink(lnk.ref(),lnk.file(),lnk.relPath(),lnk.anchor());
1859 visitChildren(lnk);
1860 endLink();
1861}

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

◆ operator()() [32/57]

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

Definition at line 343 of file htmldocvisitor.cpp.

344{
345 if (m_hide) return;
346 //printf("linked word: %s\n",qPrint(w.word()));
347 startLink(w.ref(),w.file(),w.relPath(),w.anchor(),w.tooltip());
348 filter(w.word());
349 endLink();
350}
QCString file() const
Definition docnode.h:169
QCString relPath() const
Definition docnode.h:170
QCString ref() const
Definition docnode.h:171
QCString word() const
Definition docnode.h:168
QCString anchor() const
Definition docnode.h:172
QCString tooltip() const
Definition docnode.h:173

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

◆ operator()() [33/57]

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

Definition at line 1815 of file htmldocvisitor.cpp.

1816{
1817 if (m_hide) return;
1818 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(HTML_OUTPUT)+"/"+stripPath(df.file()));
1820 m_t << "<div class=\"mscgraph\">\n";
1821 writeMscFile(df.file(),df.relPath(),df.context(),df.srcFile(),df.srcLine());
1822 if (df.hasCaption())
1823 {
1824 m_t << "<div class=\"caption\">\n";
1825 }
1826 visitChildren(df);
1827 if (df.hasCaption())
1828 {
1829 m_t << "</div>\n";
1830 }
1831 m_t << "</div>\n";
1833}
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/57]

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

Definition at line 1305 of file htmldocvisitor.cpp.

1306{
1307 if (m_hide) return;
1308
1309 //printf("> DocPara\n");
1310 //dumpDocNodeList(p.children());
1311
1312 bool needsTag = determineIfNeedsTag(p);
1313 //printf(" needsTag=%d\n",needsTag);
1314 bool needsTagBefore = needsTag;
1315 bool needsTagAfter = needsTag;
1316
1317 // if the first element of a paragraph is something that should be outside of
1318 // the paragraph (<ul>,<dl>,<table>,..) then that will already started the
1319 // paragraph and we don't need to do it here
1320 if (!p.children().empty())
1321 {
1322 auto it = std::find_if(std::begin(p.children()),std::end(p.children()),
1323 [](const auto &node) { return !isInvisibleNode(node); });
1324 if (it!=std::end(p.children()))
1325 {
1326 const DocNodeVariant &n = *it;
1328 {
1329 needsTagBefore = FALSE;
1330 }
1331 }
1332 }
1333
1334 // check if this paragraph is the first or last or intermediate child of a <li> or <dd>.
1335 // this allows us to mark the tag with a special class so we can
1336 // fix the otherwise ugly spacing.
1337 bool isFirst = false;
1338 bool isLast = false;
1339 contexts_t t = getParagraphContext(p,isFirst,isLast);
1340 //printf("startPara first=%d last=%d\n",isFirst,isLast);
1341 if (isFirst && isLast) needsTagBefore=FALSE;
1342
1343 //printf(" needsTagBefore=%d\n",needsTagBefore);
1344 // write the paragraph tag (if needed)
1345 if (needsTagBefore)
1346 {
1347 if (contexts(t))
1348 m_t << "<p class=\"" << contexts(t) << "\"" << htmlAttribsToString(p.attribs()) << ">";
1349 else
1350 m_t << "<p" << htmlAttribsToString(p.attribs()) << ">";
1351 }
1352
1353 visitChildren(p);
1354
1355 // if the last element of a paragraph is something that should be outside of
1356 // the paragraph (<ul>,<dl>,<table>) then that will already have ended the
1357 // paragraph and we don't need to do it here
1358 if (!p.children().empty())
1359 {
1360 auto it = std::prev(std::end(p.children()));
1361 for (;;)
1362 {
1363 const DocNodeVariant &n = *it;
1364 if (!isInvisibleNode(n))
1365 {
1367 {
1368 needsTagAfter = FALSE;
1369 }
1370 // stop searching if we found a node that is visible
1371 break;
1372 }
1373 if (it==std::begin(p.children()))
1374 {
1375 // stop searching if we are at the beginning of the list
1376 break;
1377 }
1378 else
1379 {
1380 --it;
1381 }
1382 }
1383 }
1384
1385 //printf("endPara first=%d last=%d\n",isFirst,isLast);
1386 if (isFirst && isLast) needsTagAfter=FALSE;
1387
1388 //printf(" needsTagAfter=%d\n",needsTagAfter);
1389 if (needsTagAfter) m_t << "</p>\n";
1390 //printf("< DocPara\n");
1391}
const HtmlAttribList & attribs() const
Definition docnode.h:1076
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(), htmlAttribsToString(), isInvisibleNode(), m_hide, m_t, mustBeOutsideParagraph(), and visitChildren().

◆ operator()() [35/57]

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

Definition at line 1950 of file htmldocvisitor.cpp.

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

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/57]

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

Definition at line 1906 of file htmldocvisitor.cpp.

1907{
1908 if (m_hide) return;
1910 QCString className;
1911 QCString heading;
1912 switch(s.type())
1913 {
1915 heading=theTranslator->trParameters();
1916 className="params";
1917 break;
1919 heading=theTranslator->trReturnValues();
1920 className="retval";
1921 break;
1923 heading=theTranslator->trExceptions();
1924 className="exception";
1925 break;
1928 className="tparams";
1929 break;
1930 default:
1931 ASSERT(0);
1932 }
1933 m_t << "<dl class=\"" << className << "\"><dt>";
1934 m_t << heading;
1935 m_t << "</dt><dd>\n";
1936 m_t << " <table class=\"" << className << "\">\n";
1937 visitChildren(s);
1938 m_t << " </table>\n";
1939 m_t << " </dd>\n";
1940 m_t << "</dl>\n";
1942}
Type type() const
Definition docnode.h:1030
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, Translator::trExceptions(), Translator::trParameters(), Translator::trReturnValues(), Translator::trTemplateParameters(), DocParamSect::type(), and visitChildren().

◆ operator()() [37/57]

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

Definition at line 2082 of file htmldocvisitor.cpp.

2083{
2084 if (m_hide) return;
2085 visitChildren(pb);
2086}

References m_hide, and visitChildren().

◆ operator()() [38/57]

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

Definition at line 1863 of file htmldocvisitor.cpp.

1864{
1865 if (m_hide) return;
1866 if (!ref.file().isEmpty())
1867 {
1868 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1869 // ref.anchor() for LaTeX/RTF
1870 startLink(ref.ref(),ref.file(),ref.relPath(),ref.isSubPage() ? QCString() : ref.anchor());
1871 }
1872 if (!ref.hasLinkText()) filter(ref.targetTitle());
1873 visitChildren(ref);
1874 if (!ref.file().isEmpty()) endLink();
1875 //m_t << " ";
1876}
QCString relPath() const
Definition docnode.h:745
QCString targetTitle() const
Definition docnode.h:748
bool isSubPage() const
Definition docnode.h:754
QCString file() const
Definition docnode.h:744
QCString ref() const
Definition docnode.h:746
bool hasLinkText() const
Definition docnode.h:750

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()() [39/57]

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

Definition at line 1393 of file htmldocvisitor.cpp.

1394{
1395 //printf("> DocRoot\n");
1396 //dumpDocNodeList(r.children());
1397 visitChildren(r);
1398 //printf("< DocRoot\n");
1399}

References visitChildren().

◆ operator()() [40/57]

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

Definition at line 1878 of file htmldocvisitor.cpp.

1879{
1880 if (m_hide) return;
1881 if (!ref.file().isEmpty())
1882 {
1883 m_t << "<li>";
1884 startLink(ref.ref(),ref.file(),ref.relPath(),ref.isSubPage() ? QCString() : ref.anchor());
1885 }
1886 visitChildren(ref);
1887 if (!ref.file().isEmpty())
1888 {
1889 endLink();
1890 m_t << "</li>\n";
1891 }
1892}
QCString relPath() const
Definition docnode.h:903
QCString file() const
Definition docnode.h:901
QCString ref() const
Definition docnode.h:904
bool isSubPage() const
Definition docnode.h:906

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

◆ operator()() [41/57]

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

Definition at line 1894 of file htmldocvisitor.cpp.

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

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

◆ operator()() [42/57]

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

Definition at line 1485 of file htmldocvisitor.cpp.

1486{
1487 if (m_hide) return;
1489 m_t << "<h" << s.level() << ">";
1490 m_t << "<a class=\"anchor\" id=\"" << s.anchor();
1491 m_t << "\"></a>\n";
1492 if (s.title())
1493 {
1494 std::visit(*this,*s.title());
1495 }
1496 m_t << "</h" << s.level() << ">\n";
1497 visitChildren(s);
1499}
int level() const
Definition docnode.h:880
QCString anchor() const
Definition docnode.h:882
const DocNodeVariant * title() const
Definition docnode.h:881

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

◆ operator()() [43/57]

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

Definition at line 1944 of file htmldocvisitor.cpp.

1945{
1946 if (m_hide) return;
1947 m_t << "&#160;" << s.chars() << "&#160;";
1948}
QCString chars() const
Definition docnode.h:348

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

◆ operator()() [44/57]

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

Definition at line 1461 of file htmldocvisitor.cpp.

1462{
1463 if (m_hide) return;
1465 m_t << "<ul>";
1466 if (!sl.isPreformatted()) m_t << "\n";
1467 visitChildren(sl);
1468 m_t << "</ul>";
1469 if (!sl.isPreformatted()) m_t << "\n";
1471}

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

◆ operator()() [45/57]

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

Definition at line 1473 of file htmldocvisitor.cpp.

1474{
1475 if (m_hide) return;
1476 m_t << "<li>";
1477 if (li.paragraph())
1478 {
1479 visit(*this,*li.paragraph());
1480 }
1481 m_t << "</li>";
1482 if (!li.isPreformatted()) m_t << "\n";
1483}
const DocNodeVariant * paragraph() const
Definition docnode.h:1119

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

◆ operator()() [46/57]

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

Definition at line 1401 of file htmldocvisitor.cpp.

1402{
1403 if (m_hide) return;
1405 m_t << "<dl class=\"section " << s.typeString() << "\"><dt>";
1406 switch(s.type())
1407 {
1408 case DocSimpleSect::See:
1409 m_t << theTranslator->trSeeAlso(); break;
1411 m_t << theTranslator->trReturns(); break;
1413 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
1415 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
1417 m_t << theTranslator->trVersion(); break;
1419 m_t << theTranslator->trSince(); break;
1421 m_t << theTranslator->trDate(); break;
1423 m_t << theTranslator->trNote(); break;
1425 m_t << theTranslator->trWarning(); break;
1426 case DocSimpleSect::Pre:
1427 m_t << theTranslator->trPrecondition(); break;
1429 m_t << theTranslator->trPostcondition(); break;
1431 m_t << theTranslator->trCopyright(); break;
1433 m_t << theTranslator->trInvariant(); break;
1435 m_t << theTranslator->trRemarks(); break;
1437 m_t << theTranslator->trAttention(); break;
1439 m_t << theTranslator->trImportant(); break;
1440 case DocSimpleSect::User: break;
1441 case DocSimpleSect::Rcs: break;
1442 case DocSimpleSect::Unknown: break;
1443 }
1444
1445 if (s.title())
1446 {
1447 std::visit(*this,*s.title());
1448 }
1449 m_t << "</dt><dd>";
1450 visitChildren(s);
1451 m_t << "</dd></dl>\n";
1453}
QCString typeString() const
Definition docnode.cpp:2922
Type type() const
Definition docnode.h:988
const DocNodeVariant * title() const
Definition docnode.h:995
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(), Translator::trAttention(), Translator::trAuthor(), Translator::trCopyright(), Translator::trDate(), Translator::trImportant(), Translator::trInvariant(), Translator::trNote(), Translator::trPostcondition(), Translator::trPrecondition(), Translator::trRemarks(), Translator::trReturns(), Translator::trSeeAlso(), Translator::trSince(), TRUE, Translator::trVersion(), Translator::trWarning(), DocSimpleSect::type(), DocSimpleSect::typeString(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [47/57]

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

Definition at line 1001 of file htmldocvisitor.cpp.

1002{
1003 m_t << "</dd>\n";
1004 m_t << "<dd>\n";
1005}

References m_t.

◆ operator()() [48/57]

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

Definition at line 482 of file htmldocvisitor.cpp.

483{
484 if (m_hide) return;
485 switch (s.style())
486 {
488 if (s.enable()) m_t << "<b" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</b>";
489 break;
491 if (s.enable()) m_t << "<s" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</s>";
492 break;
494 if (s.enable()) m_t << "<strike" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</strike>";
495 break;
497 if (s.enable()) m_t << "<del" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</del>";
498 break;
500 if (s.enable()) m_t << "<u" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</u>";
501 break;
503 if (s.enable()) m_t << "<ins" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</ins>";
504 break;
506 if (s.enable()) m_t << "<em" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</em>";
507 break;
509 if (s.enable()) m_t << "<code" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</code>";
510 break;
512 if (s.enable()) m_t << "<sub" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</sub>";
513 break;
515 if (s.enable()) m_t << "<sup" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</sup>";
516 break;
518 if (s.enable())
519 {
521 m_t << "<center" << htmlAttribsToString(s.attribs()) << ">";
522 }
523 else
524 {
525 m_t << "</center>";
527 }
528 break;
530 if (s.enable()) m_t << "<small" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</small>";
531 break;
533 if (s.enable()) m_t << "<cite" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</cite>";
534 break;
536 if (s.enable())
537 {
539 m_t << "<pre" << htmlAttribsToString(s.attribs()) << ">";
541 }
542 else
543 {
545 m_t << "</pre>";
547 }
548 break;
550 if (s.enable())
551 {
553 m_t << "<div" << htmlAttribsToString(s.attribs()) << ">";
554 }
555 else
556 {
557 m_t << "</div>";
559 }
560 break;
562 if (s.enable()) m_t << "<span" << htmlAttribsToString(s.attribs()) << ">"; else m_t << "</span>";
563 break;
564 }
565}
const HtmlAttribList & attribs() const
Definition docnode.h:294
Style style() const
Definition docnode.h:290
bool enable() const
Definition docnode.h:292

References DocStyleChange::attribs(), DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable(), FALSE, forceEndParagraph(), forceStartParagraph(), htmlAttribsToString(), DocStyleChange::Ins, DocStyleChange::Italic, 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()() [49/57]

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

Definition at line 365 of file htmldocvisitor.cpp.

366{
367 if (m_hide) return;
368 if (m_insideTitle &&
369 (s.symbol()==HtmlEntityMapper::Sym_Quot || s.symbol()==HtmlEntityMapper::Sym_quot)) // escape "'s inside title="..."
370 {
371 m_t << "&quot;";
372 }
373 else
374 {
375 const char *res = HtmlEntityMapper::instance().html(s.symbol());
376 if (res)
377 {
378 m_t << res;
379 }
380 else
381 {
382 err("HTML: non supported HTML-entity found: %s\n",
384 }
385 }
386}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:311
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:84

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

◆ operator()() [50/57]

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

Definition at line 2039 of file htmldocvisitor.cpp.

2040{
2041 visitChildren(t);
2042}

References visitChildren().

◆ operator()() [51/57]

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

Definition at line 1455 of file htmldocvisitor.cpp.

1456{
1457 if (m_hide) return;
1458 visitChildren(t);
1459}

References m_hide, and visitChildren().

◆ operator()() [52/57]

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

Definition at line 430 of file htmldocvisitor.cpp.

431{
432 if (m_hide) return;
433 if (u.isEmail()) // mail address
434 {
435 QCString url = u.url();
436 // obfuscate the mail address link
438 if (!Config_getBool(OBFUSCATE_EMAILS))
439 {
440 m_t << url;
441 }
442 else
443 {
444 const char *p = url.data();
445 // also obfuscate the address as shown on the web page
446 uint32_t size=5;
447 while (*p)
448 {
449 for (uint32_t j=0;j<size && *p;j++)
450 {
451 p = writeUTF8Char(m_t,p);
452 }
453 if (*p) m_t << "<span class=\"obfuscator\">.nosp@m.</span>";
454 if (size==5) size=4; else size=5;
455 }
456 }
457 m_t << "</a>";
458 }
459 else // web address
460 {
461 m_t << "<a href=\"";
462 m_t << u.url() << "\">";
463 filter(u.url());
464 m_t << "</a>";
465 }
466}
QCString url() const
Definition docnode.h:190
bool isEmail() const
Definition docnode.h:191
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()() [53/57]

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

Definition at line 569 of file htmldocvisitor.cpp.

570{
571 if (m_hide) return;
572 QCString lang = m_langExt;
573 if (!s.language().isEmpty()) // explicit language setting
574 {
575 lang = s.language();
576 }
577 SrcLangExt langExt = getLanguageFromCodeLang(lang);
578 switch(s.type())
579 {
582 m_ci.startCodeFragment("DoxyCode");
584 s.context(),
585 s.text(),
586 langExt,
587 s.isExample(),
588 s.exampleFile(),
589 nullptr, // fileDef
590 -1, // startLine
591 -1, // endLine
592 FALSE, // inlineFragment
593 nullptr, // memberDef
594 TRUE, // show line numbers
595 m_ctx // search context
596 );
597 m_ci.endCodeFragment("DoxyCode");
599 break;
602 m_t << "<pre class=\"fragment\">";
603 filter(s.text());
604 m_t << "</pre>";
606 break;
608 filter(s.text(), true);
609 break;
611 m_t << "<code class=\"JavaDocCode\">";
612 filter(s.text(), true);
613 m_t << "</code>";
614 break;
616 {
617 if (s.isBlock()) forceEndParagraph(s);
618 m_t << s.text();
619 if (s.isBlock()) forceStartParagraph(s);
620 }
621 break;
627 /* nothing */
628 break;
629
630 case DocVerbatim::Dot:
631 {
632 static int dotindex = 1;
633 QCString fileName(4096, QCString::ExplicitSize);
634
636 fileName.sprintf("%s%d%s",
637 qPrint(Config_getString(HTML_OUTPUT)+"/inline_dotgraph_"),
638 dotindex++,
639 ".dot"
640 );
641 std::ofstream file = Portable::openOutputStream(fileName);
642 if (!file.is_open())
643 {
644 err("Could not open file %s for writing\n",qPrint(fileName));
645 }
646 else
647 {
648 QCString stext = s.text();
649 file.write( stext.data(), stext.length() );
650 file.close();
651
652 m_t << "<div class=\"dotgraph\">\n";
653 writeDotFile(fileName,s.relPath(),s.context(),s.srcFile(),s.srcLine());
654 visitCaption(m_t, s);
655 m_t << "</div>\n";
656
657 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
658 }
660 }
661 break;
662 case DocVerbatim::Msc:
663 {
665
666 static int mscindex = 1;
667 QCString baseName(4096, QCString::ExplicitSize);
668
669 baseName.sprintf("%s%d",
670 qPrint(Config_getString(HTML_OUTPUT)+"/inline_mscgraph_"),
671 mscindex++
672 );
673 std::ofstream file = Portable::openOutputStream(baseName.str()+".msc");
674 if (!file.is_open())
675 {
676 err("Could not open file %s.msc for writing\n",qPrint(baseName));
677 }
678 else
679 {
680 QCString text = "msc {";
681 text+=s.text();
682 text+="}";
683
684 file.write( text.data(), text.length() );
685 file.close();
686
687 m_t << "<div class=\"mscgraph\">\n";
688 writeMscFile(baseName+".msc",s.relPath(),s.context(),s.srcFile(),s.srcLine());
689 visitCaption(m_t, s);
690 m_t << "</div>\n";
691
692 if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str()+".msc");
693 }
695 }
696 break;
698 {
700 QCString htmlOutput = Config_getString(HTML_OUTPUT);
702 PlantumlManager::OutputFormat format = PlantumlManager::PUML_BITMAP; // default : PUML_BITMAP
703 if (imgExt=="svg")
704 {
706 }
708 htmlOutput,s.exampleFile(),
709 s.text(),format,s.engine(),s.srcFile(),s.srcLine());
710 m_t << "<div class=\"plantumlgraph\">\n";
711 writePlantUMLFile(baseName,s.relPath(),s.context(),s.srcFile(),s.srcLine());
712 visitCaption(m_t, s);
713 m_t << "</div>\n";
715 }
716 break;
717 }
718}
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
QCString srcFile() const
Definition docnode.h:376
int srcLine() const
Definition docnode.h:377
QCString language() const
Definition docnode.h:367
bool isBlock() const
Definition docnode.h:368
bool isExample() const
Definition docnode.h:364
QCString context() const
Definition docnode.h:363
Type type() const
Definition docnode.h:361
QCString text() const
Definition docnode.h:362
QCString exampleFile() const
Definition docnode.h:365
QCString engine() const
Definition docnode.h:372
QCString relPath() const
Definition docnode.h:366
@ JavaDocLiteral
Definition docnode.h:357
void writePlantUMLFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
void visitCaption(TextStream &t, const T &n)
QCString writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
Definition plantuml.cpp:27
OutputFormat
Plant UML output image formats.
Definition plantuml.h:44
static PlantumlManager & instance()
Definition plantuml.cpp:155
@ ExplicitSize
Definition qcstring.h:126
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:638
const char * qPrint(const char *s)
Definition qcstring.h:652
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5490
QCString getDotImageExtension()
Definition util.cpp:6639

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), QCString::data(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, OutputCodeList::endCodeFragment(), DocVerbatim::engine(), err, DocVerbatim::exampleFile(), QCString::ExplicitSize, FALSE, 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(), OutputCodeList::startCodeFragment(), QCString::str(), DocVerbatim::text(), TRUE, DocVerbatim::type(), DocVerbatim::Verbatim, visitCaption(), writeDotFile(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [54/57]

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

Definition at line 2054 of file htmldocvisitor.cpp.

2055{
2056 if (m_hide) return;
2057 if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
2058 {
2061 m_t << "<p>";
2063 m_t << " ";
2064 m_t << "<a href=\"";
2065 m_t << fname;
2066 m_t << ".svg\">";
2068 m_t << "</a>";
2069 if (vf.hasCaption())
2070 {
2071 m_t << "<br />";
2072 }
2073 }
2074 visitChildren(vf);
2075 if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
2076 {
2077 m_t << "</p>";
2079 }
2080}
virtual const QCString & name() const =0
bool hasCaption() const
Definition docnode.h:715
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, Translator::trFlowchart(), and visitChildren().

◆ operator()() [55/57]

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

Definition at line 352 of file htmldocvisitor.cpp.

353{
354 if (m_hide) return;
355 if (m_insidePre)
356 {
357 m_t << w.chars();
358 }
359 else
360 {
361 m_t << " ";
362 }
363}
QCString chars() const
Definition docnode.h:337

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

◆ operator()() [56/57]

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

Definition at line 337 of file htmldocvisitor.cpp.

338{
339 if (m_hide) return;
340 filter(w.word());
341}
QCString word() const
Definition docnode.h:154

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

◆ operator()() [57/57]

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

Definition at line 2002 of file htmldocvisitor.cpp.

2003{
2004 if (m_hide) return;
2005 if (x.title().isEmpty()) return;
2006
2008 bool anonymousEnum = x.file()=="@";
2009 if (!anonymousEnum)
2010 {
2011 QCString fn = x.file();
2013 m_t << "<dl class=\"" << x.key() << "\"><dt><b><a class=\"el\" href=\""
2014 << x.relPath() << fn
2015 << "#" << x.anchor() << "\">";
2016 }
2017 else
2018 {
2019 m_t << "<dl class=\"" << x.key() << "\"><dt><b>";
2020 }
2021 filter(x.title());
2022 if (!anonymousEnum) m_t << "</a>";
2023 m_t << "</b></dt><dd>";
2024 visitChildren(x);
2025 if (x.title().isEmpty()) return;
2026 m_t << "</dd></dl>\n";
2028}
QCString anchor() const
Definition docnode.h:596
QCString key() const
Definition docnode.h:599
QCString relPath() const
Definition docnode.h:598
QCString file() const
Definition docnode.h:595
QCString title() const
Definition docnode.h:597
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5171

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 2172 of file htmldocvisitor.cpp.

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

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 320 of file htmldocvisitor.cpp.

321{
322 if (n.hasCaption())
323 {
324 t << "<div class=\"caption\">\n";
325 for (const auto &child : n.children())
326 {
327 std::visit(*this, child);
328 }
329 t << "</div>\n";
330 }
331}

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 2227 of file htmldocvisitor.cpp.

2229{
2230 QCString baseName=makeBaseName(fileName);
2231 baseName.prepend("dia_");
2232 QCString outDir = Config_getString(HTML_OUTPUT);
2233 writeDiaGraphFromFile(fileName,outDir,baseName,DIA_BITMAP,srcFile,srcLine);
2234
2235 m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />\n";
2236}
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
@ DIA_BITMAP
Definition dia.h:23
static QCString makeBaseName(const QCString &name)

References Config_getString, DIA_BITMAP, 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 2203 of file htmldocvisitor.cpp.

2205{
2206 QCString baseName=makeBaseName(fn);
2207 baseName.prepend("dot_");
2208 QCString outDir = Config_getString(HTML_OUTPUT);
2209 writeDotGraphFromFile(fn,outDir,baseName,GOF_BITMAP,srcFile,srcLine);
2210 writeDotImageMapFromFile(m_t,fn,outDir,relPath,baseName,context,-1,srcFile,srcLine);
2211}
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
@ GOF_BITMAP
Definition dotgraph.h:29

References Config_getString, GOF_BITMAP, 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 2213 of file htmldocvisitor.cpp.

2215{
2216 QCString baseName=makeBaseName(fileName);
2217 baseName.prepend("msc_");
2218 QCString outDir = Config_getString(HTML_OUTPUT);
2219 QCString imgExt = getDotImageExtension();
2220 MscOutputFormat mscFormat = MSC_BITMAP;
2221 if ("svg" == imgExt)
2222 mscFormat = MSC_SVG;
2223 writeMscGraphFromFile(fileName,outDir,baseName,mscFormat,srcFile,srcLine);
2224 writeMscImageMapFromFile(m_t,fileName,outDir,relPath,baseName,context,mscFormat,srcFile,srcLine);
2225}
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:229
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:156
MscOutputFormat
Definition msc.h:22
@ MSC_SVG
Definition msc.h:22
@ MSC_BITMAP
Definition msc.h:22

References Config_getString, getDotImageExtension(), m_t, makeBaseName(), MSC_BITMAP, MSC_SVG, QCString::prepend(), writeMscGraphFromFile(), and writeMscImageMapFromFile().

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

◆ writeObfuscatedMailAddress()

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

Definition at line 402 of file htmldocvisitor.cpp.

403{
404 if (!Config_getBool(OBFUSCATE_EMAILS))
405 {
406 m_t << "<a href=\"mailto:" << url << "\">";
407 }
408 else
409 {
410 m_t << "<a href=\"#\" onclick=\"location.href='mai'+'lto:'";
411 if (!url.isEmpty())
412 {
413 const char *p = url.data();
414 uint32_t size=3;
415 while (*p)
416 {
417 m_t << "+'";
418 for (uint32_t j=0;j<size && *p;j++)
419 {
420 p = writeUTF8Char(m_t,p);
421 }
422 m_t << "'";
423 if (size==3) size=2; else size=3;
424 }
425 }
426 m_t << "; return false;\">";
427 }
428}

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 2238 of file htmldocvisitor.cpp.

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

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

Referenced by operator()().

Member Data Documentation

◆ m_ci

OutputCodeList& HtmlDocVisitor::m_ci
private

Definition at line 144 of file htmldocvisitor.h.

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

◆ m_ctx

const Definition* HtmlDocVisitor::m_ctx
private

Definition at line 148 of file htmldocvisitor.h.

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

◆ m_fileName

QCString HtmlDocVisitor::m_fileName
private

Definition at line 149 of file htmldocvisitor.h.

Referenced by startLink().

◆ m_hide

◆ m_insidePre

bool HtmlDocVisitor::m_insidePre = false
private

Definition at line 145 of file htmldocvisitor.h.

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

◆ m_insideTitle

bool HtmlDocVisitor::m_insideTitle = false
private

Definition at line 147 of file htmldocvisitor.h.

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

◆ m_langExt

QCString HtmlDocVisitor::m_langExt
private

Definition at line 150 of file htmldocvisitor.h.

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

◆ m_t


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