diff options
Diffstat (limited to 'LocalFileReader.h')
-rw-r--r-- | LocalFileReader.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/LocalFileReader.h b/LocalFileReader.h new file mode 100644 index 0000000..6ea4f84 --- /dev/null +++ b/LocalFileReader.h @@ -0,0 +1,30 @@ +#pragma once + +#include <fstream> + +#include "FileReader.h" + +class LocalFileReader : FileReader { +protected: + virtual void open(const std::string url); +public: + virtual void close(); + virtual const std::string read(); + +public: + virtual ~LocalFileReader(); + +private: + LocalFileReader(const LocalFileReader *); + virtual LocalFileReader * clone() const; + +private: + using FileReader::FileReader; + constexpr static const std::string protocol = "file://"; + static LocalFileReader instance; + +private: + std::ifstream * file = nullptr; + std::string * content = nullptr; +}; + |