/* */ #ifndef D_GROW_SEGMENT_H #define D_GROW_SEGMENT_H #include "Segment.h" namespace aria2 { class GrowSegment:public Segment { private: SharedHandle piece_; int32_t writtenLength_; public: GrowSegment(const SharedHandle& piece); virtual ~GrowSegment(); virtual bool complete() const { return false; } virtual size_t getIndex() const { return 0; } virtual off_t getPosition() const { return 0; } virtual off_t getPositionToWrite() const { return writtenLength_; } virtual int32_t getLength() const { return 0; } virtual int32_t getSegmentLength() const { return 0; } virtual int32_t getWrittenLength() const { return writtenLength_; } virtual void updateWrittenLength(int32_t bytes); #ifdef ENABLE_MESSAGE_DIGEST virtual bool updateHash (int32_t begin, const unsigned char* data, size_t dataLength) { return false; } virtual bool isHashCalculated() const { return false; } virtual std::string getDigest(); #endif // ENABLE_MESSAGE_DIGEST virtual void clear(); virtual SharedHandle getPiece() const; }; } // namespace aria2 #endif // D_GROW_SEGMENT_H