diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-09 18:55:22 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-24 14:08:14 (GMT) |
commit | 0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6 (patch) | |
tree | f3af0df1bd26f367220386ab4e011a27c9b341fd /src/mangen.cpp | |
parent | 8b3efba55c297d9af5274bf525e53417b78e8be3 (diff) | |
download | Doxygen-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/mangen.cpp')
-rw-r--r-- | src/mangen.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/mangen.cpp b/src/mangen.cpp index 1faa296..8574018 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -74,15 +74,23 @@ static QCString getSubdir() return dir; } -ManGenerator::ManGenerator() : OutputGenerator() +ManGenerator::ManGenerator() : OutputGenerator(Config_getString(MAN_OUTPUT)+"/"+getSubdir()) { - m_dir=Config_getString(MAN_OUTPUT) + "/" + getSubdir(); - m_firstCol=TRUE; - m_paragraph=TRUE; - m_col=0; - m_upperCase=FALSE; - m_insideTabbing=FALSE; - m_inHeader=FALSE; +} + +ManGenerator::ManGenerator(const ManGenerator &og) : OutputGenerator(og) +{ +} + +ManGenerator &ManGenerator::operator=(const ManGenerator &og) +{ + OutputGenerator::operator=(og); + return *this; +} + +std::unique_ptr<OutputGenerator> ManGenerator::clone() const +{ + return std::make_unique<ManGenerator>(*this); } ManGenerator::~ManGenerator() @@ -428,7 +436,7 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName, // name,baseName.data(),buildFileName(baseName).data()); // - remove dangerous characters and append suffix, then add dir prefix - QCString fileName=m_dir+"/"+buildFileName( baseName ); + QCString fileName=dir()+"/"+buildFileName( baseName ); QFile linkfile( fileName ); // - only create file if it doesn't exist already if ( !linkfile.open( IO_ReadOnly ) ) |