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 /Parser.cpp | |
parent | 3f63576819151ff15237a9b4f0651c538cfef067 (diff) |
(1/2) rename
Diffstat (limited to 'Parser.cpp')
-rw-r--r-- | Parser.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,16 +1,16 @@ #include <algorithm> -#include "Parser.h" +#include "ParserFactory.h" #include "Exception.h" -void Parser::parse(FileStrategy & file, Deserializer & deserializer) { - auto & col = Parser::get_collection(); +void ParserFactory::parse(FileReader & file, MuseumDeserializer & deserializer) { + auto & col = ParserFactory::get_collection(); if (col.size() < 1) throw Exception("no parsers registered"); unsigned int best_score = 0; - ParserStrategy * best_strategy = nullptr; - for (ParserStrategy * strategy : col) { + Parser * best_strategy = nullptr; + for (Parser * strategy : col) { unsigned int score = strategy->heuristic(file); if (score <= best_score) continue; @@ -24,8 +24,8 @@ void Parser::parse(FileStrategy & file, Deserializer & deserializer) { best_strategy->parse(file, deserializer); } -void Parser::register_strategy(ParserStrategy * ps) { - auto & col = Parser::get_collection(); +void ParserFactory::register_strategy(Parser * ps) { + auto & col = ParserFactory::get_collection(); if (std::find(col.begin(), col.end(), ps) != col.end()) return; col.push_back(ps); } |