25 using namespace Expressions;
28 namespace Attributes {
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(
"string");
55 throw ParseError(
"PredefinedString::parse",
"Unsupported value '" + value +
"'");
Abstract base class for attribute parsers.
std::string toUpper(const std::string &str)
void setPredefinedValues(const std::set< std::string > &, const std::string &)
Add predefined strings values to the help.
virtual ~PredefinedString()
virtual void parse(Attribute &, Statement &, bool) const
Parse the attribute.
std::set< std::string > predefinedStrings_m
Interface for statements.
void setPredefinedString(Attribute &attr, const std::string &val)
Set predefined string value.
virtual const std::string & getType() const
Return attribute type string ``string''.
std::string parseStringValue(Statement &, const char msg[])
A representation of an Object attribute.