浏览该文件的文档.
40 #define DB_VIS_C DB_VIS_C1(m_t)
41 #define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
42 #define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
43 #define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
48 #define DB_VIS_C2a(x,y)
56 const char *p=s.
data();
62 case ':': growBuf.
addStr(
"_1");
break;
63 default: growBuf.
addChar(c);
break;
72 return (name==
"align" ||
75 name==
"cellpadding" ||
76 name==
"cellspacing" ||
89 for (
const auto &n : children) n->accept(
this);
100 if (hasCaption && !inlineImage)
109 t <<
" <informalfigure>\n";
111 t <<
" <mediaobject>\n";
112 t <<
" <imageobject>\n";
120 if (!height.
isEmpty() && !inlineImage) t <<
" width=\"50%\"";
126 t <<
" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name <<
"\">";
127 t <<
"</imagedata>\n";
128 t <<
" </imageobject>\n";
129 if (hasCaption && !inlineImage)
138 if (hasCaption && !inlineImage)
142 t <<
" </mediaobject>\n";
143 if (hasCaption && !inlineImage)
149 t <<
" </informalfigure>\n";
233 m_t <<
"<link xlink:href=\"";
245 m_t <<
"\n<literallayout> 
</literallayout>\n";
254 m_t <<
"<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
255 m_t <<
"</entry></row></tbody></tgroup></informaltable>\n";
265 if (s->
enable())
m_t <<
"<emphasis role=\"bold\">";
else m_t <<
"</emphasis>";
268 if (s->
enable())
m_t <<
"<emphasis>";
else m_t <<
"</emphasis>";
271 if (s->
enable())
m_t <<
"<computeroutput>";
else m_t <<
"</computeroutput>";
274 if (s->
enable())
m_t <<
"<subscript>";
else m_t <<
"</subscript>";
277 if (s->
enable())
m_t <<
"<superscript>";
else m_t <<
"</superscript>";
280 if (s->
enable())
m_t <<
"<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
281 else m_t <<
"</entry></row></tbody></tgroup></informaltable>";
286 m_t <<
"<literallayout>";
291 m_t <<
"</literallayout>";
321 m_t <<
"<literallayout><computeroutput>";
327 m_t <<
"</computeroutput></literallayout>";
330 m_t <<
"<literallayout><computeroutput>";
332 m_t <<
"</computeroutput></literallayout>";
349 static int dotindex = 1;
354 name.
sprintf(
"%s%d",
"dot_inline_dotgraph_", dotindex);
359 std::string fileName = baseName.
str()+
".dot";
360 std::ofstream file(fileName,std::ofstream::out | std::ofstream::binary);
363 err(
"Could not open file %s for writing\n",fileName.c_str());
374 static int mscindex = 1;
379 name.
sprintf(
"%s%d",
"msc_inline_mscgraph_", mscindex);
384 std::string fileName = baseName.
str()+
".msc";
385 std::ofstream file(fileName,std::ofstream::out | std::ofstream::binary);
388 err(
"Could not open file %s for writing\n",fileName.c_str());
406 if ((i=shortName.
findRev(
'/'))!=-1)
408 shortName=shortName.
right((
int)shortName.
length()-i-1);
434 m_t <<
"<literallayout><computeroutput>";
443 m_t <<
"</computeroutput></literallayout>";
447 m_t <<
"<literallayout><computeroutput>";
453 m_t <<
"</computeroutput></literallayout>";
467 m_t <<
"<literallayout>";
469 m_t <<
"</literallayout>";
472 m_t <<
"<literallayout><computeroutput>";
480 m_t <<
"</computeroutput></literallayout>";
486 m_t <<
"<literallayout><computeroutput>";
501 m_t <<
"</computeroutput></literallayout>";
506 err(
"Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
507 "Please create a bug report\n",__FILE__);
519 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
571 else m_t <<
" <mediaobject>\n";
572 m_t <<
" <imageobject>\n";
573 m_t <<
" <imagedata ";
574 m_t <<
"align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f->
relPath() << f->
name() <<
".png\"/>\n";
575 m_t <<
" </imageobject>\n";
576 if (f->
isInline())
m_t <<
"</inlinemediaobject>\n";
577 else m_t <<
" </mediaobject>\n";
584 m_t <<
"<indexterm><primary>";
586 m_t <<
"</primary></indexterm>\n";
614 m_t <<
"<orderedlist>\n";
618 m_t <<
"<itemizedlist>\n";
628 m_t <<
"</orderedlist>\n";
632 m_t <<
"</itemizedlist>\n";
647 m_t <<
"</listitem>";
839 m_t <<
"<formalpara>\n";
856 m_t <<
"</formalpara>\n";
864 m_t <<
"</caution>\n";
867 m_t <<
"</warning>\n";
870 m_t <<
"</formalpara>\n";
893 m_t <<
"<itemizedlist>\n";
900 m_t <<
"</itemizedlist>\n";
914 m_t <<
"</listitem>\n";
932 m_t <<
"</section>\n";
947 m_t <<
"</orderedlist>\n";
949 m_t <<
"</itemizedlist>\n";
959 bool isFirst = l->
children().front().get()==s;
962 for (
const auto &opt : s->
attribs())
964 if (opt.name==
"value")
967 int val = opt.value.
toInt(&ok);
972 if (value>0 || isFirst)
974 for (
const auto &opt : l->
attribs())
976 if (opt.name==
"type")
979 type =
" numeration=\"arabic\"";
980 else if (opt.value==
"a")
981 type =
" numeration=\"loweralpha\"";
982 else if (opt.value==
"A")
983 type =
" numeration=\"upperalpha\"";
984 else if (opt.value==
"i")
985 type =
" numeration=\"lowerroman\"";
986 else if (opt.value==
"I")
987 type =
" numeration=\"upperroman\"";
989 else if (value==0 && opt.name==
"start")
992 int val = opt.value.
toInt(&ok);
998 if (value>0 && !isFirst)
1000 m_t <<
"</orderedlist>\n";
1002 if (value>0 || isFirst)
1004 m_t <<
"<orderedlist";
1006 if (value>0)
m_t <<
" startingnumber=\"" << value <<
"\"";
1012 m_t <<
"<itemizedlist>\n";
1014 m_t <<
"<listitem>\n";
1021 m_t <<
"</listitem>\n";
1028 m_t <<
"<variablelist>\n";
1035 m_t <<
"</variablelist>\n";
1042 m_t <<
"<varlistentry><term>";
1056 m_t <<
"<listitem>";
1063 m_t <<
"</listitem></varlistentry>\n";
1071 m_t <<
"<informaltable frame=\"all\">\n";
1072 m_t <<
" <tgroup cols=\"" << (
unsigned int)t->
numColumns() <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1076 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1086 m_t <<
" </tgroup>\n";
1087 m_t <<
"</informaltable>\n";
1110 for (
const auto &opt : tr->
attribs())
1128 m_t <<
"</thead><tbody>\n";
1140 for (
const auto &opt : c->
attribs())
1142 if (opt.name==
"colspan")
1145 int cols = opt.value.toInt();
1149 else if (opt.name==
"rowspan")
1151 int extraRows = opt.value.toInt() - 1;
1152 m_t <<
" morerows='" << extraRows <<
"'";
1154 else if (opt.name==
"class")
1156 if (opt.value.left(13)==
"markdownTable")
1158 if (opt.value.right(5)==
"Right")
1160 m_t <<
" align='right'";
1162 else if (opt.value.right(4)==
"Left")
1164 m_t <<
" align='left'";
1166 else if (opt.value.right(6)==
"Center")
1168 m_t <<
" align='center'";
1204 m_t <<
"</caption>\n";
1225 if (href->
url().
at(0) !=
'#')
1246 m_t <<
"<formalpara><title>";
1253 m_t <<
"</title></formalpara>\n";
1265 if ((i=baseName.
findRev(
'/'))!=-1 || (i=baseName.
findRev(
'\\'))!=-1)
1267 baseName=baseName.
right((
int)baseName.
length()-i-1);
1288 if ((i=baseName.
findRev(
'/'))!=-1 || (i=baseName.
findRev(
'\\'))!=-1)
1290 baseName=baseName.
right((
int)baseName.
length()-i-1);
1390 m_t <<
"<tocentry>";
1397 m_t <<
"</tocentry>\n";
1419 m_t <<
" <formalpara>\n";
1420 m_t <<
" <title>\n";
1430 m_t <<
"</title>\n";
1432 m_t <<
" <table frame=\"all\">\n";
1438 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1439 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1441 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1442 for (
int i = 1; i <= ncols; i++)
1444 if (i == ncols)
m_t <<
" <colspec colwidth=\"4*\"/>\n";
1445 else m_t <<
" <colspec colwidth=\"1*\"/>\n";
1447 m_t <<
" <tbody>\n";
1454 m_t <<
" </tbody>\n";
1455 m_t <<
" </tgroup>\n";
1456 m_t <<
" </table>\n";
1457 m_t <<
" </para>\n";
1458 m_t <<
" </formalpara>\n";
1519 m_t <<
"<entry></entry>\n";
1550 m_t <<
"</entry>\n";
1559 m_t <<
"<para><link linkend=\"_";
1608 m_t <<
"<blockquote>";
1615 m_t <<
"</blockquote>";
1671 if ((i=shortName.findRev(
'/'))!=-1)
1673 shortName=shortName.
right((
int)shortName.length()-i-1);
1687 if ((i=shortName.findRev(
'/'))!=-1)
1689 shortName=shortName.
right((
int)shortName.length()-i-1);
1710 if ((i=baseName.findRev(
'/'))!=-1)
1712 baseName=baseName.
right((
int)baseName.length()-i-1);
1714 if ((i=baseName.find(
'.'))!=-1)
1716 baseName=baseName.
left(i);
1722 visitPreStart(
m_t, children, hasCaption, baseName +
".png", width, height);
1738 if ((i=shortName.findRev(
'/'))!=-1)
1740 shortName=shortName.
right((
int)shortName.length()-i-1);
1761 if ((i=baseName.findRev(
'/'))!=-1)
1763 baseName=baseName.
right((
int)baseName.length()-i-1);
1765 if ((i=baseName.find(
'.'))!=-1)
1767 baseName=baseName.
left(i);
1773 visitPreStart(
m_t, children, hasCaption, baseName +
".png", width, height);
1789 if ((i=shortName.findRev(
'/'))!=-1)
1791 shortName=shortName.
right((
int)shortName.length()-i-1);
1812 if ((i=baseName.findRev(
'/'))!=-1)
1814 baseName=baseName.
right((
int)baseName.length()-i-1);
1816 if ((i=baseName.find(
'.'))!=-1)
1818 baseName=baseName.
left(i);
1825 visitPreStart(
m_t, children, hasCaption, baseName +
"." + imgExt, width, height);
Node representing an HTML blockquote
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
Node representing a style change
Node representing a verbatim, unparsed text fragment
virtual QCString trCopyright()=0
DocNodeList & paramTypes()
Node representing a simple section title
virtual QCString trPostcondition()=0
Node representing a paragraph in the documentation tree
bool isInlineImage() const
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Node representing a dot file
void pushHidden(bool hide)
const HtmlAttribList & attribs() const
Node representing a HTML table
virtual QCString trNote()=0
static FileNameLinkedMap * imageNameLinkedMap
bool remove(const std::string &path, bool acceptsAbsPath=true) const
void visitPost(DocAutoList *)
Class representing a directory in the file system
Root node of documentation tree
uint length() const
Returns the length of the string, not counting the 0-terminator.
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
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
size_t numColumns() const
Node representing a VHDL flow chart
Node representing a HTML description data
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Node representing a Html description item
Node representing a n emoji
Node representing a msc file
SrcLangExt
Language as given by extension
virtual QCString trReturns()=0
QCString targetTitle() const
QCString exampleFile() const
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s)
Node representing a reference to a section
static PlantumlManager & instance()
Node representing an anchor
DocbookDocVisitor(TextStream &t, CodeOutputInterface &ci, const QCString &langExt)
virtual QCString trPrecondition()=0
void err(const char *fmt,...)
void filter(const QCString &str)
char & at(size_t i)
Returns a reference to the character at index i.
Text streaming class that buffers data.
void addStr(const QCString &s)
Root node of a text fragment
void endDiaFile(bool hasCaption)
const HtmlAttribList & attribs() const
Abstract visitor that participates in the visitor pattern.
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
Node representing a Html description list
CodeParserInterface & getCodeParser(const QCString &langExt)
Class representing a string buffer optimised for growing.
Node representing a include/dontinclude operator block
Node representing an entry in the index.
Node representing a list of section references
virtual QCString trSeeAlso()=0
CodeOutputInterface & m_ci
Node representing a line break
Node representing a special symbol
QCString extractBlock(const QCString &text, const QCString &marker)
Returns the section of text, in between a pair of markers.
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
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
void startLink(const QCString &file, const QCString &anchor)
virtual QCString trVersion()=0
std::vector< std::unique_ptr< DocNode > > DocNodeList
QCString left(size_t len) const
Node representing a URL (or email address)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Node representing a HTML table caption
Node representing a parameter list.
virtual QCString trAttention()=0
Translator * theTranslator
const int DocVisitor_Docbook
Node representing a separator
void visitPre(DocAutoList *)
QCString exampleFile() const
Node representing an block of paragraphs
Node representing a separator between two simple sections of the same type.
QCString stripPath(const QCString &s)
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
Node representing a citation of some bibliographic reference
virtual QCString trParameters()=0
Node representing a reference to some item
void writeMscFile(const QCString &fileName, DocVerbatim *s)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Node representing a parameter section
void writeDotFile(const QCString &fileName, DocVerbatim *s)
static bool supportedHtmlAttribute(const QCString &name)
const DocNodeList & children() const
void writeDiaFile(const QCString &fileName, DocVerbatim *s)
int toInt(bool *ok=0, int base=10) 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.
DocParamSect::Direction direction() const
Node representing a simple section
void endDotFile(bool hasCaption)
Node representing a normal section
const char * docbook(DocSymbol::SymType symb) const
Access routine to the docbook code of the HTML entity
Node representing a horizontal ruler
static QCString filterId(const QCString &s)
QCString language() const
Node representing an included text block from file
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
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
#define Config_getBool(name)
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command
Output interface for code parser.
Node representing a link to some item
Node representing a dia file
Minimal replacement for QFileInfo.
virtual QCString absFilePath() const =0
const char * qPrint(const char *s)
#define Config_getString(name)
QCString convertToDocBook(const QCString &s)
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 includeFileName() const
A model of a file symbol.
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
const DocNodeList & children() const
Node representing some amount of white space
static EmojiEntityMapper * instance()
Returns the one and only instance of the Emoji entity mapper
std::string fileName() const
Node representing a HTML table cell
QCString extension() const
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
DocNodeList & parameters()
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void visitCaption(const DocNodeList &children)
A bunch of utility functions.
Node representing a HTML table row
QCString right(size_t len) const
QCString & prepend(const char *s)
QCString & sprintf(const char *format,...)
void endMscFile(bool hasCaption)
virtual QCString trTemplateParameters()=0
QCString exampleFile() const
virtual QCString trReturnValues()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
const HtmlAttribList & attribs() const
This is an alternative implementation of QCString.