| 442 | } |
| 443 | |
| 444 | void 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 | } |