/* */ #include "ChecksumCheckIntegrityEntry.h" #include "RequestGroup.h" #include "Command.h" #include "SingleFileDownloadContext.h" #include "IteratableChecksumValidator.h" #include "DownloadEngine.h" #include "PieceStorage.h" ChecksumCheckIntegrityEntry::ChecksumCheckIntegrityEntry(RequestGroup* requestGroup, Command* nextCommand): CheckIntegrityEntry(requestGroup, nextCommand) {} ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() {} bool ChecksumCheckIntegrityEntry::isValidationReady() { SingleFileDownloadContextHandle dctx = _requestGroup->getDownloadContext(); return !dctx.isNull() && dctx->getChecksum().size() > 0 && dctx->getChecksumHashAlgo().size() > 0; } void ChecksumCheckIntegrityEntry::initValidator() { _validator = new IteratableChecksumValidator(_requestGroup->getDownloadContext(), _requestGroup->getPieceStorage()); _validator->init(); } Commands ChecksumCheckIntegrityEntry::onDownloadFinished(DownloadEngine* e) { return Commands(); } Commands ChecksumCheckIntegrityEntry::onDownloadIncomplete(DownloadEngine* e) { return Commands(); }