/* */ #include "AutoSaveCommand.h" #include "DownloadEngine.h" #include "RequestGroupMan.h" namespace aria2 { AutoSaveCommand::AutoSaveCommand (cuid_t cuid, DownloadEngine* e, time_t interval) : TimeBasedCommand(cuid, e, interval, true) {} AutoSaveCommand::~AutoSaveCommand() {} void AutoSaveCommand::preProcess() { if(getDownloadEngine()->getRequestGroupMan()->downloadFinished() || getDownloadEngine()->isHaltRequested()) { enableExit(); } } void AutoSaveCommand::process() { getDownloadEngine()->getRequestGroupMan()->save(); } } // namespace aria2