[Compbench-devel] CompBenchmarks++/libcompbenchmarks/System System-Thread-Download.cpp, NONE, 1.1 S
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-05-16 09:47:05
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29757 Added Files: System-Thread-Download.cpp System-Thread-Download.h Log Message: First import. --- NEW FILE: System-Thread-Download.cpp --- /* ---------------------------------------------------------------------------- $Id: System-Thread-Download.cpp,v 1.1 2007/05/16 09:46:59 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <System/System-Thread-Download.h> #include <System/System.h> using namespace CBM; SystemThreadDownload::SystemThreadDownload(std::string _url, std::string _file, int _filesize) { url=_url; file=_file; filesize=_filesize; } void SystemThreadDownload::routine(void) { cbmSystem->downloadNow(url, file); } float SystemThreadDownload::Progress(void) { int currentsize = cbmSystem->fileSize(file); return((currentsize*100.0)/filesize); } SystemThreadDownload::~SystemThreadDownload() { } --- NEW FILE: System-Thread-Download.h --- /* ---------------------------------------------------------------------------- $Id: System-Thread-Download.h,v 1.1 2007/05/16 09:46:59 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMSYSTEM_THREAD_DOWNLOAD #define H_CBMSYSTEM_THREAD_DOWNLOAD 1 #include <Base/Thread.h> #include <string> namespace CBM { class SystemThreadDownload : public ThreadAction { private: std::string url; std::string file; int filesize; protected: virtual void routine(void); public: SystemThreadDownload(std::string _url, std::string _file, int _filesize); virtual float Progress(void); ~SystemThreadDownload(); }; } #endif |