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

Method ParseBOM

Source/cmVisualStudioSlnParser.cxx:528–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528bool 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
548bool cmVisualStudioSlnParser::ParseMultiValueTag(std::string const& line,
549 ParsedLine& parsedLine,

Callers 1

ParseImplMethod · 0.95

Calls 4

ReadLineMethod · 0.80
cmStrCatFunction · 0.70
getMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected