/* */ #ifndef D_SINGLE_FILE_ALLOCATION_ITERATOR_H #define D_SINGLE_FILE_ALLOCATION_ITERATOR_H #include "FileAllocationIterator.h" namespace aria2 { class BinaryStream; class SingleFileAllocationIterator:public FileAllocationIterator { private: BinaryStream* stream_; int64_t offset_; int64_t totalLength_; unsigned char* buffer_; public: SingleFileAllocationIterator (BinaryStream* stream, int64_t offset, int64_t totalLength); virtual ~SingleFileAllocationIterator(); virtual void allocateChunk(); virtual bool finished(); virtual int64_t getCurrentLength() { return offset_; } virtual int64_t getTotalLength() { return totalLength_; } /** * Must be called only once, before calling allocateChunk() */ void init(); }; } // namespace aria2 #endif // D_SINGLE_FILE_ALLOCATION_ITERATOR_H