| 13 | { |
| 14 | |
| 15 | FsFile::FsFile(const QString& path, int read_block_size) { |
| 16 | this->file_ = File::OpenForReadB(path.toStdString()); |
| 17 | this->read_block_size_ = read_block_size; |
| 18 | this->file_path_ = path; |
| 19 | if (this->file_->IsOpen()) { |
| 20 | this->file_size_ = this->file_->Size(); |
| 21 | this->file_name_ = QString::fromStdString(this->file_->FileName()); |
| 22 | } |
| 23 | this->file_id_ = MD5::Hex(this->file_path_.toStdString() + std::to_string(TimeUtil::GetCurrentTimestamp())); |
| 24 | } |
| 25 | |
| 26 | bool FsFile::Send(SendTask&& task) { |
| 27 | if (!this->file_->IsOpen()) { |