2 #include "core/oxygine.h" 3 #include "closure/closure.h" 11 typedef Closure<void (MyHttp*)> DownloadDoneCallback;
12 typedef Closure<void (MyHttp*)> ErrorCallback;
13 typedef Closure<void (MyHttp*, int)> ProgressCallback;
27 DownloadDoneCallback _cbDone;
28 ProgressCallback _cbProgress;
29 ErrorCallback _cbError;
31 void getFile(
const std::string& url,
const std::string& name);
32 void get(
const std::string& url);
33 void post(
const std::string& url,
const char* data,
int size);
36 std::vector<unsigned char>& getBuffer() {
return _data;}
37 status getStatus()
const {
return _status;}
38 unsigned int getTotalSize()
const;
39 unsigned int getReceivedSize()
const;
40 int getResponseCode()
const;
44 enum METHOD {GETFILE, GET, POST};
46 static int _gotHeaders(
void* systemData,
void* userData);
47 static int _gotData(
void* systemData,
void* userData);
48 static int _delayedError(
void* systemData,
void* userData);
54 void gotData(
int size);
55 void progress(
int size);
63 std::vector<unsigned char> _tempBuffer;
64 std::vector<unsigned char> _data;
72 void makeSingleHttpAsyncGetRequest(
const char* url);
73 void makeSingleHttpAsyncPostRequest(
const char* url,
const char* data,
int size);
Definition: FileSystem.h:12