MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateIfAny

Method CreateIfAny

Source/cmDebuggerVariablesHelper.cxx:61–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61std::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
84std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny(
85 std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,

Callers

nothing calls this directly

Calls 15

to_stringFunction · 0.85
reserveMethod · 0.80
emplace_backMethod · 0.80
SetEnableSortingMethod · 0.80
AddSubVariablesMethod · 0.80
GetVisibilityMethod · 0.80
GetInstallPathMethod · 0.80
IsPerConfigMethod · 0.80
GetListMethod · 0.80
GetSourceEntriesMethod · 0.80

Tested by

no test coverage detected