#include <config.h>
Public Member Functions | |
QListIterator< ConfigOption > | iterator () |
void | writeTemplate (QTextStream &t, bool shortIndex, bool updateOnly) |
void | convertStrToVal () |
void | substituteEnvironmentVars () |
void | check () |
void | init () |
bool | parseString (const char *fn, const char *str) |
bool | parse (const char *fn) |
void | create () |
Getting configuration values. | |
QCString & | getString (const char *fileName, int num, const char *name) const |
QStrList & | 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 char *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) |
Static Public Member Functions | |
static Config * | instance () |
static void | deleteInstance () |
Protected Member Functions | |
Config () | |
~Config () |
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 345 of file config.h.
Config::Config | ( | ) | [inline, protected] |
static Config* Config::instance | ( | ) | [inline, static] |
Returns the one and only instance of this class
Definition at line 353 of file config.h.
Referenced by checkConfiguration(), parseString(), and readConfiguration().
static void Config::deleteInstance | ( | ) | [inline, static] |
QListIterator<ConfigOption> Config::iterator | ( | ) | [inline] |
QCString & Config::getString | ( | const char * | fileName, | |
int | num, | |||
const char * | name | |||
) | const |
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.
Definition at line 778 of file config.cpp.
References config_err(), ConfigOption::kind(), and ConfigOption::O_String.
QStrList & Config::getList | ( | const char * | fileName, | |
int | num, | |||
const char * | name | |||
) | const |
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.
Definition at line 794 of file config.cpp.
References config_err(), ConfigOption::kind(), and ConfigOption::O_List.
QCString & Config::getEnum | ( | const char * | fileName, | |
int | num, | |||
const char * | name | |||
) | const |
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.
Definition at line 810 of file config.cpp.
References config_err(), ConfigOption::kind(), and ConfigOption::O_Enum.
int & Config::getInt | ( | const char * | fileName, | |
int | num, | |||
const char * | name | |||
) | const |
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.
Definition at line 826 of file config.cpp.
References config_err(), ConfigOption::kind(), and ConfigOption::O_Int.
bool & Config::getBool | ( | const char * | fileName, | |
int | num, | |||
const char * | name | |||
) | const |
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.
Definition at line 842 of file config.cpp.
References config_err(), ConfigOption::kind(), and ConfigOption::O_Bool.
ConfigOption* Config::get | ( | const char * | name | ) | const [inline] |
Returns the ConfigOption corresponding with name or 0 if the option is not supported.
ConfigInfo* Config::addInfo | ( | const char * | name, | |
const char * | doc | |||
) | [inline] |
ConfigString* Config::addString | ( | const char * | name, | |
const char * | doc | |||
) | [inline] |
ConfigEnum* Config::addEnum | ( | const char * | name, | |
const char * | doc, | |||
const char * | defVal | |||
) | [inline] |
ConfigList* Config::addList | ( | const char * | name, | |
const char * | doc | |||
) | [inline] |
ConfigInt* Config::addInt | ( | const char * | name, | |
const char * | doc, | |||
int | minVal, | |||
int | maxVal, | |||
int | defVal | |||
) | [inline] |
ConfigBool* Config::addBool | ( | const char * | name, | |
const char * | doc, | |||
bool | defVal | |||
) | [inline] |
ConfigOption* Config::addObsolete | ( | const char * | name | ) | [inline] |
Adds an option that has become obsolete.
Definition at line 499 of file config.h.
References ConfigOption::O_Obsolete.
Referenced by create().
void Config::writeTemplate | ( | QTextStream & | 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 2633 of file config.cpp.
References versionString, and ConfigOption::writeTemplate().
void Config::convertStrToVal | ( | ) |
Converts the string values read from the configuration file to real values for non-string type options (like int, and bools)
Definition at line 2656 of file config.cpp.
References ConfigOption::convertStrToVal().
Referenced by checkConfiguration(), and readConfiguration().
void Config::substituteEnvironmentVars | ( | ) |
Replaces references to environment variable by the actual value of the environment variable.
Definition at line 2795 of file config.cpp.
References ConfigOption::substEnvVars().
Referenced by checkConfiguration(), and readConfiguration().
void Config::check | ( | ) |
Checks if the values of the variable are correct, adjusts them if needed, and report any errors.
Definition at line 2840 of file config.cpp.
References config_err(), Config_getBool, Config_getEnum, Config_getInt, Config_getList, Config_getString, portable_commandExtension(), portable_fileSystemIsCaseSensitive(), portable_getenv(), portable_pathListSeparator(), portable_setenv(), QCString, and stripFromPath().
Referenced by checkConfiguration(), and readConfiguration().
void Config::init | ( | ) |
Initialize config variables to their default value
Definition at line 3231 of file config.cpp.
References ConfigOption::init().
Referenced by readConfiguration().
bool Config::parseString | ( | const char * | fn, | |
const char * | str | |||
) |
Parse a configuration data in string str.
Definition at line 5053 of file config.cpp.
References BEGIN, configYYin, configYYlex(), configYYrestart(), instance(), and Start.
Referenced by parse().
bool Config::parse | ( | const char * | fn | ) |
Parse a configuration file with name fn.
Definition at line 5070 of file config.cpp.
References parseString().
void Config::create | ( | ) |
Called from the constructor, will add doxygen's default options to the configuration object
Definition at line 3241 of file config.cpp.
References addBool(), ConfigOption::addDependency(), addEnum(), addInfo(), addInt(), addList(), addObsolete(), addString(), ConfigEnum::addValue(), ConfigList::Dir, ConfigString::Dir, ConfigList::File, ConfigString::File, ConfigList::FileAndDir, portable_fileSystemIsCaseSensitive(), ConfigString::setDefaultValue(), ConfigList::setWidgetType(), and ConfigString::setWidgetType().
Referenced by Config().