58#define Docbook_DB(x) do {} while(0)
65#define DB_GEN_C DB_GEN_C1(m_t)
66#define DB_GEN_C1(x) x << "<!-- DB_GEN_C " << __LINE__ << " -->\n";
67#define DB_GEN_C2(y) DB_GEN_C2a(m_t,y)
68#define DB_GEN_C2a(x,y) x << "<!-- DB_GEN_C " << __LINE__ << " " << y << " -->\n";
73#define DB_GEN_C2a(x,y)
87 const char *s = str.
data();
101 int spacesToNextTabStop = tabSize - (col%tabSize);
102 while (spacesToNextTabStop--)
104 if (col>=stripIndentAmount) t <<
" ";
110 if (col>=stripIndentAmount) t <<
" ";
113 case '<': t <<
"<"; col++;
break;
114 case '>': t <<
">"; col++;
break;
115 case '&': t <<
"&"; col++;
break;
116 case '\'': t <<
"'"; col++;
break;
117 case '"': t <<
"""; col++;
break;
120 uint8_t uc =
static_cast<uint8_t
>(c);
121 static const char *
hex=
"0123456789ABCDEF";
124 t <<
"$" <<
hex[uc>>4] <<
hex[uc&0xF] <<
";";
140 t <<
"<indexterm><primary>";
149 t <<
"</indexterm>\n";
154 t <<
"<link linkend=\"_" <<
stripPath(compoundId);
155 if (!anchorId.
isEmpty()) t <<
"_1" << anchorId;
206 const QCString &,
bool writeLineAnchor)
210 if (!writeLineAnchor)
return;
248 *
m_t <<
"<emphasis role=\"" << colorClass <<
"\">";
256 *
m_t <<
"</emphasis>";
266 const QCString &anchor,
int l,
bool writeLineAnchor)
305 *
m_t <<
"<programlisting linenumbering=\"unnumbered\">";
314 *
m_t <<
"</programlisting>";
397 QCString fileType=
"section";
416 m_t <<
"<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
417 m_t <<
"<" << fileType <<
" xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
433 QCString fileType=
"section";
439 else if (
fileName ==
"mainpage.xml")
443 m_t <<
"</" << fileType <<
">\n";
493 m_t <<
"<chapter>\n";
497 m_t <<
"<chapter>\n";
501 m_t <<
"<chapter>\n";
505 m_t <<
"<chapter>\n";
509 m_t <<
"<chapter>\n";
513 m_t <<
"<chapter>\n";
517 m_t <<
"<chapter>\n";
521 m_t <<
"<chapter>\n";
588 if (!gd->isReference() && !gd->isASubGroup())
594 m_t <<
"</chapter>\n";
601 if (!mod->isReference() && mod->isPrimaryInterface())
607 m_t <<
"</chapter>\n";
615 if (dd->isLinkableInProject())
617 m_t <<
"< xi:include href=\"" << dd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
621 m_t <<
"</chapter>\n";
628 if (nd->isLinkableInProject() && !nd->isAlias())
630 m_t <<
"<xi:include href=\"" << nd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
634 m_t <<
"</chapter>\n";
641 if (cd->isLinkableInProject() && !cd->isAlias())
643 m_t <<
"<xi:include href=\"" << cd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
647 m_t <<
"</chapter>\n";
654 if (cd->isLinkableInProject() &&
655 cd->templateMaster()==
nullptr &&
656 !cd->isEmbeddedInOuterScope() &&
660 m_t <<
" <xi:include href=\"" << cd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
664 m_t <<
"</chapter>\n";
671 for (
const auto &fd : *fn)
673 if (fd->isLinkableInProject())
675 m_t <<
" <xi:include href=\"" << fd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
677 if (fd->generateSourceFile())
679 m_t <<
" <xi:include href=\"" << fd->getSourceFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
684 m_t <<
"</chapter>\n";
691 m_t <<
" <xi:include href=\"" << pd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
694 m_t <<
"</chapter>\n";
699 if (!pd->getGroupDef() && !pd->isReference() && !pd->hasParentPage()
717 link.sprintf(
" <xi:include href=\"%s.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n",
729 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast);
733 std::visit(visitor,astImpl->root);
756 m_t <<
"<simplesect>\n";
764 m_t <<
" </title>\n";
778 if (!f.
isEmpty()) result +=
"<link linkend=\"_" +
stripPath(f) +
"_1" + anchor +
"\">";
779 else result +=
"<link linkend=\"_" + anchor +
"\">";
783 result +=
"<link linkend=\"_" +
stripPath(f) +
"\">";
798 m_t <<
" <itemizedlist>\n";
806 m_t <<
" </itemizedlist>\n";
815 m_t <<
" <listitem><para>";
826 m_t <<
"<emphasis role=\"strong\">";
831 m_t <<
"</emphasis>";
836DB_GEN_C2(
"extraIndentLevel " << extraIndentLevel)
863 if (openBracket)
m_t <<
"(";
872 for (
int i=0;i<n;i++)
m_t <<
" ";
877 m_t <<
"<?linebreak?>";
895 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
904 m_t <<
"</programlisting>";
908 int memCount,
int memTotal,
bool)
915 m_t <<
"<computeroutput>[" << memCount <<
"/" << memTotal <<
"]</computeroutput>";
918 if (!memname.
isEmpty() && memname[0]!=
'@')
927 m_t <<
"</computeroutput></para>";
952 m_t <<
"<anchor xml:id=\"_" <<
stripPath(fName) <<
"_1" << anchor <<
"\"/>";
966 m_t <<
"<para><computeroutput>";
975 m_t <<
"<simplesect><title>";
989 m_t <<
"</simplesect>\n";
1000 m_t <<
" <informalfigure>\n";
1001 m_t <<
" <mediaobject>\n";
1002 m_t <<
" <imageobject>\n";
1003 m_t <<
" <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\""
1005 m_t <<
" </imageobject>\n";
1007 m_t <<
" </mediaobject>\n";
1008 m_t <<
" </informalfigure>\n";
1019 m_t <<
"<computeroutput>[" << l <<
"]</computeroutput>";
1020 if (!isLast)
m_t <<
", ";
1030 m_t <<
"<simplesect><title>";
1038 m_t <<
"</simplesect>\n";
1043 m_t <<
"<simplesect><title>";
1048 m_t <<
"</title></simplesect>\n";
1061 m_t <<
"<computeroutput>";
1066 m_t <<
"</computeroutput>";
1075 else if (closeBracket)
1101 if (last && closeBracket)
1165 m_t <<
"<table frame=\"all\">\n";
1167 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1168 for (
int i = 0; i < ncols; i++)
1170 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1179 m_t <<
" </tbody>\n";
1180 m_t <<
" </tgroup>\n";
1181 m_t <<
"</table>\n";
1188 m_t <<
"<row><entry>";
1218 m_t <<
"</entry></row>\n";
1224 int ncols = (hasInits?3:2);
1225 m_t <<
"<informaltable frame=\"all\">\n";
1227 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1229 m_t <<
" <colspec colname='c" << i++ <<
"'/>\n";
1230 if (hasInits)
m_t <<
" <colspec colname='c" << i++ <<
"' align='right'/>\n";
1231 m_t <<
" <colspec colname='c" << i++ <<
"'/>\n";
1239 m_t <<
" </tbody>\n";
1240 m_t <<
" </tgroup>\n";
1241 m_t <<
"</informaltable>\n";
1271 m_t <<
"</entry><entry>";
1282 m_t <<
"</entry><entry>";
1347 m_t <<
"<simplesect><title>";
1349 m_t <<
"</title>\n";
1354 m_t <<
"<para><emphasis role=\"strong\">";
1368 m_t <<
"</emphasis></para>\n";
1381 m_t <<
"</simplesect>\n";
1394 m_t <<
"</section>\n";
1424 for (
const SectionInfo *si : sectionRefs)
1426 SectionType
type = si->type();
1427 if (
type.isSection())
1430 int nextLevel =
type.level();
1431 if (nextLevel>level)
1433 for (
int l=level;l<nextLevel;l++)
1435 if (l < maxLevel)
m_t <<
" <tocdiv>\n";
1438 else if (nextLevel<level)
1440 for (
int l=level;l>nextLevel;l--)
1443 if (l <= maxLevel)
m_t <<
" </tocdiv>\n";
1446 if (nextLevel <= maxLevel)
1450 if (titleDoc.
isEmpty()) titleDoc = label;
1451 m_t <<
" <tocentry>" << titleDoc <<
"</tocentry>\n";
1453 inLi[nextLevel]=
TRUE;
1457 if (level > maxLevel) level = maxLevel;
1458 while (level>1 && level <= maxLevel)
1461 m_t <<
"</tocdiv>\n";
1470static constexpr auto hex=
"0123456789ABCDEF";
1477 const char *p = s.
data();
1478 const char *q =
nullptr;
1485 case '\n':
if (retainNewline) growBuf.
addStr(
"<literallayout> 
</literallayout>"); growBuf.
addChar(c);
break;
1486 case '<': growBuf.
addStr(
"<");
break;
1487 case '>': growBuf.
addStr(
">");
break;
1491 while ((*q >=
'a' && *q <=
'z') || (*q >=
'A' && *q <=
'Z') || (*q >=
'0' && *q <=
'9'))
1517 case '\'': growBuf.
addStr(
"'");
break;
1518 case '"': growBuf.
addStr(
""");
break;
1519 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
1520 case 11:
case 12:
case 14:
case 15:
case 16:
case 17:
case 18:
1521 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
1522 case 27:
case 28:
case 29:
case 30:
case 31:
1524 growBuf.
addChar(
hex[
static_cast<uint8_t
>(c)>>4]);
1525 growBuf.
addChar(
hex[
static_cast<uint8_t
>(c)&0xF]);
1534 return growBuf.
get();
Class representing a built-in class diagram.
void writeImage(TextStream &t, const QCString &path, const QCString &relPath, const QCString &file, bool generateMap=true) const
The common base class of all entity definitions found in the sources.
virtual QCString getDefFileExtension() const =0
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
void endFontClass() override
void endCodeFragment(const QCString &style) override
DocbookCodeGenerator(TextStream *t)
size_t m_stripIndentAmount
void stripCodeComments(bool b) override
void writeCodeAnchor(const QCString &) override
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip) override
void startSpecialComment() override
void endCodeLine() override
void endSpecialComment() override
void codify(const QCString &text) override
void writeCodeLinkLine(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip, bool)
void startCodeLine(int) override
void setStripIndentAmount(size_t amount) override
void startFontClass(const QCString &colorClass) override
void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &, const QCString &, const SourceLinkInfo &, const SourceLinkInfo &) override
void writeLineNumber(const QCString &extRef, const QCString &compId, const QCString &anchorId, int l, bool writeLineAnchor) override
QCString m_sourceFileName
void startCodeFragment(const QCString &style) override
void endInlineMemberName() override
void writeRuler() override
void startParameterList(bool) override
void startCallGraph() override
void exceptionEntry(const QCString &, bool) override
void startMemberHeader(const QCString &anchor, int typ) override
void endDescTableRow() override
void lineBreak(const QCString &) override
void startDescTableData() override
void startIndexSection(IndexSection) override
void writeNonBreakableSpace(int) override
std::unique_ptr< OutputCodeList > m_codeList
void startGroupCollaboration() override
void endMemberGroup(bool) override
void startParagraph(const QCString &) override
void endClassDiagram(const ClassDiagram &, const QCString &, const QCString &) override
void startParameterExtra() override
void endMemberItem(MemberItemType) override
void endLabels() override
void endPlainFile() override
void endTypewriter() override
void writeDoc(const IDocNodeAST *node, const Definition *ctx, const MemberDef *md, int id) override
void endMemberGroupHeader() override
void endConstraintType() override
void writeLabel(const QCString &, bool) override
DocbookCodeGenerator * m_codeGen
void startMemberGroupHeader(bool) override
void startConstraintType() override
void addCodeGen(OutputCodeList &list) override
void endMemberDocSimple(bool) override
void endMemberDocName() override
void startMemberDocSimple(bool) override
void endDotGraph(DotClassGraph &g) override
void endConstraintDocs() override
void endDescTableTitle() override
void startConstraintParam() override
void writePageLink(const QCString &, bool) override
void endCompoundTemplateParams() override
void startConstraintList(const QCString &) override
void startTypewriter() override
void startMemberTemplateParams() override
void endGroupCollaboration(DotGroupCollaboration &g) override
void endTextBlock(bool) override
void endInlineMemberDoc() override
void endMemberHeader() override
void startMemberDocList() override
OutputType type() const override
void startFile(const QCString &name, const QCString &manName, const QCString &title, int id, int hierarchyLevel) override
void writeObjectLink(const QCString &, const QCString &, const QCString &, const QCString &) override
void startLabels() override
void endMemberDocPrefixItem() override
void startMemberItem(const QCString &, MemberItemType, const QCString &) override
void startParameterName(bool) override
void endParameterDefVal() override
std::array< bool, 20 > m_inSimpleSect
void startMemberDoc(const QCString &, const QCString &, const QCString &, const QCString &, int, int, bool) override
void startTitleHead(const QCString &) override
void startMemberDocName(bool) override
void endDescTableData() override
void openSection(const QCString &attr=QCString())
void startDirDepGraph() override
void endIndexSection(IndexSection) override
void startGroupHeader(int) override
void startCompoundTemplateParams() override
void startMemberGroup() override
void endParagraph() override
void startClassDiagram() override
void startSection(const QCString &, const QCString &, SectionType) override
void endParameterName() override
void endMemberTemplateParams(const QCString &, const QCString &) override
void startMemberDocPrefixItem() override
void startDescTableInit() override
void startMemberList() override
void endDirDepGraph(DotDirDeps &g) override
void addIndexItem(const QCString &, const QCString &) override
void startExamples() override
void endCallGraph(DotCallGraph &g) override
void endDoxyAnchor(const QCString &fileName, const QCString &anchor) override
void writeString(const QCString &) override
void startDoxyAnchor(const QCString &fName, const QCString &manName, const QCString &anchor, const QCString &name, const QCString &args) override
void endMemberDoc(bool) override
void startDescTableRow() override
void startInclDepGraph() override
void startDotGraph() override
DocbookGenerator & operator=(const DocbookGenerator &)
void addLabel(const QCString &, const QCString &) override
void endSection(const QCString &, SectionType) override
void startInlineMemberType() override
void startBold() override
void endTitleHead(const QCString &fileName, const QCString &name) override
void endMemberDocList() override
void startDescTableTitle() override
void endGroupHeader(int) override
void startInlineMemberDoc() override
void startConstraintDocs() override
std::array< bool, 20 > m_inListItem
void endMemberList() override
void endParameterList() override
void endParameterExtra(bool, bool, bool) override
void docify(const QCString &text) override
void startTextBlock(bool) override
void endDescTableInit() override
void startParameterDefVal(const char *sep) override
void writeLocalToc(const SectionRefs &sr, const LocalToc <) override
void endDescTable() override
void endConstraintParam() override
void endInlineMemberType() override
void startPlainFile(const QCString &name) override
void writeInheritedSectionTitle(const QCString &, const QCString &, const QCString &, const QCString &, const QCString &, const QCString &) override
void startInlineMemberName() override
void endInclDepGraph(DotInclDepGraph &g) override
void startDescTable(const QCString &title, const bool hasInits) override
void writeChar(char) override
void endExamples() override
void endConstraintList() override
Representation of an call graph.
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
Representation of a class inheritance or dependency graph.
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool TBRank=TRUE, bool imageMap=TRUE, int graphId=-1)
Representation of an directory dependency graph.
QCString writeGraph(TextStream &out, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1, bool linkRelations=TRUE)
Representation of a group collaboration graph.
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
Representation of an include dependency graph.
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
static NamespaceLinkedMap * namespaceLinkedMap
static ConceptLinkedMap * conceptLinkedMap
static std::unique_ptr< PageDef > mainPage
static FileNameLinkedMap * inputNameLinkedMap
static ClassLinkedMap * classLinkedMap
static PageLinkedMap * exampleLinkedMap
static PageLinkedMap * pageLinkedMap
static DirLinkedMap * dirLinkedMap
static GroupLinkedMap * groupLinkedMap
Class representing a string buffer optimized for growing.
void addStr(const QCString &s)
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name.
opaque representation of the abstract syntax tree (AST)
bool isDocbookEnabled() const
A model of a class/file/namespace member symbol.
static ModuleManager & instance()
Class representing a list of different code generators.
void add(OutputCodeIntfPtr &&p)
Abstract interface for output generators.
QCString fileName() const
This is an alternative implementation of QCString.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
QCString & sprintf(const char *format,...)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
class that represents a list of constant references to sections.
Text streaming class that buffers data.
virtual QCString trInheritedFrom(const QCString &members, const QCString &what)=0
virtual QCString trISOLang()=0
virtual QCString trEnumerationValues()=0
virtual QCString trRTFTableOfContents()=0
virtual QCString trCompoundMembers()=0
virtual QCString trExamples()=0
#define Config_getInt(name)
#define Config_getBool(name)
#define Config_getString(name)
std::vector< bool > BoolVector
static constexpr auto hex
static QCString objectLinkToString(const QCString &, const QCString &f, const QCString &anchor, const QCString &text)
void writeDocbookCodeString(bool hide, TextStream &t, const QCString &str, size_t &col, size_t stripIndentAmount)
void writeDocbookString(TextStream &t, const QCString &s)
void writeDocbookLink(TextStream &t, const QCString &, const QCString &compoundId, const QCString &anchorId, const QCString &text, const QCString &)
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static void addIndexTerm(TextStream &t, QCString prim, QCString sec="")
QCString convertToDocBook(const QCString &s, const bool retainNewline=false)
@ isNamespaceDocumentation
Translator * theTranslator
OutputCodeDefer< DocbookCodeGenerator > DocbookCodeGeneratorDefer
const char * qPrint(const char *s)
size_t updateColumnCount(const char *s, size_t col)
QCString stripPath(const QCString &s)
QCString relativePathToRoot(const QCString &name)
void clearSubDirs(const Dir &d)
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
void createSubDirs(const Dir &d)
A bunch of utility functions.