| 28 | PyRecordWriter::PyRecordWriter() {} |
| 29 | |
| 30 | PyRecordWriter* PyRecordWriter::New(const string& filename, |
| 31 | const io::RecordWriterOptions& options, |
| 32 | TF_Status* out_status) { |
| 33 | std::unique_ptr<WritableFile> file; |
| 34 | Status s = Env::Default()->NewWritableFile(filename, &file); |
| 35 | if (!s.ok()) { |
| 36 | Set_TF_Status_from_Status(out_status, s); |
| 37 | return nullptr; |
| 38 | } |
| 39 | PyRecordWriter* writer = new PyRecordWriter; |
| 40 | writer->file_ = std::move(file); |
| 41 | writer->writer_.reset(new RecordWriter(writer->file_.get(), options)); |
| 42 | return writer; |
| 43 | } |
| 44 | |
| 45 | PyRecordWriter::~PyRecordWriter() { |
| 46 | // Writer depends on file during close for zlib flush, so destruct first. |
nothing calls this directly
no test coverage detected