KDevelop API Documentation

Config Class Reference

Singleton for configuration variables. More...

#include <config.h>

List of all members.

Public Member Functions

QPtrListIterator< ConfigOptioniterator ()
void writeTemplate (QFile *f, bool shortIndex, bool updateOnly)
void convertStrToVal ()
void substituteEnvironmentVars ()
void check ()
void init ()
bool parse (const char *fn)
void create ()
Getting configuration values.
QCStringgetString (const char *fileName, int num, const char *name) const
QStrListgetList (const char *fileName, int num, const char *name) const
QCStringgetEnum (const char *fileName, int num, const char *name) const
int & getInt (const char *fileName, int num, const char *name) const
boolgetBool (const char *fileName, int num, const char *name) const
ConfigOptionget (const char *name) const
Adding configuration options.
ConfigInfoaddInfo (const char *name, const char *doc)
ConfigStringaddString (const char *name, const char *doc)
ConfigEnumaddEnum (const char *name, const char *doc, const char *defVal)
ConfigListaddList (const char *name, const char *doc)
ConfigIntaddInt (const char *name, const char *doc, int minVal, int maxVal, int defVal)
ConfigBooladdBool (const char *name, const char *doc, bool defVal)
ConfigOptionaddObsolete (const char *name)

Static Public Member Functions

Configinstance ()
void deleteInstance ()

Protected Member Functions

 Config ()
 ~Config ()

Private Attributes

QPtrList< ConfigOption > * m_options
QPtrList< ConfigOption > * m_obsolete
QDict< ConfigOption > * m_dict
bool m_initialized

Static Private Attributes

Configm_instance = 0


Detailed 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 config.h.


Constructor & Destructor Documentation

Config::Config  )  [inline, protected]
 

Definition at line 545 of file config.h.

References create(), m_dict, m_initialized, m_obsolete, and m_options.

Config::~Config  )  [inline, protected]
 

Definition at line 555 of file config.h.

References m_dict, m_obsolete, and m_options.


Member Function Documentation

ConfigBool* Config::addBool const char *  name,
const char *  doc,
bool  defVal
[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 485 of file config.h.

References addBool(), m_dict, and m_options.

Referenced by addBool().

ConfigEnum* Config::addEnum const char *  name,
const char *  doc,
const char *  defVal
[inline]
 

Adds a new enumeration option with name and documentation doc and initial value defVal.

Returns:
An object representing the option.

Definition at line 444 of file config.h.

References addEnum(), m_dict, and m_options.

Referenced by addEnum().

ConfigInfo* Config::addInfo const char *  name,
const char *  doc
[inline]
 

Starts a new configuration section with name and description doc.

Returns:
An object representing the option.

Definition at line 421 of file config.h.

References addInfo(), and m_options.

Referenced by addInfo().

ConfigInt* Config::addInt const char *  name,
const char *  doc,
int  minVal,
int  maxVal,
int  defVal
[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 471 of file config.h.

References addInt(), m_dict, and m_options.

Referenced by addInt().

ConfigList* Config::addList const char *  name,
const char *  doc
[inline]
 

Adds a new string option with name and documentation doc.

Returns:
An object representing the option.

Definition at line 457 of file config.h.

References addList(), m_dict, and m_options.

Referenced by addList().

ConfigOption* Config::addObsolete const char *  name  )  [inline]
 

Adds an option that has become obsolete.

Definition at line 495 of file config.h.

References addObsolete(), m_dict, and m_obsolete.

Referenced by addObsolete().

ConfigString* Config::addString const char *  name,
const char *  doc
[inline]
 

Adds a new string option with name and documentation doc.

Returns:
An object representing the option.

Definition at line 431 of file config.h.

References addString(), m_dict, and m_options.

Referenced by addString().

void Config::check  ) 
 

Checks if the values of the variable are correct, adjusts them if needed, and report any errors.

Referenced by DoxygenPart::adjustDoxyfile().

void Config::convertStrToVal  ) 
 

Converts the string values read from the configuration file to real values for non-string type options (like int, and bools)

Referenced by DoxygenPart::adjustDoxyfile(), DoxygenConfigWidget::loadFile(), and DoxygenPart::slotDoxygen().

void Config::create  ) 
 

Called from the constructor, will add doxygen's default options to the configuration object

Referenced by Config().

void Config::deleteInstance  )  [inline, static]
 

Delete the instance

Definition at line 356 of file config.h.

References m_instance.

ConfigOption* Config::get const char *  name  )  const [inline]
 

Returns the ConfigOption corresponding with name or 0 if the option is not supported.

Definition at line 407 of file config.h.

References get(), and m_dict.

Referenced by DoxygenPart::adjustDoxyfile(), configYYlex(), get(), and DoxygenPart::slotDoxygen().

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 759 of file config.cpp.

References config_err(), getBool(), ConfigOption::kind(), and m_dict.

Referenced by getBool().

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 727 of file config.cpp.

References config_err(), getEnum(), ConfigOption::kind(), and m_dict.

Referenced by getEnum().

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 743 of file config.cpp.

References config_err(), getInt(), ConfigOption::kind(), and m_dict.

Referenced by getInt().

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 711 of file config.cpp.

References config_err(), getList(), ConfigOption::kind(), and m_dict.

Referenced by getList().

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 695 of file config.cpp.

References config_err(), getString(), ConfigOption::kind(), and m_dict.

Referenced by getString().

void Config::init  ) 
 

Initialize config variables to their default value

Referenced by DoxygenPart::adjustDoxyfile(), DoxygenConfigWidget::loadFile(), and DoxygenPart::slotDoxygen().

Config* Config::instance  )  [inline, static]
 

Returns the one and only instance of this class

Definition at line 350 of file config.h.

References m_instance.

Referenced by DoxygenPart::adjustDoxyfile(), DoxygenConfigWidget::DoxygenConfigWidget(), DoxygenConfigWidget::loadFile(), DoxygenConfigWidget::saveFile(), and DoxygenPart::slotDoxygen().

QPtrListIterator<ConfigOption> Config::iterator  )  [inline]
 

Returns an iterator that can by used to iterate over the configuration options.

Definition at line 364 of file config.h.

Referenced by DoxygenConfigWidget::DoxygenConfigWidget().

bool Config::parse const char *  fn  ) 
 

Parse a configuration file with name fn.

Returns:
TRUE if successful, FALSE if the file could not be opened or read.

Referenced by DoxygenPart::adjustDoxyfile(), DoxygenConfigWidget::loadFile(), and DoxygenPart::slotDoxygen().

void Config::substituteEnvironmentVars  ) 
 

Replaces references to environment variable by the actual value of the environment variable.

void Config::writeTemplate QFile f,
bool  shortIndex,
bool  updateOnly
 

Writes a template configuration file to f. If shortIndex is TRUE the description of each configuration option will be omitted.

Referenced by DoxygenPart::adjustDoxyfile(), and DoxygenConfigWidget::saveFile().


Member Data Documentation

QDict<ConfigOption>* Config::m_dict [private]
 

Definition at line 565 of file config.h.

Referenced by addBool(), addEnum(), addInt(), addList(), addObsolete(), addString(), Config(), get(), getBool(), getEnum(), getInt(), getList(), getString(), and ~Config().

bool Config::m_initialized [private]
 

Definition at line 567 of file config.h.

Referenced by Config().

Config * Config::m_instance = 0 [static, private]
 

Definition at line 657 of file config.cpp.

Referenced by deleteInstance(), and instance().

QPtrList<ConfigOption>* Config::m_obsolete [private]
 

Definition at line 564 of file config.h.

Referenced by addObsolete(), Config(), and ~Config().

QPtrList<ConfigOption>* Config::m_options [private]
 

Definition at line 563 of file config.h.

Referenced by addBool(), addEnum(), addInfo(), addInt(), addList(), addString(), Config(), and ~Config().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:21 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003