/* */ #ifndef _D_CHECK_INTEGRITY_ENTRY_H_ #define _D_CHECK_INTEGRITY_ENTRY_H_ #include "RequestGroupEntry.h" #include "ProgressAwareEntry.h" #include namespace aria2 { class IteratableValidator; class DownloadEngine; class FileAllocationEntry; class CheckIntegrityEntry : public RequestGroupEntry, public ProgressAwareEntry { protected: SharedHandle _validator; void proceedFileAllocation(std::deque& commands, const SharedHandle& entry, DownloadEngine* e); public: CheckIntegrityEntry(RequestGroup* requestGroup, Command* nextCommand = 0); virtual ~CheckIntegrityEntry(); virtual uint64_t getTotalLength(); virtual off_t getCurrentLength(); virtual void validateChunk(); virtual bool finished(); virtual bool isValidationReady() = 0; virtual void initValidator() = 0; virtual void onDownloadFinished(std::deque& commands, DownloadEngine* e) = 0; virtual void onDownloadIncomplete(std::deque& commands, DownloadEngine* e) = 0; void cutTrailingGarbage(); }; typedef SharedHandle CheckIntegrityEntryHandle; typedef std::deque CheckIntegrityEntries; } // namespace aria2 #endif // _D_CHECK_INTEGRITY_ENTRY_H_