| 88 | } |
| 89 | |
| 90 | bool BReadFile::readLine(BString& line) { |
| 91 | char c = 0; |
| 92 | bool result = false; |
| 93 | line.removeAll(); |
| 94 | while (read(c)) { |
| 95 | if (c == '\n') { |
| 96 | return true; |
| 97 | } |
| 98 | if (c == '\r') { |
| 99 | continue; |
| 100 | } |
| 101 | line.append(c); |
| 102 | result = true; |
| 103 | } |
| 104 | return result; |
| 105 | } |
| 106 | |
| 107 | bool BReadFile::read(char& value) { |
| 108 | return std::fread(&value, 1, 1, file) == 1; |
no test coverage detected