/* */ #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_; off_t offset_; off_t totalLength_; unsigned char* buffer_; public: SingleFileAllocationIterator (BinaryStream* stream, off_t offset, off_t totalLength); virtual ~SingleFileAllocationIterator(); virtual void allocateChunk(); virtual bool finished(); virtual off_t getCurrentLength() { return offset_; } virtual off_t getTotalLength() { return totalLength_; } /** * Must be called only once, before calling allocateChunk() */ void init(); }; } // namespace aria2 #endif // D_SINGLE_FILE_ALLOCATION_ITERATOR_H