summaryrefslogtreecommitdiffstats
path: root/src/docbookgen.h
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.h
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.h')
-rw-r--r--src/docbookgen.h53
1 files changed, 23 insertions, 30 deletions
diff --git a/src/docbookgen.h b/src/docbookgen.h
index bed2f5f..0fefe4b 100644
--- a/src/docbookgen.h
+++ b/src/docbookgen.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
-*
+*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
@@ -15,6 +15,7 @@
#ifndef DOCBOOKGEN_H
#define DOCBOOKGEN_H
+#include "config.h"
#include "outputgen.h"
class DocbookCodeGenerator : public CodeOutputInterface
@@ -57,16 +58,16 @@ class DocbookCodeGenerator : public CodeOutputInterface
private:
FTextStream m_t;
- bool m_streamSet = FALSE;
+ bool m_streamSet = false;
QCString m_refId;
QCString m_external;
int m_lineNumber = -1;
int m_col = 0;
- bool m_insideCodeLine = FALSE;
- bool m_insideSpecialHL = FALSE;
+ bool m_insideCodeLine = false;
+ bool m_insideSpecialHL = false;
QCString m_relPath;
QCString m_sourceFileName;
- bool m_prettyCode = FALSE;
+ bool m_prettyCode = Config_getBool(DOCBOOK_PROGRAMLISTING);
};
@@ -97,20 +98,14 @@ class DocbookGenerator : public OutputGenerator
{
public:
DocbookGenerator();
- ~DocbookGenerator();
+ DocbookGenerator(const DocbookGenerator &o);
+ DocbookGenerator &operator=(const DocbookGenerator &o);
+ virtual ~DocbookGenerator();
+ virtual std::unique_ptr<OutputGenerator> clone() const;
+
static void init();
- ///////////////////////////////////////////////////////////////
- // generic generator methods
- ///////////////////////////////////////////////////////////////
- void enable()
- { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
- void disable() { m_active=FALSE; }
- void enableIf(OutputType o) { if (o==Docbook) enable(); }
- void disableIf(OutputType o) { if (o==Docbook) disable(); }
- void disableIfNot(OutputType o) { if (o!=Docbook) disable(); }
- bool isEnabled(OutputType o) { return (o==Docbook && m_active); }
- OutputGenerator *get(OutputType o) { return (o==Docbook) ? this : 0; }
+ OutputType type() const { return Docbook; }
// --- CodeOutputInterface
void codify(const char *text)
@@ -343,21 +338,19 @@ class DocbookGenerator : public OutputGenerator
void addWord(const char *,bool) {DB_GEN_EMPTY}
private:
- DocbookGenerator(const DocbookGenerator &o);
- DocbookGenerator &operator=(const DocbookGenerator &o);
-
+
QCString relPath;
DocbookCodeGenerator m_codeGen;
- bool m_prettyCode;
- bool m_denseText;
- bool m_inGroup;
- bool m_inDetail;
- int m_levelListItem;
- bool m_inListItem[20];
- bool m_inSimpleSect[20];
- bool m_descTable;
- int m_inLevel;
- bool m_firstMember;
+ bool m_prettyCode = Config_getBool(DOCBOOK_PROGRAMLISTING);
+ bool m_denseText = false;
+ bool m_inGroup = false;
+ bool m_inDetail = false;
+ int m_levelListItem = 0;
+ bool m_inListItem[20] = { false, };
+ bool m_inSimpleSect[20] = { false, };
+ bool m_descTable = false;
+ int m_inLevel = -1;
+ bool m_firstMember = false;
};
#endif