void expect(LineReader& lr, const char* expected) { StringPiece line; size_t expectedLen = strlen(expected); EXPECT_EQ(expectedLen != 0 ? LineReader::kReading : LineReader::kEof, lr.readLine(line)); EXPECT_EQ(expectedLen, line.size()); EXPECT_EQ(std::string(expected, expectedLen), line.str()); }
std::string ODMatrix::getNextNonCommentLine(LineReader& lr) { while (lr.good() && lr.hasMore()) { const std::string line = lr.readLine(); if (line[0] != '*') { return StringUtils::prune(line); } } throw ProcessError("End of file while reading " + lr.getFileName() + "."); }