diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-04-02 19:27:49 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-04-02 19:27:49 (GMT) |
commit | ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c (patch) | |
tree | 23804fcf753b3487b9a1ea28d4d28b71fa4ae208 /src/config.h | |
parent | deaa34e0c1d990f37fe00e465ac7a22f705904f0 (diff) | |
download | Doxygen-ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c.zip Doxygen-ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c.tar.gz Doxygen-ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c.tar.bz2 |
Release-1.8.3.1-20130402
Diffstat (limited to 'src/config.h')
-rw-r--r-- | src/config.h | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/src/config.h b/src/config.h index a33909c..47bef4c 100644 --- a/src/config.h +++ b/src/config.h @@ -67,6 +67,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; } protected: virtual void writeTemplate(FTextStream &t,bool sl,bool upd) = 0; @@ -75,7 +76,7 @@ class ConfigOption virtual void writeXML(FTextStream&) {} virtual void init() {} - QCString convertToComment(const QCString &s); + QCString convertToComment(const QCString &s, const QCString &u); void writeBoolValue(FTextStream &t,bool v); void writeIntValue(FTextStream &t,int i); void writeStringValue(FTextStream &t,QCString &s); @@ -86,6 +87,7 @@ class ConfigOption QCString m_doc; QCString m_dependency; QCString m_encoding; + QCString m_userComment; OptionType m_kind; }; @@ -135,9 +137,13 @@ class ConfigList : public ConfigOption if (!sl) { t << endl; - t << convertToComment(m_doc); + t << convertToComment(m_doc, m_userComment); t << endl; } + else if (!m_userComment.isEmpty()) + { + t << convertToComment("", m_userComment); + } t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "="; writeStringList(t,m_value); t << "\n"; @@ -175,9 +181,13 @@ class ConfigEnum : public ConfigOption if (!sl) { t << endl; - t << convertToComment(m_doc); + t << convertToComment(m_doc, m_userComment); t << endl; } + else if (!m_userComment.isEmpty()) + { + t << convertToComment("", m_userComment); + } t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "="; writeStringValue(t,m_value); t << "\n"; @@ -216,9 +226,13 @@ class ConfigString : public ConfigOption if (!sl) { t << endl; - t << convertToComment(m_doc); + t << convertToComment(m_doc, m_userComment); t << endl; } + else if (!m_userComment.isEmpty()) + { + t << convertToComment("", m_userComment); + } t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "="; writeStringValue(t,m_value); t << "\n"; @@ -259,9 +273,13 @@ class ConfigInt : public ConfigOption if (!sl) { t << endl; - t << convertToComment(m_doc); + t << convertToComment(m_doc, m_userComment); t << endl; } + else if (!m_userComment.isEmpty()) + { + t << convertToComment("", m_userComment); + } t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "="; if (upd && !m_valueString.isEmpty()) { @@ -306,9 +324,13 @@ class ConfigBool : public ConfigOption if (!sl) { t << endl; - t << convertToComment(m_doc); + t << convertToComment(m_doc, m_userComment); t << endl; } + else if (!m_userComment.isEmpty()) + { + t << convertToComment("", m_userComment); + } t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "="; if (upd && !m_valueString.isEmpty()) { @@ -570,6 +592,22 @@ class Config */ void create(); + /*! Append user comment + */ + void appendUserComment(const QCString &u) + { + m_userComment += u; + } + /*! Take the user comment and reset it internally + * \returns user comment + */ + QCString takeUserComment() + { + QCString result=m_userComment; + m_userComment.resize(0); + return result; + } + protected: Config() @@ -594,6 +632,7 @@ class Config QList<ConfigOption> *m_obsolete; QDict<ConfigOption> *m_dict; static Config *m_instance; + QCString m_userComment; bool m_initialized; }; |