Doxygen
ConfigImpl类 参考

Singleton for configuration variables. 更多...

#include <configimpl.h>

+ ConfigImpl 的协作图:

Public 成员函数

void writeTemplate (TextStream &t, bool shortIndex, bool updateOnly)
 
void compareDoxyfile (TextStream &t)
 
void writeXMLDoxyfile (TextStream &t)
 
void setHeader (const char *header)
 
void convertStrToVal ()
 
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 create ()
 
void appendStartComment (const QCString &u)
 
void appendUserComment (const QCString &u)
 
QCString takeStartComment ()
 
QCString takeUserComment ()
 
Getting configuration values.
QCStringgetString (const char *fileName, int num, const char *name) const
 
StringVectorgetList (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
 
bool & getBool (const char *fileName, int num, const char *name) const
 
ConfigOptionget (const QCString &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, ConfigOption::OptionType orgType)
 
ConfigOptionaddDisabled (const char *name)
 

静态 Public 成员函数

static ConfigImplinstance ()
 
static void deleteInstance ()
 

Protected 成员函数

 ConfigImpl ()
 
 ~ConfigImpl ()
 

Private 属性

ConfigOptionList m_options
 
ConfigOptionList m_obsolete
 
ConfigOptionList m_disabled
 
ConfigOptionMap m_dict
 
QCString m_startComment
 
QCString m_userComment
 
bool m_initialized
 
QCString m_header
 

静态 Private 属性

static ConfigImplm_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()

在文件 configimpl.h335 行定义.

构造及析构函数说明

◆ ConfigImpl()

ConfigImpl::ConfigImpl ( )
inlineprotected

在文件 configimpl.h588 行定义.

589  {
591  create();
592  }

引用了 create(), FALSE , 以及 m_initialized.

被这些函数引用 instance().

◆ ~ConfigImpl()

ConfigImpl::~ConfigImpl ( )
inlineprotected

在文件 configimpl.h593 行定义.

594  {
595  }

成员函数说明

◆ addBool()

ConfigBool* ConfigImpl::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.

返回
An object representing the option.

在文件 configimpl.h472 行定义.

475  {
476  ConfigBool *result = new ConfigBool(name,doc,defVal);
477  m_options.push_back(std::unique_ptr<ConfigOption>(result));
478  m_dict.insert(std::make_pair(name,result));
479  return result;
480  }

引用了 m_dict , 以及 m_options.

◆ addDisabled()

ConfigOption* ConfigImpl::addDisabled ( const char *  name)
inline

Adds an option that has been disabled at compile time.

在文件 configimpl.h490 行定义.

491  {
492  ConfigDisabled *result = new ConfigDisabled(name);
493  m_disabled.push_back(std::unique_ptr<ConfigOption>(result));
494  m_dict.insert(std::make_pair(name,result));
495  return result;
496  }

引用了 m_dict , 以及 m_disabled.

◆ addEnum()

ConfigEnum* ConfigImpl::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.

返回
An object representing the option.

在文件 configimpl.h431 行定义.

434  {
435  ConfigEnum *result = new ConfigEnum(name,doc,defVal);
436  m_options.push_back(std::unique_ptr<ConfigOption>(result));
437  m_dict.insert(std::make_pair(name,result));
438  return result;
439  }

引用了 m_dict , 以及 m_options.

◆ addInfo()

ConfigInfo* ConfigImpl::addInfo ( const char *  name,
const char *  doc 
)
inline

Starts a new configuration section with name and description doc.

返回
An object representing the option.

在文件 configimpl.h408 行定义.

409  {
410  ConfigInfo *result = new ConfigInfo(name,doc);
411  m_options.push_back(std::unique_ptr<ConfigOption>(result));
412  return result;
413  }

引用了 m_options.

◆ addInt()

ConfigInt* ConfigImpl::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.

返回
An object representing the option.

在文件 configimpl.h458 行定义.

461  {
462  ConfigInt *result = new ConfigInt(name,doc,minVal,maxVal,defVal);
463  m_options.push_back(std::unique_ptr<ConfigOption>(result));
464  m_dict.insert(std::make_pair(name,result));
465  return result;
466  }

引用了 m_dict , 以及 m_options.

◆ addList()

ConfigList* ConfigImpl::addList ( const char *  name,
const char *  doc 
)
inline

Adds a new string option with name and documentation doc.

返回
An object representing the option.

在文件 configimpl.h444 行定义.

446  {
447  ConfigList *result = new ConfigList(name,doc);
448  m_options.push_back(std::unique_ptr<ConfigOption>(result));
449  m_dict.insert(std::make_pair(name,result));
450  return result;
451  }

引用了 m_dict , 以及 m_options.

◆ addObsolete()

ConfigOption* ConfigImpl::addObsolete ( const char *  name,
ConfigOption::OptionType  orgType 
)
inline

Adds an option that has become obsolete.

在文件 configimpl.h482 行定义.

483  {
484  ConfigObsolete *result = new ConfigObsolete(name,orgType);
485  m_obsolete.push_back(std::unique_ptr<ConfigOption>(result));
486  m_dict.insert(std::make_pair(name,result));
487  return result;
488  }

引用了 m_dict , 以及 m_obsolete.

◆ addString()

ConfigString* ConfigImpl::addString ( const char *  name,
const char *  doc 
)
inline

Adds a new string option with name and documentation doc.

返回
An object representing the option.

在文件 configimpl.h418 行定义.

420  {
421  ConfigString *result = new ConfigString(name,doc);
422  m_options.push_back(std::unique_ptr<ConfigOption>(result));
423  m_dict.insert(std::make_pair(name,result));
424  return result;
425  }

引用了 m_dict , 以及 m_options.

◆ appendStartComment()

void ConfigImpl::appendStartComment ( const QCString u)
inline

Append user start comment

在文件 configimpl.h557 行定义.

558  {
559  m_startComment += u;
560  }

引用了 m_startComment.

◆ appendUserComment()

void ConfigImpl::appendUserComment ( const QCString u)
inline

Append user comment

在文件 configimpl.h563 行定义.

564  {
565  m_userComment += u;
566  }

引用了 m_userComment.

◆ compareDoxyfile()

void ConfigImpl::compareDoxyfile ( TextStream t)

Writes a the differences between the current configuration and the template configuration to stream t.

◆ convertStrToVal()

void ConfigImpl::convertStrToVal ( )

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

◆ create()

void ConfigImpl::create ( )

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

被这些函数引用 ConfigImpl().

◆ deleteInstance()

static void ConfigImpl::deleteInstance ( )
inlinestatic

Delete the instance

在文件 configimpl.h349 行定义.

350  {
351  delete m_instance;
352  m_instance=0;
353  }

引用了 m_instance.

◆ emptyValueToDefault()

void ConfigImpl::emptyValueToDefault ( )

Sets default value in case value is empty

◆ get()

ConfigOption* ConfigImpl::get ( const QCString name) const
inline

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

在文件 configimpl.h393 行定义.

394  {
395  auto it = m_dict.find(name.str());
396  return it!=m_dict.end() ? it->second : nullptr;
397  }

引用了 m_dict , 以及 QCString::str().

◆ getBool()

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.

◆ getEnum()

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.

◆ getInt()

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.

◆ getList()

StringVector& 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.

◆ getString()

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.

◆ init()

void ConfigImpl::init ( )

Initialize config variables to their default value

◆ instance()

static ConfigImpl* ConfigImpl::instance ( )
inlinestatic

Returns the one and only instance of this class

在文件 configimpl.h343 行定义.

344  {
345  if (m_instance==0) m_instance = new ConfigImpl;
346  return m_instance;
347  }

引用了 ConfigImpl() , 以及 m_instance.

◆ parse()

bool ConfigImpl::parse ( const QCString fn,
bool  upd = FALSE 
)

Parse a configuration file with name fn.

返回
TRUE if successful, FALSE if the file could not be opened or read.

◆ parseString()

bool ConfigImpl::parseString ( const QCString fn,
const QCString str,
bool  upd = FALSE 
)

Parse a configuration data in string str.

返回
TRUE if successful, or FALSE if the string could not be parsed.

◆ setHeader()

void ConfigImpl::setHeader ( const char *  header)
inline

在文件 configimpl.h515 行定义.

515 { m_header = header; }

引用了 m_header.

◆ substituteEnvironmentVars()

void ConfigImpl::substituteEnvironmentVars ( )

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

◆ takeStartComment()

QCString ConfigImpl::takeStartComment ( )
inline

Take the user start comment and reset it internally

返回
user start comment

在文件 configimpl.h570 行定义.

571  {
572  QCString result=m_startComment;
574  return substitute(result,"\r","");
575  }

引用了 m_startComment, QCString::resize() , 以及 substitute().

◆ takeUserComment()

QCString ConfigImpl::takeUserComment ( )
inline

Take the user comment and reset it internally

返回
user comment

在文件 configimpl.h579 行定义.

580  {
581  QCString result=m_userComment;
583  return substitute(result,"\r","");
584  }

引用了 m_userComment, QCString::resize() , 以及 substitute().

◆ 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.

◆ writeXMLDoxyfile()

void ConfigImpl::writeXMLDoxyfile ( TextStream t)

Writes a the used settings of the current configuration as XML format to stream t.

类成员变量说明

◆ m_dict

ConfigOptionMap ConfigImpl::m_dict
private

在文件 configimpl.h601 行定义.

被这些函数引用 addBool(), addDisabled(), addEnum(), addInt(), addList(), addObsolete(), addString() , 以及 get().

◆ m_disabled

ConfigOptionList ConfigImpl::m_disabled
private

在文件 configimpl.h600 行定义.

被这些函数引用 addDisabled().

◆ m_header

QCString ConfigImpl::m_header
private

在文件 configimpl.h606 行定义.

被这些函数引用 setHeader().

◆ m_initialized

bool ConfigImpl::m_initialized
private

在文件 configimpl.h605 行定义.

被这些函数引用 ConfigImpl().

◆ m_instance

ConfigImpl* ConfigImpl::m_instance
staticprivate

在文件 configimpl.h602 行定义.

被这些函数引用 deleteInstance() , 以及 instance().

◆ m_obsolete

ConfigOptionList ConfigImpl::m_obsolete
private

在文件 configimpl.h599 行定义.

被这些函数引用 addObsolete().

◆ m_options

ConfigOptionList ConfigImpl::m_options
private

在文件 configimpl.h598 行定义.

被这些函数引用 addBool(), addEnum(), addInfo(), addInt(), addList() , 以及 addString().

◆ m_startComment

QCString ConfigImpl::m_startComment
private

在文件 configimpl.h603 行定义.

被这些函数引用 appendStartComment() , 以及 takeStartComment().

◆ m_userComment

QCString ConfigImpl::m_userComment
private

在文件 configimpl.h604 行定义.

被这些函数引用 appendUserComment() , 以及 takeUserComment().


该类的文档由以下文件生成:
ConfigImpl::m_startComment
QCString m_startComment
Definition: configimpl.h:603
ConfigString
Class representing a string type option.
Definition: configimpl.h:182
ConfigImpl::m_dict
ConfigOptionMap m_dict
Definition: configimpl.h:601
QCString::str
std::string str() const
Definition: qcstring.h:442
ConfigInfo
Section marker for grouping the configuration options.
Definition: configimpl.h:104
ConfigImpl::create
void create()
ConfigImpl::m_obsolete
ConfigOptionList m_obsolete
Definition: configimpl.h:599
ConfigImpl::m_initialized
bool m_initialized
Definition: configimpl.h:605
ConfigBool
Class representing a Boolean type option.
Definition: configimpl.h:250
ConfigList
Class respresenting a list type option.
Definition: configimpl.h:121
ConfigImpl::m_userComment
QCString m_userComment
Definition: configimpl.h:604
ConfigImpl::m_header
QCString m_header
Definition: configimpl.h:606
ConfigInt
Class representing an integer type option.
Definition: configimpl.h:216
ConfigImpl::m_disabled
ConfigOptionList m_disabled
Definition: configimpl.h:600
ConfigEnum
Class representing an enum type option.
Definition: configimpl.h:152
ConfigImpl::m_options
ConfigOptionList m_options
Definition: configimpl.h:598
ConfigObsolete
Section marker for obsolete options
Definition: configimpl.h:279
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
ConfigImpl::m_instance
static ConfigImpl * m_instance
Definition: configimpl.h:602
ConfigDisabled
Section marker for compile time optional options
Definition: configimpl.h:302
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
ConfigImpl::ConfigImpl
ConfigImpl()
Definition: configimpl.h:588
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108