lsnes/include/core/filedownload.hpp

40 lines
783 B
C++
Raw Normal View History

2013-11-11 01:49:06 +02:00
#ifndef _filedownload__hpp__included__
#define _filedownload__hpp__included__
#include "library/threads.hpp"
2013-11-11 01:49:06 +02:00
#include "library/httpreq.hpp"
2014-05-01 13:56:33 +03:00
#include "library/urirewrite.hpp"
2013-11-11 01:49:06 +02:00
#include <string>
#include <list>
#include <vector>
2014-06-08 04:15:01 +03:00
class loaded_rom;
2013-11-11 01:49:06 +02:00
struct file_download
{
//Variables.
std::string url;
std::string target_slot;
//Ctor
file_download();
~file_download();
//Lauch.
2014-06-08 04:15:01 +03:00
void do_async(loaded_rom& rom);
2013-11-11 01:49:06 +02:00
void cancel();
//Status.
volatile bool finished; //This signals download finishing, call finish().
std::string errormsg;
http_async_request req;
std::string statusmsg();
threads::cv cond;
threads::lock m;
2013-11-11 01:49:06 +02:00
//Internal.
2014-06-08 04:15:01 +03:00
void _do_async(loaded_rom& rom);
2013-11-11 01:49:06 +02:00
std::string tempname;
std::string tempname2;
};
2014-05-01 13:56:33 +03:00
extern urirewrite::rewriter lsnes_uri_rewrite;
2013-11-11 01:49:06 +02:00
#endif