Skip to content

Commit

Permalink
VariableExpression: Add converters for long and bool data types.
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindkv authored and wwmayer committed Jan 26, 2016
1 parent e9480e6 commit 22d77b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/App/Expression.cpp
Expand Up @@ -1031,6 +1031,16 @@ Expression * VariableExpression::eval() const

return new NumberExpression(owner, ivalue);
}
else if (value.type() == typeid(long)) {
long lvalue = boost::any_cast<long>(value);

return new NumberExpression(owner, lvalue);
}
else if (value.type() == typeid(bool)) {
double bvalue = boost::any_cast<bool>(value) ? 1.0 : 0.0;

return new NumberExpression(owner, bvalue);
}
else if (value.type() == typeid(std::string)) {
std::string svalue = boost::any_cast<std::string>(value);

Expand Down

0 comments on commit 22d77b7

Please sign in to comment.