/* */ #ifndef D_TRUNC_FILE_ALLOCATION_ITERATOR_H #define D_TRUNC_FILE_ALLOCATION_ITERATOR_H #include "FileAllocationIterator.h" #include "BinaryStream.h" namespace aria2 { // Use ftruncate() system call or platform-specific counterpart to set // file length. This allocator may not allocate file space, it just // changes file length information. class TruncFileAllocationIterator:public FileAllocationIterator { private: BinaryStream* stream_; int64_t offset_; int64_t totalLength_; public: TruncFileAllocationIterator(BinaryStream* stream, int64_t offset, int64_t totalLength); virtual void allocateChunk(); virtual bool finished(); virtual int64_t getCurrentLength(); virtual int64_t getTotalLength(); }; } // namespace aria2 #endif // D_TRUNC_FILE_ALLOCATION_ITERATOR_H