diff options
-rw-r--r-- | src/configimpl.h | 1 | ||||
-rw-r--r-- | src/configimpl.l | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/configimpl.h b/src/configimpl.h index 6b85d8a..6134088 100644 --- a/src/configimpl.h +++ b/src/configimpl.h @@ -158,6 +158,7 @@ class ConfigEnum : public ConfigOption QCString *valueRef() { return &m_value; } void substEnvVars(); void writeTemplate(FTextStream &t,bool sl,bool); + void convertStrToVal(); void compareDoxyfile(FTextStream &t); void init() { m_value = m_defValue.copy(); } diff --git a/src/configimpl.l b/src/configimpl.l index daa7d90..eb33610 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -221,6 +221,25 @@ void ConfigBool::convertStrToVal() } } +void ConfigEnum::convertStrToVal() +{ + QCString val = m_value.stripWhiteSpace().lower(); + const char *s=m_valueRange.first(); + while (s) + { + if (QCString(s).lower() == val) + { + m_value = s; + return; + } + s = m_valueRange.next(); + } + + config_warn("argument '%s' for option %s is not a valid enum value\n" + "Using the default: %s!\n",m_value.data(),m_name.data(),m_defValue.data()); + m_value = m_defValue; +} + QCString &ConfigImpl::getString(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); |