285 std::string s =
"'" + v +
"' is not a valid integer.";
334 std::ostringstream oss;
427 :
Option(true), myValue(value) {
445 if (v.find(
';') != std::string::npos) {
446 WRITE_WARNING(
TL(
"Please note that using ';' as list separator is deprecated and not accepted anymore."));
471 Option(true), myValue(value) {
#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 toString(const T &t, std::streamsize accuracy=gPrecision)
Option_Additional(const std::string &value)
Constructor for an option with a default value.
bool isAdditional() const
Returns true, the information whether this option is a file name.
Option_BoolExtended(bool value)
Constructor for an option that can be used without an argument like Option_BoolExtended but which als...
bool set(const std::string &v, const std::string &orig, const bool append)
sets the given value (converts it to bool)
bool getBool() const
Returns the stored boolean value.
bool set(const std::string &v, const std::string &orig, const bool append)
sets the given value (converts it to bool)
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.
bool myValue
the value, valid only when the base-classes "myAmSet"-member is true
Option_Data(const std::string &value)
Constructor for an option with a default value.
bool isData() const
Returns true, the information whether this option is a data file.
bool isEdge() const
Returns true, the information whether this option is a list of edges.
Option_Edge(const std::string &value)
Constructor for an option with a default value.
bool isEdgeVector() const
Returns true, the information whether this option is a list of edges.
Option_EdgeVector(const std::string &value)
Constructor for an option with a default value.
std::string getString() const
Legacy method that returns the stored filenames as a comma-separated string.
Option_FileName()
Constructor for an option with no default value.
bool isFileName() const
Returns true, the information whether this option is a file name.
bool isFloat() const
Returns the information whether the option is a float option.
double getFloat() const
Returns the stored double value.
bool set(const std::string &v, const std::string &orig, const bool append)
Stores the given value after parsing it into a double.
double myValue
the value, valid only when the base-classes "myAmSet"-member is true
Option_Float(double value)
Constructor for an option with a default value.
const IntVector & getIntVector() const
Returns the stored integer vector.
IntVector myValue
the value, valid only when the base-classes "myAmSet"-member is true
bool set(const std::string &v, const std::string &orig, const bool append)
Stores the given value after parsing it into a vector of integers.
Option_IntVector()
Constructor for an option with no default value.
bool isInteger() const
Returns the information whether the option is a int option.
Option_Integer(int value)
Constructor for an option with a default value.
int myValue
the value, valid only when the base-classes "myAmSet"-member is true
int getInt() const
Returns the stored integer value.
bool set(const std::string &v, const std::string &orig, const bool append)
Stores the given value after parsing it into an integer.
Option_Network(const std::string &value)
Constructor for an option with a default value.
bool isNetwork() const
Returns true, the information whether this option is a file name.
bool isRoute() const
Returns true, the information whether this option is a file name.
Option_Route(const std::string &value)
Constructor for an option with a default value.
bool set(const std::string &v, const std::string &orig, const bool append)
Stores the given value.
std::string myValue
the value, valid only when the base-classes "myAmSet"-member is true
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.
StringVector myValue
the value, valid only when the base-classes "myAmSet"-member is true
Option_StringVector()
Constructor for an option with no default value.
bool set(const std::string &v, const std::string &orig, const bool append)
Stores the given value after parsing it into a vector of strings.
Option_SumoConfig(const std::string &value)
Constructor for an option with a default value.
bool isSumoConfig() const
Returns true, the information whether this option is a sumo config name.
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.
virtual bool isSumoConfig() const
Returns the information whether this option is a sumo config file.
virtual bool isNetwork() const
Returns the information whether this option is a network file.
bool isSet() const
returns the information whether this options holds a valid value
virtual ~Option()
destructor
virtual bool isDefault() const
Returns the information whether the option holds the default value.
void setRequired()
mark option as required
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)
virtual bool isInteger() const
Returns the information whether the option is a int option.
std::string myListSeparator
the list separator for this option (needed for python tools)
std::string mySubTopic
The subtopic to which this option belongs.
void setListSeparator(const std::string &listSep)
set list separator
virtual bool isAdditional() const
Returns the information whether this option is an additional file.
virtual bool isData() const
Returns the information whether this option is a data file.
virtual bool isFileName() const
Returns the information whether this option is a file name.
const std::string & getListSeparator() const
retrieve list separator
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.
virtual bool isEdgeVector() const
Returns the information whether this option is a vector of edges.
virtual bool getBool() const
Returns the stored boolean value.
virtual bool isRoute() const
Returns the information whether this option is a route file.
bool isPositional() const
check if option is positional
void setPositional()
mark option as positional
bool myPositional
this option is positional (needed for python tools)
Option(bool set=false)
Constructor.
void resetDefault()
Resets the option to be on its default value.
const std::string & getSubTopic() const
Returns the subtopic to which this option belongs.
virtual bool isFloat() const
Returns the information whether the option is a float option.
bool markSet(const std::string &orig)
Marks the information as set.
bool myRequired
this option is required (needed for python tools)
bool myAmWritable
information whether the value may be changed
std::string myValueString
The original set string.
virtual bool isEdge() const
Returns the information whether this option is an edge.
virtual bool isBool() const
Returns the information whether the option is a bool option.
bool isRequired() const
check if option is required
const std::string & getValueString() const
Returns the string-representation of the value.
void setSubtopic(const std::string &subtopic)
Sets the subtopic to which this option belongs.
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 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