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 --- FileReader.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'FileReader.h') diff --git a/FileReader.h b/FileReader.h index f896ec8..ee6e550 100644 --- a/FileReader.h +++ b/FileReader.h @@ -5,21 +5,20 @@ class FileReaderFactory; #include class FileReader { -protected: - virtual void open(const std::string url) = 0; -public: - virtual void close() = 0; - virtual const std::string read() = 0; + friend class FileReaderFactory; +protected: + FileReader(const std::string & url); public: virtual ~FileReader() = default; protected: - FileReader() = default; - virtual FileReader * clone() const = 0; + virtual void open() = 0; +public: + virtual void close() = 0; + virtual const std::string read() = 0; protected: - FileReader(const std::string protocol); - friend FileReaderFactory; + const std::string url = ""; }; -- cgit v1.2.3