23#include <unordered_map>
90 void writeIntValue(TextStream &t,
int i,
bool initSpace =
true);
91 void writeStringValue(TextStream &t,
const QCString &s,
bool initSpace =
true,
bool wasQuoted =
false);
320#define ConfigImpl_getString(val) ConfigImpl::instance()->getString(__FILE__,__LINE__,val)
321#define ConfigImpl_getInt(val) ConfigImpl::instance()->getInt(__FILE__,__LINE__,val)
322#define ConfigImpl_getList(val) ConfigImpl::instance()->getList(__FILE__,__LINE__,val)
323#define ConfigImpl_getEnum(val) ConfigImpl::instance()->getEnum(__FILE__,__LINE__,val)
324#define ConfigImpl_getBool(val) ConfigImpl::instance()->getBool(__FILE__,__LINE__,val)
370 QCString &
getString(
const char *fileName,
int num,
const char *name)
const;
382 QCString &
getEnum(
const char *fileName,
int num,
const char *name)
const;
388 int &
getInt(
const char *fileName,
int num,
const char *name)
const;
394 bool &
getBool(
const char *fileName,
int num,
const char *name)
const;
399 ConfigOption *
get(
const QCString &name)
const
402 return it!=
m_dict.end() ? it->second :
nullptr;
414 ConfigInfo *
addInfo(
const char *name,
const char *doc)
416 ConfigInfo *result =
new ConfigInfo(name,doc);
417 m_options.push_back(std::unique_ptr<ConfigOption>(result));
427 ConfigString *result =
new ConfigString(name,doc);
428 m_options.push_back(std::unique_ptr<ConfigOption>(result));
429 m_dict.emplace(name,result);
441 ConfigEnum *result =
new ConfigEnum(name,doc,defVal);
442 m_options.push_back(std::unique_ptr<ConfigOption>(result));
443 m_dict.emplace(name,result);
453 ConfigList *result =
new ConfigList(name,doc);
454 m_options.push_back(std::unique_ptr<ConfigOption>(result));
455 m_dict.emplace(name,result);
466 int minVal,
int maxVal,
int defVal)
468 ConfigInt *result =
new ConfigInt(name,doc,minVal,maxVal,defVal);
469 m_options.push_back(std::unique_ptr<ConfigOption>(result));
470 m_dict.emplace(name,result);
482 ConfigBool *result =
new ConfigBool(name,doc,defVal);
483 m_options.push_back(std::unique_ptr<ConfigOption>(result));
484 m_dict.emplace(name,result);
491 ConfigObsolete *result =
new ConfigObsolete(name,orgType);
492 m_obsolete.push_back(std::unique_ptr<ConfigOption>(result));
493 m_dict.emplace(name,result);
500 ConfigDisabled *result =
new ConfigDisabled(name);
501 m_disabled.push_back(std::unique_ptr<ConfigOption>(result));
502 m_dict.emplace(name,result);
511 void writeTemplate(TextStream &t,
bool shortIndex,
bool updateOnly);
561 bool parse(
const QCString &fn,
bool upd =
FALSE);
ConfigBool(const char *name, const char *doc, bool defVal)
void writeTemplate(TextStream &t, bool sl, bool upd) override
bool isDefault() override
void writeXMLDoxyfile(TextStream &t) override
void writeXSDDoxyfile(TextStream &t) override
void substEnvVars() override
QCString * valueStringRef()
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
void convertStrToVal(Config::CompareMode compareMode) override
void setValueString(const QCString &v)
void writeXSDDoxyfile(TextStream &) override
void writeXMLDoxyfile(TextStream &) override
ConfigDisabled(const char *name)
void compareDoxyfile(TextStream &, Config::CompareMode) override
void writeTemplate(TextStream &, bool, bool) override
void substEnvVars() override
void writeTemplate(TextStream &t, bool sl, bool) override
void writeXSDDoxyfile(TextStream &t) override
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
bool isDefault() override
void writeXMLDoxyfile(TextStream &t) override
void addValue(const char *v)
std::vector< QCString > m_valueRange
const std::vector< QCString > & values() const
ConfigEnum(const char *name, const char *doc, const char *defVal)
void substEnvVars() override
void convertStrToVal(Config::CompareMode compareMode) override
ConfigInt * addInt(const char *name, const char *doc, int minVal, int maxVal, int defVal)
ConfigEnum * addEnum(const char *name, const char *doc, const char *defVal)
ConfigOptionList m_options
static void deleteInstance()
static void config_term(const char *fmt,...)
ConfigOptionList m_obsolete
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode)
void convertStrToVal(Config::CompareMode compareMode)
void appendUserComment(const QCString &u)
ConfigOption * addDisabled(const char *name)
static ConfigImpl * instance()
ConfigList * addList(const char *name, const char *doc)
void substituteEnvironmentVars()
bool parseString(const QCString &fn, const QCString &str, bool upd=FALSE)
static void config_warn(const char *fmt,...)
void setHeader(const char *header)
QCString & getEnum(const char *fileName, int num, const char *name) const
bool parse(const QCString &fn, bool upd=FALSE)
QCString takeStartComment()
ConfigOption * get(const QCString &name) const
void appendStoreRepl(const QCString &u)
static void config_err(const char *fmt,...)
void appendStartComment(const QCString &u)
void writeXMLDoxyfile(TextStream &t)
StringVector & getList(const char *fileName, int num, const char *name) const
void writeXSDDoxyfile(TextStream &t)
QCString takeUserComment()
ConfigString * addString(const char *name, const char *doc)
void writeTemplate(TextStream &t, bool shortIndex, bool updateOnly)
ConfigInfo * addInfo(const char *name, const char *doc)
ConfigBool * addBool(const char *name, const char *doc, bool defVal)
static std::unique_ptr< ConfigImpl > m_instance
bool & getBool(const char *fileName, int num, const char *name) const
ConfigOptionList m_disabled
int & getInt(const char *fileName, int num, const char *name) const
ConfigOption * addObsolete(const char *name, ConfigOption::OptionType orgType)
void emptyValueToDefault()
QCString & getString(const char *fileName, int num, const char *name) const
void substEnvVars() override
void writeXMLDoxyfile(TextStream &) override
void writeXSDDoxyfile(TextStream &t) override
ConfigInfo(const char *name, const char *doc)
void compareDoxyfile(TextStream &, Config::CompareMode) override
void writeTemplate(TextStream &t, bool sl, bool) override
ConfigInt(const char *name, const char *doc, int minVal, int maxVal, int defVal)
QCString * valueStringRef()
bool isDefault() override
void writeXMLDoxyfile(TextStream &t) override
void convertStrToVal(Config::CompareMode compareMode) override
void writeXSDDoxyfile(TextStream &t) override
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
void writeTemplate(TextStream &t, bool sl, bool upd) override
void substEnvVars() override
void setWidgetType(WidgetType w)
void substEnvVars() override
StringVector * valueRef()
void writeTemplate(TextStream &t, bool sl, bool) override
void addValue(const char *v)
StringVector getDefault()
bool isDefault() override
ConfigList(const char *name, const char *doc)
StringVector m_defaultValue
void writeXMLDoxyfile(TextStream &t) override
WidgetType widgetType() const
void emptyValueToDefault() override
void writeXSDDoxyfile(TextStream &t) override
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
void writeXSDDoxyfile(TextStream &) override
ConfigObsolete(const char *name, OptionType orgType)
void writeTemplate(TextStream &, bool, bool) override
StringVector * valueListRef()
QCString * valueStringRef()
OptionType orgType() const
void substEnvVars() override
void writeXMLDoxyfile(TextStream &) override
void compareDoxyfile(TextStream &, Config::CompareMode) override
virtual void convertStrToVal(Config::CompareMode)
void setEncoding(const QCString &e)
void addDependency(const char *dep)
virtual void writeXMLDoxyfile(TextStream &t)=0
void writeStringValue(TextStream &t, const QCString &s, bool initSpace=true, bool wasQuoted=false)
ConfigOption(OptionType t)
virtual void writeTemplate(TextStream &t, bool sl, bool upd)=0
void setUserComment(const QCString &u)
void writeIntValue(TextStream &t, int i, bool initSpace=true)
void writeStringList(TextStream &t, const StringVector &l)
virtual void writeXSDDoxyfile(TextStream &t)=0
QCString dependsOn() const
virtual void emptyValueToDefault()
virtual void compareDoxyfile(TextStream &t, Config::CompareMode compareMode)=0
@ O_Disabled
Disabled compile time option.
@ O_Enum
A fixed set of items.
@ O_Obsolete
An obsolete option.
@ O_Info
A section header.
virtual void substEnvVars()=0
void writeBoolValue(TextStream &t, bool v, bool initSpace=true)
void substEnvVars() override
bool isDefault() override
void setWidgetType(WidgetType w)
void writeXSDDoxyfile(TextStream &t) override
WidgetType widgetType() const
void writeXMLDoxyfile(TextStream &t) override
void writeTemplate(TextStream &t, bool sl, bool) override
void setDefaultValue(const char *v)
void emptyValueToDefault() override
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
ConfigString(const char *name, const char *doc)
const std::string & str() const
Text streaming class that buffers data.
std::vector< std::unique_ptr< ConfigOption > > ConfigOptionList
std::unordered_map< std::string, ConfigOption * > ConfigOptionMap
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
std::vector< std::string > StringVector
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst