| 546 | } |
| 547 | |
| 548 | bool cmVisualStudioSlnParser::ParseMultiValueTag(std::string const& line, |
| 549 | ParsedLine& parsedLine, |
| 550 | State& state) |
| 551 | { |
| 552 | size_t idxEqualSign = line.find('='); |
| 553 | auto fullTag = cm::string_view(line).substr(0, idxEqualSign); |
| 554 | if (!this->ParseTag(fullTag, parsedLine, state)) { |
| 555 | return false; |
| 556 | } |
| 557 | if (idxEqualSign != std::string::npos) { |
| 558 | size_t idxFieldStart = idxEqualSign + 1; |
| 559 | if (idxFieldStart < line.size()) { |
| 560 | size_t idxParsing = idxFieldStart; |
| 561 | bool inQuotes = false; |
| 562 | for (;;) { |
| 563 | idxParsing = line.find_first_of(",\"", idxParsing); |
| 564 | bool fieldOver = false; |
| 565 | if (idxParsing == std::string::npos) { |
| 566 | fieldOver = true; |
| 567 | if (inQuotes) { |
| 568 | this->LastResult.SetError(ResultErrorInputStructure, |
| 569 | state.GetCurrentLine()); |
| 570 | return false; |
| 571 | } |
| 572 | } else if (line[idxParsing] == ',' && !inQuotes) { |
| 573 | fieldOver = true; |
| 574 | } else if (line[idxParsing] == '"') { |
| 575 | inQuotes = !inQuotes; |
| 576 | } |
| 577 | if (fieldOver) { |
| 578 | if (!this->ParseValue( |
| 579 | line.substr(idxFieldStart, idxParsing - idxFieldStart), |
| 580 | parsedLine)) { |
| 581 | return false; |
| 582 | } |
| 583 | if (idxParsing == std::string::npos) { |
| 584 | break; // end of last field |
| 585 | } |
| 586 | idxFieldStart = idxParsing + 1; |
| 587 | } |
| 588 | ++idxParsing; |
| 589 | } |
| 590 | } |
| 591 | } |
| 592 | return true; |
| 593 | } |
| 594 | |
| 595 | bool cmVisualStudioSlnParser::ParseSingleValueTag(std::string const& line, |
| 596 | ParsedLine& parsedLine, |
no test coverage detected