My Project
|
#include <configimpl.h>
Public Member Functions | |
QListIterator< ConfigOption > | iterator () |
void | writeTemplate (FTextStream &t, bool shortIndex, bool updateOnly) |
void | setHeader (const char *header) |
void | convertStrToVal () |
void | substituteEnvironmentVars () |
void | init () |
bool | parseString (const char *fn, const char *str, bool upd=FALSE) |
bool | parse (const char *fn, bool upd=FALSE) |
void | create () |
void | appendStartComment (const QCString &u) |
void | appendUserComment (const QCString &u) |
QCString | takeStartComment () |
QCString | takeUserComment () |
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) |
ConfigOption * | addDisabled (const char *name) |
Static Public Member Functions | |
static ConfigImpl * | instance () |
static void | deleteInstance () |
Protected Member Functions | |
ConfigImpl () | |
~ConfigImpl () | |
Private Attributes | |
QList< ConfigOption > * | m_options |
QList< ConfigOption > * | m_obsolete |
QList< ConfigOption > * | m_disabled |
QDict< ConfigOption > * | m_dict |
QCString | m_startComment |
QCString | m_userComment |
bool | m_initialized |
QCString | m_header |
Static Private Attributes | |
static 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 292 of file configimpl.h.
|
inlineprotected |
Definition at line 539 of file configimpl.h.
References create(), m_dict, m_disabled, m_initialized, m_obsolete, and m_options.
Referenced by instance().
|
inlineprotected |
Definition at line 551 of file configimpl.h.
References m_dict, m_disabled, m_obsolete, and m_options.
|
inline |
|
inline |
Adds an option that has been disabled at compile time.
Definition at line 454 of file configimpl.h.
References m_dict, and m_disabled.
|
inline |
|
inline |
Starts a new configuration section with name and description doc.
Definition at line 372 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 422 of file configimpl.h.
|
inline |
|
inline |
Adds an option that has become obsolete.
Definition at line 446 of file configimpl.h.
References m_dict, and m_obsolete.
|
inline |
|
inline |
|
inline |
void ConfigImpl::convertStrToVal | ( | ) |
Converts the string values read from the configuration file to real values for non-string type options (like int, and bools)
void ConfigImpl::create | ( | ) |
Called from the constructor, will add doxygen's default options to the configuration object
Referenced by ConfigImpl().
|
inlinestatic |
|
inline |
Returns the ConfigOption corresponding with name or 0 if the option is not supported.
Definition at line 358 of file configimpl.h.
References m_dict.
bool& ConfigImpl::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.
QCString& ConfigImpl::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.
int& ConfigImpl::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.
QStrList& ConfigImpl::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.
QCString& ConfigImpl::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.
void ConfigImpl::init | ( | ) |
Initialize config variables to their default value
|
inlinestatic |
Returns the one and only instance of this class
Definition at line 300 of file configimpl.h.
References ConfigImpl(), and m_instance.
|
inline |
Returns an iterator that can by used to iterate over the configuration options.
Definition at line 315 of file configimpl.h.
bool ConfigImpl::parse | ( | const char * | fn, |
bool | upd = FALSE |
||
) |
Parse a configuration file with name fn.
bool ConfigImpl::parseString | ( | const char * | fn, |
const char * | str, | ||
bool | upd = FALSE |
||
) |
Parse a configuration data in string str.
|
inline |
void ConfigImpl::substituteEnvironmentVars | ( | ) |
Replaces references to environment variable by the actual value of the environment variable.
|
inline |
Take the user start comment and reset it internally
Definition at line 521 of file configimpl.h.
References m_startComment.
|
inline |
Take the user comment and reset it internally
Definition at line 530 of file configimpl.h.
References m_userComment.
void ConfigImpl::writeTemplate | ( | FTextStream & | 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.
|
private |
Definition at line 563 of file configimpl.h.
Referenced by addBool(), addDisabled(), addEnum(), addInt(), addList(), addObsolete(), addString(), ConfigImpl(), get(), and ~ConfigImpl().
|
private |
Definition at line 562 of file configimpl.h.
Referenced by addDisabled(), ConfigImpl(), and ~ConfigImpl().
|
private |
Definition at line 568 of file configimpl.h.
Referenced by setHeader().
|
private |
Definition at line 567 of file configimpl.h.
Referenced by ConfigImpl().
|
staticprivate |
Definition at line 564 of file configimpl.h.
Referenced by deleteInstance(), and instance().
|
private |
Definition at line 561 of file configimpl.h.
Referenced by addObsolete(), ConfigImpl(), and ~ConfigImpl().
|
private |
Definition at line 560 of file configimpl.h.
Referenced by addBool(), addEnum(), addInfo(), addInt(), addList(), addString(), ConfigImpl(), and ~ConfigImpl().
|
private |
Definition at line 565 of file configimpl.h.
Referenced by appendStartComment(), and takeStartComment().
|
private |
Definition at line 566 of file configimpl.h.
Referenced by appendUserComment(), and takeUserComment().