blob: fded2d3a479e45b9ebb9dc0d2248b83709bc3d74 (
plain)
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
|
#include <cpr/cpr.h>
#include "HTTPFile.h"
HTTPFile HTTPFile::instance(protocol);
void HTTPFile::open(const std::string url) {
_res = cpr::Get(cpr::Url{url});
}
void HTTPFile::close() { }
const std::string HTTPFile::read() {
return _res.text.data();
}
HTTPFile::~HTTPFile() {
close();
}
HTTPFile * HTTPFile::clone() const {
return new HTTPFile(this);
}
HTTPFile::HTTPFile(const HTTPFile *) : FileStrategy() { }
|