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

Method Create

Source/cmDebuggerVariablesHelper.cxx:34–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace cmDebugger {
33
34std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::Create(
35 std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
36 std::string const& name, bool supportsVariableType,
37 cmPolicies::PolicyMap const& policyMap)
38{
39 static std::map<cmPolicies::PolicyStatus, std::string> policyStatusString = {
40 { cmPolicies::PolicyStatus::OLD, "OLD" },
41 { cmPolicies::PolicyStatus::WARN, "WARN" },
42 { cmPolicies::PolicyStatus::NEW, "NEW" },
43 };
44
45 return std::make_shared<cmDebuggerVariables>(
46 variablesManager, name, supportsVariableType, [=]() {
47 std::vector<cmDebuggerVariableEntry> ret;
48 ret.reserve(cmPolicies::CMPCOUNT);
49 for (int i = 0; i < cmPolicies::CMPCOUNT; ++i) {
50 if (policyMap.IsDefined(static_cast<cmPolicies::PolicyID>(i))) {
51 auto status = policyMap.Get(static_cast<cmPolicies::PolicyID>(i));
52 std::ostringstream ss;
53 ss << "CMP" << std::setfill('0') << std::setw(4) << i;
54 ret.emplace_back(ss.str(), policyStatusString[status]);
55 }
56 }
57 return ret;
58 });
59}
60
61std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny(
62 std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,

Callers 1

OnCreateMethod · 0.45

Calls 15

to_stringFunction · 0.85
reserveMethod · 0.80
emplace_backMethod · 0.80
strMethod · 0.80
AddSubVariablesMethod · 0.80
rfindMethod · 0.80
GetTestsMethod · 0.80
cmStrCatFunction · 0.70
IsDefinedMethod · 0.45
GetMethod · 0.45
GetLineMethod · 0.45

Tested by

no test coverage detected