diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-18 15:43:25 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-18 15:43:25 +0200 |
commit | 76e61d68bbf568ec0d7fc4632e52d4de5496b003 (patch) | |
tree | 92a2dc9b12a542456bdc154f44deb34925883210 /FileReader.cpp | |
parent | 3f63576819151ff15237a9b4f0651c538cfef067 (diff) |
(1/2) rename
Diffstat (limited to 'FileReader.cpp')
-rw-r--r-- | FileReader.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/FileReader.cpp b/FileReader.cpp index d2d888f..4b72b11 100644 --- a/FileReader.cpp +++ b/FileReader.cpp @@ -1,27 +1,27 @@ #include <memory> +#include "FileReaderFactory.h" #include "FileReader.h" -#include "FileStrategy.h" using namespace std; -unique_ptr<FileStrategy> FileReader::open(const std::string url) { - FileStrategy * reader = find_reader(url)->clone(); +unique_ptr<FileReader> FileReaderFactory::open(const std::string url) { + FileReader * reader = find_reader(url)->clone(); reader->open(url); - return unique_ptr<FileStrategy>(reader); + return unique_ptr<FileReader>(reader); } -void FileReader::register_strategy(const std::string type, const FileStrategy * node) { +void FileReaderFactory::register_strategy(const std::string type, const FileReader * node) { static FactoryMap & map = get_map(); map[type] = node; } -FactoryMap & FileReader::get_map() { +FactoryMap & FileReaderFactory::get_map() { static FactoryMap map; return map; } -const FileStrategy * FileReader::find_reader(const std::string type) { +const FileReader * FileReaderFactory::find_reader(const std::string type) { static FactoryMap & map = get_map(); // try to find protocol by prefix |