/* */ #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; uint64_t _totalLength; unsigned char* _buffer; public: SingleFileAllocationIterator(BinaryStream* stream, off_t offset, uint64_t totalLength); virtual ~SingleFileAllocationIterator(); virtual void allocateChunk(); virtual bool finished(); virtual off_t getCurrentLength() { return _offset; } virtual uint64_t getTotalLength() { return _totalLength; } /** * Must be called only once, before calling allocateChunk() */ void init(); }; typedef SharedHandle SingleFileAllocationIteratorHandle; } // namespace aria2 #endif // _D_SINGLE_FILE_ALLOCATION_ITERATOR_H_