| 165 | } |
| 166 | |
| 167 | virtual bool OnWrite(int64_t offset, void const * buffer, size_t size) |
| 168 | { |
| 169 | #ifdef DEBUG |
| 170 | static threads::ThreadID const id = threads::GetCurrentThreadID(); |
| 171 | ASSERT_EQUAL(id, threads::GetCurrentThreadID(), ("OnWrite called from different threads")); |
| 172 | #endif |
| 173 | |
| 174 | try |
| 175 | { |
| 176 | m_writer->Seek(offset); |
| 177 | m_writer->Write(buffer, size); |
| 178 | return true; |
| 179 | } |
| 180 | catch (Writer::Exception const & e) |
| 181 | { |
| 182 | LOG(LWARNING, ("Can't write buffer for size", size, e.Msg())); |
| 183 | return false; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | // Saves current chunks' statuses into a resume file. |
| 188 | void SaveResumeChunks() |
no test coverage detected