| 50 | |
| 51 | template <typename E> |
| 52 | static std::function<bool(E&, Json::Value const*, cmJSONState*)> EnumHelper( |
| 53 | std::vector<std::string> const toString, std::string const& type) |
| 54 | { |
| 55 | return [toString, type](E& out, Json::Value const* value, |
| 56 | cmJSONState* state) -> bool { |
| 57 | for (size_t i = 0; i < toString.size(); ++i) { |
| 58 | if (value->asString() == toString[i]) { |
| 59 | out = (E)i; |
| 60 | return true; |
| 61 | } |
| 62 | } |
| 63 | state->AddErrorAtValue( |
| 64 | cmStrCat("Not a valid ", type, ": \"", value->asString(), '"'), value); |
| 65 | return false; |
| 66 | }; |
| 67 | } |
| 68 | static auto const OptionHelper = EnumHelper<cmInstrumentationQuery::Option>( |
| 69 | cmInstrumentationQuery::OptionString, "option"); |
| 70 | static auto const OptionListHelper = |
nothing calls this directly
no test coverage detected
searching dependent graphs…