2006-04-16 14:42:26 +00:00
|
|
|
/* <!-- copyright */
|
|
|
|
/*
|
2006-09-21 15:31:24 +00:00
|
|
|
* aria2 - The high speed download utility
|
2006-04-16 14:42:26 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Tatsuhiro Tsujikawa
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-09-21 15:31:24 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
* In addition, as a special exception, the copyright holders give
|
|
|
|
* permission to link the code of portions of this program with the
|
|
|
|
* OpenSSL library under certain conditions as described in each
|
|
|
|
* individual source file, and distribute linked combinations
|
|
|
|
* including the two.
|
|
|
|
* You must obey the GNU General Public License in all respects
|
|
|
|
* for all of the code used other than OpenSSL. If you modify
|
|
|
|
* file(s) with this exception, you may extend this exception to your
|
|
|
|
* version of the file(s), but you are not obligated to do so. If you
|
|
|
|
* do not wish to do so, delete this exception statement from your
|
|
|
|
* version. If you delete this exception statement from all source
|
|
|
|
* files in the program, then also delete it here.
|
2006-04-16 14:42:26 +00:00
|
|
|
*/
|
|
|
|
/* copyright --> */
|
|
|
|
#ifndef _D_MULTI_DISK_ADAPTOR_H_
|
|
|
|
#define _D_MULTI_DISK_ADAPTOR_H_
|
|
|
|
|
|
|
|
#include "DiskAdaptor.h"
|
2007-01-08 00:13:25 +00:00
|
|
|
#include "Option.h"
|
|
|
|
#include "DiskWriter.h"
|
2007-01-11 16:32:31 +00:00
|
|
|
#include "File.h"
|
2007-10-11 16:58:24 +00:00
|
|
|
#include "DlAbortEx.h"
|
2007-01-08 00:13:25 +00:00
|
|
|
|
|
|
|
class DiskWriterEntry {
|
|
|
|
private:
|
2007-01-11 16:32:31 +00:00
|
|
|
FileEntryHandle fileEntry;
|
2007-01-08 00:13:25 +00:00
|
|
|
DiskWriterHandle diskWriter;
|
|
|
|
public:
|
|
|
|
DiskWriterEntry(const FileEntryHandle& fileEntry):
|
|
|
|
fileEntry(fileEntry),
|
|
|
|
diskWriter(0) {}
|
|
|
|
|
|
|
|
~DiskWriterEntry() {}
|
|
|
|
|
|
|
|
string getFilePath(const string& topDir) const
|
|
|
|
{
|
|
|
|
return topDir+"/"+fileEntry->getPath();
|
|
|
|
}
|
|
|
|
|
|
|
|
void initAndOpenFile(const string& topDir)
|
2007-10-11 16:58:24 +00:00
|
|
|
throw(DlAbortEx*)
|
2007-01-08 00:13:25 +00:00
|
|
|
{
|
|
|
|
diskWriter->initAndOpenFile(getFilePath(topDir), fileEntry->getLength());
|
|
|
|
}
|
|
|
|
|
|
|
|
void openFile(const string& topDir)
|
2007-10-11 16:58:24 +00:00
|
|
|
throw(DlAbortEx*)
|
2007-01-08 00:13:25 +00:00
|
|
|
{
|
|
|
|
diskWriter->openFile(getFilePath(topDir), fileEntry->getLength());
|
|
|
|
}
|
|
|
|
|
|
|
|
void openExistingFile(const string& topDir)
|
2007-10-11 16:58:24 +00:00
|
|
|
throw(DlAbortEx*)
|
2007-01-08 00:13:25 +00:00
|
|
|
{
|
2007-03-24 15:32:40 +00:00
|
|
|
diskWriter->openExistingFile(getFilePath(topDir), fileEntry->getLength());
|
2007-01-08 00:13:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void closeFile()
|
|
|
|
{
|
|
|
|
diskWriter->closeFile();
|
|
|
|
}
|
|
|
|
|
2007-01-11 16:32:31 +00:00
|
|
|
bool fileExists(const string& topDir)
|
|
|
|
{
|
|
|
|
return File(getFilePath(topDir)).exists();
|
|
|
|
}
|
|
|
|
|
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
MessageDigestHelper is introduced in order to simplify the use
of message digest. Removed repeated code.
The message digest algorithm is now specified by string, like
"sha1",
"md5".
* src/messageDigest.{h, cc}
* src/MessageDigestHelper.{h, cc}: New class.
* src/DefaultPieceStorage.cc
* src/DefaultBtContext.{h, cc}
(computeFastSet): New function.
(setInfoHash): Added for unit testing.
(setNumPieces): Added for unit testing.
* src/DefaultBtInteractive.cc
* src/BtPieceMessage.cc
* src/Peer.cc
* src/Checksum.h
* src/message.h
* src/IteratableChecksumValidator.h
* src/ChunkChecksumValidator.{h, cc}: Use
IteratableChecksumValidator
inside it.
* src/SegmentMan.{h, cc}
(checkIntegrity): Removed.
* src/IteratableChunkChecksumValidator.{h, cc}
* src/Util.h
(sha1Sum): Removed.
(simpleMessageDigest): Removed.
(fileChecksum): Removed.
(computeFastSet): Removed.
* src/ShaVisitor.cc
* src/ChunkChecksum.h
* src/DownloadCommand.cc
Removed messageDigest virtual functions.
* src/MultiDiskAdaptor.{h, cc}
* src/DiskAdaptor.h
* src/ByteArrayDiskWriter.h
* src/DiskWriter.h
* src/DiskAdaptorWriter.h
* src/AbstractSingleDiskAdaptor.{h, cc}
* src/AbstractDiskWriter.{h, cc}
Fixed comilation error when message digest is disabled.
* src/MetalinkEntry.{h, cc}
* src/MetalinkRequestInfo.cc
Removed srandom and random.
* src/SimpleRandomizer.h
Added size() virtual function to DiskAdaptor
* src/MultiDiskAdaptor.h
Fixed the bug that causes that files are not opened correctly in
multi-file torrent.
* src/TorrentRequestInfo.cc
* src/MultiDiskAdaptor.cc
Added SHA256 support
* src/messageDigest.cc
* src/Xml2MetalinkProcessor.cc
Show supported message digest algorithms
* src/main.cc
Updated contact info.
* src/main.cc
2007-08-08 14:40:11 +00:00
|
|
|
int64_t size() const
|
2007-10-11 16:58:24 +00:00
|
|
|
throw(DlAbortEx*)
|
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
MessageDigestHelper is introduced in order to simplify the use
of message digest. Removed repeated code.
The message digest algorithm is now specified by string, like
"sha1",
"md5".
* src/messageDigest.{h, cc}
* src/MessageDigestHelper.{h, cc}: New class.
* src/DefaultPieceStorage.cc
* src/DefaultBtContext.{h, cc}
(computeFastSet): New function.
(setInfoHash): Added for unit testing.
(setNumPieces): Added for unit testing.
* src/DefaultBtInteractive.cc
* src/BtPieceMessage.cc
* src/Peer.cc
* src/Checksum.h
* src/message.h
* src/IteratableChecksumValidator.h
* src/ChunkChecksumValidator.{h, cc}: Use
IteratableChecksumValidator
inside it.
* src/SegmentMan.{h, cc}
(checkIntegrity): Removed.
* src/IteratableChunkChecksumValidator.{h, cc}
* src/Util.h
(sha1Sum): Removed.
(simpleMessageDigest): Removed.
(fileChecksum): Removed.
(computeFastSet): Removed.
* src/ShaVisitor.cc
* src/ChunkChecksum.h
* src/DownloadCommand.cc
Removed messageDigest virtual functions.
* src/MultiDiskAdaptor.{h, cc}
* src/DiskAdaptor.h
* src/ByteArrayDiskWriter.h
* src/DiskWriter.h
* src/DiskAdaptorWriter.h
* src/AbstractSingleDiskAdaptor.{h, cc}
* src/AbstractDiskWriter.{h, cc}
Fixed comilation error when message digest is disabled.
* src/MetalinkEntry.{h, cc}
* src/MetalinkRequestInfo.cc
Removed srandom and random.
* src/SimpleRandomizer.h
Added size() virtual function to DiskAdaptor
* src/MultiDiskAdaptor.h
Fixed the bug that causes that files are not opened correctly in
multi-file torrent.
* src/TorrentRequestInfo.cc
* src/MultiDiskAdaptor.cc
Added SHA256 support
* src/messageDigest.cc
* src/Xml2MetalinkProcessor.cc
Show supported message digest algorithms
* src/main.cc
Updated contact info.
* src/main.cc
2007-08-08 14:40:11 +00:00
|
|
|
{
|
|
|
|
return diskWriter->size();
|
|
|
|
}
|
|
|
|
|
2007-01-11 16:32:31 +00:00
|
|
|
FileEntryHandle getFileEntry() const {
|
|
|
|
return fileEntry;
|
|
|
|
}
|
|
|
|
|
2007-01-08 00:13:25 +00:00
|
|
|
void setDiskWriter(const DiskWriterHandle& diskWriter) {
|
|
|
|
this->diskWriter = diskWriter;
|
|
|
|
}
|
|
|
|
|
|
|
|
DiskWriterHandle getDiskWriter() const {
|
|
|
|
return diskWriter;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef SharedHandle<DiskWriterEntry> DiskWriterEntryHandle;
|
|
|
|
|
|
|
|
typedef deque<DiskWriterEntryHandle> DiskWriterEntries;
|
2006-04-16 14:42:26 +00:00
|
|
|
|
|
|
|
class MultiDiskAdaptor : public DiskAdaptor {
|
|
|
|
private:
|
2006-11-08 16:25:38 +00:00
|
|
|
string topDir;
|
2007-01-25 16:47:29 +00:00
|
|
|
int32_t pieceLength;
|
2007-01-08 00:13:25 +00:00
|
|
|
DiskWriterEntries diskWriterEntries;
|
|
|
|
const Option* option;
|
|
|
|
|
|
|
|
void resetDiskWriterEntries();
|
2006-11-08 16:25:38 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
void mkdir() const throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
|
|
|
bool isInRange(const DiskWriterEntryHandle entry, int64_t offset) const;
|
|
|
|
|
2007-01-25 16:47:29 +00:00
|
|
|
int32_t calculateLength(const DiskWriterEntryHandle entry,
|
|
|
|
int64_t fileOffset,
|
|
|
|
int32_t rem) const;
|
2007-01-08 00:13:25 +00:00
|
|
|
|
|
|
|
string getTopDirPath() const;
|
2006-04-16 14:42:26 +00:00
|
|
|
public:
|
2007-01-08 00:13:25 +00:00
|
|
|
MultiDiskAdaptor():pieceLength(0),
|
|
|
|
option(0)
|
2007-01-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add chunk checksum validation:
* src/MetalinkEntry.h
(MetalinkChunkChecksum.h): New include.
(chunkChecksum): New variable.
* src/Request.h
(method): New variable.
(setMethod): New function.
(getMethod): New function.
(METHOD_GET): New static constant.
(METHOD_HEAD): New static constant.
* src/Xml2MetalinkProcessor.h
(getPieceHash): New function.
* src/PieceStorage.h
(markAllPiecesDone): New function.
(checkIntegrity): New function.
* src/FileAllocator.h
(NullFileAllocationMonitor.h): New include.
(FileAllocator): Initialize fileAllocationMonitor with new
NullFileAllocationMonitor().
* src/MultiDiskAdaptor.h
(messageDigest.h): Remove include.
(ctx): Removed.
(hashUpdate): Added ctx.
(MultiDiskAdaptor): Removed ctx.
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/UrlRequestInfo.h
(HeadResult): New class.
(digestAlgo): New variable.
(chunkChecksumLength): New variable.
(chunkChecksums): New variable.
(getHeadResult): New function.
(UrlRequestInfo): Added digestAlgo, chunkChecksumLength.
(setDigestAlgo): New function.
(setChunkChecksumLength): New function.
(setChunkChecksums): New function.
* src/DefaultPieceStorage.cc
(DiskAdaptorWriter.h): New include.
(ChunkChecksumValidator.h): New include.
(markAllPiecesDone): New function.
(checkIntegrity): New function.
* src/DefaultBtContext.h
(getPieceHashes): New function.
* src/TorrentRequestInfo.cc
(execute): Try to validate chunk checksum if file already exists
and
.aria2 file doesn't there and user allows aria2 to overwrite it.
* src/messageDigest.h
(~MessageDigestContext): Added digestFree().
* src/MetalinkRequestInfo.cc
(execute): Set digestAlgo, chunkChecksum, chunkChecksums to
reqInfo.
* src/DiskAdaptor.h
(messageDigest.h): New include.
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/DownloadCommand.h
(PeerStat.h): New include.
(maxDownloadSpeedLimit): New variable.
(startupIdleTime): New variable.
(lowestDownloadSpeedLimit): New variable.
(peerStat): New variable.
(setMaxDownloadSpeedLimit): New function.
(setStartupIdleTime): New function.
(setLowestDownloadSPeedLimit): New function.
* src/BtContext.h
(getPieceHashes): New function.
* src/main.cc
(main): Set PREF_REALTIME_CHUNK_CHECKSUM and
PREF_CHECK_INTEGRITY
option to true for testing purpose.
* src/BtPieceMessage.cc
(checkPieceHash): Use messageDigest
* src/DownloadEngine.cc
(SetDescriptor): Removed.
(AccumulateActiveCommand): Removed.
(waitData): Rewritten.
(updateFdSet): Rewritten.
* src/MultiDiskAdaptor.cc
(hashUpdate): Added ctx.
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/BitfieldMan.h
(isBitRangeSet): New function.
(unsetBitRange): New function.
* src/ByteArrayDiskWriter.h
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/ConsoleDownloadEngine.cc
(calculateStatistics): If nspeed < 0 then set nspeed to 0.
* src/DiskWriter.h
(messageDigest.h): New include.
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/ChunkChecksumValidator.h: New class.
* src/DiskAdaptorWriter.h: New class.
* src/prefs.h
(PREF_REALTIME_CHUNK_CHECKSUM): New definition.
(PREF_CHECK_INTEGRITY): New definition.
* src/HttpResponseCommand.cc
(handleDefaultEncoding): Added method "HEAD" handling.
Removed the call to
e->segmentMan->shouldCancelDownloadForSafety().
(handleOtherEncoding):
Added the call to
e->segmentMan->shouldCancelDownloadForSafety().
(createHttpDownloadCommand): Set maxDownloadSpeedLimit,
startupIdleTime, lowestDownloadSpeedLimit to command.
* src/SegmentMan.h
(getSegmentEntryByIndex): New function.
(getSegmentEntryByCuid): New function.
(getSegmentEntryIteratorByCuid): New function.
(diskWriter): DiskWriter -> DiskWriterHandle
(pieceHashes): New variable.
(chunkHashLength): New variable.
(digestAlgo): New variable.
(FindPeerStat): Removed.
(getPeerStat): Rewritten.
(markAllPiecesDone): New function.
(checkIntegrity): New function.
(tryChunkChecksumValidation): New function.
(isChunkChecksumValidationReady): New function.
* src/BitfieldMan.cc
(BitfieldMan): Initialized bitfieldLength, blocks to 0.
(BitfieldMan): Initialized blockLength, totalLength,
bitfieldLength,
blocks to 0.
(isBitRangeSet): New function.
(unsetBitRange): New function.
* src/FtpNegotiateCommand.cc
(executeInternal): Set maxDownloadSpeedLimit,
startupIdleTime, lowestDownloadSpeedLimit to command.
(recvSize): Added method "HEAD" handling.
Removed the call to
e->segmentMan->shouldCancelDownloadForSafety().
* src/AbstractSingleDiskAdaptor.cc
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/AbstractSingleDiskAdaptor.h
(sha1Sum): Renamed as messageDigest.
(messageDigest): New function.
* src/Util.h
(indexRange): New function.
* src/MetalinkEntry.cc
(MetalinkEntry): Initialized chunkChecksum to 0.
* src/ShaVisitor.cc
(~ShaVisitor): Removed the call to ctx.digestFree().
* src/SegmentMan.cc
(ChunkChecksumValidator.h): New include.
(SegmentMan): Initialized chunkHashLength to 0. Initialized
digestAlgo
to DIGEST_ALGO_SHA1.
(~SegmentMan): Removed diskWriter.
(FindSegmentEntryByIndex): Removed.
(FindSegmentEntryByCuid): Removed.
(checkoutSegment): Rewritten.
(findSlowerSegmentEntry): Rewritten.
(getSegment): Rewritten.
(updateSegment): Rewritten.
(completeSegment): Rewritten.
(markAllPiecesDone): New function.
(checkIntegrity): New function.
(isChunkChecksumValidationReady): New function.
(tryChunkChecksumValidation): New function.
* src/Xml2MetalinkProcessor.cc
(getEntry): Get size and set it to entry.
Get chunk checksum and set it to entry.
(getPieceHash): New function.
* src/Util.cc
(sha1Sum): Removed ctx.digestFree()
(fileChecksum): Removed ctx.digestFree()
(indexRange): New function.
* src/Request.cc
(METHOD_GET): New variable.
(METHOD_HEAD): New variable.
(Request): Added method.
* src/UrlRequestInfo.cc
(FatalException.h): New include.
(message.h): New include.
(operator<<): Added operator<< for class HeadResult.
(getHeadResult): New function.
(execute): Get filename and size in separate download engine.
* src/ChunkChecksumValidator.cc: New class.
* src/DownloadCommand.cc:
(DownloadCommand): Added peerStat.
(executeInternal): Use maxDownloadSpeedLimit member instead of
getting
the value from Option.
The buffer size is now 16KB.
Use peerStat member instead of getting it from SegmentMan.
Use startupIdleTime member instead of gettingit from Option.
Added chunk checksum validation.
* src/AbstractDiskWriter.cc
(AbstractDiskWriter): Removed ctx.
(~AbstractDiskWriter): Removed ctx.digestFree()
(writeDataInternal): Returns the return value of write.
(readDataInternal): Returns the return value of read.
(sha1Sum): Renamed as messageDigest
(messageDigest): New function.
* src/AbstractDiwkWriter.h
(messageDigest.h): Removed include.
(ctx): Removed.
(sha1Sum): Renamed as messageDigest
(messageDigest): New function.
* src/DefaultPieceStorage.h
(markAllPiecesDone): New function.
(checkIntegrity): New function.
* src/NullFileAllocationMonitor.h: New class.
2007-01-24 15:55:34 +00:00
|
|
|
{}
|
2007-01-08 00:13:25 +00:00
|
|
|
|
|
|
|
virtual ~MultiDiskAdaptor() {}
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual void initAndOpenFile() throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual void openFile() throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual void openExistingFile() throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
|
|
|
virtual void closeFile();
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual void onDownloadComplete() throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
2007-01-25 16:47:29 +00:00
|
|
|
virtual void writeData(const unsigned char* data, int32_t len,
|
2007-10-11 16:58:24 +00:00
|
|
|
int64_t offset) throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual int32_t readData(unsigned char* data, int32_t len, int64_t offset) throw(DlAbortEx*);
|
2007-01-08 00:13:25 +00:00
|
|
|
|
2007-01-11 16:32:31 +00:00
|
|
|
virtual bool fileExists();
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual string getFilePath()
|
|
|
|
{
|
2007-01-11 16:32:31 +00:00
|
|
|
return getTopDirPath();
|
|
|
|
}
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
virtual int64_t size() const throw(DlAbortEx*);
|
|
|
|
|
|
|
|
virtual FileAllocationIteratorHandle fileAllocationIterator();
|
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
MessageDigestHelper is introduced in order to simplify the use
of message digest. Removed repeated code.
The message digest algorithm is now specified by string, like
"sha1",
"md5".
* src/messageDigest.{h, cc}
* src/MessageDigestHelper.{h, cc}: New class.
* src/DefaultPieceStorage.cc
* src/DefaultBtContext.{h, cc}
(computeFastSet): New function.
(setInfoHash): Added for unit testing.
(setNumPieces): Added for unit testing.
* src/DefaultBtInteractive.cc
* src/BtPieceMessage.cc
* src/Peer.cc
* src/Checksum.h
* src/message.h
* src/IteratableChecksumValidator.h
* src/ChunkChecksumValidator.{h, cc}: Use
IteratableChecksumValidator
inside it.
* src/SegmentMan.{h, cc}
(checkIntegrity): Removed.
* src/IteratableChunkChecksumValidator.{h, cc}
* src/Util.h
(sha1Sum): Removed.
(simpleMessageDigest): Removed.
(fileChecksum): Removed.
(computeFastSet): Removed.
* src/ShaVisitor.cc
* src/ChunkChecksum.h
* src/DownloadCommand.cc
Removed messageDigest virtual functions.
* src/MultiDiskAdaptor.{h, cc}
* src/DiskAdaptor.h
* src/ByteArrayDiskWriter.h
* src/DiskWriter.h
* src/DiskAdaptorWriter.h
* src/AbstractSingleDiskAdaptor.{h, cc}
* src/AbstractDiskWriter.{h, cc}
Fixed comilation error when message digest is disabled.
* src/MetalinkEntry.{h, cc}
* src/MetalinkRequestInfo.cc
Removed srandom and random.
* src/SimpleRandomizer.h
Added size() virtual function to DiskAdaptor
* src/MultiDiskAdaptor.h
Fixed the bug that causes that files are not opened correctly in
multi-file torrent.
* src/TorrentRequestInfo.cc
* src/MultiDiskAdaptor.cc
Added SHA256 support
* src/messageDigest.cc
* src/Xml2MetalinkProcessor.cc
Show supported message digest algorithms
* src/main.cc
Updated contact info.
* src/main.cc
2007-08-08 14:40:11 +00:00
|
|
|
|
2006-11-08 16:25:38 +00:00
|
|
|
void setTopDir(const string& topDir) {
|
|
|
|
this->topDir = topDir;
|
|
|
|
}
|
|
|
|
|
|
|
|
const string& getTopDir() const {
|
|
|
|
return topDir;
|
|
|
|
}
|
|
|
|
|
2007-01-25 16:47:29 +00:00
|
|
|
void setPieceLength(int32_t pieceLength) {
|
2007-01-08 00:13:25 +00:00
|
|
|
this->pieceLength = pieceLength;
|
|
|
|
}
|
|
|
|
|
2007-01-25 16:47:29 +00:00
|
|
|
int32_t getPieceLength() const {
|
2007-01-08 00:13:25 +00:00
|
|
|
return pieceLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setOption(const Option* option) {
|
|
|
|
this->option = option;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Option* getOption() const {
|
|
|
|
return option;
|
|
|
|
}
|
2006-04-16 14:42:26 +00:00
|
|
|
};
|
|
|
|
|
2007-01-08 00:13:25 +00:00
|
|
|
typedef SharedHandle<MultiDiskAdaptor> MultiDiskAdaptorHandle;
|
|
|
|
|
2006-04-16 14:42:26 +00:00
|
|
|
#endif // _D_MULTI_DISK_ADAPTOR_H_
|