| 31 | InputBuffer::~InputBuffer() { delete[] buf_; } |
| 32 | |
| 33 | Status InputBuffer::FillBuffer() { |
| 34 | StringPiece data; |
| 35 | Status s = file_->Read(file_pos_, size_, &data, buf_); |
| 36 | if (data.data() != buf_) { |
| 37 | memmove(buf_, data.data(), data.size()); |
| 38 | } |
| 39 | pos_ = buf_; |
| 40 | limit_ = pos_ + data.size(); |
| 41 | file_pos_ += data.size(); |
| 42 | return s; |
| 43 | } |
| 44 | |
| 45 | Status InputBuffer::ReadLine(string* result) { |
| 46 | result->clear(); |