| 24 | TupleTextFileReader::TupleTextFileReader(const std::string& path) : path_(path) {} |
| 25 | |
| 26 | Status TupleTextFileReader::Open() { |
| 27 | if (!reader_.is_open()) { |
| 28 | reader_.open(path_, std::ios::in | std::ios::binary); |
| 29 | if (!reader_.is_open()) { |
| 30 | return Status(TErrorCode::DISK_IO_ERROR, |
| 31 | "open tuple text reader on " + path_ + " failed", GetStrErrMsg()); |
| 32 | } |
| 33 | reader_.seekg(0, std::ios::end); |
| 34 | file_size_ = reader_.tellg(); |
| 35 | reader_.seekg(0, std::ios::beg); |
| 36 | } |
| 37 | return Status(); |
| 38 | } |
| 39 | |
| 40 | void TupleTextFileReader::Close() { |
| 41 | if (reader_.is_open()) { |
nothing calls this directly
no test coverage detected