summaryrefslogtreecommitdiff
path: root/src/AbstractDiskWriter.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-10-11 16:58:24 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-10-11 16:58:24 +0000
commit048a2cf59737f761876e81a77e8d064c45c752d7 (patch)
tree65c9d5498aafe6a8c8e640ddfcc43c7013504d0d /src/AbstractDiskWriter.h
parente26bbbb9eee140ba24402fe872a752b42f0077de (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/AbstractDiskWriter.h')
-rw-r--r--src/AbstractDiskWriter.h34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/AbstractDiskWriter.h b/src/AbstractDiskWriter.h
index f6b2d426..e5d8eb14 100644
--- a/src/AbstractDiskWriter.h
+++ b/src/AbstractDiskWriter.h
@@ -36,52 +36,40 @@
#define _D_ABSTRACT_DISK_WRITER_H_
#include "DiskWriter.h"
-#include "FileAllocator.h"
#include "Logger.h"
+#include "DlAbortEx.h"
class AbstractDiskWriter : public DiskWriter {
protected:
string filename;
int32_t fd;
- FileAllocatorHandle fileAllocator;
- FileAllocatorHandle glowFileAllocator;
const Logger* logger;
- void createFile(const string& filename, int32_t addFlags = 0);
+ void createFile(const string& filename, int32_t addFlags = 0) throw(DlAbortEx*);
private:
- int32_t writeDataInternal(const char* data, int32_t len);
- int32_t readDataInternal(char* data, int32_t len);
+ int32_t writeDataInternal(const unsigned char* data, int32_t len);
+ int32_t readDataInternal(unsigned char* data, int32_t len);
- void seek(int64_t offset);
+ void seek(int64_t offset) throw(DlAbortEx*);
public:
AbstractDiskWriter();
virtual ~AbstractDiskWriter();
- virtual void openFile(const string& filename, int64_t totalLength = 0);
+ virtual void openFile(const string& filename, int64_t totalLength = 0) throw(DlAbortEx*);
virtual void closeFile();
- virtual void openExistingFile(const string& filename, int64_t totalLength = 0);
+ virtual void openExistingFile(const string& filename, int64_t totalLength = 0) throw(DlAbortEx*);
- virtual void writeData(const char* data, int32_t len, int64_t offset);
+ virtual void writeData(const unsigned char* data, int32_t len, int64_t offset) throw(DlAbortEx*);
- virtual int32_t readData(char* data, int32_t len, int64_t offset);
+ virtual int32_t readData(unsigned char* data, int32_t len, int64_t offset) throw(DlAbortEx*);
- void setFileAllocator(const FileAllocatorHandle& fileAllocator)
- {
- this->fileAllocator = fileAllocator;
- }
+ virtual void truncate(int64_t length) throw(DlAbortEx*);
- void setGlowFileAllocator(const FileAllocatorHandle& fileAllocator)
- {
- this->glowFileAllocator = fileAllocator;
- }
-
- virtual void truncate(int64_t length);
-
- virtual int64_t size() const;
+ virtual int64_t size() const throw(DlAbortEx*);
};
#endif // _D_ABSTRACT_DISK_WRITER_H_