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.
This commit is contained in:
Tatsuhiro Tsujikawa 2007-10-11 16:58:24 +00:00
parent e26bbbb9ee
commit 048a2cf597
252 changed files with 8646 additions and 5343 deletions

View file

@ -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;
}