From 048a2cf59737f761876e81a77e8d064c45c752d7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 11 Oct 2007 16:58:24 +0000 Subject: 2007-10-12 Tatsuhiro Tsujikawa Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only. --- src/AbstractSingleDiskAdaptor.cc | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/AbstractSingleDiskAdaptor.cc') diff --git a/src/AbstractSingleDiskAdaptor.cc b/src/AbstractSingleDiskAdaptor.cc index e0bec6ee..44e2e846 100644 --- a/src/AbstractSingleDiskAdaptor.cc +++ b/src/AbstractSingleDiskAdaptor.cc @@ -34,28 +34,40 @@ /* copyright --> */ #include "AbstractSingleDiskAdaptor.h" #include "File.h" +#include "SingleFileAllocationIterator.h" -void AbstractSingleDiskAdaptor::initAndOpenFile() { +void AbstractSingleDiskAdaptor::initAndOpenFile() + throw(DlAbortEx*) +{ diskWriter->initAndOpenFile(getFilePath(), totalLength); } -void AbstractSingleDiskAdaptor::openFile() { +void AbstractSingleDiskAdaptor::openFile() + throw(DlAbortEx*) +{ diskWriter->openFile(getFilePath(), totalLength); } -void AbstractSingleDiskAdaptor::closeFile() { +void AbstractSingleDiskAdaptor::closeFile() +{ diskWriter->closeFile(); } -void AbstractSingleDiskAdaptor::openExistingFile() { +void AbstractSingleDiskAdaptor::openExistingFile() + throw(DlAbortEx*) +{ diskWriter->openExistingFile(getFilePath(), totalLength); } -void AbstractSingleDiskAdaptor::writeData(const unsigned char* data, int32_t len, int64_t offset) { +void AbstractSingleDiskAdaptor::writeData(const unsigned char* data, int32_t len, int64_t offset) + throw(DlAbortEx*) +{ diskWriter->writeData(data, len, offset); } -int32_t AbstractSingleDiskAdaptor::readData(unsigned char* data, int32_t len, int64_t offset) { +int32_t AbstractSingleDiskAdaptor::readData(unsigned char* data, int32_t len, int64_t offset) + throw(DlAbortEx*) +{ return diskWriter->readData(data, len, offset); } @@ -63,3 +75,8 @@ bool AbstractSingleDiskAdaptor::fileExists() { return File(getFilePath()).exists(); } + +FileAllocationIteratorHandle AbstractSingleDiskAdaptor::fileAllocationIterator() +{ + return new SingleFileAllocationIterator(this); +} -- cgit