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

Method Evaluate

Source/cmGeneratorExpressionNode.cxx:357–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 int NumExpectedParameters() const override { return 2; }
356
357 std::string Evaluate(
358 std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
359 GeneratorExpressionContent const* content,
360 cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
361 {
362 long numbers[2];
363 for (int i = 0; i < 2; ++i) {
364 if (!ParameterToLong(parameters[i].c_str(), &numbers[i])) {
365 reportError(eval, content->GetOriginalExpression(),
366 "$<EQUAL> parameter " + parameters[i] +
367 " is not a valid integer.");
368 return {};
369 }
370 }
371 return numbers[0] == numbers[1] ? "1" : "0";
372 }
373
374 static bool ParameterToLong(char const* param, long* outResult)
375 {

Callers

nothing calls this directly

Calls 3

reportErrorFunction · 0.85
c_strMethod · 0.80
GetOriginalExpressionMethod · 0.80

Tested by

no test coverage detected