41#define DB_VIS_C DB_VIS_C1(m_t)
42#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
43#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
44#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
49#define DB_VIS_C2a(x,y)
57 const char *p=s.
data();
63 case ':': growBuf.
addStr(
"_1");
break;
64 default: growBuf.
addChar(c);
break;
73 return (name==
"align" ||
76 name==
"cellpadding" ||
77 name==
"cellspacing" ||
93 result=result.
mid(i+1);
101 int i = result.
find(
'.');
104 result=result.
left(i);
112 for (
const auto &n : children)
126 if (hasCaption && !inlineImage)
135 t <<
" <informalfigure>\n";
137 t <<
" <mediaobject>\n";
138 t <<
" <imageobject>\n";
146 if (!height.
isEmpty() && !inlineImage) t <<
" width=\"50%\"";
152 t <<
" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name <<
"\">";
153 t <<
"</imagedata>\n";
154 t <<
" </imageobject>\n";
155 if (hasCaption && !inlineImage)
164 if (hasCaption && !inlineImage)
168 t <<
" </mediaobject>\n";
169 if (hasCaption && !inlineImage)
175 t <<
" </informalfigure>\n";
254 m_t <<
"<link xlink:href=\"";
266 m_t <<
"<?linebreak?>";
275 m_t <<
"<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
276 m_t <<
"</entry></row></tbody></tgroup></informaltable>\n";
286 if (s.
enable())
m_t <<
"<emphasis role=\"bold\">";
else m_t <<
"</emphasis>";
289 if (s.
enable())
m_t <<
"<emphasis>";
else m_t <<
"</emphasis>";
294 if (s.
enable())
m_t <<
"<computeroutput>";
else m_t <<
"</computeroutput>";
297 if (s.
enable())
m_t <<
"<subscript>";
else m_t <<
"</subscript>";
300 if (s.
enable())
m_t <<
"<superscript>";
else m_t <<
"</superscript>";
303 if (s.
enable())
m_t <<
"<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
304 else m_t <<
"</entry></row></tbody></tgroup></informaltable>";
309 m_t <<
"<literallayout>";
314 m_t <<
"</literallayout>";
345 m_t <<
"<literallayout><computeroutput>";
352 m_t <<
"</computeroutput></literallayout>";
355 m_t <<
"<literallayout><computeroutput>";
357 m_t <<
"</computeroutput></literallayout>";
363 m_t <<
"<computeroutput>";
365 m_t <<
"</computeroutput>";
382 static int dotindex = 1;
387 name.
sprintf(
"%s%d",
"dot_inline_dotgraph_", dotindex);
392 QCString fileName = baseName+
".dot";
396 err(
"Could not open file {} for writing\n",fileName);
407 static int mscindex = 1;
412 name.
sprintf(
"%s%d",
"msc_inline_mscgraph_", mscindex);
417 QCString fileName = baseName+
".msc";
421 err(
"Could not open file {} for writing\n",fileName);
439 for (
const auto &baseName: baseNameVector)
466 m_t <<
"<literallayout><computeroutput>";
475 m_t <<
"</computeroutput></literallayout>";
479 m_t <<
"<literallayout><computeroutput>";
486 m_t <<
"</computeroutput></literallayout>";
500 m_t <<
"<literallayout>";
502 m_t <<
"</literallayout>";
506 m_t <<
"<literallayout><computeroutput>";
515 m_t <<
"</computeroutput></literallayout>";
527 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
540 std::unique_ptr<FileDef> fd;
580 else m_t <<
" <mediaobject>\n";
581 m_t <<
" <imageobject>\n";
582 m_t <<
" <imagedata ";
583 m_t <<
"align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.
relPath() << f.
name() <<
".png\"/>\n";
584 m_t <<
" </imageobject>\n";
586 else m_t <<
" </mediaobject>\n";
593 m_t <<
"<indexterm><primary>";
595 m_t <<
"</primary></indexterm>\n";
619 if (!opt.noPar())
filter(
"[");
621 if (!opt.noPar())
filter(
"]");
637 m_t <<
"<orderedlist>\n";
641 m_t <<
"<itemizedlist>\n";
646 m_t <<
"</orderedlist>\n";
650 m_t <<
"</itemizedlist>\n";
661 m_t <<
"<listitem override=\"unchecked\">";
665 m_t <<
"<listitem override=\"checked\">";
672 m_t <<
"</listitem>";
791 m_t <<
"<formalpara><title>" <<
theTranslator->trPrecondition() <<
"</title>\n";
801 m_t <<
"<formalpara><title>" <<
theTranslator->trPostcondition() <<
"</title>\n";
811 m_t <<
"<formalpara><title>" <<
theTranslator->trCopyright() <<
"</title>\n";
821 m_t <<
"<formalpara><title>" <<
theTranslator->trInvariant() <<
"</title>\n";
852 m_t <<
"<important><title>" <<
theTranslator->trImportant() <<
"</title>\n";
863 m_t <<
"<formalpara>\n";
871 std::visit(*
this,*s.
title());
881 m_t <<
"</formalpara>\n";
889 m_t <<
"</caution>\n";
892 m_t <<
"</important>\n";
895 m_t <<
"</warning>\n";
898 m_t <<
"</formalpara>\n";
916 m_t <<
"<itemizedlist>\n";
918 m_t <<
"</itemizedlist>\n";
930 m_t <<
"</listitem>\n";
942 std::visit(*
this,*s.
title());
945 m_t <<
"</section>\n";
956 m_t <<
"<itemizedlist>\n";
959 m_t <<
"</orderedlist>\n";
961 m_t <<
"</itemizedlist>\n";
971 bool isFirst = &std::get<DocHtmlListItem>(l->
children().
front())==&s;
974 for (
const auto &opt : s.
attribs())
976 if (opt.name==
"value")
979 int val = opt.value.toInt(&ok);
984 if (value>0 || isFirst)
986 for (
const auto &opt : l->
attribs())
988 if (opt.name==
"type")
991 type =
" numeration=\"arabic\"";
992 else if (opt.value==
"a")
993 type =
" numeration=\"loweralpha\"";
994 else if (opt.value==
"A")
995 type =
" numeration=\"upperalpha\"";
996 else if (opt.value==
"i")
997 type =
" numeration=\"lowerroman\"";
998 else if (opt.value==
"I")
999 type =
" numeration=\"upperroman\"";
1001 else if (value==0 && opt.name==
"start")
1004 int val = opt.value.toInt(&ok);
1005 if (ok) value = val;
1010 if (value>0 && !isFirst)
1012 m_t <<
"</orderedlist>\n";
1014 if (value>0 || isFirst)
1016 m_t <<
"<orderedlist";
1018 if (value>0)
m_t <<
" startingnumber=\"" << value <<
"\"";
1022 m_t <<
"<listitem>\n";
1024 m_t <<
"</listitem>\n";
1031 m_t <<
"<variablelist>\n";
1033 m_t <<
"</variablelist>\n";
1040 m_t <<
"<varlistentry><term>";
1042 m_t <<
"</term></varlistentry>\n";
1049 m_t <<
"<listitem>";
1051 m_t <<
"</listitem>\n";
1059 m_t <<
"<informaltable frame=\"all\">\n";
1060 m_t <<
" <tgroup cols=\"" << t.
numColumns() <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1064 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1068 std::visit(*
this,*t.
caption());
1073 m_t <<
" </tgroup>\n";
1074 m_t <<
"</informaltable>\n";
1097 for (
const auto &opt : tr.
attribs())
1110 m_t <<
"</thead><tbody>\n";
1122 for (
const auto &opt : c.
attribs())
1124 if (opt.name==
"colspan")
1127 int cols = opt.value.toInt();
1131 else if (opt.name==
"rowspan")
1133 int extraRows = opt.value.toInt() - 1;
1134 m_t <<
" morerows='" << extraRows <<
"'";
1136 else if (opt.name==
"class")
1138 if (opt.value.startsWith(
"markdownTable"))
1140 if (opt.value.endsWith(
"Right"))
1142 m_t <<
" align='right'";
1144 else if (opt.value.endsWith(
"Left"))
1146 m_t <<
" align='left'";
1148 else if (opt.value.endsWith(
"Center"))
1150 m_t <<
" align='center'";
1180 m_t <<
"</caption>\n";
1194 if (href.
url().
at(0) !=
'#')
1210 m_t <<
"<para><emphasis role=\"bold\">";
1212 m_t <<
"</emphasis></para>";
1223 std::visit(*
this,*summary);
1235 m_t <<
"<formalpara><title>";
1237 m_t <<
"</title></formalpara>\n";
1337 m_t <<
"<tocentry>";
1339 m_t <<
"</tocentry>\n";
1356 m_t <<
" <formalpara>\n";
1357 m_t <<
" <title>\n";
1367 m_t <<
"</title>\n";
1369 m_t <<
" <table frame=\"all\">\n";
1375 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1376 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1378 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1379 for (
int i = 1; i <= ncols; i++)
1381 if (i == ncols)
m_t <<
" <colspec colwidth=\"4*\"/>\n";
1382 else m_t <<
" <colspec colwidth=\"1*\"/>\n";
1384 m_t <<
" <tbody>\n";
1386 m_t <<
" </tbody>\n";
1387 m_t <<
" </tgroup>\n";
1388 m_t <<
" </table>\n";
1389 m_t <<
" </para>\n";
1390 m_t <<
" </formalpara>\n";
1434 std::visit(*
this,type);
1441 m_t <<
"<entry></entry>\n";
1453 std::visit(*
this,param);
1461 std::visit(*
this,par);
1463 m_t <<
"</entry>\n";
1472 m_t <<
"<para><link linkend=\"_";
1504 m_t <<
"<blockquote>";
1506 m_t <<
"</blockquote>";
1585 for (
const auto &bName: baseNameVector)
1592 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1617 baseName.prepend(
"msc_");
1621 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1655 baseName.prepend(
"dia_");
1659 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1693 baseName.prepend(
"dot_");
1698 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
"." + imgExt, width, height);
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
Class representing a directory in the file system.
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Node representing an anchor.
Node representing an auto List.
Node representing an item of a auto list.
Node representing a citation of some bibliographic reference.
CiteInfoOption option() const
Node representing a dia file.
Node representing a dot file.
Node representing an emoji.
Node representing a Hypertext reference.
Node representing a horizontal ruler.
Node representing an HTML blockquote.
Node representing a HTML table caption.
Node representing a HTML table cell.
const HtmlAttribList & attribs() const
Node representing a HTML description data.
Node representing a Html description list.
Node representing a Html description item.
const DocNodeVariant * summary() const
Node representing a Html list.
const HtmlAttribList & attribs() const
Node representing a HTML list item.
const HtmlAttribList & attribs() const
Node representing a HTML table row.
const HtmlAttribList & attribs() const
Node representing a HTML table.
size_t numColumns() const
const DocNodeVariant * caption() const
Node representing an image.
bool isInlineImage() const
Node representing a include/dontinclude operator block.
bool stripCodeComments() const
QCString includeFileName() const
QCString exampleFile() const
Node representing an included text block from file.
QCString extension() const
bool stripCodeComments() const
QCString exampleFile() const
Node representing an entry in the index.
Node representing an internal section of documentation.
Node representing an internal reference to some item.
Node representing a line break.
Node representing a link to some item.
Node representing a word that can be linked to something.
Node representing a msc file.
DocNodeVariant * parent()
Node representing an block of paragraphs.
Node representing a paragraph in the documentation tree.
Node representing a parameter list.
const DocNodeList & parameters() const
const DocNodeList & paramTypes() const
DocParamSect::Direction direction() const
const DocNodeList & paragraphs() const
Node representing a parameter section.
bool hasInOutSpecifier() const
bool hasTypeSpecifier() const
Node representing a uml file.
Node representing a reference to some item.
QCString targetTitle() const
Root node of documentation tree.
Node representing a reference to a section.
Node representing a list of section references.
Node representing a normal section.
const DocNodeVariant * title() const
Node representing a separator.
Node representing a simple list.
Node representing a simple list item.
const DocNodeVariant * paragraph() const
Node representing a simple section.
const DocNodeVariant * title() const
Node representing a separator between two simple sections of the same type.
Node representing a style change.
Node representing a special symbol.
HtmlEntityMapper::SymType symbol() const
Root node of a text fragment.
Node representing a simple section title.
Node representing a URL (or email address)
Node representing a verbatim, unparsed text fragment.
QCString language() const
const DocNodeList & children() const
QCString exampleFile() const
Node representing a VHDL flow chart.
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
Node representing some amount of white space.
Node representing a word.
Node representing an item of a cross-referenced list.
void writeDotFile(const QCString &fileName, const DocVerbatim &s)
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
void endDiaFile(bool hasCaption)
void operator()(const DocWord &)
void filter(const QCString &str, const bool retainNewLine=false)
void visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
void writeMscFile(const QCString &fileName, const DocVerbatim &s)
void startDiaFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void startMscFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void startDotFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void endPlantUmlFile(bool hasCaption)
void visitCaption(const DocNodeList &children)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void endDotFile(bool hasCaption)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void endMscFile(bool hasCaption)
DocbookDocVisitor(TextStream &t, OutputCodeList &ci, const QCString &langExt)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
static FileNameLinkedMap * imageNameLinkedMap
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
A model of a file symbol.
virtual QCString absFilePath() const =0
Minimal replacement for QFileInfo.
std::string fileName() const
std::string dirPath(bool absPath=true) const
Class representing a string buffer optimized for growing.
void addStr(const QCString &s)
bool empty() const
checks whether the container is empty
T & front()
access the first element
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * docbook(SymType symb) const
Access routine to the docbook code of the HTML entity.
Class representing a list of different code generators.
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
static PlantumlManager & instance()
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
QCString & sprintf(const char *format,...)
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
Text streaming class that buffers data.
#define Config_getBool(name)
#define Config_getString(name)
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static QCString filterId(const QCString &s)
static QCString makeBaseName(const QCString &name)
static QCString makeShortName(const QCString &baseName)
static bool supportedHtmlAttribute(const QCString &name)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Translator * theTranslator
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
std::ofstream openOutputStream(const QCString &name, bool append=false)
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
QCString stripPath(const QCString &s)
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
QCString getDotImageExtension()
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
QCString getFileNameExtension(const QCString &fn)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
A bunch of utility functions.