| 59 | } |
| 60 | |
| 61 | std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny( |
| 62 | std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager, |
| 63 | std::string const& name, bool supportsVariableType, |
| 64 | std::vector<std::pair<std::string, std::string>> const& list) |
| 65 | { |
| 66 | if (list.empty()) { |
| 67 | return {}; |
| 68 | } |
| 69 | |
| 70 | auto listVariables = std::make_shared<cmDebuggerVariables>( |
| 71 | variablesManager, name, supportsVariableType, [=]() { |
| 72 | std::vector<cmDebuggerVariableEntry> ret; |
| 73 | ret.reserve(list.size()); |
| 74 | for (auto const& kv : list) { |
| 75 | ret.emplace_back(kv.first, kv.second); |
| 76 | } |
| 77 | return ret; |
| 78 | }); |
| 79 | |
| 80 | listVariables->SetValue(std::to_string(list.size())); |
| 81 | return listVariables; |
| 82 | } |
| 83 | |
| 84 | std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny( |
| 85 | std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager, |
nothing calls this directly
no test coverage detected