summaryrefslogtreecommitdiffstats
path: root/src/docbookgen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-09 18:55:22 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-24 14:08:14 (GMT)
commit0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6 (patch)
treef3af0df1bd26f367220386ab4e011a27c9b341fd /src/docbookgen.cpp
parent8b3efba55c297d9af5274bf525e53417b78e8be3 (diff)
downloadDoxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.zip
Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.tar.gz
Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.tar.bz2
Refactoring: OutputList & OutputGen
- Initialized member variables inside the class - Added copy & assign operators for OutputGenerator and Derived classes. - throw a runtime exception when OutputGenerator is copied while is file is still in progress. - Added clone method to make a copy of OutputList. - Moved the implementation of enable() & disable() and friend into OutputGen instead of having the same implementation in each derived class. - Made m_dir and m_fileName readonly (members dir() and fileName()) - Removed call to new while adding generators to OutputList - Replaced QStack by std::stack for the "enabled" state.
Diffstat (limited to 'src/docbookgen.cpp')
-rw-r--r--src/docbookgen.cpp50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp
index e5c9a6b..da7987b 100644
--- a/src/docbookgen.cpp
+++ b/src/docbookgen.cpp
@@ -89,7 +89,7 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col)
{
case '\t':
{
- static int tabSize = Config_getInt(TAB_SIZE);
+ int tabSize = Config_getInt(TAB_SIZE);
int spacesToNextTabStop = tabSize - (col%tabSize);
col+=spacesToNextTabStop;
while (spacesToNextTabStop--) t << "&#32;";
@@ -140,7 +140,6 @@ DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t)
DocbookCodeGenerator::DocbookCodeGenerator()
{
- m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING);
}
DocbookCodeGenerator::~DocbookCodeGenerator() {}
@@ -255,25 +254,24 @@ void DocbookCodeGenerator::endCodeFragment()
m_t << "</computeroutput></literallayout>" << endl;
}
-DocbookGenerator::DocbookGenerator() : OutputGenerator()
+DocbookGenerator::DocbookGenerator() : OutputGenerator(Config_getString(DOCBOOK_OUTPUT))
{
DB_GEN_C
- m_dir=Config_getString(DOCBOOK_OUTPUT);
- //insideTabbing=FALSE;
- //firstDescItem=TRUE;
- //disableLinks=FALSE;
- //m_indent=0;
- //templateMemberItem = FALSE;
- m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING);
- m_denseText = FALSE;
- m_inGroup = FALSE;
- m_inDetail = FALSE;
- m_levelListItem = 0;
- m_descTable = FALSE;
- m_inLevel = -1;
- m_firstMember = FALSE;
- for (size_t i = 0 ; i < sizeof(m_inListItem) / sizeof(*m_inListItem) ; i++) m_inListItem[i] = FALSE;
- for (size_t i = 0 ; i < sizeof(m_inSimpleSect) / sizeof(*m_inSimpleSect) ; i++) m_inSimpleSect[i] = FALSE;
+}
+
+DocbookGenerator::DocbookGenerator(const DocbookGenerator &og) : OutputGenerator(og)
+{
+}
+
+DocbookGenerator &DocbookGenerator::operator=(const DocbookGenerator &og)
+{
+ OutputGenerator::operator=(og);
+ return *this;
+}
+
+std::unique_ptr<OutputGenerator> DocbookGenerator::clone() const
+{
+ return std::make_unique<DocbookGenerator>(*this);
}
DocbookGenerator::~DocbookGenerator()
@@ -428,7 +426,7 @@ DB_GEN_C2("IndexSections " << is)
void DocbookGenerator::endIndexSection(IndexSections is)
{
DB_GEN_C2("IndexSections " << is)
- static bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
+ bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
switch (is)
{
case isTitlePageStart:
@@ -913,7 +911,7 @@ DB_GEN_C
t << " <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\""
<< relPath << fileName << ".png\">" << "</imagedata>" << endl;
t << " </imageobject>" << endl;
- d.writeImage(t,m_dir,relPath,fileName,FALSE);
+ d.writeImage(t,dir(),relPath,fileName,FALSE);
t << " </mediaobject>" << endl;
t << " </informalfigure>" << endl;
t << "</para>" << endl;
@@ -1104,7 +1102,7 @@ DB_GEN_C
void DocbookGenerator::endGroupCollaboration(DotGroupCollaboration &g)
{
DB_GEN_C
- g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),m_fileName,relPath,FALSE);
+ g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startDotGraph()
{
@@ -1113,7 +1111,7 @@ DB_GEN_C
void DocbookGenerator::endDotGraph(DotClassGraph &g)
{
DB_GEN_C
- g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),m_fileName,relPath,TRUE,FALSE);
+ g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,TRUE,FALSE);
}
void DocbookGenerator::startInclDepGraph()
{
@@ -1122,7 +1120,7 @@ DB_GEN_C
void DocbookGenerator::endInclDepGraph(DotInclDepGraph &g)
{
DB_GEN_C
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), m_fileName,relPath,FALSE);
+ QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startCallGraph()
{
@@ -1131,7 +1129,7 @@ DB_GEN_C
void DocbookGenerator::endCallGraph(DotCallGraph &g)
{
DB_GEN_C
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), m_fileName,relPath,FALSE);
+ QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startDirDepGraph()
{
@@ -1140,7 +1138,7 @@ DB_GEN_C
void DocbookGenerator::endDirDepGraph(DotDirDeps &g)
{
DB_GEN_C
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), m_fileName,relPath,FALSE);
+ QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startMemberDocList()
{