The ConfigImpl
Class Reference
Singleton for configuration variables. More...
Declaration
Included Headers
Public Constructors Index
ConfigImpl () | |
Public Member Functions Index
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 () |
Private Member Attributes Index
ConfigOptionList | m_options |
ConfigOptionList | m_obsolete |
ConfigOptionList | m_disabled |
ConfigOptionMap | m_dict |
QCString | m_startComment |
QCString | m_userComment |
QCString | m_storeRepl |
QCString | m_header |
Public Static Functions Index
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) |
Private Static Attributes Index
static std::unique_ptr< ConfigImpl > | m_instance |
Getting configuration values. Index
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. Index
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) |
Description
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.
Public Constructors
ConfigImpl()
|
Declaration at line 348 of file configimpl.h, definition at line 1564 of file configimpl.l.
Reference addConfigOptions.
Referenced by instance.
Public Member Functions
appendStartComment()
| inline |
appendStoreRepl()
| inline |
appendUserComment()
| inline |
compareDoxyfile()
|
Writes a the differences between the current configuration and the template configuration to stream t.
Declaration at line 517 of file configimpl.h, definition at line 1334 of file configimpl.l.
References ConfigOption::compareDoxyfile, m_options, m_storeRepl, ConfigOption::m_userComment and takeStoreRepl.
Referenced by Config::compareDoxyfile.
convertStrToVal()
|
Converts the string values read from the configuration file to real values for non-string type options (like int, and bools)
Declaration at line 538 of file configimpl.h, definition at line 1373 of file configimpl.l.
References ConfigOption::convertStrToVal and m_options.
emptyValueToDefault()
|
Sets default value in case value is empty
Declaration at line 542 of file configimpl.h, definition at line 1380 of file configimpl.l.
References ConfigOption::emptyValueToDefault and m_options.
init()
|
Initialize config variables to their default value
Declaration at line 550 of file configimpl.h, definition at line 1541 of file configimpl.l.
References config_term, ConfigOption::dependsOn, get, ConfigOption::init, instance, QCString::isEmpty, m_options and ConfigOption::name.
Referenced by Config::init.
parse()
Parse a configuration file with name fn.
- Returns
TRUE if successful, FALSE if the file could not be opened or read.
Declaration at line 562 of file configimpl.h, definition at line 1620 of file configimpl.l.
References configFileToString, g_encoding, Debug::Lex_configimpl, parseString and qPrint.
Referenced by Config::parse.
parseString()
Parse a configuration data in string str.
- Returns
TRUE if successful, or FALSE if the string could not be parsed.
Declaration at line 556 of file configimpl.h, definition at line 1600 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.
setHeader()
| inline |
Definition at line 529 of file configimpl.h.
Reference m_header.
substituteEnvironmentVars()
|
Replaces references to environment variable by the actual value of the environment variable.
Declaration at line 547 of file configimpl.h, definition at line 1533 of file configimpl.l.
References m_options and ConfigOption::substEnvVars.
takeStartComment()
| inline |
Take the user start comment and reset it internally
- Returns
user start comment
Definition at line 585 of file configimpl.h.
References m_startComment and substitute.
Referenced by writeTemplate.
takeStoreRepl()
| inline |
Take the replacement string
- Returns
the replacement string
Definition at line 603 of file configimpl.h.
References m_storeRepl and substitute.
Referenced by compareDoxyfile.
takeUserComment()
| inline |
Take the user comment and reset it internally
- Returns
user comment
Definition at line 594 of file configimpl.h.
References m_userComment and substitute.
Referenced by writeTemplate.
writeTemplate()
|
Writes a template configuration to stream t. If shortIndex is TRUE the description of each configuration option will be omitted.
Declaration at line 512 of file configimpl.h, definition at line 1310 of file configimpl.l.
References convertToComment, m_header, m_options, m_startComment, m_userComment, takeStartComment, takeUserComment and ConfigOption::writeTemplate.
Referenced by Config::writeTemplate.
writeXMLDoxyfile()
|
Writes a the used settings of the current configuration as XML format to stream t.
Declaration at line 522 of file configimpl.h, definition at line 1350 of file configimpl.l.
References m_options, theTranslator and ConfigOption::writeXMLDoxyfile.
Referenced by Config::writeXMLDoxyfile.
writeXSDDoxyfile()
|
Writes all possible setting ids to an XSD file for validation through the stream t.
Declaration at line 527 of file configimpl.h, definition at line 1361 of file configimpl.l.
References m_disabled, m_options and ConfigOption::writeXSDDoxyfile.
Referenced by Config::writeXSDDoxyfile.
Private Member Attributes
m_dict
|
Definition at line 636 of file configimpl.h.
Referenced by addBool, addDisabled, addEnum, addInt, addList, addObsolete, addString, get, getBool, getEnum, getInt, getList and getString.
m_disabled
|
Definition at line 635 of file configimpl.h.
Referenced by addDisabled and writeXSDDoxyfile.
m_header
|
Definition at line 641 of file configimpl.h.
Referenced by setHeader and writeTemplate.
m_obsolete
|
Definition at line 634 of file configimpl.h.
Referenced by addObsolete.
m_options
|
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.
m_startComment
|
Definition at line 638 of file configimpl.h.
Referenced by appendStartComment, takeStartComment and writeTemplate.
m_storeRepl
|
Definition at line 640 of file configimpl.h.
Referenced by appendStoreRepl, compareDoxyfile and takeStoreRepl.
m_userComment
|
Definition at line 639 of file configimpl.h.
Referenced by appendUserComment, takeUserComment and writeTemplate.
Public Static Functions
config_err()
| inline static |
Definition at line 615 of file configimpl.h.
Reference config_err_.
Referenced by tryPath.
config_err_()
| static |
Declaration at line 610 of file configimpl.h, definition at line 59 of file configimpl.l.
Reference error_str.
Referenced by config_err.
config_term()
| inline static |
Definition at line 621 of file configimpl.h.
Reference config_term_.
Referenced by Config::checkAndCorrect, configFileToString, configStringRecode, getBool, getEnum, getInt, getList, getString, init and readIncludeFile.
config_term_()
| static |
Declaration at line 611 of file configimpl.h, definition at line 64 of file configimpl.l.
Reference error_str.
Referenced by config_term.
config_warn()
| inline static |
Definition at line 627 of file configimpl.h.
Reference config_warn_.
Referenced by ConfigBool::convertStrToVal, ConfigEnum::convertStrToVal, ConfigInt::convertStrToVal, processList, processString and setTranslator.
config_warn_()
| static |
Declaration at line 612 of file configimpl.h, definition at line 71 of file configimpl.l.
Reference warning_str.
Referenced by config_warn.
deleteInstance()
| inline static |
Delete the instance
Definition at line 357 of file configimpl.h.
Reference m_instance.
Referenced by Config::deinit.
instance()
| inline static |
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.
Private Static Attributes
m_instance
| static |
Definition at line 637 of file configimpl.h.
Referenced by deleteInstance and instance.
Getting configuration values.
get
| 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.
getBool
|
Returns the value of the boolean option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getBool() for this.
Declaration at line 395 of file configimpl.h, definition at line 341 of file configimpl.l.
References config_term, m_dict and ConfigOption::O_Bool.
getEnum
|
Returns the value of the enum option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getEnum() for this.
Declaration at line 383 of file configimpl.h, definition at line 313 of file configimpl.l.
References config_term, m_dict and ConfigOption::O_Enum.
getInt
|
Returns the value of the integer option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getInt() for this.
Declaration at line 389 of file configimpl.h, definition at line 327 of file configimpl.l.
References config_term, m_dict and ConfigOption::O_Int.
getList
|
Returns the value of the list option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getList() for this.
Declaration at line 377 of file configimpl.h, definition at line 299 of file configimpl.l.
References config_term, m_dict and ConfigOption::O_List.
getString
|
Returns the value of the string option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getString() for this.
Declaration at line 371 of file configimpl.h, definition at line 285 of file configimpl.l.
References config_term, m_dict and ConfigOption::O_String.
Adding configuration options.
addBool
| inline |
Adds a new boolean option with name and documentation doc. The boolean has a default value of defVal.
- Returns
An object representing the option.
Definition at line 479 of file configimpl.h.
addDisabled
| 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.
addEnum
| inline |
Adds a new enumeration option with name and documentation doc and initial value defVal.
- Returns
An object representing the option.
Definition at line 438 of file configimpl.h.
addInfo
| inline |
Starts a new configuration section with name and description doc.
- Returns
An object representing the option.
Definition at line 415 of file configimpl.h.
Reference m_options.
addInt
| 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.
- Returns
An object representing the option.
Definition at line 465 of file configimpl.h.
addList
| inline |
Adds a new string option with name and documentation doc.
- Returns
An object representing the option.
Definition at line 451 of file configimpl.h.
addObsolete
| inline |
Adds an option that has become obsolete.
Definition at line 490 of file configimpl.h.
References m_dict and m_obsolete.
addString
| inline |
Adds a new string option with name and documentation doc.
- Returns
An object representing the option.
Definition at line 425 of file configimpl.h.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus by Doxygen 1.14.0.