Relacs Options Library  0.9.8
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ConfigClass Class Reference

#include <configclass.h>

Inheritance diagram for ConfigClass:
Inheritance graph
[legend]
Collaboration diagram for ConfigClass:
Collaboration graph
[legend]

Public Types

enum  Action { Save =1, Dialog =2, Help =4, Menu =8 }
 
- Public Types inherited from Options
enum  SaveFlags {
  NoName = 1, NoType = 2, NoInclude = 4, SwitchNameType = 8,
  Embrace = 16, PrintRequest = 32, FirstOnly = 64, PrintType = 128,
  PrintStyle = 256, DontCloseSection = 512, AlwaysQuote = 1024, EscapeQuotes = 2048
}
 
typedef deque< Parameter >
::iterator 
iterator
 
typedef deque< Parameter >
::const_iterator 
const_iterator
 
typedef deque< Options * >
::iterator 
section_iterator
 
typedef deque< Options * >
::const_iterator 
const_section_iterator
 

Public Member Functions

 ConfigClass (const string &ident, int group=0, int mode=0xffff, int selectmask=0)
 
 ConfigClass (const ConfigClass &C)
 
virtual ~ConfigClass (void)
 
const string & configIdent (void) const
 
void setConfigIdent (const string &ident)
 
int configGroup (void) const
 
void setConfigGroup (int group)
 
int configMode (void) const
 
void setConfigMode (int mode)
 
void addConfigMode (int mode)
 
void delConfigMode (int mode)
 
int configSelectMask (void) const
 
void setConfigSelectMask (int mask)
 
void addConfig (void)
 
void readConfig (void)
 
virtual void readConfig (StrQueue &sq)
 
virtual void saveConfig (ofstream &str)
 
virtual int configSize (void) const
 
virtual void config (void)
 
virtual void preConfig (void)
 
- Public Member Functions inherited from Options
 Options (void)
 
 Options (const Options &o)
 
 Options (const Options &o, int flags)
 
 Options (const string &name, const string &type, int flags, int style)
 
 Options (const Str &opttxt, const string &assignment=":=", const string &separator=",;")
 
 Options (const StrQueue &sq, const string &assignment=":=")
 
 Options (istream &str, const string &assignment=":=", const string &comment="#", const string &stop="", string *line=0)
 
virtual ~Options (void)
 
Optionsoperator= (const Options &o)
 
Optionsassign (const Options &o)
 
Optionsappend (const Options &o)
 
Optionsadd (const Options &o)
 
Optionsinsert (const Options &o, const string &atname="")
 
Optionsassign (const Options &o, int flags)
 
Optionscopy (Options &o, int flags)
 
Optionsappend (const Options &o, int flags)
 
Optionsadd (const Options &o, int flags)
 
Optionsinsert (const Options &o, int flags, const string &atname="")
 
Parameterassign (const string &name, const string &value)
 
OptionsparentSection (void)
 
const OptionsparentSection (void) const
 
void setParentSection (Options *parentsection)
 
void resetParents (void)
 
OptionsrootSection (void)
 
const OptionsrootSection (void) const
 
string name (void) const
 
virtual void setName (const string &name)
 
virtual void setName (const string &name, const string &type)
 
string type (void) const
 
void setType (const string &type)
 
string include (void) const
 
void setInclude (const string &include)
 
void setInclude (const string &url, const string &name)
 
int flag (void) const
 
bool flag (int selectflag) const
 
OptionssetFlag (int flag)
 
OptionsaddFlag (int flag)
 
OptionsdelFlag (int flag)
 
OptionsclearFlag (void)
 
int style (void) const
 
OptionssetStyle (int style)
 
OptionsaddStyle (int style)
 
OptionsdelStyle (int style)
 
OptionsclearStyle (void)
 
bool checkType (int mask) const
 
Str warning (void) const
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
section_iterator sectionsBegin (void)
 
section_iterator sectionsEnd (void)
 
const_section_iterator sectionsBegin (void) const
 
const_section_iterator sectionsEnd (void) const
 
const_iterator find (const string &pattern, int level=-1) const
 
iterator find (const string &pattern, int level=-1)
 
const_iterator rfind (const string &pattern, int level=-1) const
 
iterator rfind (const string &pattern, int level=-1)
 
const_section_iterator findSection (const string &pattern, int level=-1) const
 
section_iterator findSection (const string &pattern, int level=-1)
 
const_section_iterator rfindSection (const string &pattern, int level=-1) const
 
section_iterator rfindSection (const string &pattern, int level=-1)
 
const Parameteroperator[] (int i) const
 
Parameteroperator[] (int i)
 
const Parameteroperator[] (const string &name) const
 
Parameteroperator[] (const string &name)
 
const Optionssection (int i) const
 
Optionssection (int i)
 
const Optionssection (const string &name) const
 
Optionssection (const string &name)
 
Str request (const string &name) const
 
ParametersetRequest (const string &name, const string &request)
 
Parameter::ValueType valueType (const string &name) const
 
ParametersetValueType (const string &name, Parameter::ValueType type)
 
int flags (const string &name) const
 
bool flags (const string &name, int flag) const
 
ParametersetFlags (const string &name, int flags)
 
ParameteraddFlags (const string &name, int flags)
 
ParameterdelFlags (const string &name, int flags)
 
ParameterclearFlags (const string &name)
 
bool changed (const string &name)
 
int style (const string &name) const
 
ParametersetStyle (const string &name, int style)
 
ParameteraddStyle (const string &name, int style)
 
ParameterdelStyle (const string &name, int style)
 
Str format (const string &name) const
 
ParametersetFormat (const string &name, int width=0, int prec=-1, char fmt='g')
 
ParametersetFormat (const string &name, const string &format)
 
int formatWidth (const string &name) const
 
int size (const string &name) const
 
Parameteradd (const Parameter &np)
 
Parameterinsert (const Parameter &np, const string &atname="")
 
ParameteraddText (const string &name, const string &request, const string &dflt, int flags=0, int style=0)
 
ParameteraddText (const string &name, const string &dflt="", int flags=0, int style=0)
 
ParameterinsertText (const string &name, const string &atname, const string &request, const string &dflt, int flags=0, int style=0)
 
ParameterinsertText (const string &name, const string &atname="", const string &dflt="", int flags=0, int style=0)
 
Str text (const string &name, int index, const string &dflt="", const string &format="", const string &unit="") const
 
Str text (const string &name, const string &dflt="", const string &format="", const string &unit="") const
 
void texts (const string &name, vector< string > &s, const string &format="", const string &unit="") const
 
Str allText (const string &name, const string &dflt="", const string &format="", const string &unit="", const string &separator=", ") const
 
ParametersetText (const string &name, const string &strg)
 
ParametersetText (const string &name, const Parameter &p)
 
ParameterpushText (const string &name, const string &strg)
 
Str defaultText (const string &name, const string &format="", const string &unit="") const
 
ParametersetDefaultText (const string &name, const string &dflt)
 
ParameteraddSelection (const string &name, const string &request, const string &selection, int flags=0, int style=0)
 
ParameteraddSelection (const string &name, const string &selection="", int flags=0, int style=0)
 
ParameterinsertSelection (const string &name, const string &atname, const string &request, const string &selection, int flags=0, int style=0)
 
ParameterinsertSelection (const string &name, const string &atname="", const string &selection="", int flags=0, int style=0)
 
ParameterselectText (const string &name, const string &strg, int add=0)
 
ParameterselectText (const string &name, int index)
 
int index (const string &name) const
 
int index (const string &name, const string &strg) const
 
ParameteraddNumber (const string &name, const string &request, double dflt, double minimum, double maximum=MAXDOUBLE, double step=1.0, const string &unit="", const string &outputunit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, const string &request, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, double dflt, const string &unit, int flags, int style=0)
 
ParameteraddNumber (const string &name, double dflt, double error, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameteraddNumber (const string &name, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, const string &request, double dflt, double minimum, double maximum=MAXDOUBLE, double step=1.0, const string &unit="", const string &outputunit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, const string &request, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, double dflt, const string &unit="", const string &format="", int flags=0, int style=0)
 
ParameterinsertNumber (const string &name, const string &atname, const string &unit="", const string &format="", int flags=0, int style=0)
 
double number (const string &name, double dflt=0.0, const string &unit="", int index=0) const
 
double number (const string &name, const string &unit, double dflt=0.0, int index=0) const
 
double number (const string &name, int index, double dflt=0.0, const string &unit="") const
 
double number (const string &name, int index, const string &unit, double dflt=0.0) const
 
void numbers (const string &name, vector< double > &n, const string &unit="") const
 
double error (const string &name, const string &unit="", int index=0) const
 
double error (const string &name, int index, const string &unit="") const
 
void errors (const string &name, vector< double > &n, const string &unit="") const
 
ParametersetNumber (const string &name, double number, double error, const string &unit="")
 
ParametersetNumber (const string &name, double number, const string &unit="")
 
ParameterpushNumber (const string &name, double number, double error=-1.0, const string &unit="")
 
ParameterpushNumber (const string &name, double number, const string &unit)
 
ParametersetNumber (const string &name, const Parameter &p)
 
double defaultNumber (const string &name, const string &unit="") const
 
ParametersetDefaultNumber (const string &name, double dflt, const string &unit="")
 
double minimum (const string &name, const string &unit="") const
 
double maximum (const string &name, const string &unit="") const
 
double step (const string &name, const string &unit="") const
 
ParametersetStep (const string &name, double step, const string &unit="")
 
ParametersetMinMax (const string &name, double minimum=-MAXDOUBLE, double maximum=MAXDOUBLE, double step=1.0, const string &unit="")
 
Str unit (const string &name) const
 
Str outUnit (const string &name) const
 
ParametersetUnit (const string &name, const string &internunit, const string &outunit="")
 
ParametersetOutUnit (const string &name, const string &outputunit)
 
ParameterchangeUnit (const string &name, const string &internunit)
 
ParameteraddInteger (const string &name, const string &request, long dflt, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="", const string &outputunit="", int width=0, int flags=0, int style=0)
 
ParameteraddInteger (const string &name, long dflt, const string &unit="", int width=0, int flags=0, int style=0)
 
ParameteraddInteger (const string &name, const string &unit="")
 
ParameterinsertInteger (const string &name, const string &atname, const string &request, long dflt, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="", const string &outputunit="", int width=0, int flags=0, int style=0)
 
ParameterinsertInteger (const string &name, const string &atname, long dflt, const string &unit="", int width=0, int flags=0, int style=0)
 
ParameterinsertInteger (const string &name, const string &atname, const string &unit="", int width=0, int flags=0, int style=0)
 
long integer (const string &name, const string &unit="", long dflt=0, int index=0) const
 
long integer (const string &name, int index, long dflt=0, const string &unit="") const
 
long integer (const string &name, int index, const string &unit, long dflt=0) const
 
void integers (const string &name, vector< long > &n, const string &unit="") const
 
void integers (const string &name, vector< int > &n, const string &unit="") const
 
ParametersetInteger (const string &name, long number, long error, const string &unit="")
 
ParametersetInteger (const string &name, long number, const string &unit="")
 
ParameterpushInteger (const string &name, long number, long error, const string &unit="")
 
ParameterpushInteger (const string &name, long number, const string &unit="")
 
ParametersetInteger (const string &name, const Parameter &p)
 
long defaultInteger (const string &name, const string &unit="") const
 
ParametersetDefaultInteger (const string &name, long dflt, const string &unit="")
 
ParametersetMinMax (const string &name, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="")
 
ParametersetMinMax (const string &name, int minimum, int maximum, int step=1, const string &unit="")
 
ParameteraddBoolean (const string &name, const string &request, bool dflt, int flags=0, int style=0)
 
ParameteraddBoolean (const char *name, const char *request, bool dflt, int flags=0, int style=0)
 
ParameteraddBoolean (const string &name, bool dflt, int flags=0, int style=0)
 
ParameteraddBoolean (const char *name, bool dflt, int flags=0, int style=0)
 
ParameterinsertBoolean (const string &name, const string &atname="", const string &request="", bool dflt=false, int flags=0, int style=0)
 
ParameterinsertBoolean (const string &name, const string &atname, int flags=0, int style=0)
 
bool boolean (const string &name, bool dflt=false, int index=0) const
 
bool boolean (const string &name, int index, bool dflt=false) const
 
void booleans (const string &name, vector< bool > &n) const
 
ParametersetBoolean (const string &name, bool b)
 
ParametersetBoolean (const string &name, const Parameter &p)
 
bool defaultBoolean (const string &name) const
 
ParametersetDefaultBoolean (const string &name, bool dflt)
 
ParameteraddDate (const string &name, const string &request, int year=0, int month=0, int day=0, int flags=0, int style=0)
 
ParameteraddDate (const string &name, int year, int month, int day, int flags=0, int style=0)
 
ParameteraddDate (const string &name, int flags=0, int style=0)
 
ParameterinsertDate (const string &name, const string &atname="", const string &request="", int year=0, int month=0, int day=0, int flags=0, int style=0)
 
ParameterinsertDate (const string &name, const string &atname, int year=0, int month=0, int day=0, int flags=0, int style=0)
 
ParameterinsertDate (const string &name, const string &atname, int flags=0, int style=0)
 
const Parameterdate (const string &name, int index, int &year, int &month, int &day) const
 
ParametersetDate (const string &name, int year, int month, int day)
 
ParametersetDate (const string &name, const string &date)
 
ParametersetDate (const string &name, const struct tm &date)
 
ParametersetDate (const string &name, const time_t &time)
 
ParametersetCurrentDate (const string &name)
 
ParametersetDate (const string &name, const Parameter &p)
 
const ParameterdefaultDate (const string &name, int index, int &year, int &month, int &day) const
 
ParametersetDefaultDate (const string &name, int year, int month, int day)
 
ParameteraddTime (const string &name, const string &request, int hour=0, int minutes=0, int seconds=0, int milliseconds=0, int flags=0, int style=0)
 
ParameteraddTime (const string &name, int hour, int minutes, int seconds, int milliseconds=0, int flags=0, int style=0)
 
ParameteraddTime (const string &name, int flags=0, int style=0)
 
ParameterinsertTime (const string &name, const string &atname="", const string &request="", int hour=0, int minutes=0, int seconds=0, int milliseconds=0, int flags=0, int style=0)
 
ParameterinsertTime (const string &name, const string &atname, int hour=0, int minutes=0, int seconds=0, int milliseconds=0, int flags=0, int style=0)
 
ParameterinsertTime (const string &name, const string &atname, int flags=0, int style=0)
 
const Parametertime (const string &name, int index, int &hour, int &minutes, int &seconds, int &milliseconds) const
 
ParametersetTime (const string &name, int hour, int minutes, int seconds, int milliseconds=0)
 
ParametersetTime (const string &name, const string &time)
 
ParametersetTime (const string &name, const struct tm &time)
 
ParametersetTime (const string &name, const time_t &time)
 
ParametersetCurrentTime (const string &name)
 
ParametersetTime (const string &name, const Parameter &p)
 
const ParameterdefaultTime (const string &name, int index, int &hour, int &minutes, int &seconds, int &milliseconds) const
 
ParametersetDefaultTime (const string &name, int hour, int minutes, int seconds, int milliseconds=0)
 
OptionsnewSection (int level, const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSection (int level, const string &name, int flag, int style=0)
 
OptionsnewSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSection (const string &name, int flag, int style=0)
 
OptionsnewSubSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSubSection (const string &name, int flag, int style=0)
 
OptionsnewSubSubSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsnewSubSubSection (const string &name, int flag, int style=0)
 
OptionsaddSection (const string &name, const string &type="", int flag=0, int style=0)
 
OptionsaddSection (const string &name, int flag, int style=0)
 
OptionsinsertSection (const string &name, const string &atpattern, const string &type="", int flag=0, int style=0)
 
OptionsinsertSection (const string &name, const string &atpattern, int flag, int style=0)
 
OptionsnewSection (int level, const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (int level, const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (int level, const Options &opt, const string &name, int flag, int style=0)
 
OptionsnewSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsnewSubSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsnewSubSubSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSubSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsnewSubSubSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsaddSection (const Options &opt, int selectmask, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsaddSection (const Options &opt, const string &name="", const string &type="", int flag=0, int style=0)
 
OptionsaddSection (const Options &opt, const string &name, int flag, int style=0)
 
OptionsinsertSection (const Options &opt, int selectmask, const string &name, const string &atpattern, const string &type="", int flag=0, int style=0)
 
OptionsinsertSection (const Options &opt, const string &name, const string &atpattern, const string &type="", int flag=0, int style=0)
 
OptionsinsertSection (const Options &opt, const string &name, const string &atpattern, int flag, int style=0)
 
OptionsnewSection (Options *opt, bool newparent=false)
 
OptionsaddSection (Options *opt, bool newparent=false)
 
OptionsinsertSection (Options *opt, const string &atpattern, bool newparent=false)
 
OptionsnewSections (Options *opt, bool newparent=false)
 
void endSection (void)
 
void clearSections (void)
 
void setSection (Options &opt)
 
void lastSection (void)
 
int up (void)
 
int down (void)
 
ParametersetDefault (const string &name)
 
OptionssetDefaults (int flags=0)
 
ParametersetToDefault (const string &name)
 
OptionssetToDefaults (int flags=0)
 
Optionserase (iterator p)
 
Optionserase (section_iterator p)
 
Optionserase (Options *s)
 
Optionserase (const string &pattern)
 
Optionserase (int selectflag)
 
Optionspop (void)
 
OptionspopSection (void)
 
Optionsflatten (Options *root=0)
 
Optionsclear (bool revert=true)
 
int size (void) const
 
int size (int selectflag) const
 
bool empty (void) const
 
int parameterSize (void) const
 
int parameterSize (int flags) const
 
int sectionsSize (void) const
 
int sectionsSize (int flags) const
 
bool exist (const string &pattern) const
 
bool existSection (const string &pattern) const
 
OptionssetFlags (int flags, int selectflag=0)
 
OptionsaddFlags (int flags, int selectflag=0)
 
OptionsdelFlags (int flags, int selectflag=0)
 
OptionssetValueTypeFlags (int flags, int typemask)
 
OptionsaddValueTypeFlags (int flags, int typemask)
 
OptionsdelValueTypeFlags (int flags, int typemask)
 
OptionssetStyles (int style, int selectflag=0)
 
OptionsaddStyles (int style, int selectflag=0)
 
OptionsdelStyles (int style, int selectflag=0)
 
int styleSize (int style) const
 
OptionssetValueTypeStyles (int style, int typemask)
 
OptionsaddValueTypeStyles (int style, int typemask)
 
OptionsdelValueTypeStyles (int style, int typemask)
 
int nameWidth (int selectmask=0, bool detailed=false, bool escape=false) const
 
string save (int selectmask=0, int flags=0) const
 
ostream & save (ostream &str, const string &start="", int selectmask=0, int flags=0, int width=-1) const
 
ostream & save (ostream &str, const string &textformat, const string &numberformat, const string &boolformat="%i=%b", const string &dateformat="%i=%04Y-%02m-%02d", const string &timeformat="%i=%02H:%02M:%02S", const string &sectionformat="%i", int selectmask=0, const string &start="") const
 
ostream & saveXML (ostream &str, int selectmask=0, int flags=0, int level=0, int indent=4) const
 
Optionsread (const string &opttxt, int flag, const string &assignment=":=", const string &separator=",;", int *indent=0)
 
Optionsread (const string &opttxt, const string &assignment=":=", const string &separator=",;")
 
istream & read (istream &str, int flag, const string &assignment=":=", const string &comment="#", const string &stop="", Str *line=0)
 
istream & read (istream &str, const string &assignment=":=", const string &comment="#", const string &stop="", Str *line=0)
 
Optionsread (const StrQueue &sq, int flag=0, const string &assignment=":=")
 
bool read (const Parameter &p, int flag=0)
 
Optionsread (const Options &o, int flags=0, int flag=0)
 
bool readAppend (const Parameter &p)
 
OptionsreadAppend (const Options &o, int flags=0)
 
Optionsload (const Str &opttxt, const string &assignment=":=", const string &separator=",;", int *indent=0, int *indentspacing=0, int *level=0)
 
istream & load (istream &str, const string &assignment=":=", const string &comment="#", const string &stop="", string *line=0)
 
Optionsload (const StrQueue &sq, const string &assignment=":=")
 
virtual void notify (void)
 
void callNotifies (void)
 
bool setNotify (bool notify=true)
 
bool unsetNotify (void)
 
bool notifying (void) const
 

Static Public Member Functions

static void setConfigureClasses (ConfigureClasses *cfg)
 
- Static Public Member Functions inherited from Options
static double floorLog10 (double v)
 
static double floor10 (double v, double scale=1.0)
 
static double ceil10 (double v, double scale=1.0)
 

Additional Inherited Members

- Static Public Attributes inherited from Options
static const int NonDefault = Parameter::NonDefault
 
static const long TabSection = 0x04000000
 

Detailed Description

Base class for each class that has some parameters to be configured.

Author
Jan Benda
Version
1.1

Each ConfigClass instance can read and save configuration settings from/to its section of a configuration file. The sections are introduced by a line starting with '*' immediately followed by the configIdent(). A group of configuration files can be selected by setConfigGroup() (see ConfigureClasses for more details).

The configMode() determines whether the settings of this instance should be saved in a configuration file, get a configuration dialog, etc. See ConfigClass::Action for possible values.

The configSelectMask() selects a subset of items to be saved in a configuration file.

readConfig( StrQueue& ) reads the configuration settings from its section of a configuration file. saveConfig() stores the configuration settings in a configuration file and configSize() returns the number of items to be stored. The default implementation of these functions use the corresponding functions Options::read(), Options::save(), and Options::size() from the Options class. You may reimplement them according to your needs.

The config() function can be reimplemented for some post-configuration after all configuration files have been read in. The preConfig() function is for some pre-configuration before the configuration files are read in.

Member Enumeration Documentation

enum Action

Possible flags for the configuration mode.

Enumerator
Save 

The ConfigClass instance should get its configuration settings saved to a configuration file.

Dialog 

The ConfigClass instance should get a configuration dialog.

Help 

The ConfigClass instance provides a help text.

Menu 

The ConfigClass instance should get a menu entry.

Constructor & Destructor Documentation

ConfigClass ( const string &  ident,
int  group = 0,
int  mode = 0xffff,
int  selectmask = 0 
)

Constructs a ConfigClass with identifier ident that is a member of the configuration group with index group. It has the configuration mode mode and selectmask is used to select specific items to be saved into the configuration file. The new ConfigClass instance is then added to the static list of ConfigClass instances managed by ConfigureClasses.

Parameters
[in]identthe identifier string of the ConfigClass instance. It is used to specify the right section in a configuration file.
[in]groupthe index of the configuration group where the ConfigClass instance should belong to.
[in]modean integer flag that determines whether the settings of this instance should be saved in a configuration file, get a configuration dialog, etc. See ConfigClass::Action or possible values.
[in]selectmaskselects a subset of items to be saved in a configuration file.
See Also
addConfig()

References ConfigClass::addConfig().

ConfigClass ( const ConfigClass C)

Copy constructor. Never should be called.

~ConfigClass ( void  )
virtual

Deconstructs a ConfigClass and removes it from the list of ConfigClass instances.

References ConfigureClasses::eraseConfigClass().

Member Function Documentation

const string & configIdent ( void  ) const
Returns
the identifier string that is used to specify the right section for this ConfigClass instance in a configuration file.
See Also
setConfigIdent()

Referenced by ConfigureClasses::read().

void setConfigIdent ( const string &  ident)

Set the identifier string that is used to specify the right section for this ConfigClass instance in a configuration file to ident.

Parameters
[in]identthe identifier string of this ConfigClass instance.
See Also
configIdent()
int configGroup ( void  ) const
Returns
the index of the configuration group this instance of ConfigClass belongs to.
See Also
setConfigGroup()

Referenced by ConfigureClasses::read().

void setConfigGroup ( int  group)

Set the index of the configuration group this instance of ConfigClass belongs to to group.

Parameters
[in]groupthe index of the configuration group.
See Also
configGroup()
int configMode ( void  ) const
Returns
the mode flags of this ConfigClass instance that determines whether its settings should be saved in a configuration file, get a configuration dialog, etc. See ConfigClass::Action or possible values.
See Also
setConfigMode(), addConfigMode(), delConfigMode()
void setConfigMode ( int  mode)

Set the mode flags of this instance of ConfigClass to mode.

Parameters
[in]modethe mode flags that determine whether the settings of this instance should be saved in a configuration file, get a configuration dialog, etc. See ConfigClass::Action or possible values.
See Also
configMode(), addConfigMode(), delConfigMode()
void addConfigMode ( int  mode)

Sets the bits specified by mode in the mode flags.

Parameters
[in]modethe mode flags that determine whether the settings of this instance should be saved in a configuration file, get a configuration dialog, etc. See ConfigClass::Action or possible values.
See Also
configMode(), setConfigMode(), delConfigMode()
void delConfigMode ( int  mode)

Unsets the bits specified by mode from the mode flags.

Parameters
[in]modethe mode flags that determine whether the settings of this instance should be saved in a configuration file, get a configuration dialog, etc. See ConfigClass::Action or possible values.
See Also
setConfigMode(), addConfigMode(), configMode()
int configSelectMask ( void  ) const
Returns
the mask that is used to select specific items to be saved into the configuration file.
See Also
setConfigSelectMask()
void setConfigSelectMask ( int  mask)

Set the mask that is used to select specific items to be saved into the configuration file to mask.

Parameters
[in]maskthe mask for selecting configuration items.
See Also
configSelectMask()

References Options::flag().

void addConfig ( void  )

Adds this ConfigClass instance to the list of ConfigClass instances. This function needs to be called only if at the time of construction this list was not yet created, i.e. no instance of ConfigureClasses existed.

References ConfigureClasses::addConfigClass().

Referenced by ConfigClass::ConfigClass().

void readConfig ( void  )

Read in all configuration files and pass the right sections to readConfig( StrQueue& ) of this instance only.

See Also
readConfig( StrQueue& )

References ConfigureClasses::read().

Referenced by ConfigureClasses::read().

void readConfig ( StrQueue sq)
virtual

Read out the configuration settings from sq. The default implementation simply calls Options::read( sq, 0, ':' ) to set the Options directly as specified by sq. This function is called from the ConfigureClasses::read() functions.

Parameters
[in]sqthe section from a configuration file for this ConfigClass instance. The first line specifying the ConfigClass instance is already removed as well as any leading and trailing empty lines.
See Also
saveConfig(), readConfig( void )

References Options::read().

void saveConfig ( ofstream &  str)
virtual

Save the configuration settings to str. The default implementation simply calls Options::save( str, " ", -1, configSelectMask(), CFG->Detailed, CFG->FirstOnly ) to directly save the selected Options to str. This function is called from the ConfigureClasses::save() functions only if configMode() has the Save flag set.

Parameters
[in]strthe output stream for saving the configuration settings. The first line specifying the ConfigClass instance is already written.
See Also
readConfig( StrQueue& )

References Options::save().

int configSize ( void  ) const
virtual
Returns
the number of items as selected by configSelectMask() to be saved to a configuration file. saveConfig() is only called from the ConfigureClasses::save() functions if configSize() returns a number greater than zero. The default implementation returns Options::size( configSelectMask() ).

References Options::size().

void config ( void  )
virtual

This function can be reimplemented to do some post-configuration. It is called by ConfigureClasses::configure() after all configuration files have been read in via readConfig( StrQueue& ).

void preConfig ( void  )
virtual

This function can be reimplemented to do some pre-configuration. It is called by ConfigureClasses::preConfigure() before the configuration files are read in via readConfig( StrQueue& ).

void setConfigureClasses ( ConfigureClasses cfg)
static

This function is called by the constructors of ConfigureClasses to make the ConfigureClasses instance cfg known to each ConfigClass.

Referenced by ConfigureClasses::ConfigureClasses(), and ConfigureClasses::~ConfigureClasses().


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