43 : myAmSet(set), myHaveTheDefaultValue(true), myAmWritable(true) {}
47 : myAmSet(s.myAmSet), myHaveTheDefaultValue(s.myHaveTheDefaultValue),
48 myAmWritable(s.myAmWritable) {}
183 :
Option(true), myValue(value) {
220 std::string s =
"'" + v +
"' is not a valid integer.";
228 std::ostringstream s;
245 :
Option(true), myValue(value) {
294 :
Option(true), myValue(value) {
331 throw ProcessError(
"'" + v +
"' is not a valid float.");
338 std::ostringstream s;
349 :
Option(true), myValue(value) {
411 :
Option_Bool(value), myValueString(value ?
"true" :
"false") {
465 :
Option(true), myValue(value) {
471 :
Option(s), myValue(s.myValue) {}
495 if (v.find(
';') != std::string::npos) {
496 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated and not accepted anymore.");
506 throw ProcessError(
"'" + v +
"' is not a valid integer vector.");
525 :
Option(true), myValue(value) {
530 :
Option(s), myValue(s.myValue) {}
550 if (v.find(
';') != std::string::npos) {
551 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated and not accepted anymore.");
561 throw ProcessError(
"'" + v +
"' is not a valid string vector.");
#define WRITE_WARNING(msg)
std::vector< std::string > StringVector
Definition of a vector of strings.
std::vector< int > IntVector
Definition of a vector of ints.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string getValueString() const
Returns the string-representation of the value.
Option_BoolExtended(bool value)
Constructor for an option that can be used without an argument like Option_BoolExtended but which als...
std::string myValueString
~Option_BoolExtended()
Destructor.
bool set(const std::string &v)
Option_BoolExtended & operator=(const Option_BoolExtended &s)
Assignment operator.
Option_Bool & operator=(const Option_Bool &s)
Assignment operator.
bool getBool() const
Returns the stored boolean value.
~Option_Bool()
Destructor.
virtual std::string getValueString() const
Returns the string-representation of the value.
bool isBool() const
Returns true, the information whether the option is a bool option.
Option_Bool(bool value)
Constructor for an option with a default value.
virtual bool set(const std::string &v)
Option_FileName & operator=(const Option_FileName &s)
Assignment operator.
std::string getString() const
Legacy method that returns the stored filenames as a comma-separated string.
std::string getValueString() const
Returns the string-representation of the value.
virtual ~Option_FileName()
Destructor.
Option_FileName()
Constructor for an option with no default value.
bool isFileName() const
Returns true, the information whether this option is a file name.
double getFloat() const
Returns the stored double value.
~Option_Float()
Destructor.
bool set(const std::string &v)
Stores the given value after parsing it into a double.
Option_Float & operator=(const Option_Float &s)
Assignment operator.
std::string getValueString() const
Returns the string-representation of the value.
Option_Float(double value)
Constructor for an option with a default value.
const IntVector & getIntVector() const
Returns the stored integer vector.
Option_IntVector & operator=(const Option_IntVector &s)
Assignment operator.
Option_IntVector()
Constructor for an option with no default value.
std::string getValueString() const
Returns the string-representation of the value.
bool set(const std::string &v)
Stores the given value after parsing it into a vector of integers.
virtual ~Option_IntVector()
Destructor.
Option_Integer(int value)
Constructor for an option with a default value.
Option_Integer & operator=(const Option_Integer &s)
Assignment operator.
std::string getValueString() const
Returns the string-representation of the value.
~Option_Integer()
Destructor.
int getInt() const
Returns the stored integer value.
bool set(const std::string &v)
Stores the given value after parsing it into an integer.
bool set(const std::string &v)
Stores the given value.
std::string getValueString() const
Returns the string-representation of the value.
virtual ~Option_String()
Destructor.
Option_String & operator=(const Option_String &s)
Assignment operator.
std::string getString() const
Returns the stored string value.
Option_String()
Constructor for an option with no default value.
const StringVector & getStringVector() const
Returns the stored string vector.
Option_StringVector & operator=(const Option_StringVector &s)
Assignment operator.
Option_StringVector()
Constructor for an option with no default value.
bool set(const std::string &v)
Stores the given value after parsing it into a vector of strings.
virtual ~Option_StringVector()
Destructor.
std::string getValueString() const
Returns the string-representation of the value.
A class representing a single program option.
bool myHaveTheDefaultValue
information whether the value is the default value (is then set)
bool isWriteable() const
Returns the information whether the option may be set a further time.
bool isSet() const
returns the information whether this options holds a valid value
virtual bool isDefault() const
Returns the information whether the option holds the default value.
virtual std::string getString() const
Returns the stored string value.
bool myAmSet
information whether the value is set
virtual const IntVector & getIntVector() const
Returns the stored integer vector.
void resetWritable()
Resets the option to be writeable.
const std::string & getDescription() const
Returns the description of what this option does.
std::string myTypeName
A type name for this option (has presets, but may be overwritten)
void unSet()
marks this option as unset
virtual bool isFileName() const
Returns the information whether this option is a file name.
std::string myDescription
The description what this option does.
virtual const StringVector & getStringVector() const
Returns the stored string vector.
void setDescription(const std::string &desc)
Sets the description of what this option does.
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
virtual int getInt() const
Returns the stored integer value.
virtual double getFloat() const
Returns the stored double value.
bool markSet()
Marks the information as set.
virtual bool getBool() const
Returns the stored boolean value.
Option(bool set=false)
Constructor.
void resetDefault()
Resets the option to be on its default value.
bool myAmWritable
information whether the value may be changed
virtual Option & operator=(const Option &s)
Assignment operator.
virtual bool isBool() const
Returns the information whether the option is a bool option.
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static std::string urlEncode(const std::string &url, const std::string encodeWhich="")
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter