Skip to content

Commit

Permalink
issue #9058 Strip leading spaces in QHP file
Browse files Browse the repository at this point in the history
As the `qhp` file is meant for processing by tools, not for humans to read.
To get a better readable form (indentation and line endings) one has to supply the option `-d qhp` to the doxygen command.
  • Loading branch information
albert-github committed Jan 23, 2022
1 parent 9c35e68 commit 7d91d52
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ static std::map< std::string, Debug::DebugMask > s_labels =
{ "plantuml", Debug::Plantuml },
{ "fortranfixed2free", Debug::FortranFixed2Free },
{ "cite", Debug::Cite },
{ "rtf", Debug::Rtf }
{ "rtf", Debug::Rtf },
{ "qhp", Debug::Qhp },
};

//------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class Debug
FortranFixed2Free = 0x00008000,
Cite = 0x00010000,
NoLineNo = 0x00020000,
Rtf = 0x00040000
Rtf = 0x00040000,
Qhp = 0x00080000,
};
static void print(DebugMask mask,int prio,const char *fmt,...);

Expand Down
11 changes: 8 additions & 3 deletions src/qhpxmlwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
#include "qhpxmlwriter.h"
#include "util.h"
#include "qcstring.h"
#include "debug.h"

QhpXmlWriter::QhpXmlWriter()
: m_indentLevel(0), m_curLineIndented(false), m_compress(false)
: m_indentLevel(0), m_curLineIndented(false)
{
m_compress = !Debug::isFlagSet(Debug::Qhp);
}

QhpXmlWriter::~QhpXmlWriter()
Expand Down Expand Up @@ -94,9 +96,12 @@ void QhpXmlWriter::indent()
{
return;
}
for (int i = 0; i < m_indentLevel; i++)
if (!m_compress)
{
m_backend << " ";
for (int i = 0; i < m_indentLevel; i++)
{
m_backend << " ";
}
}
m_curLineIndented = true;
}
Expand Down

0 comments on commit 7d91d52

Please sign in to comment.