| 526 | } |
| 527 | |
| 528 | bool cmVisualStudioSlnParser::ParseBOM(std::istream& input, std::string& line, |
| 529 | State& state) |
| 530 | { |
| 531 | char bom[4]; |
| 532 | if (!input.get(bom, 4)) { |
| 533 | this->LastResult.SetError(ResultErrorReadingInput, 1); |
| 534 | return false; |
| 535 | } |
| 536 | this->LastResult.HadBOM = |
| 537 | (bom[0] == char(0xEF) && bom[1] == char(0xBB) && bom[2] == char(0xBF)); |
| 538 | if (!state.ReadLine(input, line)) { |
| 539 | this->LastResult.SetError(ResultErrorReadingInput, 1); |
| 540 | return false; |
| 541 | } |
| 542 | if (!this->LastResult.HadBOM) { |
| 543 | line = cmStrCat(bom, line); // it wasn't a BOM, prepend it to first line |
| 544 | } |
| 545 | return true; |
| 546 | } |
| 547 | |
| 548 | bool cmVisualStudioSlnParser::ParseMultiValueTag(std::string const& line, |
| 549 | ParsedLine& parsedLine, |