Fix crash if text containing \n is printed at nonzero x
[lsnes.git] / include / core / fileupload.hpp
blob64c121fc6424cd1d3eef9d24ff8978d784957d81
1 #ifndef _fileupload__hpp__included__
2 #define _fileupload__hpp__included__
4 #include "library/threads.hpp"
5 #include "library/httpreq.hpp"
6 #include "library/httpauth.hpp"
7 #include <string>
8 #include <list>
9 #include <vector>
11 struct file_upload
13 //Variables.
14 std::string base_url;
15 std::vector<char> content;
16 std::string filename;
17 std::string title;
18 std::string description;
19 std::string gamename;
20 bool hidden;
21 //Ctor
22 file_upload();
23 ~file_upload();
24 //Lauch.
25 void do_async();
26 void _do_async();
27 void cancel();
28 //Status.
29 std::list<std::string> get_messages();
30 int get_progress_ppm(); //-1 => No progress.
31 volatile bool finished;
32 volatile bool success;
33 std::string final_url;
34 //Vars.
35 dh25519_http_auth* dh25519;
36 http_async_request* req;
37 std::list<std::string> msgs;
38 threads::lock m;
39 void add_msg(const std::string& msg);
42 void get_dh25519_pubkey(uint8_t* out);
44 #endif