50#define Docbook_DB(x) do {} while(0)
57#define DB_GEN_C DB_GEN_C1(m_t)
58#define DB_GEN_C1(x) x << "<!-- DB_GEN_C " << __LINE__ << " -->\n";
59#define DB_GEN_C2(y) DB_GEN_C2a(m_t,y)
60#define DB_GEN_C2a(x,y) x << "<!-- DB_GEN_C " << __LINE__ << " " << y << " -->\n";
65#define DB_GEN_C2a(x,y)
77 if (str.
empty())
return;
79 const char *s = str.
data();
93 int spacesToNextTabStop = tabSize - (col%tabSize);
94 while (spacesToNextTabStop--)
96 if (col>=stripIndentAmount) t <<
" ";
102 if (col>=stripIndentAmount) t <<
" ";
105 case '<': t <<
"<"; col++;
break;
106 case '>': t <<
">"; col++;
break;
107 case '&': t <<
"&"; col++;
break;
108 case '\'': t <<
"'"; col++;
break;
109 case '"': t <<
"""; col++;
break;
112 uint8_t uc =
static_cast<uint8_t
>(c);
113 static const char *
hex=
"0123456789ABCDEF";
116 t <<
"$" <<
hex[uc>>4] <<
hex[uc&0xF] <<
";";
132 t <<
"<indexterm><primary>";
141 t <<
"</indexterm>\n";
146 t <<
"<link linkend=\"_" <<
stripPath(compoundId);
147 if (!anchorId.
empty()) t <<
"_1" << anchorId;
198 const DString &,
bool writeLineAnchor)
202 if (!writeLineAnchor)
return;
240 *
m_t <<
"<emphasis role=\"" << colorClass <<
"\">";
248 *
m_t <<
"</emphasis>";
258 const DString &anchor,
int l,
bool writeLineAnchor)
272 if (!fileName.
empty())
297 *
m_t <<
"<programlisting linenumbering=\"unnumbered\">";
309 *
m_t <<
"</programlisting>";
374 term(
"Could not create output directory {}\n",
dir);
411 m_t <<
"<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
412 m_t <<
"<" << fileType <<
" xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
434 else if (
fileName ==
"mainpage.xml")
438 m_t <<
"</" << fileType <<
">\n";
488 m_t <<
"<chapter>\n";
492 m_t <<
"<chapter>\n";
496 m_t <<
"<chapter>\n";
500 m_t <<
"<chapter>\n";
504 m_t <<
"<chapter>\n";
508 m_t <<
"<chapter>\n";
512 m_t <<
"<chapter>\n";
516 m_t <<
"<chapter>\n";
583 if (!gd->isReference() && !gd->isASubGroup())
589 m_t <<
"</chapter>\n";
596 if (!mod->isReference() && mod->isPrimaryInterface())
602 m_t <<
"</chapter>\n";
610 if (dd->isLinkableInProject())
612 m_t <<
" <xi:include href=\"" << dd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
616 m_t <<
"</chapter>\n";
623 if (nd->isLinkableInProject() && !nd->isAlias())
625 m_t <<
" <xi:include href=\"" << nd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
629 m_t <<
"</chapter>\n";
636 if (cd->isLinkableInProject() && !cd->isAlias())
638 m_t <<
" <xi:include href=\"" << cd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
642 m_t <<
"</chapter>\n";
649 if (cd->isLinkableInProject() &&
650 !cd->isImplicitTemplateInstance() &&
651 !cd->isEmbeddedInOuterScope() &&
655 m_t <<
" <xi:include href=\"" << cd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
659 m_t <<
"</chapter>\n";
666 for (
const auto &fd : *fn)
668 if (fd->isLinkableInProject())
670 m_t <<
" <xi:include href=\"" << fd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
672 if (fd->generateSourceFile())
674 m_t <<
" <xi:include href=\"" << fd->getSourceFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
679 m_t <<
"</chapter>\n";
686 m_t <<
" <xi:include href=\"" << pd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
689 m_t <<
"</chapter>\n";
694 if (!pd->getGroupDef() && !pd->isReference() && !pd->hasParentPage()
712 link.
sprintf(
" <xi:include href=\"%s.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n",
724 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast);
728 std::visit(visitor,astImpl->root);
751 m_t <<
"<simplesect>\n";
759 m_t <<
" </title>\n";
773 if (!f.
empty()) result +=
"<link linkend=\"_" +
stripPath(f) +
"_1" + anchor +
"\">";
774 else result +=
"<link linkend=\"_" + anchor +
"\">";
778 result +=
"<link linkend=\"_" +
stripPath(f) +
"\">";
793 m_t <<
" <itemizedlist>\n";
801 m_t <<
" </itemizedlist>\n";
810 m_t <<
" <listitem><para>";
821 m_t <<
"<emphasis role=\"strong\">";
826 m_t <<
"</emphasis>";
831DB_GEN_C2(
"extraIndentLevel " << extraIndentLevel)
858 if (openBracket)
m_t <<
"(";
867 for (
int i=0;i<n;i++)
m_t <<
" ";
872 m_t <<
"<?linebreak?>";
890 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
899 m_t <<
"</programlisting>";
903 int memCount,
int memTotal,
bool)
910 m_t <<
"<computeroutput>[" << memCount <<
"/" << memTotal <<
"]</computeroutput>";
913 if (!memname.
empty() && memname[0]!=
'@')
922 m_t <<
"</computeroutput></para>";
947 m_t <<
"<anchor xml:id=\"_" <<
stripPath(fName) <<
"_1" << anchor <<
"\"/>";
961 m_t <<
"<para><computeroutput>";
970 m_t <<
"<simplesect><title>";
984 m_t <<
"</simplesect>\n";
995 m_t <<
" <informalfigure>\n";
996 m_t <<
" <mediaobject>\n";
997 m_t <<
" <imageobject>\n";
998 m_t <<
" <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\""
1000 m_t <<
" </imageobject>\n";
1002 m_t <<
" </mediaobject>\n";
1003 m_t <<
" </informalfigure>\n";
1014 m_t <<
"<computeroutput>[" << l <<
"]</computeroutput>";
1015 if (!isLast)
m_t <<
", ";
1025 m_t <<
"<simplesect><title>";
1033 m_t <<
"</simplesect>\n";
1038 m_t <<
"<simplesect><title>";
1043 m_t <<
"</title></simplesect>\n";
1056 m_t <<
"<computeroutput>";
1061 m_t <<
"</computeroutput>";
1070 else if (closeBracket)
1096 if (last && closeBracket)
1160 m_t <<
"<table frame=\"all\">\n";
1162 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1163 for (
int i = 0; i < ncols; i++)
1165 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1174 m_t <<
" </tbody>\n";
1175 m_t <<
" </tgroup>\n";
1176 m_t <<
"</table>\n";
1183 m_t <<
"<row><entry>";
1213 m_t <<
"</entry></row>\n";
1219 int ncols = (hasInits?3:2);
1220 m_t <<
"<informaltable frame=\"all\">\n";
1222 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1224 m_t <<
" <colspec colname='c" << i++ <<
"'/>\n";
1225 if (hasInits)
m_t <<
" <colspec colname='c" << i++ <<
"' align='right'/>\n";
1226 m_t <<
" <colspec colname='c" << i++ <<
"'/>\n";
1234 m_t <<
" </tbody>\n";
1235 m_t <<
" </tgroup>\n";
1236 m_t <<
"</informaltable>\n";
1266 m_t <<
"</entry><entry>";
1277 m_t <<
"</entry><entry>";
1342 m_t <<
"<simplesect><title>";
1344 m_t <<
"</title>\n";
1349 m_t <<
"<para><emphasis role=\"strong\">";
1363 m_t <<
"</emphasis></para>\n";
1376 m_t <<
"</simplesect>\n";
1382 if (!attr.
empty())
m_t <<
" " << attr;
1389 m_t <<
"</section>\n";
1424 m_t <<
"</tocdiv>\n";
1455 m_t <<
" <tocentry>";
1466 m_t <<
"</tocentry>\n";
1474static constexpr auto hex=
"0123456789ABCDEF";
1479 if (s.
empty())
return s;
1482 const char *p = s.
data();
1491 result+=
"<literallayout> 
</literallayout>";
1495 case '<': result+=
"<";
break;
1496 case '>': result+=
">";
break;
1504 case '\'': result+=
"'";
break;
1505 case '"': result+=
""";
break;
1506 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
1507 case 11:
case 12:
case 14:
case 15:
case 16:
case 17:
case 18:
1508 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
1509 case 27:
case 28:
case 29:
case 30:
case 31:
1511 result+=
hex[
static_cast<uint8_t
>(c)>>4];
1512 result+=
hex[
static_cast<uint8_t
>(c)&0xF];
Class representing a built-in class diagram.
void writeImage(TextStream &t, const DString &path, const DString &relPath, const DString &file, bool generateMap, bool toIndex) const
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
DString & sprintf(const char *format,...)
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
The common base class of all entity definitions found in the sources.
virtual DString getDefFileExtension() const =0
Class representing a directory in the file system.
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
Class representing the abstract syntax tree of a documentation block.
void startFontClass(const DString &colorClass) override
void writeLineNumber(const DString &extRef, const DString &compId, const DString &anchorId, int l, bool writeLineAnchor) override
void endFontClass() override
void codify(const DString &text) override
DocbookCodeGenerator(TextStream *t)
size_t m_stripIndentAmount
void stripCodeComments(bool b) override
void writeCodeLinkLine(CodeSymbolType type, const DString &ref, const DString &file, const DString &anchor, const DString &name, const DString &tooltip, bool)
void writeCodeLink(CodeSymbolType type, const DString &ref, const DString &file, const DString &anchor, const DString &name, const DString &tooltip) override
void setRelativePath(const DString &path)
void endCodeFragment(const DString &style) override
void writeCodeAnchor(const DString &) override
void startCodeFragment(const DString &style) override
void writeTooltip(const DString &, const DocLinkInfo &, const DString &, const DString &, const SourceLinkInfo &, const SourceLinkInfo &) override
void startSpecialComment() override
void endCodeLine() override
void endSpecialComment() override
void startCodeLine(int) override
void setStripIndentAmount(size_t amount) override
void setTextStream(TextStream *t)
void setSourceFileName(const DString &sourceFileName)
Concrete visitor implementation for Docbook output.
void endInlineMemberName() override
void writeRuler() override
void startParameterList(bool) override
void startLocalToc(int level) override
void startTocEntry(const SectionInfo *si) override
void writeDoc(const IDocNodeAST *node, const Definition *ctx, const MemberDef *md, int id, int sectionLevel) override
void startCallGraph() override
void endDescTableRow() override
void startDescTableData() override
void startParagraph(const DString &) override
void startIndexSection(IndexSection) override
void writeNonBreakableSpace(int) override
std::unique_ptr< OutputCodeList > m_codeList
void startGroupCollaboration() override
void addLabel(const DString &, const DString &) override
void startMemberGroupHeader(const DString &, bool) override
void endMemberGroup(bool) override
void startMemberHeader(const DString &anchor, int typ) override
void startParameterExtra() override
void endMemberItem(MemberItemType) override
void endLabels() override
void endPlainFile() override
void endTypewriter() override
void endConstraintType() override
DocbookCodeGenerator * m_codeGen
void endMemberTemplateParams(const DString &, const DString &) override
void docify(const DString &text) override
void writeLabel(const DString &, bool) override
void startConstraintType() override
void endTocEntry(const SectionInfo *si) override
void addCodeGen(OutputCodeList &list) override
void endMemberDocSimple(bool) override
void endMemberDocName() override
void startMemberDocSimple(bool) override
void endMemberGroupHeader(bool) override
void endDotGraph(DotClassGraph &g) override
void endSection(const DString &, SectionType) override
void endConstraintDocs() override
void endDescTableTitle() override
void startDoxyAnchor(const DString &fName, const DString &manName, const DString &anchor, const DString &name, const DString &args) override
void openSection(const DString &attr=DString())
void startConstraintParam() override
void endCompoundTemplateParams() override
void startTypewriter() override
void startMemberTemplateParams() override
void endTitleHead(const DString &fileName, const DString &name) override
void endGroupCollaboration(DotGroupCollaboration &g) override
void endTextBlock(bool) override
void endInlineMemberDoc() override
void endMemberHeader() override
void writeObjectLink(const DString &, const DString &, const DString &, const DString &) override
void startMemberDocList() override
void endLocalToc() override
OutputType type() const override
void startConstraintList(const DString &) override
void startLabels() override
void endMemberDocPrefixItem() override
void exceptionEntry(const DString &, bool) override
void startTitleHead(const DString &) override
void startParameterName(bool) override
void endParameterDefVal() override
std::array< bool, 20 > m_inSimpleSect
void startFile(const DString &name, bool isSource, const DString &manName, const DString &title, int id, int hierarchyLevel) override
void startGroupHeader(const DString &, int) override
void writeInheritedSectionTitle(const DString &, const DString &, const DString &, const DString &, const DString &, const DString &) override
void endDoxyAnchor(const DString &fileName, const DString &anchor) override
void addIndexItem(const DString &, const DString &) override
static DString convertToDocbook(const DString &s, bool retainNewline=false, bool citeEntry=false)
void writePageLink(const DString &, bool) override
void startMemberDocName(bool) override
void endDescTableData() override
void startDirDepGraph() override
void endIndexSection(IndexSection) override
void startCompoundTemplateParams() override
void startMemberGroup() override
void endParagraph() override
void startClassDiagram() override
void endParameterName() override
void startMemberDocPrefixItem() override
void startDescTableInit() override
void startMemberList() override
void endDirDepGraph(DotDirDeps &g) override
void lineBreak(const DString &) override
void startExamples() override
void endCallGraph(DotCallGraph &g) override
void endMemberDoc(bool) override
void startPlainFile(const DString &name) override
void startDescTableRow() override
void startInclDepGraph() override
void startDotGraph() override
DocbookGenerator & operator=(const DocbookGenerator &)
void startInlineMemberType() override
void startMemberItem(const DString &, MemberItemType, const DString &) override
void startBold() override
void endClassDiagram(const ClassDiagram &, const DString &, const DString &) override
void startSection(const DString &, const DString &, SectionType) override
void endMemberDocList() override
void startDescTable(const DString &title, bool hasInits) 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 startMemberDoc(const DString &, const DString &, const DString &, const DString &, int, int, bool) override
void endParameterExtra(bool, bool, bool) override
void startTextBlock(bool) override
void endDescTableInit() override
void startParameterDefVal(const char *sep) override
void endDescTable() override
void endConstraintParam() override
void endInlineMemberType() override
void writeString(const DString &) override
void startInlineMemberName() override
void endInclDepGraph(DotInclDepGraph &g) override
void writeChar(char) override
void endExamples() override
void endConstraintList() override
Representation of an call graph.
DString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &relPath, bool writeImageMap=true, int graphId=-1)
Representation of a class inheritance or dependency graph.
DString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &relPath, bool TBRank=true, bool imageMap=true, int graphId=-1)
Representation of an directory dependency graph.
DString writeGraph(TextStream &out, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &relPath, bool writeImageMap=true, int graphId=-1, bool linkRelations=true)
Representation of a group collaboration graph.
DString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &relPath, bool writeImageMap=true, int graphId=-1)
Representation of an include dependency graph.
DString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &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
const char * writeHtmlEntity(T &result, const char *s, HtmlEntityMapperFunc &&mapper, const char *fallback)
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.
opaque representation of the abstract syntax tree (AST)
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.
class that provide information about a section.
constexpr bool isSection() const
constexpr int level() const
Text streaming class that buffers data.
virtual DString trCompoundMembers()=0
virtual DString trInheritedFrom(const DString &members, const DString &what)=0
virtual DString trISOLang()=0
virtual DString trEnumerationValues()=0
virtual DString trRTFTableOfContents()=0
virtual DString trExamples()=0
#define Config_getInt(name)
#define Config_getBool(name)
#define Config_getString(name)
std::vector< bool > BoolVector
static constexpr auto hex
void writeDocbookCodeString(bool hide, TextStream &t, const DString &str, size_t &col, size_t stripIndentAmount)
static void addIndexTerm(TextStream &t, DString prim, DString sec="")
void writeDocbookString(TextStream &t, const DString &s)
void writeDocbookLink(TextStream &t, const DString &, const DString &compoundId, const DString &anchorId, const DString &text, const DString &)
static DString objectLinkToString(const DString &, const DString &f, const DString &anchor, const DString &text)
@ isNamespaceDocumentation
Translator * theTranslator
size_t updateColumnCount(const char *s, size_t col)
OutputCodeDefer< DocbookCodeGenerator > DocbookCodeGeneratorDefer
DString stripExtensionGeneral(const DString &fName, const DString &ext)
void clearSubDirs(const Dir &d)
void createSubDirs(const Dir &d)
DString relativePathToRoot(const DString &name)
DString stripPath(const DString &s)
A bunch of utility functions.