/* */ #include "FileAllocationEntry.h" #include "FileAllocationIterator.h" #include "DownloadEngine.h" #include "RequestGroup.h" #include "PieceStorage.h" #include "DiskAdaptor.h" namespace aria2 { FileAllocationEntry::FileAllocationEntry(RequestGroup* requestGroup, Command* nextCommand): RequestGroupEntry(requestGroup, nextCommand), _fileAllocationIterator(requestGroup->getPieceStorage()->getDiskAdaptor()->fileAllocationIterator()) { _requestGroup->getPieceStorage()->getDiskAdaptor()->enableDirectIO(); } FileAllocationEntry:: ~FileAllocationEntry() { _requestGroup->getPieceStorage()->getDiskAdaptor()->disableDirectIO(); } off_t FileAllocationEntry::getCurrentLength() { return _fileAllocationIterator->getCurrentLength(); } uint64_t FileAllocationEntry::getTotalLength() { return _fileAllocationIterator->getTotalLength(); } bool FileAllocationEntry::finished() { return _fileAllocationIterator->finished(); } void FileAllocationEntry::allocateChunk() { _fileAllocationIterator->allocateChunk(); } } // namespace aria2