浏览该文件的文档.
65 static const char *
hex=
"0123456789ABCDEF";
72 result += cntStr.
setNum(cnt);
75 const char *str = word.
data();
81 if ((c >=
'a' && c <=
'z') ||
82 (c >=
'A' && c <=
'Z') ||
83 (c >=
'0' && c <=
'9') ||
95 enc[1] =
hex[(c & 0xf0) >> 4];
96 enc[2] =
hex[c & 0xf];
153 return !((
DocImage*)n)->isInlineImage();
218 for (
const auto &att : attribs)
220 auto it = std::find_if(mergeInto.begin(),mergeInto.end(),
221 [&att](
const auto &opt) { return opt.name==att.name; });
222 if (it!=mergeInto.end())
224 it->value = it->value +
" " + att.value;
228 mergeInto.push_back(att);
236 for (
const auto &att : attribs)
238 if (!att.value.isEmpty())
242 if (att.name==
"alt" && pAltValue)
246 *pAltValue = att.value;
255 else if (att.name==
"nowrap")
259 result+=
"=\"nowrap\"";
270 m_hide(
FALSE), m_ctx(ctx)
328 m_t <<
"<span class=\"emoji\">"<<res<<
"</span>";
338 m_t <<
"<a href=\"#\" onclick=\"location.href='mai'+'lto:'";
343 m_t <<
"+'" << url.
mid(i,size) <<
"'";
345 if (size==3) size=2;
else size=3;
347 m_t <<
"; return false;\">";
361 if (i<url.
length()-size)
m_t <<
"<span style=\"display: none;\">.nosp@m.</span>";
363 if (size==5) size=4;
else size=5;
478 t <<
"<div class=\"caption\">\n";
494 for (
const auto &n : children) n->accept(parent);
530 m_t <<
"<pre class=\"fragment\">";
552 static int dotindex = 1;
561 std::ofstream file(fileName.
str(),std::ofstream::out | std::ofstream::binary);
564 err(
"Could not open file %s for writing\n",
qPrint(fileName));
572 m_t <<
"<div class=\"dotgraph\">\n";
588 static int mscindex = 1;
595 std::ofstream file(baseName.
str()+
".msc",std::ofstream::out | std::ofstream::binary);
598 err(
"Could not open file %s.msc for writing\n",
qPrint(baseName));
609 m_t <<
"<div class=\"mscgraph\">\n";
634 m_t <<
"<div class=\"plantumlgraph\">\n";
720 m_t <<
"<pre class=\"fragment\">";
774 err(
"Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
775 "Please create a bug report\n",__FILE__);
844 m_t <<
"<p class=\"formulaDsp\">\n";
850 bool closeInline =
FALSE;
851 if (!bDisplay && !text.
isEmpty() && text.
at(0)==
'$' &&
858 else if (!bDisplay && !text.
isEmpty())
871 m_t <<
"<img class=\"formula"
872 << (bDisplay ?
"Dsp" :
"Inl");
877 if (
Config_getEnum(HTML_FORMULA_FORMAT)==HTML_FORMULA_FORMAT_t::svg)
910 m_t <<
"<a id=\"" << anchor <<
"\" name=\"" << anchor <<
"\"></a>";
1009 return !parent->children().empty() && parent->children().front().get()==node;
1015 return !parent->children().empty() && parent->children().back().get()==node;
1021 auto it = std::find_if(nodes.begin(),nodes.end(),[par](
const auto &n) { return n.get()==par; });
1022 if (it==nodes.end())
return FALSE;
1023 size_t i = it - nodes.begin();
1024 size_t count = parent->
children().size();
1025 if (count>1 && i==0)
1032 else if (count>1 && i==count-1)
1039 else if (count>2 && i>0 && i<count-1)
1108 if (!isFirst && !isLast)
1148 if (isLast) t=
ENDLI;
1149 if (!isFirst && !isLast) t =
INTERLI;
1155 if (isLast) t=
ENDLI;
1156 if (!isFirst && !isLast) t =
INTERLI;
1162 if (isLast) t=
ENDDD;
1163 if (!isFirst && !isLast) t =
INTERDD;
1169 if (isLast) t=
ENDDD;
1170 if (!isFirst && !isLast) t =
INTERDD;
1176 if (isLast) t=
ENDDD;
1182 isFirst=isLast=
TRUE;
1184 if (!isFirst && !isLast) t =
INTERDD;
1190 if (isLast) t=
ENDTD;
1191 if (!isFirst && !isLast) t =
INTERTD;
1209 bool needsTag =
FALSE;
1239 size_t nodeIndex = 0;
1240 if (p && nodeIndex<p->children().size())
1246 if (nodeIndex<p->children().size())
1264 if (isFirst && isLast) needsTag=
FALSE;
1283 bool needsTag =
FALSE;
1315 int nodeIndex =
static_cast<int>(p->
children().size()-1);
1334 if (isFirst && isLast) needsTag=
FALSE;
1338 if (needsTag)
m_t <<
"</p>\n";
1354 m_t <<
"<dl class=\"section " << s->
typeString() <<
"\"><dt>";
1402 m_t <<
"</dd></dl>\n";
1451 m_t <<
"<a class=\"anchor\" id=\"" << s->
anchor();
1454 m_t <<
"</h" << s->
level() <<
">\n";
1554 m_t <<
"<a class=\"anchor\" id=\"" << anc <<
"\"></a>\n";
1561 m_t <<
"<table class=\"doxtable\">\n";
1572 m_t <<
"</table>\n";
1616 m_t <<
"</caption>\n";
1635 if (href->
url().
left(7)==
"mailto:")
1663 m_t <<
"</h" << header->
level() <<
">\n";
1672 bool typeSVG = img->
isSVG();
1682 if ((i=baseName.
findRev(
'/'))!=-1 || (i=baseName.
findRev(
'\\'))!=-1)
1686 if (!inlineImage)
m_t <<
"<div class=\"image\">\n";
1690 sizeAttribs+=
" width=\""+img->
width()+
"\"";
1694 sizeAttribs+=
" height=\""+img->
height()+
"\"";
1703 opt.
value =
"pointer-events: none;";
1704 extraAttribs.push_back(opt);
1718 if (typeSVG && !inlineImage)
1721 <<
"\"" << sizeAttribs << attrs;
1728 m_t <<
">" << alt <<
"</object>\n";
1733 m_t <<
"<img src=\"" <<
convertToHtml(src) <<
"\" alt=\"" << alt <<
"\"" << sizeAttribs << attrs;
1736 m_t <<
" class=\"inline\"";
1751 m_t <<
"<div class=\"caption\">\n";
1754 else if (inlineImage)
1798 m_t <<
"<div class=\"dotgraph\">\n";
1802 m_t <<
"<div class=\"caption\">\n";
1819 m_t <<
"<div class=\"mscgraph\">\n";
1823 m_t <<
"<div class=\"caption\">\n";
1839 m_t <<
"<div class=\"diagraph\">\n";
1843 m_t <<
"<div class=\"caption\">\n";
1912 m_t <<
"<ul class=\"multicol\">\n";
1941 className=
"exception";
1945 className=
"tparams";
1950 m_t <<
"<dl class=\"" << className <<
"\"><dt>";
1952 m_t <<
"</dt><dd>\n";
1953 m_t <<
" <table class=\"" << className <<
"\">\n";
1959 m_t <<
" </table>\n";
1977 m_t <<
"<td class=\"paramdir\">";
1999 m_t <<
"<td class=\"paramtype\">";
2017 m_t <<
"<td class=\"paramname\">";
2021 if (!first)
m_t <<
",";
else first=
FALSE;
2038 m_t <<
"</td></tr>\n";
2047 bool anonymousEnum = x->
file()==
"@";
2050 m_t <<
"<dl class=\"" << x->
key() <<
"\"><dt><b><a class=\"el\" href=\""
2052 <<
"#" << x->
anchor() <<
"\">";
2056 m_t <<
"<dl class=\"" << x->
key() <<
"\"><dt><b>";
2060 if (!anonymousEnum)
m_t <<
"</a>";
2061 m_t <<
"</b></dt><dd>";
2068 m_t <<
"</dd></dl>\n";
2104 m_t <<
"</blockquote>\n";
2116 m_t <<
"flowchart: " ;
2117 m_t <<
"<a href=\"";
2154 const char *p=str.
data();
2161 case '<':
m_t <<
"<";
break;
2162 case '>':
m_t <<
">";
break;
2163 case '&':
m_t <<
"&";
break;
2164 case '\\':
if ((*p ==
'(') || (*p ==
')'))
2165 m_t <<
"\\‍" << *p++;
2174 m_t <<
"$" <<
hex[uc>>4] <<
hex[uc&0xF] <<
";";
2191 const char *p=str.
data();
2198 case '&':
m_t <<
"&";
break;
2199 case '"':
m_t <<
""";
break;
2200 case '<':
m_t <<
"<";
break;
2201 case '>':
m_t <<
">";
break;
2202 case '\\':
if ((*p ==
'(') || (*p ==
')'))
2203 m_t <<
"\\‍" << *p++;
2212 m_t <<
"$" <<
hex[uc>>4] <<
hex[uc&0xF] <<
";";
2231 m_t <<
"<a class=\"elRef\" ";
2236 m_t <<
"<a class=\"el\" ";
2260 if ((i=baseName.
findRev(
'/'))!=-1)
2264 if ((i=baseName.
find(
'.'))!=-1)
2266 baseName=baseName.
left(i);
2279 if ((i=baseName.
findRev(
'/'))!=-1)
2283 if ((i=baseName.
find(
'.'))!=-1)
2285 baseName=baseName.
left(i);
2291 if (
"svg" == imgExt)
2302 if ((i=baseName.
findRev(
'/'))!=-1)
2306 if ((i=baseName.
find(
'.'))!=-1)
2308 baseName=baseName.
left(i);
2314 m_t <<
"<img src=\"" << relPath << baseName <<
".png" <<
"\" />\n";
2322 if ((i=baseName.
findRev(
'/'))!=-1)
2326 if ((i=baseName.
findRev(
'.'))!=-1)
2328 baseName=baseName.
left(i);
2338 m_t <<
"<object type=\"image/svg+xml\" data=\"" << relPath << baseName <<
".svg\"></object>\n";
2343 m_t <<
"<img src=\"" << relPath << baseName <<
".png" <<
"\" />\n";
2356 bool styleOutsideParagraph=
FALSE;
2357 while (nodeIndex>=0 && !styleOutsideParagraph)
2365 styleMask|=(int)sc->
style();
2371 if (sc->
enable() && (styleMask&(int)sc->
style())==0 &&
2375 styleOutsideParagraph=
TRUE;
2380 return styleOutsideParagraph;
2394 auto it = std::find_if(children.begin(),children.end(),[n](
const auto &np) { return np.get()==n; });
2395 if (it==children.end())
return;
2396 int nodeIndex =
static_cast<int>(it - children.begin());
2398 if (nodeIndex<0)
return;
2403 if (nodeIndex<0)
return;
2404 n = children.at(nodeIndex).get();
2412 if (isFirst && isLast)
return;
2413 if (styleOutsideParagraph)
return;
2430 auto it = std::find_if(children.begin(),children.end(),[n](
const auto &np) { return np.get()==n; });
2431 if (it==children.end())
return;
2432 int nodeIndex =
static_cast<int>(it - children.begin());
2433 int numNodes =
static_cast<int>(para->
children().size());
2435 if (styleOutsideParagraph)
return;
2437 if (nodeIndex==numNodes)
return;
2442 if (nodeIndex<numNodes)
2444 n = para->
children().at(nodeIndex).get();
2452 bool needsTag =
TRUE;
2456 if (isFirst && isLast) needsTag =
FALSE;
2459 if (needsTag)
m_t <<
"<p>";
Node representing an HTML blockquote
static const MemberDef * getFlowMember()
Node representing an item of a auto list
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
QCString getDotImageExtension()
Node representing a Hypertext reference
virtual QCString getDefFileExtension() const =0
Node representing a style change
const int DocVisitor_Html
Node representing a verbatim, unparsed text fragment
DocHtmlCaption * caption() const
virtual QCString trCopyright()=0
DocNodeList & paramTypes()
Node representing a simple section title
static const char types[][NUM_HTML_LIST_TYPES]
virtual QCString trPostcondition()=0
Node representing a paragraph in the documentation tree
bool isInlineImage() const
static bool isDocIncludeVisible(const DocInclude *s)
static QCString convertNameToFileName()
bool isPreformatted() const
static const int NUM_HTML_LIST_TYPES
Node representing a dot file
void pushHidden(bool hide)
#define Config_getEnum(name)
const HtmlAttribList & attribs() const
Node representing a HTML table
void writeDiaFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
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)
void startLink(const QCString &ref, const QCString &file, const QCString &relPath, const QCString &anchor, const QCString &tooltip="")
virtual QCString trNote()=0
The common base class of all entity definitions found in the sources.
const HtmlAttribList & attribs() const
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Class representing a directory in the file system
const HtmlAttribList & attribs() const
Root node of documentation tree
void visitPre(DocAutoList *)
uint length() const
Returns the length of the string, not counting the 0-terminator.
Class representing a list of HTML attributes.
OutputFormat
Plant UML output image formats
int findRev(char c, int index=-1, bool cs=TRUE) const
virtual QCString trExceptions()=0
Node representing a HTML list item
bool isEmpty() const
Returns TRUE iff the string is empty
void forceStartParagraph(DocNode *n)
Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the pa...
static QCString convertIndexWordToAnchor(const QCString &word)
Node representing a VHDL flow chart
Abstract node interface with type information.
const HtmlAttribList & attribs() const
static IndexList * indexList
static bool isDocIncOperatorVisible(const DocIncOperator *s)
Node representing a HTML description data
Node representing a Html description item
void filterQuotedCdataAttr(const QCString &str)
Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be...
Node representing a n emoji
Node representing a msc file
SrcLangExt
Language as given by extension
virtual QCString trReturns()=0
void addIndexItem(const Definition *context, const MemberDef *md, const QCString §ionAnchor=QCString(), const QCString &title=QCString())
QCString targetTitle() const
virtual void endCodeFragment(const QCString &style)=0
CodeOutputInterface & m_ci
QCString exampleFile() const
Node representing a reference to a section
static PlantumlManager & instance()
Node representing an anchor
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
virtual QCString trPrecondition()=0
static void visitPostCaption(TextStream &t, DocVerbatim *s)
void err(const char *fmt,...)
char & at(size_t i)
Returns a reference to the character at index i.
Text streaming class that buffers data.
const HtmlAttribList & attribs() const
Kind kind() const override
int find(char c, int index=0, bool cs=TRUE) const
Root node of a text fragment
const HtmlAttribList & attribs() const
bool isLastChildNode(T *parent, DocNode *node)
Abstract visitor that participates in the visitor pattern.
const MemberDef * member() const
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
virtual void startCodeFragment(const QCString &style)=0
Concrete visitor implementation for HTML output.
const HtmlAttribList & attribs() const
Node representing a Html description list
CodeParserInterface & getCodeParser(const QCString &langExt)
Node representing a include/dontinclude operator block
void writeDotFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
Node representing an entry in the index.
Node representing a list of section references
virtual QCString trSeeAlso()=0
Node representing a line break
Node representing a special symbol
virtual QCString anchor() const =0
static void mergeHtmlAttributes(const HtmlAttribList &attribs, HtmlAttribList &mergeInto)
QCString extractBlock(const QCString &text, const QCString &marker)
Returns the section of text, in between a pair of markers.
QCString addHtmlExtensionIfMissing(const QCString &fName)
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity
Node representing an item of a cross-referenced list
const HtmlAttribList & attribs() const
FileDef * createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Node representing an image
const HtmlAttribList & attribs() const
virtual Kind kind() const =0
static bool isspace(char c)
virtual QCString trVersion()=0
std::vector< std::unique_ptr< DocNode > > DocNodeList
QCString left(size_t len) const
Node representing a URL (or email address)
static bool isInvisibleNode(const DocNode *node)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
void visitPost(DocAutoList *)
const HtmlAttribList & attribs() const
Node representing a HTML table caption
void writeMscFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
const Definition * scope() const
const HtmlAttribList & attribs() const
Node representing a parameter list.
virtual QCString trAttention()=0
Translator * theTranslator
bool isSeparatedParagraph(DocSimpleSect *parent, DocPara *par)
virtual QCString name() const =0
Node representing a separator
QCString exampleFile() const
Node representing an block of paragraphs
bool isFirstChildNode(T *parent, DocNode *node)
Node representing a separator between two simple sections of the same type.
const HtmlAttribList & attribs() const
static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAltValue=0)
Node representing a citation of some bibliographic reference
virtual QCString trParameters()=0
Node representing a reference to some item
QCString typeString() const
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Node representing a parameter section
Class representing a HTML attribute.
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)
const DocNodeList & children() const
Node representing a Html list
virtual QCString trRemarks()=0
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
static int getParagraphContext(DocPara *p, bool &isFirst, bool &isLast)
DocParamSect::Direction direction() const
Node representing a simple section
Node representing a normal section
Node representing a horizontal ruler
QCString language() const
Node representing an included text block from file
QCString externalLinkTarget(const bool parent)
virtual void parseCode(CodeOutputInterface &codeOutIntf, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=0, bool showLineNumbers=TRUE, const Definition *searchCtx=0, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Node representing an auto List
QCString & setNum(short n)
virtual QCString trSince()=0
Node representing an internal section of documentation
virtual QCString trInvariant()=0
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
bool hasTypeSpecifier() const
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
std::string dirPath(bool absPath=true) const
Node representing a word that can be linked to something
const char * html(DocSymbol::SymType symb, bool useInPrintf=FALSE) const
Access routine to the html code of the HTML entity
#define Config_getBool(name)
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command
Output interface for code parser.
void writePlantUMLFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
Node representing a link to some item
static bool mustBeOutsideParagraph(const DocNode *n)
Node representing a dia file
Minimal replacement for QFileInfo.
static bool insideStyleChangeThatIsOutsideParagraph(DocPara *para, int nodeIndex)
Returns TRUE if the child nodes in paragraph para until nodeIndex contain a style change node that is...
const char * qPrint(const char *s)
#define Config_getString(name)
static void visitPreCaption(TextStream &t, DocVerbatim *s)
const HtmlAttribList & attribs() const
QCString convertCharEntitiesToUTF8(const QCString &str)
Node representing a simple list
QCString getFileNameExtension(const QCString &fn)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Node representing a simple list item
QCString convertToXML(const QCString &s, bool keepEntities)
QCString includeFileName() const
A model of a file symbol.
const DocNodeList & children() const
Node representing some amount of white space
const HtmlAttribList & attribs() const
static bool isDocVerbatimVisible(const DocVerbatim *s)
const HtmlAttribList & attribs() const
static EmojiEntityMapper * instance()
Returns the one and only instance of the Emoji entity mapper
std::string fileName() const
Node representing a HTML table cell
void filter(const QCString &str)
QCString extension() const
static void visitCaption(HtmlDocVisitor *parent, DocNodeList &children)
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
virtual QCString trDate()=0
bool hasInOutSpecifier() const
Node representing an internal reference to some item
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
DocNodeList & parameters()
void writeObfuscatedMailAddress(const QCString &url)
HtmlDocVisitor(TextStream &t, CodeOutputInterface &ci, const Definition *ctx)
A bunch of utility functions.
void forceEndParagraph(DocNode *n)
Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the pa...
const HtmlAttribList & attribs() const
Node representing a HTML table row
QCString right(size_t len) const
QCString & prepend(const char *s)
static const char * contexts[10]
QCString & sprintf(const char *format,...)
QCString convertToHtml(const QCString &s, bool keepEntities)
virtual QCString trTemplateParameters()=0
QCString exampleFile() const
virtual QCString trReturnValues()=0
Kind kind() const override
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
const HtmlAttribList & attribs() const
This is an alternative implementation of QCString.