forked from openframeworks/openFrameworks
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathofxEmscriptenURLFileLoader.h
More file actions
29 lines (27 loc) · 1.02 KB
/
ofxEmscriptenURLFileLoader.h
File metadata and controls
29 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* ofxEmscriptenURLFileLoader.h
*
* Created on: May 30, 2014
* Author: arturo
*/
#pragma once
#include "ofURLFileLoader.h"
class ofxEmscriptenURLFileLoader: public ofBaseURLFileLoader {
public:
ofxEmscriptenURLFileLoader();
virtual ~ofxEmscriptenURLFileLoader();
ofHttpResponse get(const std::string & url);
int getAsync(const std::string & url, const std::string & name=""); // returns id
ofHttpResponse saveTo(const std::string & url, const of::filesystem::path & path);
int saveAsync(const std::string & url, const of::filesystem::path & path);
ofHttpResponse handleRequest(const ofHttpRequest & request);
int handleRequestAsync(const ofHttpRequest & request);
void remove(int id);
void clear();
void stop();
private:
static void onload_cb(unsigned, void* request, void* data, unsigned int size);
static void onerror_cb(unsigned, void* request, int status, const char* msg);
static void onload_file_cb(unsigned, void* request, const char* file);
static void onerror_file_cb(unsigned, void* request, int status);
};