/* */ #include "GrowSegment.h" #include "Piece.h" #include "A2STR.h" namespace aria2 { GrowSegment::GrowSegment(const SharedHandle& piece): piece_(piece), writtenLength_(0) {} GrowSegment::~GrowSegment() {} void GrowSegment::updateWrittenLength(size_t bytes) { writtenLength_ += bytes; piece_->reconfigure(writtenLength_); piece_->setAllBlock(); } #ifdef ENABLE_MESSAGE_DIGEST std::string GrowSegment::getHashString() { return A2STR::NIL; } #endif // ENABLE_MESSAGE_DIGEST void GrowSegment::clear() { writtenLength_ = 0; piece_->clearAllBlock(); } SharedHandle GrowSegment::getPiece() const { return piece_; } } // namespace aria2