| 211 | } |
| 212 | |
| 213 | float field_float(const std::string& cmd, const std::string& key, const std::string& v) { |
| 214 | double x = 0; |
| 215 | if (!fnx::parse_number(v.c_str(), x) || !std::isfinite((float) x)) throw std::runtime_error(cmd + ": " + key + "=" + v + " is not a number"); |
| 216 | return (float) x; |
| 217 | } |
| 218 | |
| 219 | uint64_t field_hex64(const std::string& cmd, const std::string& key, const std::string& v) { |
| 220 | if (v.empty() || v.size() > 16 || v.find_first_not_of("0123456789abcdefABCDEF") != std::string::npos) |
no test coverage detected