/* */ #include "PieceHashCheckIntegrityEntry.h" #include "RequestGroup.h" #include "IteratableChunkChecksumValidator.h" #include "DownloadContext.h" #include "PieceStorage.h" #include "a2functional.h" namespace aria2 { PieceHashCheckIntegrityEntry::PieceHashCheckIntegrityEntry( RequestGroup* requestGroup, std::unique_ptr nextCommand) : CheckIntegrityEntry{requestGroup, std::move(nextCommand)} { } PieceHashCheckIntegrityEntry::~PieceHashCheckIntegrityEntry() = default; bool PieceHashCheckIntegrityEntry::isValidationReady() { const std::shared_ptr& dctx = getRequestGroup()->getDownloadContext(); return dctx->isPieceHashVerificationAvailable(); } void PieceHashCheckIntegrityEntry::initValidator() { auto validator = make_unique( getRequestGroup()->getDownloadContext(), getRequestGroup()->getPieceStorage()); validator->init(); setValidator(std::move(validator)); } } // namespace aria2