/* */ #include "GrowSegment.h" #include "Piece.h" #include "A2STR.h" namespace aria2 { GrowSegment::GrowSegment(const std::shared_ptr& piece) : piece_(piece), writtenLength_(0) { } GrowSegment::~GrowSegment() {} void GrowSegment::updateWrittenLength(int64_t bytes) { writtenLength_ += bytes; piece_->reconfigure(writtenLength_); piece_->setAllBlock(); } std::string GrowSegment::getDigest() { return A2STR::NIL; } void GrowSegment::clear(WrDiskCache* diskCache) { writtenLength_ = 0; // cache won't be used in this object. piece_->clearAllBlock(nullptr); } std::shared_ptr GrowSegment::getPiece() const { return piece_; } } // namespace aria2