| 88 | } |
| 89 | |
| 90 | bool GzipTextReader::nextLine(std::string& line) { |
| 91 | bool result = false; |
| 92 | line.clear(); |
| 93 | while (true) { |
| 94 | if (outPtr_ == outEnd_) { |
| 95 | if (!nextBuffer()) { |
| 96 | return result; |
| 97 | } |
| 98 | } |
| 99 | unsigned char ch = *(outPtr_++); |
| 100 | if (ch == '\n') { |
| 101 | return true; |
| 102 | } |
| 103 | line += static_cast<char>(ch); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | GzipTextReader::~GzipTextReader() { |
| 108 | inflateEnd(&stream_); |