51 : myAmSet(set), myHaveTheDefaultValue(true), myAmWritable(true) {}
187 :
Option(true), myValue(value) {
224 std::string s =
"'" + v +
"' is not a valid integer.";
232 std::ostringstream s;
335 throw ProcessError(
"'" + v +
"' is not a valid float.");
342 std::ostringstream s;
493 if (v.find(
';') != std::string::npos) {
494 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated.\n From 1.0 onwards, only ',' will be accepted.");
504 throw ProcessError(
"'" + v +
"' is not a valid integer 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.
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
static bool _2bool(const E *const data)
converts a 0-terminated char-type array into the boolean value described by it
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 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 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.
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.
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)
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.
std::string getString() const
Returns the stored string value.
~Option_Integer()
Destructor.
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.
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.
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
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.
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)
static double _2double(const E *const data)
converts a char-type array into the double value described by it
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.