57#define Docbook_DB(x) do {} while(0)
64#define DB_GEN_C DB_GEN_C1(m_t)
65#define DB_GEN_C1(x) x << "<!-- DB_GEN_C " << __LINE__ << " -->\n";
66#define DB_GEN_C2(y) DB_GEN_C2a(m_t,y)
67#define DB_GEN_C2a(x,y) x << "<!-- DB_GEN_C " << __LINE__ << " " << y << " -->\n";
72#define DB_GEN_C2a(x,y)
84 if (str.
empty())
return;
86 const char *s = str.
data();
100 int spacesToNextTabStop = tabSize - (col%tabSize);
101 while (spacesToNextTabStop--)
103 if (col>=stripIndentAmount) t <<
" ";
109 if (col>=stripIndentAmount) t <<
" ";
112 case '<': t <<
"<"; col++;
break;
113 case '>': t <<
">"; col++;
break;
114 case '&': t <<
"&"; col++;
break;
115 case '\'': t <<
"'"; col++;
break;
116 case '"': t <<
"""; col++;
break;
119 uint8_t uc =
static_cast<uint8_t
>(c);
120 static const char *
hex=
"0123456789ABCDEF";
123 t <<
"$" <<
hex[uc>>4] <<
hex[uc&0xF] <<
";";
139 t <<
"<indexterm><primary>";
148 t <<
"</indexterm>\n";
153 t <<
"<link linkend=\"_" <<
stripPath(compoundId);
154 if (!anchorId.
empty()) t <<
"_1" << anchorId;
205 const DString &,
bool writeLineAnchor)
209 if (!writeLineAnchor)
return;
247 *
m_t <<
"<emphasis role=\"" << colorClass <<
"\">";
255 *
m_t <<
"</emphasis>";
265 const DString &anchor,
int l,
bool writeLineAnchor)
279 if (!fileName.
empty())
304 *
m_t <<
"<programlisting linenumbering=\"unnumbered\">";
316 *
m_t <<
"</programlisting>";
381 term(
"Could not create output directory {}\n",
dir);
418 m_t <<
"<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
419 m_t <<
"<" << fileType <<
" xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
441 else if (
fileName ==
"mainpage.xml")
445 m_t <<
"</" << fileType <<
">\n";
495 m_t <<
"<chapter>\n";
499 m_t <<
"<chapter>\n";
503 m_t <<
"<chapter>\n";
507 m_t <<
"<chapter>\n";
511 m_t <<
"<chapter>\n";
515 m_t <<
"<chapter>\n";
519 m_t <<
"<chapter>\n";
523 m_t <<
"<chapter>\n";
590 if (!gd->isReference() && !gd->isASubGroup())
596 m_t <<
"</chapter>\n";
603 if (!mod->isReference() && mod->isPrimaryInterface())
609 m_t <<
"</chapter>\n";
617 if (dd->isLinkableInProject())
619 m_t <<
" <xi:include href=\"" << dd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
623 m_t <<
"</chapter>\n";
630 if (nd->isLinkableInProject() && !nd->isAlias())
632 m_t <<
" <xi:include href=\"" << nd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
636 m_t <<
"</chapter>\n";
643 if (cd->isLinkableInProject() && !cd->isAlias())
645 m_t <<
" <xi:include href=\"" << cd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
649 m_t <<
"</chapter>\n";
656 if (cd->isLinkableInProject() &&
657 !cd->isImplicitTemplateInstance() &&
658 !cd->isEmbeddedInOuterScope() &&
662 m_t <<
" <xi:include href=\"" << cd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
666 m_t <<
"</chapter>\n";
673 for (
const auto &fd : *fn)
675 if (fd->isLinkableInProject())
677 m_t <<
" <xi:include href=\"" << fd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
679 if (fd->generateSourceFile())
681 m_t <<
" <xi:include href=\"" << fd->getSourceFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
686 m_t <<
"</chapter>\n";
693 m_t <<
" <xi:include href=\"" << pd->getOutputFileBase() <<
".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
696 m_t <<
"</chapter>\n";
701 if (!pd->getGroupDef() && !pd->isReference() && !pd->hasParentPage()
719 link.
sprintf(
" <xi:include href=\"%s.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n",
731 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast);
735 std::visit(visitor,astImpl->root);
758 m_t <<
"<simplesect>\n";
766 m_t <<
" </title>\n";
780 if (!f.
empty()) result +=
"<link linkend=\"_" +
stripPath(f) +
"_1" + anchor +
"\">";
781 else result +=
"<link linkend=\"_" + anchor +
"\">";
785 result +=
"<link linkend=\"_" +
stripPath(f) +
"\">";
800 m_t <<
" <itemizedlist>\n";
808 m_t <<
" </itemizedlist>\n";
817 m_t <<
" <listitem><para>";
828 m_t <<
"<emphasis role=\"strong\">";
833 m_t <<
"</emphasis>";
838DB_GEN_C2(
"extraIndentLevel " << extraIndentLevel)
865 if (openBracket)
m_t <<
"(";
874 for (
int i=0;i<n;i++)
m_t <<
" ";
879 m_t <<
"<?linebreak?>";
897 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
906 m_t <<
"</programlisting>";
910 int memCount,
int memTotal,
bool)
917 m_t <<
"<computeroutput>[" << memCount <<
"/" << memTotal <<
"]</computeroutput>";
920 if (!memname.
empty() && memname[0]!=
'@')
929 m_t <<
"</computeroutput></para>";
954 m_t <<
"<anchor xml:id=\"_" <<
stripPath(fName) <<
"_1" << anchor <<
"\"/>";
968 m_t <<
"<para><computeroutput>";
977 m_t <<
"<simplesect><title>";
991 m_t <<
"</simplesect>\n";
1002 m_t <<
" <informalfigure>\n";
1003 m_t <<
" <mediaobject>\n";
1004 m_t <<
" <imageobject>\n";
1005 m_t <<
" <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\""
1007 m_t <<
" </imageobject>\n";
1009 m_t <<
" </mediaobject>\n";
1010 m_t <<
" </informalfigure>\n";
1021 m_t <<
"<computeroutput>[" << l <<
"]</computeroutput>";
1022 if (!isLast)
m_t <<
", ";
1032 m_t <<
"<simplesect><title>";
1040 m_t <<
"</simplesect>\n";
1045 m_t <<
"<simplesect><title>";
1050 m_t <<
"</title></simplesect>\n";
1063 m_t <<
"<computeroutput>";
1068 m_t <<
"</computeroutput>";
1077 else if (closeBracket)
1103 if (last && closeBracket)
1167 m_t <<
"<table frame=\"all\">\n";
1169 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1170 for (
int i = 0; i < ncols; i++)
1172 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1181 m_t <<
" </tbody>\n";
1182 m_t <<
" </tgroup>\n";
1183 m_t <<
"</table>\n";
1190 m_t <<
"<row><entry>";
1220 m_t <<
"</entry></row>\n";
1226 int ncols = (hasInits?3:2);
1227 m_t <<
"<informaltable frame=\"all\">\n";
1229 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1231 m_t <<
" <colspec colname='c" << i++ <<
"'/>\n";
1232 if (hasInits)
m_t <<
" <colspec colname='c" << i++ <<
"' align='right'/>\n";
1233 m_t <<
" <colspec colname='c" << i++ <<
"'/>\n";
1241 m_t <<
" </tbody>\n";
1242 m_t <<
" </tgroup>\n";
1243 m_t <<
"</informaltable>\n";
1273 m_t <<
"</entry><entry>";
1284 m_t <<
"</entry><entry>";
1349 m_t <<
"<simplesect><title>";
1351 m_t <<
"</title>\n";
1356 m_t <<
"<para><emphasis role=\"strong\">";
1370 m_t <<
"</emphasis></para>\n";
1383 m_t <<
"</simplesect>\n";
1389 if (!attr.
empty())
m_t <<
" " << attr;
1396 m_t <<
"</section>\n";
1431 m_t <<
"</tocdiv>\n";
1462 m_t <<
" <tocentry>";
1473 m_t <<
"</tocentry>\n";
1481static constexpr auto hex=
"0123456789ABCDEF";
1486 if (s.
empty())
return s;
1489 const char *p = s.
data();
1498 result+=
"<literallayout> 
</literallayout>";
1502 case '<': result+=
"<";
break;
1503 case '>': result+=
">";
break;
1507 case '\'': result+=
"'";
break;
1508 case '"': result+=
""";
break;
1509 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
1510 case 11:
case 12:
case 14:
case 15:
case 16:
case 17:
case 18:
1511 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
1512 case 27:
case 28:
case 29:
case 30:
case 31:
1514 result+=
hex[
static_cast<uint8_t
>(c)>>4];
1515 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
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
OutputCodeDefer< DocbookCodeGenerator > DocbookCodeGeneratorDefer
size_t updateColumnCount(const char *s, size_t col)
DString stripExtensionGeneral(const DString &fName, const DString &ext)
void clearSubDirs(const Dir &d)
void createSubDirs(const Dir &d)
DString relativePathToRoot(const DString &name)
const char * writeHtmlEntity(T &result, const char *s, HtmlEntityMapperFunc &&mapper, const char *fallback)
DString stripPath(const DString &s)
A bunch of utility functions.