Permalink
Browse files

Based on the report of Peter D. Barnes in the doxygen forum (http://d…

…oxygen.10944.n7.nabble.com/doxygen-1-8-9-1-upgrade-errors-td6990.html)

All lines at the beginning of the file starting with ## are preserved at the beginning of the Doxyfile
Consecutive user comments (with +=) are now joined like the options are.
  • Loading branch information...
albert-github committed Jan 21, 2015
1 parent 7fea8a4 commit 9771b807cd776b37f6538dec085442218a5b6a09
Showing with 33 additions and 2 deletions.
  1. +17 −1 src/config.h
  2. +13 −0 src/config.l
  3. +3 −1 src/config.xml
View
@@ -69,7 +69,7 @@ class ConfigOption
QCString dependsOn() const { return m_dependency; }
void addDependency(const char *dep) { m_dependency = dep; }
void setEncoding(const QCString &e) { m_encoding = e; }
void setUserComment(const QCString &u) { m_userComment = u; }
void setUserComment(const QCString &u) { m_userComment += u; }
protected:
virtual void writeTemplate(FTextStream &t,bool sl,bool upd) = 0;
@@ -507,12 +507,27 @@ class Config
*/
void create();
/*! Append user start comment
*/
void appendStartComment(const QCString &u)
{
m_startComment += u;
}
/*! Append user comment
*/
void appendUserComment(const QCString &u)
{
m_userComment += u;
}
/*! Take the user start comment and reset it internally
* \returns user start comment
*/
QCString takeStartComment()
{
QCString result=m_startComment;
m_startComment.resize(0);
return result.replace(QRegExp("\r"),"");
}
/*! Take the user comment and reset it internally
* \returns user comment
*/
@@ -552,6 +567,7 @@ class Config
QList<ConfigOption> *m_disabled;
QDict<ConfigOption> *m_dict;
static Config *m_instance;
QCString m_startComment;
QCString m_userComment;
bool m_initialized;
QCString m_header;
View
@@ -617,6 +617,13 @@ static void readIncludeFile(const char *incName)
%%
<*>\0x0d
/*
<PreStart>"##".*"\n" { config->appendStartComment(yytext);}
<PreStart>. {
BEGIN(Start);
REJECT;
}
*/
<Start,GetString,GetStrList,GetBool,SkipInvalid>"##".*"\n" { config->appendUserComment(yytext);}
<Start,GetString,GetStrList,GetBool,SkipInvalid>"#" { BEGIN(SkipComment); }
<Start>[a-z_A-Z][a-z_A-Z0-9]*[ \t]*"=" { QCString cmd=yytext;
@@ -851,6 +858,12 @@ static void readIncludeFile(const char *incName)
void Config::writeTemplate(FTextStream &t,bool sl,bool upd)
{
/* print first lines of user comment that were at the beginning of the file, might have special meaning for editors */
if (m_startComment)
{
t << takeStartComment();
t << "\n";
}
t << "# Doxyfile " << versionString << endl << endl;
if (!sl)
{
View
@@ -29,7 +29,9 @@ parsed by \c doxygen. The file may contain tabs and newlines for
formatting purposes. The statements in the file are case-sensitive.
Comments may be placed anywhere within the file (except within quotes).
Comments beginning with two hash characters (\c \#\#) are kept when updating
the configuration file and are placed in front of the TAG are in front of.
the configuration file and are placed in front of the TAG they are in front of.
Comments beginning with two hash characters (\c \#\#) at the beginning of the
configuration file are also kept and placed at the beginning of the file.
Comments beginning with two hash characters (\c \#\#) at the end of the
configuration file are also kept and placed at the end of the file.
Comments begin with the hash character (\c \#) and ends at the end of the line.

0 comments on commit 9771b80

Please sign in to comment.