ConfigOption Class Reference

Abstract base class for any configuration option. More...

#include <config.h>

Inheritance diagram for ConfigOption:

ConfigBool ConfigEnum ConfigInfo ConfigInt ConfigList ConfigObsolete ConfigString List of all members.

Public Types

enum  OptionType {
  O_Info, O_List, O_Enum, O_String,
  O_Int, O_Bool, O_Obsolete
}
enum  { MAX_OPTION_LENGTH = 23 }

Public Member Functions

 ConfigOption (OptionType t)
virtual ~ConfigOption ()
OptionType kind () const
QCString name () const
QCString docs () const
QCString dependsOn () const
void addDependency (const char *dep)
void setEncoding (const QCString &e)

Protected Member Functions

virtual void writeTemplate (QTextStream &t, bool sl, bool upd)=0
virtual void convertStrToVal ()
virtual void substEnvVars ()=0
virtual void init ()
QCString convertToComment (const QCString &s)
void writeBoolValue (QTextStream &t, bool v)
void writeIntValue (QTextStream &t, int i)
void writeStringValue (QTextStream &t, QCString &s)
void writeStringList (QTextStream &t, QStrList &l)

Protected Attributes

QCString m_spaces
QCString m_name
QCString m_doc
QCString m_dependency
QCString m_encoding
OptionType m_kind

Friends

class Config

Detailed Description

Abstract base class for any configuration option.

Definition at line 14 of file config.h.


Member Enumeration Documentation

enum ConfigOption::OptionType

The type of option

Enumerator:
O_Info 
O_List 
O_Enum 
O_String 
O_Int 
O_Bool 
O_Obsolete 

Definition at line 21 of file config.h.

anonymous enum

Enumerator:
MAX_OPTION_LENGTH  Maximum length of an option in the config file. Used for alignment purposes.

Definition at line 31 of file config.h.


Constructor & Destructor Documentation

ConfigOption::ConfigOption ( OptionType  t  )  [inline]

Definition at line 38 of file config.h.

References m_spaces.

virtual ConfigOption::~ConfigOption (  )  [inline, virtual]

Definition at line 42 of file config.h.


Member Function Documentation

OptionType ConfigOption::kind (  )  const [inline]

returns the kind of option this is.

Definition at line 47 of file config.h.

References m_kind.

Referenced by Config::getBool(), Config::getEnum(), Config::getInt(), Config::getList(), and Config::getString().

QCString ConfigOption::name (  )  const [inline]

Definition at line 48 of file config.h.

References m_name.

QCString ConfigOption::docs (  )  const [inline]

Definition at line 49 of file config.h.

References m_doc.

QCString ConfigOption::dependsOn (  )  const [inline]

Definition at line 51 of file config.h.

References m_dependency.

void ConfigOption::addDependency ( const char *  dep  )  [inline]

Definition at line 52 of file config.h.

References m_dependency.

Referenced by Config::create().

void ConfigOption::setEncoding ( const QCString &  e  )  [inline]

Definition at line 53 of file config.h.

References m_encoding.

virtual void ConfigOption::writeTemplate ( QTextStream &  t,
bool  sl,
bool  upd 
) [protected, pure virtual]

Implemented in ConfigInfo, ConfigList, ConfigEnum, ConfigString, ConfigInt, ConfigBool, and ConfigObsolete.

Referenced by Config::writeTemplate().

virtual void ConfigOption::convertStrToVal (  )  [inline, protected, virtual]

Reimplemented in ConfigInt, and ConfigBool.

Definition at line 57 of file config.h.

Referenced by Config::convertStrToVal().

virtual void ConfigOption::substEnvVars (  )  [protected, pure virtual]

Implemented in ConfigInfo, ConfigList, ConfigEnum, ConfigString, ConfigInt, ConfigBool, and ConfigObsolete.

Referenced by Config::substituteEnvironmentVars().

virtual void ConfigOption::init (  )  [inline, protected, virtual]

Reimplemented in ConfigList, ConfigEnum, ConfigString, ConfigInt, and ConfigBool.

Definition at line 59 of file config.h.

Referenced by Config::init().

QCString ConfigOption::convertToComment ( const QCString &  s  )  [protected]

Definition at line 662 of file config.cpp.

References QCString.

Referenced by ConfigBool::writeTemplate(), ConfigInt::writeTemplate(), ConfigString::writeTemplate(), ConfigEnum::writeTemplate(), and ConfigList::writeTemplate().

void ConfigOption::writeBoolValue ( QTextStream &  t,
bool  v 
) [protected]

Definition at line 682 of file config.cpp.

Referenced by ConfigBool::writeTemplate().

void ConfigOption::writeIntValue ( QTextStream &  t,
int  i 
) [protected]

Definition at line 687 of file config.cpp.

Referenced by ConfigInt::writeTemplate().

void ConfigOption::writeStringValue ( QTextStream &  t,
QCString &  s 
) [protected]

Definition at line 692 of file config.cpp.

References m_encoding, and QCString.

Referenced by writeStringList(), ConfigBool::writeTemplate(), ConfigInt::writeTemplate(), ConfigString::writeTemplate(), and ConfigEnum::writeTemplate().

void ConfigOption::writeStringList ( QTextStream &  t,
QStrList &  l 
) [protected]

Definition at line 722 of file config.cpp.

References QCString, and writeStringValue().

Referenced by ConfigList::writeTemplate().


Friends And Related Function Documentation

friend class Config [friend]

Definition at line 16 of file config.h.


Member Data Documentation

QCString ConfigOption::m_spaces [protected]

Definition at line 67 of file config.h.

Referenced by ConfigOption(), ConfigBool::writeTemplate(), ConfigInt::writeTemplate(), ConfigString::writeTemplate(), ConfigEnum::writeTemplate(), and ConfigList::writeTemplate().

QCString ConfigOption::m_name [protected]

Definition at line 68 of file config.h.

Referenced by ConfigBool::ConfigBool(), ConfigEnum::ConfigEnum(), ConfigInfo::ConfigInfo(), ConfigInt::ConfigInt(), ConfigList::ConfigList(), ConfigString::ConfigString(), ConfigBool::convertStrToVal(), ConfigInt::convertStrToVal(), name(), ConfigBool::writeTemplate(), ConfigInt::writeTemplate(), ConfigString::writeTemplate(), ConfigEnum::writeTemplate(), and ConfigList::writeTemplate().

QCString ConfigOption::m_doc [protected]

Definition at line 69 of file config.h.

Referenced by ConfigBool::ConfigBool(), ConfigEnum::ConfigEnum(), ConfigInfo::ConfigInfo(), ConfigInt::ConfigInt(), ConfigList::ConfigList(), ConfigString::ConfigString(), docs(), ConfigBool::writeTemplate(), ConfigInt::writeTemplate(), ConfigString::writeTemplate(), ConfigEnum::writeTemplate(), ConfigList::writeTemplate(), and ConfigInfo::writeTemplate().

QCString ConfigOption::m_dependency [protected]

Definition at line 70 of file config.h.

Referenced by addDependency(), and dependsOn().

QCString ConfigOption::m_encoding [protected]

Definition at line 71 of file config.h.

Referenced by setEncoding(), and writeStringValue().

OptionType ConfigOption::m_kind [protected]

Definition at line 72 of file config.h.

Referenced by kind().


The documentation for this class was generated from the following files:



Generated on Mon Mar 31 10:58:57 2008 by  doxygen 1.5.1