|
Doxygen
|
Singleton for configuration variables. More...
#include <src/configimpl.h>
Public Member Functions | |
| ConfigImpl () | |
| void | writeTemplate (TextStream &t, bool shortIndex, bool updateOnly) |
| void | compareDoxyfile (TextStream &t, Config::CompareMode compareMode) |
| void | writeXMLDoxyfile (TextStream &t) |
| void | writeXSDDoxyfile (TextStream &t) |
| void | setHeader (const char *header) |
| void | convertStrToVal (Config::CompareMode compareMode) |
| void | emptyValueToDefault () |
| void | substituteEnvironmentVars () |
| void | init () |
| bool | parseString (const QCString &fn, const QCString &str, bool upd=FALSE) |
| bool | parse (const QCString &fn, bool upd=FALSE) |
| void | appendStartComment (const QCString &u) |
| void | appendUserComment (const QCString &u) |
| void | appendStoreRepl (const QCString &u) |
| QCString | takeStartComment () |
| QCString | takeUserComment () |
| QCString | takeStoreRepl () |
Getting configuration values. | |
| QCString & | getString (const char *fileName, int num, const char *name) const |
| StringVector & | getList (const char *fileName, int num, const char *name) const |
| QCString & | getEnum (const char *fileName, int num, const char *name) const |
| int & | getInt (const char *fileName, int num, const char *name) const |
| bool & | getBool (const char *fileName, int num, const char *name) const |
| ConfigOption * | get (const QCString &name) const |
Adding configuration options. | |
| ConfigInfo * | addInfo (const char *name, const char *doc) |
| ConfigString * | addString (const char *name, const char *doc) |
| ConfigEnum * | addEnum (const char *name, const char *doc, const char *defVal) |
| ConfigList * | addList (const char *name, const char *doc) |
| ConfigInt * | addInt (const char *name, const char *doc, int minVal, int maxVal, int defVal) |
| ConfigBool * | addBool (const char *name, const char *doc, bool defVal) |
| ConfigOption * | addObsolete (const char *name, ConfigOption::OptionType orgType) |
| ConfigOption * | addDisabled (const char *name) |
Static Public Member Functions | |
| static ConfigImpl * | instance () |
| static void | deleteInstance () |
| static void | config_err_ (fmt::string_view fmt, fmt::format_args args) |
| static void | config_term_ (fmt::string_view fmt, fmt::format_args args) |
| static void | config_warn_ (fmt::string_view fmt, fmt::format_args args) |
| template<typename ... Args> | |
| static void | config_err (fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename ... Args> | |
| static void | config_term (fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename ... Args> | |
| static void | config_warn (fmt::format_string< Args... > fmt, Args &&... args) |
Static Private Attributes | |
| static std::unique_ptr< ConfigImpl > | m_instance |
Singleton for configuration variables.
This object holds the global static variables read from a user-supplied configuration file. The static member instance() can be used to get a pointer to the one and only instance.
Set all variables to their default values by calling Config::instance()->init()
Definition at line 342 of file configimpl.h.
| ConfigImpl::ConfigImpl | ( | ) |
Definition at line 1568 of file configimpl.l.
References addConfigOptions().
Referenced by instance().
|
inline |
Adds a new boolean option with name and documentation doc. The boolean has a default value of defVal.
Definition at line 479 of file configimpl.h.
|
inline |
Adds an option that has been disabled at compile time.
Definition at line 499 of file configimpl.h.
References m_dict, and m_disabled.
|
inline |
Adds a new enumeration option with name and documentation doc and initial value defVal.
Definition at line 438 of file configimpl.h.
|
inline |
Starts a new configuration section with name and description doc.
Definition at line 415 of file configimpl.h.
References m_options.
|
inline |
Adds a new integer option with name and documentation doc. The integer has a range between minVal and maxVal and a default value of defVal.
Definition at line 465 of file configimpl.h.
|
inline |
Adds a new string option with name and documentation doc.
Definition at line 451 of file configimpl.h.
|
inline |
Adds an option that has become obsolete.
Definition at line 490 of file configimpl.h.
References m_dict, and m_obsolete.
|
inline |
Adds a new string option with name and documentation doc.
Definition at line 425 of file configimpl.h.
|
inline |
Append user start comment
Definition at line 566 of file configimpl.h.
References m_startComment.
|
inline |
Append replacement string
Definition at line 578 of file configimpl.h.
References m_storeRepl.
|
inline |
Append user comment
Definition at line 572 of file configimpl.h.
References m_userComment.
| void ConfigImpl::compareDoxyfile | ( | TextStream & | t, |
| Config::CompareMode | compareMode ) |
Writes a the differences between the current configuration and the template configuration to stream t.
Definition at line 1338 of file configimpl.l.
References ConfigOption::compareDoxyfile(), m_options, m_storeRepl, ConfigOption::m_userComment, and takeStoreRepl().
Referenced by Config::compareDoxyfile().
|
inlinestatic |
Definition at line 615 of file configimpl.h.
References config_err_().
Referenced by tryPath().
|
static |
Definition at line 59 of file configimpl.l.
References error_str.
Referenced by config_err().
|
inlinestatic |
Definition at line 621 of file configimpl.h.
References config_term_().
Referenced by Config::checkAndCorrect(), configFileToString(), configStringRecode(), getBool(), getEnum(), getInt(), getList(), getString(), init(), and readIncludeFile().
|
static |
Definition at line 64 of file configimpl.l.
References error_str.
Referenced by config_term().
|
inlinestatic |
Definition at line 627 of file configimpl.h.
References config_warn_().
Referenced by ConfigBool::convertStrToVal(), ConfigEnum::convertStrToVal(), ConfigInt::convertStrToVal(), processList(), processString(), and setTranslator().
|
static |
Definition at line 71 of file configimpl.l.
References warning_str.
Referenced by config_warn().
| void ConfigImpl::convertStrToVal | ( | Config::CompareMode | compareMode | ) |
Converts the string values read from the configuration file to real values for non-string type options (like int, and bools)
Definition at line 1377 of file configimpl.l.
References ConfigOption::convertStrToVal(), and m_options.
|
inlinestatic |
Delete the instance
Definition at line 357 of file configimpl.h.
References m_instance.
Referenced by Config::deinit().
| void ConfigImpl::emptyValueToDefault | ( | ) |
Sets default value in case value is empty
Definition at line 1384 of file configimpl.l.
References ConfigOption::emptyValueToDefault(), and m_options.
|
inline |
Returns the ConfigOption corresponding with name or 0 if the option is not supported.
Definition at line 400 of file configimpl.h.
References m_dict, and QCString::str().
Referenced by DocPara::handleDoxyConfig(), init(), and Config::updateObsolete().
| bool & ConfigImpl::getBool | ( | const char * | fileName, |
| int | num, | ||
| const char * | name ) const |
Returns the value of the boolean option with name name. The arguments num and fileName are for debugging purposes only. There is a convenience function Config_getBool() for this.
Definition at line 341 of file configimpl.l.
References config_term(), m_dict, and ConfigOption::O_Bool.
| QCString & ConfigImpl::getEnum | ( | const char * | fileName, |
| int | num, | ||
| const char * | name ) const |
Returns the value of the enum option with name name. The arguments num and fileName are for debugging purposes only. There is a convenience function Config_getEnum() for this.
Definition at line 313 of file configimpl.l.
References config_term(), m_dict, and ConfigOption::O_Enum.
| int & ConfigImpl::getInt | ( | const char * | fileName, |
| int | num, | ||
| const char * | name ) const |
Returns the value of the integer option with name name. The arguments num and fileName are for debugging purposes only. There is a convenience function Config_getInt() for this.
Definition at line 327 of file configimpl.l.
References config_term(), m_dict, and ConfigOption::O_Int.
| StringVector & ConfigImpl::getList | ( | const char * | fileName, |
| int | num, | ||
| const char * | name ) const |
Returns the value of the list option with name name. The arguments num and fileName are for debugging purposes only. There is a convenience function Config_getList() for this.
Definition at line 299 of file configimpl.l.
References config_term(), m_dict, and ConfigOption::O_List.
| QCString & ConfigImpl::getString | ( | const char * | fileName, |
| int | num, | ||
| const char * | name ) const |
Returns the value of the string option with name name. The arguments num and fileName are for debugging purposes only. There is a convenience function Config_getString() for this.
Definition at line 285 of file configimpl.l.
References config_term(), m_dict, and ConfigOption::O_String.
| void ConfigImpl::init | ( | ) |
Initialize config variables to their default value
Definition at line 1545 of file configimpl.l.
References config_term(), ConfigOption::dependsOn(), get(), ConfigOption::init(), instance(), QCString::isEmpty(), m_options, and ConfigOption::name().
Referenced by Config::init().
|
inlinestatic |
Returns the one and only instance of this class
Definition at line 351 of file configimpl.h.
References ConfigImpl(), and m_instance.
Referenced by Config::compareDoxyfile(), Config::deinit(), DocPara::handleDoxyConfig(), Config::init(), init(), Config::parse(), parseString(), Config::postProcess(), Config::updateObsolete(), Config::writeTemplate(), Config::writeXMLDoxyfile(), and Config::writeXSDDoxyfile().
Parse a configuration file with name fn.
Definition at line 1624 of file configimpl.l.
References configFileToString(), g_encoding, Debug::Lex_configimpl, parseString(), and qPrint().
Referenced by Config::parse().
Parse a configuration data in string str.
Definition at line 1604 of file configimpl.l.
References QCString::data(), FALSE, g_config, g_configUpdate, g_includeStack, g_inputPosition, g_inputString, g_yyFileName, g_yyLineNr, instance(), Debug::isFlagSet(), Debug::Lex_configimpl, and TRUE.
Referenced by parse().
|
inline |
| void ConfigImpl::substituteEnvironmentVars | ( | ) |
Replaces references to environment variable by the actual value of the environment variable.
Definition at line 1537 of file configimpl.l.
References m_options, and ConfigOption::substEnvVars().
|
inline |
Take the user start comment and reset it internally
Definition at line 585 of file configimpl.h.
References m_startComment, and substitute().
Referenced by writeTemplate().
|
inline |
Take the replacement string
Definition at line 603 of file configimpl.h.
References m_storeRepl, and substitute().
Referenced by compareDoxyfile().
|
inline |
Take the user comment and reset it internally
Definition at line 594 of file configimpl.h.
References m_userComment, and substitute().
Referenced by writeTemplate().
| void ConfigImpl::writeTemplate | ( | TextStream & | t, |
| bool | shortIndex, | ||
| bool | updateOnly ) |
Writes a template configuration to stream t. If shortIndex is TRUE the description of each configuration option will be omitted.
Definition at line 1314 of file configimpl.l.
References convertToComment(), m_header, m_options, m_startComment, m_userComment, takeStartComment(), takeUserComment(), and ConfigOption::writeTemplate().
Referenced by Config::writeTemplate().
| void ConfigImpl::writeXMLDoxyfile | ( | TextStream & | t | ) |
Writes a the used settings of the current configuration as XML format to stream t.
Definition at line 1354 of file configimpl.l.
References m_options, theTranslator, and ConfigOption::writeXMLDoxyfile().
Referenced by Config::writeXMLDoxyfile().
| void ConfigImpl::writeXSDDoxyfile | ( | TextStream & | t | ) |
Writes all possible setting ids to an XSD file for validation through the stream t.
Definition at line 1365 of file configimpl.l.
References m_disabled, m_options, and ConfigOption::writeXSDDoxyfile().
Referenced by Config::writeXSDDoxyfile().
|
private |
Definition at line 636 of file configimpl.h.
Referenced by addBool(), addDisabled(), addEnum(), addInt(), addList(), addObsolete(), addString(), get(), getBool(), getEnum(), getInt(), getList(), and getString().
|
private |
Definition at line 635 of file configimpl.h.
Referenced by addDisabled(), and writeXSDDoxyfile().
|
private |
Definition at line 641 of file configimpl.h.
Referenced by setHeader(), and writeTemplate().
|
staticprivate |
Definition at line 637 of file configimpl.h.
Referenced by deleteInstance(), and instance().
|
private |
Definition at line 634 of file configimpl.h.
Referenced by addObsolete().
|
private |
Definition at line 633 of file configimpl.h.
Referenced by addBool(), addEnum(), addInfo(), addInt(), addList(), addString(), compareDoxyfile(), convertStrToVal(), emptyValueToDefault(), init(), substituteEnvironmentVars(), writeTemplate(), writeXMLDoxyfile(), and writeXSDDoxyfile().
|
private |
Definition at line 638 of file configimpl.h.
Referenced by appendStartComment(), takeStartComment(), and writeTemplate().
|
private |
Definition at line 640 of file configimpl.h.
Referenced by appendStoreRepl(), compareDoxyfile(), and takeStoreRepl().
|
private |
Definition at line 639 of file configimpl.h.
Referenced by appendUserComment(), takeUserComment(), and writeTemplate().