* @brief Test if a string argument is a well formed float. */
| 212 | * @brief Test if a string argument is a well formed float. |
| 213 | */ |
| 214 | static bool is_float( |
| 215 | std::string target |
| 216 | ) { |
| 217 | float test; |
| 218 | std::istringstream stream(target); |
| 219 | |
| 220 | // Leading whitespace is an error |
| 221 | stream >> std::noskipws >> test; |
| 222 | |
| 223 | // Ensure no remaining string, in addition to checking for parse failure |
| 224 | return stream.eof() && !stream.fail(); |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * @brief Test if a string ends with a given suffix. |
no test coverage detected