From bc02054d56118110a36aea72d21f9d5e73d07d1f Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 22 Oct 2024 14:00:41 +0200 Subject: refactor file reading factory --- HTTPFileReader.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'HTTPFileReader.cpp') diff --git a/HTTPFileReader.cpp b/HTTPFileReader.cpp index d7f5dd4..191e212 100644 --- a/HTTPFileReader.cpp +++ b/HTTPFileReader.cpp @@ -2,10 +2,10 @@ #include "HTTPFileReader.h" -HTTPFileReader HTTPFileReader::instance(protocol); +using namespace std; -void HTTPFileReader::open(const std::string url) { - _res = cpr::Get(cpr::Url{url}); +void HTTPFileReader::open() { + _res = cpr::Get(cpr::Url{this->url}); } void HTTPFileReader::close() { } @@ -14,13 +14,3 @@ const std::string HTTPFileReader::read() { return _res.text.data(); } -HTTPFileReader::~HTTPFileReader() { - this->close(); -} - -HTTPFileReader * HTTPFileReader::clone() const { - return new HTTPFileReader(this); -} - -HTTPFileReader::HTTPFileReader(const HTTPFileReader *) : FileReader() { } - -- cgit v1.2.3