| 482 | } |
| 483 | |
| 484 | bool 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 | |
| 528 | bool cmVisualStudioSlnParser::ParseBOM(std::istream& input, std::string& line, |
| 529 | State& state) |
no test coverage detected