aboutsummaryrefslogtreecommitdiff
path: root/HTTPFileReader.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 15:48:14 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 15:48:14 +0200
commitd8289105193707daede1a5b59137f18e20f20aeb (patch)
tree939908b9c4c6f7aaef8aa61ee2e04be3e85610b6 /HTTPFileReader.cpp
parent76e61d68bbf568ec0d7fc4632e52d4de5496b003 (diff)
(2/2) rename
Diffstat (limited to 'HTTPFileReader.cpp')
-rw-r--r--HTTPFileReader.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/HTTPFileReader.cpp b/HTTPFileReader.cpp
new file mode 100644
index 0000000..d7f5dd4
--- /dev/null
+++ b/HTTPFileReader.cpp
@@ -0,0 +1,26 @@
+#include <cpr/cpr.h>
+
+#include "HTTPFileReader.h"
+
+HTTPFileReader HTTPFileReader::instance(protocol);
+
+void HTTPFileReader::open(const std::string url) {
+ _res = cpr::Get(cpr::Url{url});
+}
+
+void HTTPFileReader::close() { }
+
+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() { }
+