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

Method ParseImpl

Source/cmVisualStudioSlnParser.cxx:484–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482}
483
484bool cmVisualStudioSlnParser::ParseImpl(std::istream& input, cmSlnData& output,
485 State& state)
486{
487 std::string line;
488 // Does the .sln start with a Byte Order Mark?
489 if (!this->ParseBOM(input, line, state)) {
490 return false;
491 }
492 do {
493 line = cmTrimWhitespace(line);
494 if (line.empty()) {
495 continue;
496 }
497 ParsedLine parsedLine;
498 switch (state.NextLineFormat()) {
499 case LineMultiValueTag:
500 if (!this->ParseMultiValueTag(line, parsedLine, state)) {
501 return false;
502 }
503 break;
504 case LineSingleValueTag:
505 if (!this->ParseSingleValueTag(line, parsedLine, state)) {
506 return false;
507 }
508 break;
509 case LineKeyValuePair:
510 if (!this->ParseKeyValuePair(line, parsedLine, state)) {
511 return false;
512 }
513 break;
514 case LineVerbatim:
515 parsedLine.CopyVerbatim(line);
516 break;
517 }
518 if (parsedLine.IsComment()) {
519 continue;
520 }
521 if (!state.Process(parsedLine, output, this->LastResult)) {
522 return false;
523 }
524 } while (state.ReadLine(input, line));
525 return state.Finished(this->LastResult);
526}
527
528bool cmVisualStudioSlnParser::ParseBOM(std::istream& input, std::string& line,
529 State& state)

Callers 2

ParseMethod · 0.95
ParseFileMethod · 0.95

Calls 12

ParseBOMMethod · 0.95
ParseMultiValueTagMethod · 0.95
ParseSingleValueTagMethod · 0.95
ParseKeyValuePairMethod · 0.95
cmTrimWhitespaceFunction · 0.85
NextLineFormatMethod · 0.80
CopyVerbatimMethod · 0.80
IsCommentMethod · 0.80
ReadLineMethod · 0.80
emptyMethod · 0.45
ProcessMethod · 0.45
FinishedMethod · 0.45

Tested by

no test coverage detected