Changed handling of enums not in the EnumBox
This commit is contained in:
parent
2ab11f1798
commit
1bcf80ad84
1 changed files with 3 additions and 5 deletions
|
@ -52,9 +52,7 @@ public:
|
|||
typename std::map<std::string, Enum>::const_iterator i = m_string2enum.find(str);
|
||||
if (i == m_string2enum.end())
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "Couldn't convert '" << str << "' to enum " << m_name << std::endl;
|
||||
throw std::runtime_error(out.str());
|
||||
return static_cast<Enum>(boost::lexical_cast<int>(str));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -67,8 +65,8 @@ public:
|
|||
if (i == m_enum2string.end())
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "Couldn't convert '" << v << "' to string" << std::endl;
|
||||
throw std::runtime_error(out.str());
|
||||
out << v;
|
||||
return out.str();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue