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

Method ParseMultiValueTag

Source/cmVisualStudioSlnParser.cxx:548–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548bool 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
595bool cmVisualStudioSlnParser::ParseSingleValueTag(std::string const& line,
596 ParsedLine& parsedLine,

Callers 1

ParseImplMethod · 0.95

Calls 8

ParseTagMethod · 0.95
ParseValueMethod · 0.95
find_first_ofMethod · 0.80
GetCurrentLineMethod · 0.80
findMethod · 0.45
substrMethod · 0.45
sizeMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected