45 : myAmSet(set), myHaveTheDefaultValue(true), myAmWritable(true) {}
185 :
Option(true), myValue(value) {
222 std::string s =
"'" + v +
"' is not a valid integer.";
230 std::ostringstream s;
333 throw ProcessError(
"'" + v +
"' is not a valid float.");
340 std::ostringstream s;
491 if (v.find(
';') != std::string::npos) {
492 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated.\n From 1.0 onwards, only ',' will be accepted.");
502 throw ProcessError(
"'" + v +
"' is not a valid integer vector.");
553 if (v.find(
';') != std::string::npos) {
554 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated.\n From 1.0 onwards, only ',' will be accepted.");
564 throw ProcessError(
"'" + v +
"' is not a valid float vector.");
std::string getValueString() const
Returns the string-representation of the value.
virtual double getFloat() const
Returns the stored double value.
~Option_Bool()
Destructor.
double getFloat() const
Returns the stored double value.
virtual const IntVector & getIntVector() const
Returns the stored integer vector.
bool set(const std::string &v)
Stores the given value after parsing it into an integer.
bool markSet()
Marks the information as set.
virtual const FloatVector & getFloatVector() const
Returns the stored float vector.
std::vector< double > FloatVector
Definition of a vector of doubles.
Option_IntVector & operator=(const Option_IntVector &s)
Assignment operator.
const IntVector & getIntVector() const
Returns the stored integer vector.
bool myAmWritable
information whether the value may be changed
virtual std::string getString() const
Returns the stored string value.
~Option_Float()
Destructor.
bool isFileName() const
Returns true, the information whether this option is a file name.
Option_String & operator=(const Option_String &s)
Assignment operator.
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.
bool set(const std::string &v)
Stores the given value after parsing it into a double.
void setDescription(const std::string &desc)
Sets the description of what this option does.
bool myAmSet
information whether the value is set
bool isWriteable() const
Returns the information whether the option may be set a further time.
virtual ~Option_FloatVector()
Destructor.
virtual int getInt() const
Returns the stored integer value.
void unSet()
marks this option as unset
Option(bool set=false)
Constructor.
virtual ~Option_IntVector()
Destructor.
#define WRITE_WARNING(msg)
static std::string urlEncode(const std::string &url, const std::string encodeWhich="")
Option_FileName()
Constructor for an option with no default value.
void resetDefault()
Resets the option to be on its default value.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter ...
virtual ~Option_String()
Destructor.
Option_Float(double value)
Constructor for an option with a default value.
std::string getValueString() const
Returns the string-representation of the value.
std::string getValueString() const
Returns the string-representation of the value.
virtual Option & operator=(const Option &s)
Assignment operator.
std::vector< int > IntVector
Definition of a vector of ints.
std::string myTypeName
A type name for this option (has presets, but may be overwritten)
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
int getInt() const
Returns the stored integer value.
Option_String()
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 integers.
Option_Integer(int value)
Constructor for an option with a default value.
std::string getValueString() const
Returns the string-representation of the value.
Option_Bool & operator=(const Option_Bool &s)
Assignment operator.
virtual bool isFileName() const
Returns the information whether this option is a file name.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
std::string getString() const
Returns the stored string value.
~Option_Integer()
Destructor.
Option_FloatVector & operator=(const Option_FloatVector &s)
Assignment operator.
bool set(const std::string &v)
Stores the given value.
virtual bool isBool() const
Returns the information whether the option is a bool option.
A class representing a single program option.
Option_FloatVector()
Constructor for an option with no default value.
virtual bool getBool() const
Returns the stored boolean value.
bool set(const std::string &v)
std::string getValueString() const
Returns the string-representation of the value.
virtual bool isDefault() const
Returns the information whether the option holds the default value.
const std::string & getDescription() const
Returns the description of what this option does.
const FloatVector & getFloatVector() const
Returns the stored float vector.
void resetWritable()
Resets the option to be writeable.
Option_IntVector()
Constructor for an option with no default value.
std::string myDescription
The description what this option does.
virtual ~Option_FileName()
Destructor.
bool isSet() const
returns the information whether this options holds a valid value
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
Option_FileName & operator=(const Option_FileName &s)
Assignment operator.
Option_Float & operator=(const Option_Float &s)
Assignment operator.
bool myHaveTheDefaultValue
information whether the value is the default value (is then set)
std::string getValueString() const
Returns the string-representation of the value.
bool getBool() const
Returns the stored boolean value.
Option_Bool(bool value)
Constructor for an option with a default value.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Option_Integer & operator=(const Option_Integer &s)
Assignment operator.
bool isBool() const
Returns true, the information whether the option is a bool option.