From d8289105193707daede1a5b59137f18e20f20aeb Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 18 Oct 2024 15:48:14 +0200 Subject: (2/2) rename --- FileReader.h | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'FileReader.h') diff --git a/FileReader.h b/FileReader.h index 0829985..f896ec8 100644 --- a/FileReader.h +++ b/FileReader.h @@ -1,27 +1,25 @@ #pragma once -#include -#include -#include - -#include "FileReader.h" +class FileReaderFactory; -using FactoryMap = std::map; +#include -class FileReaderFactory { +class FileReader { +protected: + virtual void open(const std::string url) = 0; public: - static std::unique_ptr open(const std::string url); + virtual void close() = 0; + virtual const std::string read() = 0; -private: - FileReaderFactory() = default; - virtual ~FileReaderFactory() = default; +public: + virtual ~FileReader() = default; -private: - static void register_strategy(const std::string type, const FileReader * node); - static FactoryMap & get_map(); - static const FileReader * find_reader(const std::string type); +protected: + FileReader() = default; + virtual FileReader * clone() const = 0; -private: - friend FileReader; +protected: + FileReader(const std::string protocol); + friend FileReaderFactory; }; -- cgit v1.2.3