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

Method TransformLine

Source/cmDependsC.cxx:444–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444void cmDependsC::TransformLine(std::string& line)
445{
446 // Check for a transform rule match. Return if none.
447 if (!this->IncludeRegexTransform.find(line)) {
448 return;
449 }
450 auto tri = this->TransformRules.find(this->IncludeRegexTransform.match(3));
451 if (tri == this->TransformRules.end()) {
452 return;
453 }
454
455 // Construct the transformed line.
456 std::string newline = this->IncludeRegexTransform.match(1);
457 std::string arg = this->IncludeRegexTransform.match(4);
458 for (char c : tri->second) {
459 if (c == '%') {
460 newline += arg;
461 } else {
462 newline += c;
463 }
464 }
465
466 // Return the transformed line.
467 line = newline;
468}

Callers 1

ScanMethod · 0.95

Calls 3

findMethod · 0.45
matchMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected