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

Method ParseTag

Source/cmVisualStudioSlnParser.cxx:628–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628bool 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
658bool cmVisualStudioSlnParser::ParseValue(std::string const& value,
659 ParsedLine& parsedLine)

Callers 2

ParseMultiValueTagMethod · 0.95
ParseSingleValueTagMethod · 0.95

Calls 12

cmTrimWhitespaceFunction · 0.85
SetTagMethod · 0.80
rfindMethod · 0.80
GetCurrentLineMethod · 0.80
SetQuotedArgMethod · 0.80
SetArgMethod · 0.80
findMethod · 0.45
substrMethod · 0.45
SetErrorMethod · 0.45
frontMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected