Setter for the value.
| 152 | |
| 153 | // Setter for the value. |
| 154 | void ParamContent::SetValue(const char* val) { |
| 155 | // TODO (wanke) Test if the values actually are properly converted. |
| 156 | // (Quickly visible impacts?) |
| 157 | changed_ = TRUE; |
| 158 | if (param_type_ == VT_INTEGER) { |
| 159 | iIt->set_value(atoi(val)); |
| 160 | } else if (param_type_ == VT_BOOLEAN) { |
| 161 | bIt->set_value(atoi(val)); |
| 162 | } else if (param_type_ == VT_DOUBLE) { |
| 163 | dIt->set_value(strtod(val, NULL)); |
| 164 | } else if (param_type_ == VT_STRING) { |
| 165 | sIt->set_value(val); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | // Gets the up to the first 3 prefixes from s (split by _). |
| 170 | // For example, tesseract_foo_bar will be split into tesseract,foo and bar. |
no test coverage detected