summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2015-01-21 18:50:26 (GMT)
committeralbert-github <albert.tests@gmail.com>2015-01-21 18:50:26 (GMT)
commit9771b807cd776b37f6538dec085442218a5b6a09 (patch)
tree613f8a13f935ed39b14edab21eed955498190a3f
parent7fea8a40916d9c2ed22821cdf228d6a066a3ddec (diff)
downloadDoxygen-9771b807cd776b37f6538dec085442218a5b6a09.zip
Doxygen-9771b807cd776b37f6538dec085442218a5b6a09.tar.gz
Doxygen-9771b807cd776b37f6538dec085442218a5b6a09.tar.bz2
Based on the report of Peter D. Barnes in the doxygen forum (http://doxygen.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.
-rw-r--r--src/config.h18
-rw-r--r--src/config.l13
-rw-r--r--src/config.xml4
3 files changed, 33 insertions, 2 deletions
diff --git a/src/config.h b/src/config.h
index 981f6fe..6715d2c 100644
--- a/src/config.h
+++ b/src/config.h
@@ -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;
diff --git a/src/config.l b/src/config.l
index 4fa3b1e..0002ecb 100644
--- a/src/config.l
+++ b/src/config.l
@@ -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)
{
diff --git a/src/config.xml b/src/config.xml
index 994190d..438b885 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -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.