takes a string containing a mathematical expression (possibly including variables) and resolves it to a float value
| 321 | |
| 322 | //takes a string containing a mathematical expression (possibly including variables) and resolves it to a float value |
| 323 | float ThemeComponent::resolveExp(std::string str, float defaultVal) |
| 324 | { |
| 325 | if(str.empty()) |
| 326 | return defaultVal; |
| 327 | |
| 328 | MathExp exp; |
| 329 | exp.setExpression(str); |
| 330 | |
| 331 | //set variables |
| 332 | exp.setVariable("headerHeight", (float)(FONT_SIZE_LARGE / Renderer::getScreenHeight())); |
| 333 | exp.setVariable("infoWidth", mFloatMap["listOffsetX"]); |
| 334 | |
| 335 | return exp.eval(); |
| 336 | } |
| 337 | |
| 338 | //takes a string of hex and resolves it to an integer |
| 339 | unsigned int ThemeComponent::resolveColor(std::string str, unsigned int defaultColor) |
nothing calls this directly
no test coverage detected