/* */ #include "GrowSegment.h" #include "Piece.h" #include "A2STR.h" namespace aria2 { GrowSegment::GrowSegment(const PieceHandle& 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(); } PieceHandle GrowSegment::getPiece() const { return _piece; } } // namespace aria2