From 5cd0108f93d9b91e30b74ec92e66571493a2b997 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 8 Apr 2010 12:54:14 +0000 Subject: 2010-04-08 Tatsuhiro Tsujikawa Added --save-session=FILE option. This option saves error/unfinished downloads to FILE on exit. You can pass this output file to aria2c with -i option on restart. Please note that downloads added by aria2.addTorrent and aria2.addMetalink XML-RPC method are not saved. * src/BtPostDownloadHandler.cc * src/DownloadResult.h * src/Makefile.am * src/MetadataInfo.cc * src/MetadataInfo.h * src/Metalink2RequestGroup.cc * src/MetalinkPostDownloadHandler.cc * src/MultiUrlRequestInfo.cc * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/SessionSerializer.cc * src/SessionSerializer.h * src/UTMetadataPostDownloadHandler.cc * src/download_helper.cc * src/download_helper.h * src/prefs.cc * src/prefs.h * src/usage_text.h * test/Makefile.am * test/SessionSerializerTest.cc * test/XmlRpcMethodTest.cc * test/serialize_session.meta4 --- src/SessionSerializer.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/SessionSerializer.h (limited to 'src/SessionSerializer.h') diff --git a/src/SessionSerializer.h b/src/SessionSerializer.h new file mode 100644 index 00000000..53ca392b --- /dev/null +++ b/src/SessionSerializer.h @@ -0,0 +1,65 @@ +/* */ +#ifndef _D_SESSION_SERIALIZER_H_ +#define _D_SESSION_SERIALIZER_H_ + +#include "common.h" + +#include +#include + +#include "SharedHandle.h" + +namespace aria2 { + +class RequestGroupMan; + +class SessionSerializer { +private: + SharedHandle _rgman; + bool _saveError; + bool _saveInProgress; + bool _saveWaiting; +public: + SessionSerializer(const SharedHandle& requestGroupMan); + + bool save(const std::string& filename) const; + + void save(std::ostream& out) const; +}; + +} // namespace aria2 + +#endif // _D_SESSION_SERIALIZER_H_ -- cgit