diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:00:41 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:00:41 +0200 |
commit | bc02054d56118110a36aea72d21f9d5e73d07d1f (patch) | |
tree | 2fc49dd3f93307df6242b8e63bca0e26b2e62168 /HTTPFileReader.cpp | |
parent | fab0fccc0aaa18e915bcd08e81e5a04177e435cd (diff) |
refactor file reading factory
Diffstat (limited to 'HTTPFileReader.cpp')
-rw-r--r-- | HTTPFileReader.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
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() { } - |