aboutsummaryrefslogtreecommitdiff
path: root/HTTPFile.cpp
blob: 6da0919782e40fd5ebec8aa752e0add85a86d46c (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() {
	this->close();
}

HTTPFile * HTTPFile::clone() const {
	return new HTTPFile(this);
}

HTTPFile::HTTPFile(const HTTPFile *) : FileStrategy() { }