30 PredefinedString::PredefinedString(
const std::string &
name,
31 const std::string &help,
32 const std::initializer_list<std::string>& predefinedStrings,
33 const std::string& defaultValue):
36 for (
const std::string& value: predefinedStrings) {
48 static const std::string
type(
"predefined string");
55 throw ParseError(
"PredefinedString::parse",
"Unsupported value '" + value +
"'");
Representation objects and parsers for attribute expressions.
std::string parseStringValue(Statement &, const char msg[])
A collection of routines to construct object Attributes and retrieve.
void setPredefinedString(Attribute &attr, const std::string &val)
Set predefined string value.
std::string toUpper(const std::string &str)
boost::function< boost::tuple< double, bool >arguments_t)> type
A representation of an Object attribute.
Abstract base class for attribute parsers.
void setPredefinedValues(const std::set< std::string > &, const std::string &)
Add predefined strings values to the help.
virtual void parse(Attribute &, Statement &, bool) const
Parse the attribute.
virtual const std::string & getType() const
Return attribute type string `‘string’'.
std::set< std::string > predefinedStrings_m
virtual ~PredefinedString()
Interface for statements.