diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-10-11 16:58:24 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-10-11 16:58:24 +0000 |
| commit | 048a2cf59737f761876e81a77e8d064c45c752d7 (patch) | |
| tree | 65c9d5498aafe6a8c8e640ddfcc43c7013504d0d /src/AbstractSingleDiskAdaptor.h | |
| parent | e26bbbb9eee140ba24402fe872a752b42f0077de (diff) | |
2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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.
Diffstat (limited to 'src/AbstractSingleDiskAdaptor.h')
| -rw-r--r-- | src/AbstractSingleDiskAdaptor.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/AbstractSingleDiskAdaptor.h b/src/AbstractSingleDiskAdaptor.h index c4dc7e80..ee0733b8 100644 --- a/src/AbstractSingleDiskAdaptor.h +++ b/src/AbstractSingleDiskAdaptor.h @@ -37,6 +37,7 @@ #include "DiskAdaptor.h" #include "DiskWriter.h" +#include "DlAbortEx.h" class AbstractSingleDiskAdaptor : public DiskAdaptor { protected: @@ -47,26 +48,33 @@ public: virtual ~AbstractSingleDiskAdaptor() {} - virtual void initAndOpenFile(); + virtual void initAndOpenFile() throw(DlAbortEx*); - virtual void openFile(); + virtual void openFile() throw(DlAbortEx*); virtual void closeFile(); - virtual void openExistingFile(); + virtual void openExistingFile() throw(DlAbortEx*); virtual void writeData(const unsigned char* data, int32_t len, - int64_t offset); + int64_t offset) throw(DlAbortEx*); - virtual int32_t readData(unsigned char* data, int32_t len, int64_t offset); + virtual int32_t readData(unsigned char* data, int32_t len, int64_t offset) throw(DlAbortEx*); virtual bool fileExists(); - virtual int64_t size() const + virtual int64_t size() const throw(DlAbortEx*) { - return getTotalLength(); + return diskWriter->size(); } - + + virtual void truncate(int64_t length) throw(DlAbortEx*) + { + diskWriter->truncate(length); + } + + virtual FileAllocationIteratorHandle fileAllocationIterator(); + void setDiskWriter(const DiskWriterHandle diskWriter) { this->diskWriter = diskWriter; } |
