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

#include <options.h>

Inheritance diagram for Options:
Inheritance graph
[legend]

Public Types

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

 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 double floorLog10 (double v)
 
static double floor10 (double v, double scale=1.0)
 
static double ceil10 (double v, double scale=1.0)
 

Static Public Attributes

static const int NonDefault = Parameter::NonDefault
 
static const long TabSection = 0x04000000
 

Friends

bool operator== (const Options &o1, const Options &o2)
 
bool operator== (const Options &o, const string &name)
 
bool operator< (const Options &o1, const Options &o2)
 
ostream & operator<< (ostream &str, const Options &o)
 
istream & operator>> (istream &str, Options &o)
 

Detailed Description

A hierarchical name-value list for configuration files and dialogs.

Author
Jan Benda
Version
2.0 An Options class contains a list of name-value pairs that are identified by a string name and have a default value dflt. For a dialog the string request() is provided to request the value of the name-value pair. Name-value pairs whose value-type is a Number have in addition a minimum and maximum value, a step size, a unit, and a format string. See class Parameter for more details on the name-value pairs.

In addition to the name-value pairs an Options also contains other Options as so called sections. This way a hierarchical structure is created. Each Options has a name() and a type(). New sections can be added with the newSection() functions.

Use addNumber(), addInteger(), addBoolean(), addText(), addSelection(), addTime() and addDate() to add option variables to the currently active section. With insertNumber(), insertText(), etc. new options can be inserted into the options list.

Use setNumber(), setText(), etc. to change the value, minimum and maximum value, unit and format of an already existing option. With erase() options can selectively be erased.

The values of the options can be read out with number(), integer(), boolean(), text(), index(), time() and date(). In addition the default values are accessible with defaultNumber() and defaultText(). Minimum and maximum values can be read with minimum() and maximum(). The corresponding unit and formatting string can be read with unit() and format().

The total number of defined options is returned by size(). To check wether an option with a certain name exist use exist().

The read(), readAppend(), load() and save() functions read the values of options, load new options, and save options from and to strings or files. Options have a flag() and Parameter have flags(). These can be used to select them for saving, etc. THey also have a style() that is used to determine how they are displayed in a dialog.

Member Typedef Documentation

typedef deque< Parameter >::iterator iterator
typedef deque< Options* >::iterator section_iterator

Member Enumeration Documentation

enum SaveFlags

Flags for the customizing saving of Options.

Enumerator
NoName 

Do not save the name of a section.

NoType 

Do not save the type of a section.

NoInclude 

Do not save the include file of a section.

SwitchNameType 

Switch name and type, i.e. the sections name is saved as its type, and its type is saved as its name.

Embrace 

Make sure that the saved string is embraced with curly braces to get a valid YAML string.

PrintRequest 

Print the request string.

FirstOnly 

If the Parameter::ListAlways style bit is not set only print out the first value.

PrintType 

Specify the type of the value.

PrintStyle 

Indicate the style of a section or Parameter name.

DontCloseSection 

Do not write the final closing </section>.

AlwaysQuote 

Always quote value strings.

EscapeQuotes 

Escape the quotes of strings with an backslash.

Constructor & Destructor Documentation

Options ( void  )
Options ( const Options o)

Copy constructor.

References Options::assign().

Options ( const Options o,
int  flags 
)

Copy Options o that have flags() & flags greater than zero to this. If flags equals zero, all options are copied.

References Options::assign().

Options ( const string &  name,
const string &  type,
int  flags,
int  style 
)

Constructs an empty Options with name name, type string type, flag flags, and style flag style.

Options ( const Str opttxt,
const string &  assignment = ":=",
const string &  separator = ",;" 
)

Create options from string opttxt. See load( const Str &opttxt, const string &separator ) for details.

References Options::load().

Options ( const StrQueue sq,
const string &  assignment = ":=" 
)

Create options from strings sq. See load( const StrQueue &sq ) for details.

References Options::load().

Options ( istream &  str,
const string &  assignment = ":=",
const string &  comment = "#",
const string &  stop = "",
string *  line = 0 
)

Create options from input stream str. See load( istream &str, const string &comment, const string &stop, string *line ) for details.

References Options::load().

~Options ( void  )
virtual

Deconstructs an options list.

References Options::clear().

Member Function Documentation

Options & operator= ( const Options o)

Copy Options o to this.

References Options::assign().

Options & assign ( const Options o)
Options & append ( const Options o)

Append Options o to this. That is, all Parameter of o are added to this Options' Parameter and all sections of o are added to the list of this' sections.

Note
If you want to add o as a complete section use addSection(), newSection(), or insertSection().
See Also
add(), assign()

References Options::begin(), Options::end(), Options::Options(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & add ( const Options o)

Append Options o to the currently active section of Options. That is, all Parameter and Sections of o are added to the Parameter and Sections of the currently active section of Options.

Note
If you want to add o as a complete section use addSection(), newSection(), or insertSection().
See Also
append(), assign(), endSection(), clearSections()

References Options::begin(), Options::end(), Options::Options(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Referenced by Options::addBoolean(), Options::addDate(), Options::addInteger(), Options::addNumber(), Options::addText(), Options::addTime(), Options::flatten(), and Options::readAppend().

Options & insert ( const Options o,
const string &  atname = "" 
)

Insert all name-value pairs of Options o at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the options are appended to the end of the list. Sections of o are not considered for insertion.

References Options::begin(), Options::end(), and Options::find().

Referenced by Options::insertBoolean(), Options::insertDate(), Options::insertInteger(), Options::insertNumber(), Options::insertText(), and Options::insertTime().

Options & assign ( const Options o,
int  flags 
)

Copy Options o that have flags() & flags greater than zero to this. If flags equals zero, all options are copied. If flags is negative, only options whose values differ from the default value and have abs(flags) set in their flags() are copied. If flags equals NonDefault, all options whose values differ from their default value are copied.

References Options::begin(), Options::clear(), Options::end(), Options::Options(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & copy ( Options o,
int  flags 
)

Copy all options o that have flags() & flags greater than zero. If flags equals zero, all options are copied. If flags is negative, only options whose values differ from the default value and have abs(flags) set in their flags() are copied. If flags equals NonDefault, all options whose values differ from their default value are copied.

References Options::begin(), Options::clear(), Options::end(), Options::Options(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & append ( const Options o,
int  flags 
)

Append all parameter and sections from o that have flags() & flags greater than zero to this. If flags equals zero, all Parameter and sections are appended. If flags is negative, only Parameter and sections whose values differ from the default value and have abs(flags) set in their flags() are copied. If flags equals NonDefault, all Parameter whose values differ from their default value are copied.

References Options::begin(), Options::end(), Options::Options(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & add ( const Options o,
int  flags 
)

Append all parameter and sections from o that have flags() & flags greater than zero to the currently active section. If flags equals zero, all Parameter and sections are appended. If flags is negative, only Parameter and sections whose values differ from the default value and have abs(flags) set in their flags() are copied. If flags equals NonDefault, all Parameter whose values differ from their default value are copied.

References Options::begin(), Options::end(), Options::Options(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & insert ( const Options o,
int  flags,
const string &  atname = "" 
)

Insert name-value pairs of o that have flags() & flags greater than zero at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the options are appended to the end of the list. Sections of o are not considered for insertion.

References Options::begin(), Options::end(), and Options::find().

Parameter * assign ( const string &  name,
const string &  value 
)

Set the value of an existing option with name name to value. Set warning message, if the value is invalid. Used by read().

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Options * parentSection ( void  )

Returns a pointer to the Options where this Options belongs to as a section. If this Options does not belong to an Options, NULL is returned.

See Also
rootSection()

Referenced by Options::addSection(), Options::endSection(), Options::erase(), Options::insert(), Options::insertSection(), Options::load(), Options::newSection(), Options::read(), Options::rootSection(), and Options::up().

const Options * parentSection ( void  ) const

Returns a const pointer to the Options where this Options belongs to as a section. If this Options does not belong to an Options, NULL is returned.

See Also
rootSection()
void setParentSection ( Options parentsection)
void resetParents ( void  )

Reset the parentSection() of all sections and subsections for this tree of Options.

See Also
parentSection()

References Options::sectionsBegin(), and Options::sectionsEnd().

Options * rootSection ( void  )

Returns a pointer to the top most Options in the hierarchy. If this Options does not have a parentSection() this is returned.

See Also
parentSection()

References Options::parentSection().

Referenced by Options::callNotifies().

const Options * rootSection ( void  ) const

Returns a pointer to the top most Options in the hierarchy. If this Options does not have a parentSection() this is returned.

See Also
parentSection()

References Options::parentSection().

string name ( void  ) const
void setName ( const string &  name)
virtual

Set the name of this section of options to name.

References Options::name().

Referenced by Options::down(), Options::insertSection(), Options::load(), Options::newSection(), and Options::setName().

void setName ( const string &  name,
const string &  type 
)
virtual

Set the name of this section of options to name and its type to type. The default implementation uses setName() for setting the name.

References Options::setName(), and Options::type().

string type ( void  ) const

The type specifyier of this section of options.

Referenced by Options::down(), Options::load(), Options::nameWidth(), Options::save(), Options::saveXML(), Options::setName(), and Options::setType().

void setType ( const string &  type)

Set the type specifier of this section of options to type.

References Options::type().

Referenced by Options::down(), Options::insertSection(), Options::load(), and Options::newSection().

string include ( void  ) const

The include path.

See Also
setInclude()

Referenced by Options::saveXML(), and Options::setInclude().

void setInclude ( const string &  include)

Tell this section of options that it inherits some of it contents from a section in a different file specified by include.

See Also
include()

References Options::include().

Referenced by Options::down().

void setInclude ( const string &  url,
const string &  name 
)

Tell this section of options that it inherits some of it contents from a section with name name saved in a different file at url. This information is written out by the saveXML() function only.

See Also
include()

References Options::name().

int flag ( void  ) const
bool flag ( int  selectflag) const

True if one of the bits specified by abs(selectflag) is set in the Option's flag(), or selectflag equals zero or NonDefault.

References Options::flag(), and Options::NonDefault.

Options & setFlag ( int  flag)

Set the flag of this section of options to flag.

References Options::flag().

Referenced by Options::setFlags(), and Options::setValueTypeFlags().

Options & addFlag ( int  flag)

Add the bits specified by flag to the flag of this section of options.

References Options::flag().

Referenced by Options::addFlags(), Options::addValueTypeFlags(), Options::insertSection(), and Options::newSection().

Options & delFlag ( int  flag)

Clear the bits specified by flag in the flag of this section of options.

Referenced by Options::delFlags(), and Options::delValueTypeFlags().

Options & clearFlag ( void  )

Set all bits of the flag of this section of options, i.e. set it to 0.

int style ( void  ) const

The style flag for name() and type() of this secion of options.

Referenced by Options::addStyle(), Options::load(), Options::save(), Options::setStyle(), and Options::styleSize().

Options & setStyle ( int  style)

Set the style flag for name() and type() of this section of options to style.

References Options::style().

Referenced by Options::down(), Options::load(), Options::setStyles(), and Options::setValueTypeStyles().

Options & addStyle ( int  style)

Add the bits specified by style in the style flag for name() and type() of this section of options.

References Options::style().

Referenced by Options::addStyles(), Options::addValueTypeStyles(), Options::insertSection(), and Options::newSection().

Options & delStyle ( int  style)

Clear the bits specified by style in the style flag for name() and type() of this section of options.

Referenced by Options::delStyles(), and Options::delValueTypeStyles().

Options & clearStyle ( void  )

Clear all bits of the style of this section of options, i.e. set it to 0.

bool checkType ( int  mask) const
Returns
true if one of the bits specified by mask corresponds to the Parameter::Section bit, or mask equals zero, or mask is negative and the Parameter::Section bit is not contained in abs( mask ).

References Parameter::Section.

Referenced by Options::addValueTypeFlags(), Options::addValueTypeStyles(), Options::delValueTypeFlags(), Options::delValueTypeStyles(), Options::setValueTypeFlags(), and Options::setValueTypeStyles().

Str warning ( void  ) const
inline

Returns the warning messages of the last called Option member-function.

Referenced by Options::load().

iterator begin ( void  )
inline
iterator end ( void  )
inline

Referenced by Options::add(), Options::addFlags(), Options::addStyle(), Options::addStyles(), Options::addValueTypeFlags(), Options::addValueTypeStyles(), Options::allText(), Options::append(), Options::assign(), Options::boolean(), Options::booleans(), Options::changed(), Options::changeUnit(), Options::clearFlags(), Options::copy(), Options::date(), Options::defaultBoolean(), Options::defaultDate(), Options::defaultInteger(), Options::defaultNumber(), Options::defaultText(), Options::defaultTime(), Options::delFlags(), Options::delStyle(), Options::delStyles(), Options::delValueTypeFlags(), Options::delValueTypeStyles(), Options::erase(), Options::error(), Options::errors(), Options::exist(), Options::find(), Options::flags(), Options::format(), Options::formatWidth(), Options::index(), Options::insert(), Options::integer(), Options::integers(), Options::maximum(), Options::minimum(), Options::nameWidth(), Options::number(), Options::numbers(), relacs::operator<(), relacs::operator==(), Options::operator[](), Options::outUnit(), Options::parameterSize(), Options::pushInteger(), Options::pushNumber(), Options::pushText(), Options::read(), Options::readAppend(), Options::request(), Options::rfind(), Options::save(), Options::saveXML(), Options::selectText(), Options::setBoolean(), Options::setCurrentDate(), Options::setCurrentTime(), Options::setDate(), Options::setDefault(), Options::setDefaultBoolean(), Options::setDefaultDate(), Options::setDefaultInteger(), Options::setDefaultNumber(), Options::setDefaults(), Options::setDefaultText(), Options::setDefaultTime(), Options::setFlags(), Options::setFormat(), Options::setInteger(), Options::setMinMax(), Options::setNumber(), Options::setOutUnit(), Options::setRequest(), Options::setStep(), Options::setStyle(), Options::setStyles(), Options::setText(), Options::setTime(), Options::setToDefault(), Options::setToDefaults(), Options::setUnit(), Options::setValueType(), Options::setValueTypeFlags(), Options::setValueTypeStyles(), Options::size(), Options::step(), Options::style(), Options::styleSize(), Options::text(), Options::texts(), Options::time(), Options::unit(), Options::up(), and Options::valueType().

const_iterator begin ( void  ) const
inline
const_iterator end ( void  ) const
inline
section_iterator sectionsBegin ( void  )
inline
section_iterator sectionsEnd ( void  )
inline
const_section_iterator sectionsBegin ( void  ) const
inline
const_section_iterator sectionsEnd ( void  ) const
inline
Options::const_iterator find ( const string &  pattern,
int  level = -1 
) const

Search for the first option that matches pattern. pattern can be a list of search terms separated by '>', for example 'aaa>bbb', to search parameter 'bbb' in section 'aaa'. Alternative search terms can be separated by '|'. For example, if pattern is "date|time", then "date" is searched first and if this is not found, "time" is searched. Returns end() if no match for pattern is found.

References StrQueue::assign(), Options::begin(), Options::empty(), Options::end(), StrQueue::erase(), StrQueue::find(), Options::sectionsBegin(), Options::sectionsEnd(), and StrQueue::size().

Referenced by Options::addFlags(), Options::addStyle(), Options::allText(), Options::assign(), Options::boolean(), Options::booleans(), Options::changed(), Options::changeUnit(), Options::clearFlags(), Options::date(), Options::defaultBoolean(), Options::defaultDate(), Options::defaultInteger(), Options::defaultNumber(), Options::defaultText(), Options::defaultTime(), Options::delFlags(), Options::delStyle(), Options::erase(), Options::error(), Options::errors(), Options::exist(), Options::flags(), Options::format(), Options::formatWidth(), Options::index(), Options::insert(), Options::integer(), Options::integers(), Options::maximum(), Options::minimum(), Options::number(), Options::numbers(), Options::operator[](), Options::outUnit(), Options::pushInteger(), Options::pushNumber(), Options::pushText(), Options::request(), Options::selectText(), Options::setBoolean(), Options::setCurrentDate(), Options::setCurrentTime(), Options::setDate(), Options::setDefault(), Options::setDefaultBoolean(), Options::setDefaultDate(), Options::setDefaultInteger(), Options::setDefaultNumber(), Options::setDefaultText(), Options::setDefaultTime(), Options::setFlags(), Options::setFormat(), Options::setInteger(), Options::setMinMax(), Options::setNumber(), Options::setOutUnit(), Options::setRequest(), Options::setStep(), Options::setStyle(), Options::setText(), Options::setTime(), Options::setToDefault(), Options::setUnit(), Options::setValueType(), Options::size(), Options::step(), Options::style(), Options::text(), Options::texts(), Options::time(), Options::unit(), and Options::valueType().

Options::iterator find ( const string &  pattern,
int  level = -1 
)

Search for the first option that matches pattern. pattern can be a list of search terms separated by '>', for example 'aaa>bbb', to search parameter 'bbb' in section 'aaa'. Alternative search terms can be separated by '|'. For example, if pattern is "date|time", then "date" is searched first and if this is not found, "time" is searched. Returns end() if no match for pattern is found.

References StrQueue::assign(), Options::begin(), Options::empty(), Options::end(), StrQueue::erase(), StrQueue::find(), Options::sectionsBegin(), Options::sectionsEnd(), and StrQueue::size().

Options::const_iterator rfind ( const string &  pattern,
int  level = -1 
) const

Search for the last option that matches pattern. Returns end() if name is not found. See find() for details about valid patterns pattern.

References StrQueue::assign(), Options::begin(), Options::empty(), Options::end(), StrQueue::erase(), Options::sectionsBegin(), Options::sectionsEnd(), and StrQueue::size().

Options::iterator rfind ( const string &  pattern,
int  level = -1 
)

Search for the last option that matches pattern. Returns end() if name is not found. See find() for details about valid patterns pattern.

References StrQueue::assign(), Options::begin(), Options::empty(), Options::end(), StrQueue::erase(), Options::sectionsBegin(), Options::sectionsEnd(), and StrQueue::size().

Options::const_section_iterator findSection ( const string &  pattern,
int  level = -1 
) const

Search for the first section of Options that matches pattern. pattern can be a list of search terms separated by '>', for example 'aaa>bbb', to search subsection 'bbb' in section 'aaa'. Alternative search terms can be separated by '|'. For example, if pattern is "date|time", then "date" is searched first and if this is not found, "time" is searched. Returns sectionsEnd() if no match for pattern is found.

Note
the name() of this Options is not found.

References StrQueue::assign(), Options::empty(), StrQueue::erase(), Options::sectionsBegin(), Options::sectionsEnd(), Options::sectionsSize(), and StrQueue::size().

Referenced by Options::erase(), Options::existSection(), Options::insertSection(), Options::read(), and Options::section().

Options::section_iterator findSection ( const string &  pattern,
int  level = -1 
)

Search for the first section of Options that matches pattern. pattern can be a list of search terms separated by '>', for example 'aaa>bbb', to search subsection 'bbb' in section 'aaa'. Alternative search terms can be separated by '|'. For example, if pattern is "date|time", then "date" is searched first and if this is not found, "time" is searched. Returns sectionsEnd() if no match for pattern is found.

Note
the name() of this Options is not found.

References StrQueue::assign(), Options::empty(), StrQueue::erase(), Options::sectionsBegin(), Options::sectionsEnd(), Options::sectionsSize(), and StrQueue::size().

Options::const_section_iterator rfindSection ( const string &  pattern,
int  level = -1 
) const

Search for the last section of Options that matches pattern. pattern can be a list of search terms separated by '>', for example 'aaa>bbb', to search subsection 'bbb' in section 'aaa'. Alternative search terms can be separated by '|'. For example, if pattern is "date|time", then "date" is searched first and if this is not found, "time" is searched. Returns sectionsEnd() if no match for pattern is found.

Note
the name() of this Options is not found.

References StrQueue::assign(), Options::empty(), StrQueue::erase(), Options::sectionsBegin(), Options::sectionsEnd(), Options::sectionsSize(), and StrQueue::size().

Options::section_iterator rfindSection ( const string &  pattern,
int  level = -1 
)

Search for the last section of Options that matches pattern. pattern can be a list of search terms separated by '>', for example 'aaa>bbb', to search subsection 'bbb' in section 'aaa'. Alternative search terms can be separated by '|'. For example, if pattern is "date|time", then "date" is searched first and if this is not found, "time" is searched. Returns sectionsEnd() if no match for pattern is found.

Note
the name() of this Options is not found.

References StrQueue::assign(), Options::empty(), StrQueue::erase(), Options::sectionsBegin(), Options::sectionsEnd(), Options::sectionsSize(), and StrQueue::size().

const Parameter & operator[] ( int  i) const

Get i-th name-value pair.

Parameter & operator[] ( int  i)

Get i-th name-value pair.

const Parameter & operator[] ( const string &  name) const

Get the name-value pair with name name.

References Options::end(), and Options::find().

Parameter & operator[] ( const string &  name)

Get the name-value pair with name name.

References Options::end(), and Options::find().

const Options & section ( int  i) const

Get i-th section.

References Options::Options().

Options & section ( int  i)

Get i-th section.

References Options::Options().

const Options & section ( const string &  name) const

Get section with name name.

References Options::findSection(), Options::Options(), and Options::sectionsEnd().

Options & section ( const string &  name)

Get section with name name.

References Options::findSection(), Options::Options(), and Options::sectionsEnd().

Str request ( const string &  name) const

Returns the request string of the option with name name.

References Str::empty(), Options::end(), and Options::find().

Parameter & setRequest ( const string &  name,
const string &  request 
)

Set request string of the option with name name to request.

References Str::empty(), Options::end(), and Options::find().

Parameter::ValueType valueType ( const string &  name) const

The type of the option with name name.

References Str::empty(), Options::end(), Options::find(), and Parameter::NoType.

Parameter & setValueType ( const string &  name,
Parameter::ValueType  type 
)

Set type of the option with name name to type.

References Str::empty(), Options::end(), and Options::find().

int flags ( const string &  name) const

The flags of the option with name name.

References Str::empty(), Options::end(), and Options::find().

bool flags ( const string &  name,
int  flag 
) const
Returns
true if the flags of the option with name name have flag set.
See Also
Parameter::flags( int )

References Str::empty(), Options::end(), and Options::find().

Parameter & setFlags ( const string &  name,
int  flags 
)

Set the flags of the option with name name to flags.

References Str::empty(), Options::end(), and Options::find().

Parameter & addFlags ( const string &  name,
int  flags 
)

Add the bits specified by flags to the flags of the option with name name.

References Str::empty(), Options::end(), and Options::find().

Referenced by Options::read().

Parameter & delFlags ( const string &  name,
int  flags 
)

Clear the bits specified by flags of the flags of the option with name name.

References Str::empty(), Options::end(), and Options::find().

Parameter & clearFlags ( const string &  name)

Clear all bits of the flags of the option with name name.

References Str::empty(), Options::end(), and Options::find().

bool changed ( const string &  name)

Return true if the changedFlag() of the option with name name is set, i.e. whose value has been changed..

References Str::empty(), Options::end(), and Options::find().

Referenced by Options::read().

int style ( const string &  name) const

The style of the option with name name.

References Str::empty(), Options::end(), and Options::find().

Parameter & setStyle ( const string &  name,
int  style 
)

Set the style of the option with name name to style.

References Str::empty(), Options::end(), and Options::find().

Parameter & addStyle ( const string &  name,
int  style 
)

Add the bits specified by style to the style of the option with name name.

References Str::empty(), Options::end(), and Options::find().

Parameter & delStyle ( const string &  name,
int  style 
)

Clear the bits specified by style of the style of the option with name name.

References Str::empty(), Options::end(), and Options::find().

Str format ( const string &  name) const

Return the format string of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, an empty string is returned.

References Str::empty(), Options::end(), Options::find(), and Str::format().

Parameter & setFormat ( const string &  name,
int  width = 0,
int  prec = -1,
char  fmt = 'g' 
)

Set format string of an existing number option with name name to have a width of width, precision of prec and type fmt.

References Str::empty(), Options::end(), and Options::find().

Parameter & setFormat ( const string &  name,
const string &  format 
)

Set the format of an existing number option with name name to format.

References Str::empty(), Options::end(), and Options::find().

int formatWidth ( const string &  name) const

Returns the width specified by the format string of the option specified by name.

References Str::empty(), Options::end(), and Options::find().

int size ( const string &  name) const

If several values correspond to the option with name name size() returns the number of values.

References Str::empty(), Options::end(), and Options::find().

Referenced by relacs::operator==().

Parameter & add ( const Parameter np)

Add parameter np to options.

See Also
insert(), endSection(), clearSections()
Parameter & insert ( const Parameter np,
const string &  atname = "" 
)

Insert a new Parameter np at the position of the Parameter specified by atname. list (atname == "") or. If atname is empty or no Parameter is found for atname, the Parameter is inserted at the beginning or appended to the end of the currently active section, respectively.

See Also
add(), endSection(), clearSections()

References Options::end(), Options::find(), Options::parentSection(), and Parameter::setParentSection().

Parameter & addText ( const string &  name,
const string &  request,
const string &  dflt,
int  flags = 0,
int  style = 0 
)

Add a text option at the end of the options list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt.

References Options::add(), Str::empty(), and Parameter::warning().

Referenced by Options::addSelection().

Parameter& addText ( const string &  name,
const string &  dflt = "",
int  flags = 0,
int  style = 0 
)
inline

Add a text option at the end of the options list. Its name string and its request string for the options dialog are set to name. The option has a default value dflt.

Parameter & insertText ( const string &  name,
const string &  atname,
const string &  request,
const string &  dflt,
int  flags = 0,
int  style = 0 
)

Insert a new text option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt.

References Str::empty(), Options::insert(), and Parameter::warning().

Referenced by Options::insertSelection().

Parameter& insertText ( const string &  name,
const string &  atname = "",
const string &  dflt = "",
int  flags = 0,
int  style = 0 
)
inline

Insert a new text option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and its request string for the options dialog are set to name. The option has a default value dflt.

Str text ( const string &  name,
int  index,
const string &  dflt = "",
const string &  format = "",
const string &  unit = "" 
) const

Return the index-th string of the text option with name name. If there is no option with name name an empty string is returned.

References Str::empty(), Options::end(), Options::find(), and Str::text().

Str text ( const string &  name,
const string &  dflt = "",
const string &  format = "",
const string &  unit = "" 
) const
inline

Return the first string of the text option with name name. If there is no option with name name an empty string is returned.

void texts ( const string &  name,
vector< string > &  s,
const string &  format = "",
const string &  unit = "" 
) const

Return in s all values of the text option with name name as a list of strings formatted according to format using unit. See Parameter::text() for details.

References Str::empty(), Options::end(), and Options::find().

Str allText ( const string &  name,
const string &  dflt = "",
const string &  format = "",
const string &  unit = "",
const string &  separator = ", " 
) const

Return all values of the parameter with name name, formatted according to format using unit, and concatenated using separator. If there is no option with name name an empty string is returned. See Parameter::text() for details.

References Str::empty(), Options::end(), and Options::find().

Parameter & setText ( const string &  name,
const string &  strg 
)

Set the value of an existing text option with name name to strg.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setText ( const string &  name,
const Parameter p 
)

Set value of an existing text option with name name to the one of p, if both are of valueType() Text. If the value of the parameter is changing then the changedFlag() is set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & pushText ( const string &  name,
const string &  strg 
)

Add strg to the value of an existing text option with name name.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Str defaultText ( const string &  name,
const string &  format = "",
const string &  unit = "" 
) const

Return the default string of the text option with name name. If there is no option with name name, or the option is not a text, an empty string is returned.

References Str::empty(), Options::end(), and Options::find().

Parameter & setDefaultText ( const string &  name,
const string &  dflt 
)

Set the default string of an existing text option with name name to dflt.

References Str::empty(), Options::end(), and Options::find().

Parameter & addSelection ( const string &  name,
const string &  request,
const string &  selection,
int  flags = 0,
int  style = 0 
)

Add a text-selection option at the end of the options list. Its request string for the options dialog is set to request, its name string is set to name. The option has a list selection of strings (separated by ", ") that can be selected.

References Options::addText(), and Parameter::SelectText.

Parameter& addSelection ( const string &  name,
const string &  selection = "",
int  flags = 0,
int  style = 0 
)
inline

Add a text option at the end of the options list. Its name string and its request string for the options dialog are set to name. The option has a list selection of strings (separated by ", ") that can be selected.

Parameter & insertSelection ( const string &  name,
const string &  atname,
const string &  request,
const string &  selection,
int  flags = 0,
int  style = 0 
)

Insert a new text option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its request string for the options dialog is set to request, its name string is set to name. The option has a list selection of strings (separated by ", ") that can be selected.

References Options::insertText(), and Parameter::SelectText.

Parameter& insertSelection ( const string &  name,
const string &  atname = "",
const string &  selection = "",
int  flags = 0,
int  style = 0 
)
inline

Insert a new text option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and its request string for the options dialog are set to name. The option has a list selection of strings (separated by ", ") that can be selected.

Parameter & selectText ( const string &  name,
const string &  strg,
int  add = 0 
)

If the text parameter has several values, then the value that is matched by strg is inserted as the first value. If strg does not match any of the text values strg is added to the text values and is marked as selected if add > 0, or if add == 0 and the SelectText - Bit in the Parameter's style is not set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & selectText ( const string &  name,
int  index 
)

If the text parameter has several values, then the index-th value is selected by inserting it as the first value.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

int index ( const string &  name) const

Returns the index of the selected value, i.e. the index minus one of the matching value with the first value.

References Str::empty(), Options::end(), and Options::find().

Referenced by Options::load(), and Options::read().

int index ( const string &  name,
const string &  strg 
) const

Returns the index of the value that matches strg.

References Str::empty(), Options::end(), and Options::find().

Parameter & addNumber ( 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 
)

Add a new number option at the end of the options list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt, minimum value minimum and maximum value maximum, as well as a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

References Options::add(), Str::empty(), and Parameter::warning().

Parameter& addNumber ( const string &  name,
const string &  request,
double  dflt,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Add a new number option at the end of the options list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt, a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

Parameter& addNumber ( const string &  name,
double  dflt,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Add a new number option at the end of the options list. Its name string and request string is set to name. The option has a default value dflt, a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

Parameter& addNumber ( const string &  name,
double  dflt,
const string &  unit,
int  flags,
int  style = 0 
)
inline

Add a new number option at the end of the options list. Its name string and request string is set to name. The option has a default value dflt and a unit unit.

Parameter& addNumber ( const string &  name,
double  dflt,
double  error,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Add a new number option at the end of the options list. Its name string and request string is set to name. The option has a default value dflt, an error error, a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

References Parameter::setNumber().

Parameter& addNumber ( const string &  name,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Add a new number option at the end of the options list. Its name string and request string is set to name. The option has a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

Parameter & insertNumber ( 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 
)

Insert a new number option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt, minimum value minimum and maximum value maximum, as well as a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

References Str::empty(), Options::insert(), and Parameter::warning().

Parameter& insertNumber ( const string &  name,
const string &  atname,
const string &  request,
double  dflt,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Insert a new number option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt, a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

Parameter& insertNumber ( const string &  name,
const string &  atname,
double  dflt,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Insert a new number option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and request string is set to name. The option has a default value dflt, a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

Parameter& insertNumber ( const string &  name,
const string &  atname,
const string &  unit = "",
const string &  format = "",
int  flags = 0,
int  style = 0 
)
inline

Insert a new number option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and request string is set to name. The option has a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).

double number ( const string &  name,
double  dflt = 0.0,
const string &  unit = "",
int  index = 0 
) const

Return the index-th number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

double number ( const string &  name,
const string &  unit,
double  dflt = 0.0,
int  index = 0 
) const
inline
double number ( const string &  name,
int  index,
double  dflt = 0.0,
const string &  unit = "" 
) const
inline

Return the index-th number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

double number ( const string &  name,
int  index,
const string &  unit,
double  dflt = 0.0 
) const
inline
void numbers ( const string &  name,
vector< double > &  n,
const string &  unit = "" 
) const

Return in n all number-values of the option with name name in the unit unit.

References Str::empty(), Options::end(), and Options::find().

double error ( const string &  name,
const string &  unit = "",
int  index = 0 
) const

Return the index-th standard deviation of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

Referenced by Options::load(), and Options::read().

double error ( const string &  name,
int  index,
const string &  unit = "" 
) const
inline

Return the index-th standard deviation of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

void errors ( const string &  name,
vector< double > &  n,
const string &  unit = "" 
) const

Return in n all error-values of the option with name name in the unit unit.

References Str::empty(), Options::end(), and Options::find().

Parameter & setNumber ( const string &  name,
double  number,
double  error,
const string &  unit = "" 
)

Set the value of an existing number option with name name to number.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter& setNumber ( const string &  name,
double  number,
const string &  unit = "" 
)
inline

Set the value of an existing number option with name name to number.

Parameter & pushNumber ( const string &  name,
double  number,
double  error = -1.0,
const string &  unit = "" 
)

Add number to the value of an existing number option with name name.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter& pushNumber ( const string &  name,
double  number,
const string &  unit 
)
inline

Add number to the value of an existing number option with name name.

Parameter & setNumber ( const string &  name,
const Parameter p 
)

Set value of an existing number option with name name to the one of p, if both are of valueType() Number. If the value of the parameter is changing then the changedFlag() is set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

double defaultNumber ( const string &  name,
const string &  unit = "" 
) const

Return the default number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

Parameter & setDefaultNumber ( const string &  name,
double  dflt,
const string &  unit = "" 
)

Set the default number of an existing number option with name name to dflt.

References Str::empty(), Options::end(), and Options::find().

double minimum ( const string &  name,
const string &  unit = "" 
) const

Return the minimum number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

double maximum ( const string &  name,
const string &  unit = "" 
) const

Return the maximum number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

double step ( const string &  name,
const string &  unit = "" 
) const

Return the step size of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, unity is returned.

References Str::empty(), Options::end(), and Options::find().

Parameter & setStep ( const string &  name,
double  step,
const string &  unit = "" 
)
Parameter & setMinMax ( const string &  name,
double  minimum = -MAXDOUBLE,
double  maximum = MAXDOUBLE,
double  step = 1.0,
const string &  unit = "" 
)

Set the minimum and maximum of an existing number option with name name to minimum and maximum, respectively.

References Str::empty(), Options::end(), and Options::find().

static double floorLog10 ( double  v)
inlinestatic

Returns the largest power of ten smaller or equal to v.

static double floor10 ( double  v,
double  scale = 1.0 
)
inlinestatic

Returns the next smaller multiple of floorLog10( v ). This is flooring to the leading digit. For example: 23.7 -> 20, 1.45 -> 1. scale determines to which digit the number should be floored. For example with scale = 0.1 you get 23.7 -> 23, 1.45 -> 1.4

static double ceil10 ( double  v,
double  scale = 1.0 
)
inlinestatic

Returns the next larger multiple of floorLog10( v ). This is ceiling to the leading digit. For example: 23.7 -> 30, 1.45 -> 2. scale determines to which digit the number should be ceiled. For example with scale = 0.1 you get 23.7 -> 24, 1.45 -> 1.5

Str unit ( const string &  name) const

Return the internal unit of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, an empty string is returned.

References Str::empty(), Options::end(), Options::find(), and Str::unit().

Str outUnit ( const string &  name) const

Return the unit used for output and dialogs of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, an empty string is returned.

References Str::empty(), Options::end(), and Options::find().

Parameter & setUnit ( const string &  name,
const string &  internunit,
const string &  outunit = "" 
)

Set the internal unit and the output unit of an existing number option with name name to internunit and outunit, respectively. If outunit is an empty string it is set to internunit.

References Str::empty(), Options::end(), and Options::find().

Parameter & setOutUnit ( const string &  name,
const string &  outputunit 
)

Set the output unit of an existing number option with name name to outputunit.

References Str::empty(), Options::end(), and Options::find().

Parameter & changeUnit ( const string &  name,
const string &  internunit 
)

Set the internal unit of an existing number option with name name to inputunit. The values of the parameter are converted accordingly.

References Str::empty(), Options::end(), and Options::find().

Parameter & addInteger ( 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 
)

Add a new integer option at the end of the options list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt, minimum value minimum and maximum value maximum, as well as a unit unit and a width of output format width.

References Options::add(), Str::empty(), and Parameter::warning().

Parameter& addInteger ( const string &  name,
long  dflt,
const string &  unit = "",
int  width = 0,
int  flags = 0,
int  style = 0 
)
inline

Add a new integer option at the end of the options list. Its name string and request string is set to name. The option has a default value dflt, a unit unit, and a width of output format width.

Parameter& addInteger ( const string &  name,
const string &  unit = "" 
)
inline

Add a new integer option at the end of the options list. Its name string and request string is set to name. The option has a unit unit, and a width of output format width.

Parameter & insertInteger ( 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 
)

Insert a new integer option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt, minimum value minimum and maximum value maximum, as well as a unit unit and a width of output format width.

References Str::empty(), Options::insert(), and Parameter::warning().

Parameter& insertInteger ( const string &  name,
const string &  atname,
long  dflt,
const string &  unit = "",
int  width = 0,
int  flags = 0,
int  style = 0 
)
inline

Insert a new integer option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and request string is set to name. The option has a default value dflt, a unit unit, and a width of output format width.

Parameter& insertInteger ( const string &  name,
const string &  atname,
const string &  unit = "",
int  width = 0,
int  flags = 0,
int  style = 0 
)
inline

Insert a new integer option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and request string is set to name. The option has a unit unit, and a width of output format width.

long integer ( const string &  name,
const string &  unit = "",
long  dflt = 0,
int  index = 0 
) const

Return the index-th integer number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

long integer ( const string &  name,
int  index,
long  dflt = 0,
const string &  unit = "" 
) const
inline

Return the index-th integer number of the option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

long integer ( const string &  name,
int  index,
const string &  unit,
long  dflt = 0 
) const
inline
void integers ( const string &  name,
vector< long > &  n,
const string &  unit = "" 
) const

Return in n all integer-values of the option with name name in the unit unit.

References Str::empty(), Options::end(), and Options::find().

void integers ( const string &  name,
vector< int > &  n,
const string &  unit = "" 
) const

Return in n all integer-values of the option with name name in the unit unit.

References Str::empty(), Options::end(), and Options::find().

Parameter & setInteger ( const string &  name,
long  number,
long  error,
const string &  unit = "" 
)

Set the value of an existing integer option with name name to number.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter& setInteger ( const string &  name,
long  number,
const string &  unit = "" 
)
inline

Set the value of an existing integer option with name name to number.

Parameter & pushInteger ( const string &  name,
long  number,
long  error,
const string &  unit = "" 
)

Add number to the value of an existing integer option with name name.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter& pushInteger ( const string &  name,
long  number,
const string &  unit = "" 
)
inline

Add number to the value of an existing integer option with name name.

Parameter & setInteger ( const string &  name,
const Parameter p 
)

Set value of an existing integer option with name name to the one of p, if both are of valueType() Integer. If the value of the parameter is changing then the changedFlag() is set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

long defaultInteger ( const string &  name,
const string &  unit = "" 
) const

Return the default number of the integer option with name name. If there is no option with name name, or the option is neither a number nor an integer, zero is returned.

References Str::empty(), Options::end(), and Options::find().

Parameter & setDefaultInteger ( const string &  name,
long  dflt,
const string &  unit = "" 
)

Set the default number of an existing integer option with name name to dflt.

References Str::empty(), Options::end(), and Options::find().

Parameter & setMinMax ( const string &  name,
long  minimum = LONG_MIN,
long  maximum = LONG_MAX,
long  step = 1,
const string &  unit = "" 
)

Set the minimum and maximum of an existing integer number option with name name to minimum and maximum, respectively.

References Str::empty(), Options::end(), and Options::find().

Parameter& setMinMax ( const string &  name,
int  minimum,
int  maximum,
int  step = 1,
const string &  unit = "" 
)
inline

Set the minimum and maximum of an existing integer number option with name name to minimum and maximum, respectively.

Parameter & addBoolean ( const string &  name,
const string &  request,
bool  dflt,
int  flags = 0,
int  style = 0 
)

Add a boolean option at the end of the options list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt.

References Options::add(), Str::empty(), and Parameter::warning().

Parameter& addBoolean ( const char *  name,
const char *  request,
bool  dflt,
int  flags = 0,
int  style = 0 
)
inline

Add a boolean option at the end of the options list. Its name string and request string is set to name. The option has a default value dflt.

Parameter& addBoolean ( const string &  name,
bool  dflt,
int  flags = 0,
int  style = 0 
)
inline
Parameter& addBoolean ( const char *  name,
bool  dflt,
int  flags = 0,
int  style = 0 
)
inline
Parameter & insertBoolean ( const string &  name,
const string &  atname = "",
const string &  request = "",
bool  dflt = false,
int  flags = 0,
int  style = 0 
)

Insert a new boolean option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its request string for the options dialog is set to request, its name string is set to name. The option has a default value dflt.

References Str::empty(), Options::insert(), and Parameter::warning().

Parameter& insertBoolean ( const string &  name,
const string &  atname,
int  flags = 0,
int  style = 0 
)
inline

Insert a new boolean option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and request string is set to name. The option has a default value dflt.

Insert a new boolean option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. Its name string and request string is set to name.

bool boolean ( const string &  name,
bool  dflt = false,
int  index = 0 
) const

Return the boolean of the option with name name. If there is no option with name name, or the option is neither a boolean, nor a number, nor an integer, false is returned.

References Str::empty(), Options::end(), and Options::find().

bool boolean ( const string &  name,
int  index,
bool  dflt = false 
) const
inline
void booleans ( const string &  name,
vector< bool > &  n 
) const

Return in n all boolean-values of the options with name name.

References Str::empty(), Options::end(), and Options::find().

Parameter & setBoolean ( const string &  name,
bool  b 
)

Set the value of an existing boolean option with name name to string.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setBoolean ( const string &  name,
const Parameter p 
)

Set value of an existing boolean option with name name to the one of p, if both are of valueType() Boolean. If the value of the parameter is changing then the changedFlag() is set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

bool defaultBoolean ( const string &  name) const

Return the default boolean of the option with name name. If there is no option with name name, or the option is neither a boolean, nor a number nor an integer, false is returned.

References Str::empty(), Options::end(), and Options::find().

Parameter & setDefaultBoolean ( const string &  name,
bool  dflt 
)

Set the default value of an existing boolean option with name name to dflt.

References Str::empty(), Options::end(), and Options::find().

Parameter & addDate ( const string &  name,
const string &  request,
int  year = 0,
int  month = 0,
int  day = 0,
int  flags = 0,
int  style = 0 
)

Add a date option at the end of the options list.

Parameters
[in]namethe name string of the new option
[in]requestthe request string of the new option
[in]yearthe default value for the year
[in]monththe default value for the month
[in]daythe default value for the dat
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
insertDate(), setDate(), date()

References Options::add(), Parameter::Date, Str::empty(), and Parameter::warning().

Parameter& addDate ( const string &  name,
int  year,
int  month,
int  day,
int  flags = 0,
int  style = 0 
)
inline

Add a date option at the end of the options list.

Parameters
[in]namethe name and request string of the new option
[in]yearthe default value for the year
[in]monththe default value for the month
[in]daythe default value for the day
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
insertDate(), setDate(), date()
Parameter& addDate ( const string &  name,
int  flags = 0,
int  style = 0 
)
inline

Add a date option at the end of the options list with year, month and day set to zero.

Parameters
[in]namethe name and request string of the new option
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
insertDate(), setDate(), date()
Parameter & insertDate ( const string &  name,
const string &  atname = "",
const string &  request = "",
int  year = 0,
int  month = 0,
int  day = 0,
int  flags = 0,
int  style = 0 
)

Insert a new date option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list.

Parameters
[in]namethe name string of the new option
[in]atnamethe name string of the existing option where the new options should be inserted. If left empty, the new option is inserted at the beginning of the option list.
[in]requestthe request string of the new option
[in]yearthe default value for the year
[in]monththe default value for the month
[in]daythe default value for the day
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
addDate(), setDate(), date()

References Parameter::Date, Str::empty(), Options::insert(), and Parameter::warning().

Parameter& insertDate ( const string &  name,
const string &  atname,
int  year = 0,
int  month = 0,
int  day = 0,
int  flags = 0,
int  style = 0 
)
inline

Insert a new date option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list.

Parameters
[in]namethe name and request string of the new option
[in]atnamethe name string of the existing option where the new options should be inserted. If left empty, the new option is inserted at the beginning of the option list.
[in]yearthe default value for the year
[in]monththe default value for the month
[in]daythe default value for the day
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
addDate(), setDate(), date()
Parameter& insertDate ( const string &  name,
const string &  atname,
int  flags = 0,
int  style = 0 
)
inline

Insert a new date option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. The year, month and day are set to zero.

Parameters
[in]namethe name and request string of the new option
[in]atnamethe name string of the existing option where the new options should be inserted. If left empty, the new option is inserted at the beginning of the option list.
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
addDate(), setDate(), date()
const Parameter & date ( const string &  name,
int  index,
int &  year,
int &  month,
int &  day 
) const

Get the date from a date option.

Parameters
[in]namethe name string of the option
[in]indexthe index of the date
[out]yearthe year of the specified date
[out]monththe month of the specified date
[out]daythe day of the specified date
Returns
the reference of the option
See Also
defaultDate(), setDate(), addDate(), insertDate()

References Str::empty(), Options::end(), and Options::find().

Parameter & setDate ( const string &  name,
int  year,
int  month,
int  day 
)

Set the value of an existing date option.

Parameters
[in]namethe name string of the option
[in]yearthe new value for the year
[in]monththe new value for the month
[in]daythe new value for the day
Returns
a reference to the option.
See Also
setCurrentDate(), setDefaultDate(), addDate(), insertDate(), date()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setDate ( const string &  name,
const string &  date 
)

Set the value of an existing date option.

Parameters
[in]namethe name string of the option
[in]datethe new value for the date
Returns
a reference to the option.
See Also
setCurrentDate(), setDefaultDate(), addDate(), insertDate(), date()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setDate ( const string &  name,
const struct tm &  date 
)

Set the value of an existing date option.

Parameters
[in]namethe name string of the option
[in]datethe new value for the date
Returns
a reference to the option.
See Also
setCurrentDate(), setDefaultDate(), addDate(), insertDate(), date()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setDate ( const string &  name,
const time_t &  time 
)

Set the value of an existing date option.

Parameters
[in]namethe name string of the option
[in]timethe new value for the date
Returns
a reference to the option.
See Also
setCurrentDate(), setDefaultDate(), addDate(), insertDate(), date()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setCurrentDate ( const string &  name)

Set the value of an existing date option to the current date.

Parameters
[in]namethe name string of the option
Returns
a reference to the option.
See Also
setDate(), setDefaultDate(), addDate(), insertDate(), date()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setDate ( const string &  name,
const Parameter p 
)

Set value of an existing date option with name name to the one of p, if both are of valueType() Date. If the value of the parameter is changing then the changedFlag() is set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

const Parameter & defaultDate ( const string &  name,
int  index,
int &  year,
int &  month,
int &  day 
) const

Get the default date from a date option.

Parameters
[in]namethe name string of the option
[in]indexthe index of the default date
[out]yearthe year of the specified default date
[out]monththe month of the specified default date
[out]daythe day of the specified default date
Returns
the reference of the option
See Also
date(), setDate(), addDate(), insertDate()

References Str::empty(), Options::end(), and Options::find().

Parameter & setDefaultDate ( const string &  name,
int  year,
int  month,
int  day 
)

Set the default value of an existing date option.

Parameters
[in]namethe name string of the option
[in]yearthe new value for the default year
[in]monththe new value for the default month
[in]daythe new value for the default day
Returns
a reference to the option.
See Also
setDate(), addDate(), insertDate(), defaultDate()

References Str::empty(), Options::end(), and Options::find().

Parameter & addTime ( const string &  name,
const string &  request,
int  hour = 0,
int  minutes = 0,
int  seconds = 0,
int  milliseconds = 0,
int  flags = 0,
int  style = 0 
)

Add a time option at the end of the options list.

Parameters
[in]namethe name string of the new option
[in]requestthe request string of the new option
[in]hourthe default value for the hour
[in]minutesthe default value for the minutes
[in]secondsthe default value for the seconds
[in]millisecondsthe default value for the milliseconds
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
insertTime(), setTime(), time()

References Options::add(), Str::empty(), and Parameter::warning().

Parameter& addTime ( const string &  name,
int  hour,
int  minutes,
int  seconds,
int  milliseconds = 0,
int  flags = 0,
int  style = 0 
)
inline

Add a time option at the end of the options list.

Parameters
[in]namethe name and request string of the new option
[in]hourthe default value for the hour
[in]minutesthe default value for the minutes
[in]secondsthe default value for the seconds
[in]millisecondsthe default value for the milliseconds
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
insertTime(), setTime(), time()
Parameter& addTime ( const string &  name,
int  flags = 0,
int  style = 0 
)
inline

Add a time option at the end of the options list with hour, minutes and seconds set to zero.

Parameters
[in]namethe name and request string of the new option
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
insertTime(), setTime(), time()
Parameter & insertTime ( 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 
)

Insert a new time option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list.

Parameters
[in]namethe name string of the new option
[in]atnamethe name string of the existing option where the new options should be inserted. If left empty, the new option is inserted at the beginning of the option list.
[in]requestthe request string of the new option
[in]hourthe default value for the hour
[in]minutesthe default value for the minutes
[in]secondsthe default value for the seconds
[in]millisecondsthe default value for the milliseconds
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
addTime(), setTime(), time()

References Str::empty(), Options::insert(), and Parameter::warning().

Parameter& insertTime ( const string &  name,
const string &  atname,
int  hour = 0,
int  minutes = 0,
int  seconds = 0,
int  milliseconds = 0,
int  flags = 0,
int  style = 0 
)
inline

Insert a new time option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list.

Parameters
[in]namethe name and request string of the new option
[in]atnamethe name string of the existing option where the new options should be inserted. If left empty, the new option is inserted at the beginning of the option list.
[in]hourthe default value for the hour
[in]minutesthe default value for the minutes
[in]secondsthe default value for the seconds
[in]millisecondsthe default value for the milliseconds
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
addTime(), setTime(), time()
Parameter& insertTime ( const string &  name,
const string &  atname,
int  flags = 0,
int  style = 0 
)
inline

Insert a new time option at the beginning of the options list (atname == "") or at the position of the option with name atname. If the option with name atname does not exist, the option is appended to the end of the list. The hour, minutes, seconds and milliseconds are set to zero.

Parameters
[in]namethe name and request string of the new option
[in]atnamethe name string of the existing option where the new options should be inserted. If left empty, the new option is inserted at the beginning of the option list.
[in]flagssome flags
[in]styledefines the style in a GUI.
Returns
a reference to the new option
See Also
addTime(), setTime(), time()
const Parameter & time ( const string &  name,
int  index,
int &  hour,
int &  minutes,
int &  seconds,
int &  milliseconds 
) const

Get the time from a time option.

Parameters
[in]namethe name string of the option
[in]indexthe index of the time
[out]hourthe hour of the specified time
[out]minutesthe minutes of the specified time
[out]secondsthe seconds of the specified time
[out]millisecondsthe milliseconds of the specified time
Returns
the reference of the option
See Also
defaultTime(), setTime(), addTime(), insertTime()

References Str::empty(), Options::end(), and Options::find().

Parameter & setTime ( const string &  name,
int  hour,
int  minutes,
int  seconds,
int  milliseconds = 0 
)

Set the value of an existing time option.

Parameters
[in]namethe name string of the option
[in]hourthe new value for the hour
[in]minutesthe new value for the minutes
[in]secondsthe new value for the seconds
[in]millisecondsthe new value for the milliseconds
Returns
a reference to the option.
See Also
setCurrentTime(), setDefaultTime(), addTime(), insertTime(), time()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setTime ( const string &  name,
const string &  time 
)

Set the value of an existing time option.

Parameters
[in]namethe name string of the option
[in]timethe new value for the time
Returns
a reference to the option.
See Also
setCurrentTime(), setDefaultTime(), addTime(), insertTime(), time()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setTime ( const string &  name,
const struct tm &  time 
)

Set the value of an existing time option.

Parameters
[in]namethe name string of the option
[in]timethe new value for the time
Returns
a reference to the option.
See Also
setCurrentTime(), setDefaultTime(), addTime(), insertTime(), time()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setTime ( const string &  name,
const time_t &  time 
)

Set the value of an existing time option.

Parameters
[in]namethe name string of the option
[in]timethe new value for the time
Returns
a reference to the option.
See Also
setCurrentTime(), setDefaultTime(), addTime(), insertTime(), time()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setCurrentTime ( const string &  name)

Set the value of an existing time option to the current time.

Parameters
[in]namethe name string of the option
Returns
a reference to the option.
See Also
setTime(), setDefaultTime(), addTime(), insertTime(), time()

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Parameter & setTime ( const string &  name,
const Parameter p 
)

Set value of an existing time option with name name to the one of p, if both are of valueType() Time. If the value of the parameter is changing then the changedFlag() is set.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

const Parameter & defaultTime ( const string &  name,
int  index,
int &  hour,
int &  minutes,
int &  seconds,
int &  milliseconds 
) const

Get the default time from a time option.

Parameters
[in]namethe name string of the option
[in]indexthe index of the default time
[out]hourthe hour of the specified default time
[out]minutesthe minutes of the specified default time
[out]secondsthe seconds of the specified default time
[out]millisecondsthe milliseconds of the specified default time
Returns
the reference of the option
See Also
time(), setTime(), addTime(), insertTime()

References Str::empty(), Options::end(), and Options::find().

Parameter & setDefaultTime ( const string &  name,
int  hour,
int  minutes,
int  seconds,
int  milliseconds = 0 
)

Set the default value of an existing time option.

Parameters
[in]namethe name string of the option
[in]hourthe new value for the default hour
[in]minutesthe new value for the default minutes
[in]secondsthe new value for the default seconds
[in]millisecondsthe new value for the default milliseconds
Returns
a reference to the option.
See Also
setTime(), addTime(), insertTime(), defaultTime()

References Str::empty(), Options::end(), and Options::find().

Options & newSection ( int  level,
const string &  name,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add a new subsection of level level. The new section is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. level = 0 is the upper level, i.e. a new section is added. Higher levels add sections lower in the hierachy, i.e. level = 1 adds a subsection, level = 2 a subsubsection, etc. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Returns
the new section.
See Also
newSubSection(), newSubSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Str::empty(), Options::Options(), Options::parentSection(), and Options::setParentSection().

Referenced by Options::addSection(), Options::newSection(), Options::newSubSection(), and Options::newSubSubSection().

Options& newSection ( int  level,
const string &  name,
int  flag,
int  style = 0 
)
inline
Options & newSection ( const string &  name,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add a new section of Options to the end of the sections list. The new section is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Returns
the new section.
See Also
newSubSection(), newSubSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::newSection().

Options& newSection ( const string &  name,
int  flag,
int  style = 0 
)
inline
Options & newSubSection ( const string &  name,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add a new subsection of Options to the last section. The new subsection is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added subsection.

Note
You can only add a subsection after having added a section!
Returns
the new section.
See Also
newSection(), newSubSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::newSection().

Options& newSubSection ( const string &  name,
int  flag,
int  style = 0 
)
inline
Options & newSubSubSection ( const string &  name,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add a new subsubsection of Options to the last subsection of the last section. The new subsubsection is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added subsubsection.

Note
You can only add a subsubsection after having added a subsection!
Returns
the new section.
See Also
newSection(), newSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::newSection().

Options& newSubSubSection ( const string &  name,
int  flag,
int  style = 0 
)
inline
Options & addSection ( const string &  name,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add a new section of Options to the end of the currently active Option's sections list. The new section is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Returns
the new section.
See Also
newSection(), newSubSection(), newSubSubSection(), insertSection(), endSection(), clearSections()

References Options::clearSections(), Options::newSection(), and Options::parentSection().

Options& addSection ( const string &  name,
int  flag,
int  style = 0 
)
inline
Options & insertSection ( const string &  name,
const string &  atpattern,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Insert a new section of Options before the section specified by atpattern. If atpattern is not found or if atpattern is empty, the new section is added to the beginning or the end of the currently active Options' section list, respectively. The new section is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the inserted section.

Returns
the new section.
See Also
newSection(), newSubSection(), newSubSubSection(), addSection(), endSection(), clearSections(), findSection()

References Options::findSection(), Options::Options(), Options::parentSection(), Options::sectionsEnd(), and Options::setParentSection().

Options& insertSection ( const string &  name,
const string &  atpattern,
int  flag,
int  style = 0 
)
inline
Options & newSection ( int  level,
const Options opt,
int  selectmask,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add opt as a new subsection of level level. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. If type is not an empty string, the type of the new section is set to type. flag and style are added to the new sections flag and style flag, respectively. level = 0 is the upper level, i.e. a new section is added. Higher levels add sections lower in the hierachy, i.e. level = 1 adds a subsection, level = 2 a subsubsection, etc. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Returns
the new section.
See Also
newSubSection(), newSubSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::addFlag(), Options::addStyle(), Str::empty(), Options::Options(), Options::parentSection(), Options::setName(), Options::setParentSection(), and Options::setType().

Options& newSection ( int  level,
const Options opt,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)
inline
Options& newSection ( int  level,
const Options opt,
const string &  name,
int  flag,
int  style = 0 
)
inline
Options & newSection ( const Options opt,
int  selectmask,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add opt as a new section to the end of this Options section list. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. If type is not an empty string, the type of the new section is set to type. flag and style are added to the new sections flag and style flag, respectively. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Returns
the new section.
See Also
newSubSection(), newSubSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::newSection().

Options& newSection ( const Options opt,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)
inline
Options& newSection ( const Options opt,
const string &  name,
int  flag,
int  style = 0 
)
inline
Options & newSubSection ( const Options opt,
int  selectmask,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add opt as a new subsection to the last section. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. If type is not an empty string, the type of the new section is set to type. flag and style are added to the new sections flag and style flag, respectively. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Note
You can only add a subsection after having added a section!
Returns
the new section.
See Also
newSection(), newSubSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::newSection().

Options& newSubSection ( const Options opt,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)
inline
Options& newSubSection ( const Options opt,
const string &  name,
int  flag,
int  style = 0 
)
inline
Options & newSubSubSection ( const Options opt,
int  selectmask,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add opt as a new subsubsection to the last subsection of the last section. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. If type is not an empty string, the type of the new section is set to type. flag and style are added to the new sections flag and style flag, respectively. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Note
You can only add a subsubsection after having added a subsection!
Returns
the new section.
See Also
newSection(), newSubSection(), addSection(), insertSection(), endSection(), clearSections()

References Options::newSection().

Options& newSubSubSection ( const Options opt,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)
inline
Options& newSubSubSection ( const Options opt,
const string &  name,
int  flag,
int  style = 0 
)
inline
Options & addSection ( const Options opt,
int  selectmask,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Add opt as a new section to the end of the currently active Option's sections list. Only name-value pairs and sections as specified by selectmask are taken from opt. The new section is named name, has the optional type specifier type, some flag for selecting this section, and is formatted according to the style flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.

Returns
the new section.
See Also
newSection(), newSubSection(), newSubSubSection(), insertSection(), endSection(), clearSections()

References Options::clearSections(), Options::newSection(), and Options::parentSection().

Options& addSection ( const Options opt,
const string &  name = "",
const string &  type = "",
int  flag = 0,
int  style = 0 
)
inline
Options& addSection ( const Options opt,
const string &  name,
int  flag,
int  style = 0 
)
inline
Options & insertSection ( const Options opt,
int  selectmask,
const string &  name,
const string &  atpattern,
const string &  type = "",
int  flag = 0,
int  style = 0 
)

Insert opt as a new section of Options before the section specified by atpattern. Only name-value pairs and sections as specified by selectmask are taken from opt. If atpattern is not found or if atpattern is empty, the new section is added to the beginning or the end of the currently active Options' section list, respectively. If name is not an empty string, the name of the new section is set to name. If type is not an empty string, the type of the new section is set to type. flag and style are added to the new sections flag and style flag, respectively. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the inserted section.

Returns
the new section.
See Also
newSection(), newSubSection(), newSubSubSection(), addSection(), endSection(), clearSections(), findSection()

References Options::addFlag(), Options::addStyle(), Options::findSection(), Options::Options(), Options::parentSection(), Options::sectionsEnd(), Options::setName(), Options::setParentSection(), and Options::setType().

Options& insertSection ( const Options opt,
const string &  name,
const string &  atpattern,
const string &  type = "",
int  flag = 0,
int  style = 0 
)
inline
Options& insertSection ( const Options opt,
const string &  name,
const string &  atpattern,
int  flag,
int  style = 0 
)
inline
Options & newSection ( Options opt,
bool  newparent = false 
)

Add opt as a section. Only a pointer of opt is stored, the content of opt is not copied. If opt does not have a parentSection() or newparent is true then its parent section is set to this. Subsequent calls to addText(), addNumber(), etc. still add new Parameter to the currently active section.

Returns
the new section.
Options & addSection ( Options opt,
bool  newparent = false 
)

Add opt as a section to the end of the currently active Option's sections list. Only a pointer of opt is stored, the content of opt is not copied. If opt does not have a parentSection() or newparent is true then its parent section is set to currently active section. Subsequent calls to addText(), addNumber(), etc. still add new Parameter to the currently active section.

Returns
the new section.

References Options::parentSection(), and Options::setParentSection().

Options & insertSection ( Options opt,
const string &  atpattern,
bool  newparent = false 
)

Insert opt as a section of Options before the section specified by atpattern. If atpattern is not found or if atpattern is empty, the new section is added to the beginning or the end of the currently active Options' section list, respectively. Only a pointer of opt is stored, the content of opt is not copied. If opt does not have a parentSection() or newparent is true then its parent section is set to its parent in the new tree. Subsequent calls to addText(), addNumber(), etc. still add new Parameter to the currently active section.

Returns
the new section.

References Options::findSection(), Options::parentSection(), Options::sectionsEnd(), and Options::setParentSection().

Options & newSections ( Options opt,
bool  newparent = false 
)

Add all sections of opt as a section. Only a pointer of the sections is stored, their content is not copied. If newparent is true then the sections' parent section is set to this. Subsequent calls to addText(), addNumber(), etc. still add new Parameter to the currently active section.

Returns
*this
void endSection ( void  )

End the currently active section such that subsequent calls to addText(), addNumber(), etc. add new Parameter to the parent section.

See Also
clearSections(), setSection(), lastSection(), newSection(), newSubSection(), newSubSubSection(), insertSection()

References Options::parentSection().

void clearSections ( void  )

Reset the currently active section such that subsequent calls to addText(), addNumber(), etc. add new Parameter to this Options.

See Also
endSection(), setSection(), lastSection(), newSection(), newSubSection(), newSubSubSection(), insertSection()

Referenced by Options::addSection(), and Options::flatten().

void setSection ( Options opt)

Make opt the currently active section of this such that subsequent calls to addText(), addNumber(), etc. add new Parameter to opt.

See Also
endSection(), setSection(), lastSection(), newSection(), newSubSection(), newSubSubSection(), insertSection()
void lastSection ( void  )

Make the last top-level section of this the currently active section such that addText(), addNumber(), etc. add new Parameter to the last top-level section. If this does not have sections, this is made the currently active section.

See Also
endSection(), clearSection(), setSection()
int up ( void  )

Move this Options with its name-value pairs and sections one level up in the hierachy to its parentSection().

Returns

References Options::begin(), Options::end(), and Options::parentSection().

int down ( void  )

Make this Options with its name-value pairs and sections a section of this, i.e. move it down the hierarchy.

Returns
  • 0 successfully moved the Options down
    • -1 failed because this Options does not have a name or type

References Options::empty(), Options::name(), Options::Options(), Options::setInclude(), Options::setName(), Options::setParentSection(), Options::setStyle(), Options::setType(), and Options::type().

Referenced by Options::load().

Parameter & setDefault ( const string &  name)

Set value of option with name name to its default.

References Options::callNotifies(), Str::empty(), Options::end(), and Options::find().

Options & setDefaults ( int  flags = 0)
Parameter & setToDefault ( const string &  name)

Set default of option with name name to its value.

References Str::empty(), Options::end(), and Options::find().

Options & setToDefaults ( int  flags = 0)

Set defaults of all options to their values.

References Options::begin(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & erase ( Options::iterator  p)

Remove the Parameter where p points to. p can also be contained in a subsection of Options.

References Options::end(), and Options::parentSection().

Remove the Options where s points to. s can also be contained in a subsection of Options.

References Options::parentSection(), and Options::sectionsEnd().

Options & erase ( Options s)

Remove the Options where s points to. s can also be contained in a subsection of Options.

References Options::parentSection(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & erase ( const string &  pattern)
Options & erase ( int  selectflag)

Remove all Parameter and Options whose flag matches selectflag.

References Options::begin(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & pop ( void  )

Remove last Parameter from the currently active section.

See Also
endSection(), clearSections()
Options & popSection ( void  )

Remove last Options from the currently active section.

See Also
endSection(), clearSections()
Options & flatten ( Options root = 0)

Flatten the Options, i.e. delete all sections and subsections and copy their Parameter to this. The Parameter are copied to root, which by default is this.

References Options::add(), Options::clearSections(), Options::flatten(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Referenced by Options::flatten().

Options & clear ( bool  revert = true)

Remove all Parameter and sections of Options. If revert is set to true, also revert parentSection() of non-owned sections to zero.

References Options::sectionsBegin(), and Options::sectionsEnd().

Referenced by Options::assign(), Options::copy(), and Options::~Options().

int size ( void  ) const

Total number of name-value pairs in this Options and all its sections.

See Also
parameterSize(), sectionSize()

References Options::sectionsBegin(), and Options::sectionsEnd().

Referenced by ConfigClass::configSize(), and Options::empty().

int size ( int  selectflag) const

Total number of name-value pairs in this Options and all its sections that have selectflag set in their flags(). If selectflag equals zero, all options are counted. If selectflag is negative, only options whose values differ from the default value and have abs(selectflag) set in their flags are counted. If selectflag equals NonDefault, all options whose values differ from their default value are counted. The flag() of the sections is not used by this function.

References Options::begin(), Options::end(), Options::sectionsBegin(), Options::sectionsEnd(), and Str::size().

bool empty ( void  ) const

True if there are no name-value pairs in this Options and all its sections.

References Options::size().

Referenced by Options::down(), Options::find(), Options::findSection(), Options::rfind(), Options::rfindSection(), and Options::save().

int parameterSize ( void  ) const
Returns
the number of name-value pairs of this Options without the ones in its sections.
See Also
sectionsSize(), size()
int parameterSize ( int  flags) const
Returns
the number of name-value pairs of this Options that have flag set in their flags() without the ones in its sections.
See Also
sectionsSize(), size()

References Options::begin(), and Options::end().

int sectionsSize ( void  ) const
Returns
the number of sections of this Options without subsections.
See Also
parameterSize(), size()

Referenced by Options::findSection(), and Options::rfindSection().

int sectionsSize ( int  flags) const
Returns
the number of sections of this Options that contain at least on name-value pair with flag set in its flags().
See Also
parameterSize(), size()

References Options::sectionsBegin(), and Options::sectionsEnd().

bool exist ( const string &  pattern) const

True if a name-value pair with name name exist somewhere in the hierarchy of Options.

See Also
find(), existSection()

References Options::end(), and Options::find().

bool existSection ( const string &  pattern) const

True if a section (including the name() of this Options) of name-value pairs with name name exist somewhere in the hierarchy of Options.

See Also
findSection(), exist()

References Options::findSection(), and Options::sectionsEnd().

Options & setFlags ( int  flags,
int  selectflag = 0 
)

Set flags of all options that are selected by selectflag to flags. If selectflag equals zero, all options are considered. If selectflag is negative, only options whose values differ from the default value and have abs(selectflag) set in their flags are considered. If selectflag equals NonDefault, all options whose values differ from their default value are considered.

References Options::begin(), Options::end(), Options::flag(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setFlag().

Options & addFlags ( int  flags,
int  selectflag = 0 
)

Add the bits specified by flags to the flags of all options that are selected by selectflag. If selectflag equals zero, all options are considered. If selectflag is negative, only options whose values differ from the default value and have abs(selectflag) set in their flags are considered. If selectflag equals NonDefault, all options whose values differ from their default value are considered.

References Options::addFlag(), Options::begin(), Options::end(), Options::flag(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & delFlags ( int  flags,
int  selectflag = 0 
)

Clear the bits specified by flags of the flags of all options that are selected by selectflag. If selectflag equals zero, all options are considered. If selectflag is negative, only options whose values differ from the default value and have abs(selectflag) set in their flags are considered. If selectflag equals NonDefault, all options whose values differ from their default value are considered.

References Options::begin(), Options::delFlag(), Options::end(), Options::flag(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & setValueTypeFlags ( int  flags,
int  typemask 
)

Set flags of all options whose type matches typemask (see Parameter::valueTypes() ) to flags.

References Options::begin(), Options::checkType(), Options::end(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setFlag().

Options & addValueTypeFlags ( int  flags,
int  typemask 
)

Add flags to the flags of all options whose type matches typemask (see Parameter::valueTypes() ).

References Options::addFlag(), Options::begin(), Options::checkType(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & delValueTypeFlags ( int  flags,
int  typemask 
)

Clear the bits specified by flags of the flags of all options whose type matches typemask (see Parameter::vallueTypes() ).

References Options::begin(), Options::checkType(), Options::delFlag(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & setStyles ( int  style,
int  selectflag = 0 
)

Set style of all Parameter and sections that match selectflag to style.

References Options::begin(), Options::end(), Options::flag(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setStyle().

Options & addStyles ( int  style,
int  selectflag = 0 
)

Add the bits specified by style to the style of all Parameter and sections that match selectflag.

References Options::addStyle(), Options::begin(), Options::end(), Options::flag(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & delStyles ( int  style,
int  selectflag = 0 
)

Clear the bits specified by style of the style of all Parameter and sections that match selectflag.

References Options::begin(), Options::delStyle(), Options::end(), Options::flag(), Options::sectionsBegin(), and Options::sectionsEnd().

int styleSize ( int  style) const

Total number of Parameter in all asections that have the style style set in their style().

References Options::begin(), Options::end(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::style().

Options & setValueTypeStyles ( int  style,
int  typemask 
)

Set style of all Parameter and sections whose type matches typemask (see Parameter::valueTypes() ) to style.

References Options::begin(), Options::checkType(), Options::end(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setStyle().

Options & addValueTypeStyles ( int  style,
int  typemask 
)

Add the bits specified by style to the style of all Parameter and sections whose type matches typemask (see Parameter::valueTypes() ).

References Options::addStyle(), Options::begin(), Options::checkType(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & delValueTypeStyles ( int  style,
int  typemask 
)

Clear the bits specified by style of the style of all Parameter and sections whose type matches typemask (see Parameter::valueTypes() ).

References Options::begin(), Options::checkType(), Options::delStyle(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

int nameWidth ( int  selectmask = 0,
bool  detailed = false,
bool  escape = false 
) const

Length of largest name. If detailed is true, then include length of request string as well. If escape is true, then include lenght of escaped quotes.

References Options::begin(), Options::end(), Options::flag(), Options::name(), Str::name(), Options::sectionsBegin(), Options::sectionsEnd(), Str::size(), and Options::type().

Referenced by Options::save().

string save ( int  selectmask = 0,
int  flags = 0 
) const

Write names and their values to a string separated by ", ". Saves only options that have selectmask set in their flags(). If selectmask equals zero, all options are saved. If selectmask is negative, only options whose values differ from the default value and have abs(selectmask) set in their flags are saved. If selectmask equals NonDefault, all options whose values differ from their default value are saved. Use for flags values from SaveFlags to modify the way how the Options are written to the string.

References Options::begin(), Options::Embrace, Options::end(), Options::EscapeQuotes, Options::flag(), Options::name(), Options::NoName, Options::NoType, Options::PrintStyle, Options::sectionsBegin(), Options::sectionsEnd(), Options::style(), Options::SwitchNameType, Options::TabSection, and Options::type().

Referenced by relacs::operator<<(), and ConfigClass::saveConfig().

ostream & save ( ostream &  str,
const string &  start = "",
int  selectmask = 0,
int  flags = 0,
int  width = -1 
) const

Write names and their values to stream str as a valid YAML document. Start each line with start. Saves only options that have selectmask set in their flags(). If selectmask equals zero, all options are saved. If selectmask is negative, only options whose values differ from the default value and have abs(selectmask) set in their flags are saved. If selectmask equals NonDefault, all options whose values differ from their default value are saved. Use for flags values from SaveFlags to modify the way how the Options are written to the string.

References Options::begin(), Options::end(), Options::EscapeQuotes, Options::flag(), Options::name(), Options::nameWidth(), Options::NoName, Options::NoType, Options::PrintRequest, Options::PrintStyle, Options::sectionsBegin(), Options::sectionsEnd(), Options::style(), Options::SwitchNameType, Options::TabSection, and Options::type().

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

Write each name-value pair as a separate line to stream str and use textformat, numberformat, boolformat, dateformat, timeformat, and sectionformat for formatting text, number, boolean, date, and time parameter, or sections, respectively. Each line is started with start.

References Options::begin(), Options::empty(), Options::end(), Str::format(), Options::name(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::type().

ostream & saveXML ( ostream &  str,
int  selectmask = 0,
int  flags = 0,
int  level = 0,
int  indent = 4 
) const

Write options in XML format to output stream.

Parameters
[in]strthe output stream
[in]selectmaskselects options that have selectmask set in their flags(). See Parameter::flags(int) for details.
[in]flagssome details on how the data should be saved.
[in]levelthe level of indentation
[in]indentthe indentation depth, i.e. number of white space characters per level
Returns
the output stream str

References Options::begin(), Options::DontCloseSection, Options::end(), Options::flag(), Options::include(), Options::name(), Options::NoInclude, Options::NoName, Options::NoType, Options::sectionsBegin(), Options::sectionsEnd(), Options::SwitchNameType, and Options::type().

Options & read ( const string &  opttxt,
int  flag,
const string &  assignment = ":=",
const string &  separator = ",;",
int *  indent = 0 
)

Read options from string opttxt of the form "parameter1: x, parameter2: y, parameter3: z, ...". If the parameters 'parameter1', 'parameter2', ... match the name of an option, its value is set to x, y, z, ... respectively, and flag is added to its flags, if flag is not 0.

Returns
the Options for which to continue to read.

References Parameter::addFlags(), Options::assign(), Options::callNotifies(), Str::empty(), Str::erase(), Options::error(), Str::find(), Str::findFirstNot(), Str::findLastNot(), Options::findSection(), Str::findSeparator(), Options::index(), Str::mid(), Options::name(), Options::parentSection(), Str::preventFirst(), Str::preventLast(), Options::read(), Options::sectionsEnd(), Str::size(), Str::strip(), and Str::WhiteSpace.

Referenced by relacs::operator>>(), Options::read(), Options::readAppend(), and ConfigClass::readConfig().

Options& read ( const string &  opttxt,
const string &  assignment = ":=",
const string &  separator = ",;" 
)
inline
istream & read ( istream &  str,
int  flag,
const string &  assignment = ":=",
const string &  comment = "#",
const string &  stop = "",
Str line = 0 
)

Read from stream str and set the values of existing options, until end of file or a line beginning with stop is reached. If stop equals the StopEmpty string, reading is stopped at an empty line. Before reading the option comments are removed from each line using Str::stripComment( comment ). If line does not equal zero then the last read line is returned in line. Each parameter that has been read from the stream gets its flag set to flag. The warning message is set.

References Options::callNotifies(), Str::empty(), Options::error(), Str::find(), Str::findFirstNot(), Options::read(), StrQueue::StopEmpty, Str::stripComment(), and Str::WhiteSpace.

istream& read ( istream &  str,
const string &  assignment = ":=",
const string &  comment = "#",
const string &  stop = "",
Str line = 0 
)
inline
Options & read ( const StrQueue sq,
int  flag = 0,
const string &  assignment = ":=" 
)

Read options from the list of strings sq. Each line is assumed to be a single option. Each parameter that has been read from sq gets its flag set to flag. The warning message is set.

References Options::callNotifies(), Options::error(), and Options::read().

bool read ( const Parameter p,
int  flag = 0 
)

Read options from the parameter p. Returns true if p was read and add flag to the flags of the Parameter that read it.

References Options::addFlags(), Options::begin(), Options::callNotifies(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

Options & read ( const Options o,
int  flags = 0,
int  flag = 0 
)

Read options from the options o. A subset of the options can be selected by flags. Parameter that read a value get flag added to their flags.

References Options::begin(), Options::callNotifies(), Options::changed(), Options::end(), Options::sectionsBegin(), and Options::sectionsEnd().

bool readAppend ( const Parameter p)

Read options from the parameter p. If no option with the name equal to p's name exist p is appended to the active section of Options. Returns true if p was read, false if it was appended.

See Also
read(), endSection(), clearSections()

References Options::add(), Options::callNotifies(), Str::empty(), Parameter::name(), and Options::read().

Referenced by Options::readAppend().

Options & readAppend ( const Options o,
int  flags = 0 
)

Read options from the options o that have flags set. All options from o that do not exist are appended to the sections where they belong to.

References Options::begin(), Options::callNotifies(), Options::end(), Options::Options(), Options::readAppend(), Options::sectionsBegin(), Options::sectionsEnd(), and Options::setParentSection().

Options & load ( 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 
)

Read from stream str and create new options, until end of file or a line beginning with stop is reached. If stop equals the StopEmpty string, reading is stopped at an empty line. Each line is assumed to be a single option, which is loaded with Parameter::load(). Before loading the option comments are removed from each line using Str::stripComment( comment ). If line does not equal zero then the last read line is returned in line. The warning message is set.

References Options::callNotifies(), Str::find(), Str::findFirstNot(), Options::load(), StrQueue::StopEmpty, Str::stripComment(), Options::warning(), and Str::WhiteSpace.

Options & load ( const StrQueue sq,
const string &  assignment = ":=" 
)

Create new options from the list of strings sq. Each line is assumed to be a single option, which is loaded with Parameter::load(). The warning message is set.

References Options::callNotifies(), Str::empty(), Options::load(), and Options::warning().

virtual void notify ( void  )
inlinevirtual

This function can be reimplemented to react to a change of the value of some parameters. This function is called after each of the setNumber(), setText(), etc functions.

Referenced by Options::callNotifies(), and Options::setNotify().

void callNotifies ( void  )
bool setNotify ( bool  notify = true)

Enables the call of the notify() function if notify equals true.

Returns
the value notifying() returns before disabling it.
See Also
unsetNotify(), notifying(), callNotifies()

References Options::notify().

bool unsetNotify ( void  )

Disables the call of the notify() function.

Returns
the value notifying() returns before disabling it.
See Also
setNotify(), notifying(), callNotifies()
bool notifying ( void  ) const

Returns true if calling the notify() function is enabled.

See Also
setNotify(). unsetNotify()

Friends And Related Function Documentation

bool operator== ( const Options o1,
const Options o2 
)
friend

Returns true if the two Options o1 and o2 are equal, i.e. they have the same number of Parameter with identical name and value (as returned by Parameter::text()) and the same sections with identical name and type.

bool operator== ( const Options o,
const string &  name 
)
friend

Returns true if the name() of the Options o equals name.

bool operator< ( const Options o1,
const Options o2 
)
friend

Returns true if the Option o1 is smaller than o2, i.e. o2 has less elements than o1, an name of o2 is smaller than the corresponding one in o1, or a value of o2 is smaller than the corresponding one in o1. This function is provided just to define some ordering of Options, as is needed for example for an stl::map.

ostream& operator<< ( ostream &  str,
const Options o 
)
friend

Write names and their values to stream str

istream& operator>> ( istream &  str,
Options o 
)
friend

Read a single line from stream str and set options.

Member Data Documentation

const int NonDefault = Parameter::NonDefault
static

Use this flag to select Parameter whose value differs from their default value.

Referenced by Options::flag().

const long TabSection = 0x04000000
static

Section is a new tab.

Referenced by Options::load(), and Options::save().


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