| 171 | |
| 172 | template <typename T> |
| 173 | T EnumValues<T>::getValue(std::string_view field_name) const |
| 174 | { |
| 175 | T x; |
| 176 | if (tryGetValue(x, field_name)) |
| 177 | return x; |
| 178 | |
| 179 | auto hints = this->getHints(std::string{field_name}); |
| 180 | auto hints_string = !hints.empty() ? ", maybe you meant: " + toString(hints) : ""; |
| 181 | throw Exception(ErrorCodes::UNKNOWN_ELEMENT_OF_ENUM, "Unknown element '{}' for enum{}", field_name, hints_string); |
| 182 | } |
| 183 | |
| 184 | template <typename T> |
| 185 | bool EnumValues<T>::findValueByName(std::string_view field_name, T & result) const |
no test coverage detected