| 626 | } |
| 627 | |
| 628 | bool cmVisualStudioSlnParser::ParseTag(cm::string_view fullTag, |
| 629 | ParsedLine& parsedLine, State& state) |
| 630 | { |
| 631 | size_t idxLeftParen = fullTag.find('('); |
| 632 | if (idxLeftParen == cm::string_view::npos) { |
| 633 | parsedLine.SetTag(cmTrimWhitespace(fullTag)); |
| 634 | return true; |
| 635 | } |
| 636 | parsedLine.SetTag(cmTrimWhitespace(fullTag.substr(0, idxLeftParen))); |
| 637 | size_t idxRightParen = fullTag.rfind(')'); |
| 638 | if (idxRightParen == cm::string_view::npos) { |
| 639 | this->LastResult.SetError(ResultErrorInputStructure, |
| 640 | state.GetCurrentLine()); |
| 641 | return false; |
| 642 | } |
| 643 | std::string const& arg = cmTrimWhitespace( |
| 644 | fullTag.substr(idxLeftParen + 1, idxRightParen - idxLeftParen - 1)); |
| 645 | if (arg.front() == '"') { |
| 646 | if (arg.back() != '"') { |
| 647 | this->LastResult.SetError(ResultErrorInputStructure, |
| 648 | state.GetCurrentLine()); |
| 649 | return false; |
| 650 | } |
| 651 | parsedLine.SetQuotedArg(arg.substr(1, arg.size() - 2)); |
| 652 | } else { |
| 653 | parsedLine.SetArg(arg); |
| 654 | } |
| 655 | return true; |
| 656 | } |
| 657 | |
| 658 | bool cmVisualStudioSlnParser::ParseValue(std::string const& value, |
| 659 | ParsedLine& parsedLine) |
no test coverage detected