lunch-rest/main.cpp

35 lines
1.2 KiB
C++
Raw Normal View History

2020-09-14 22:55:03 +00:00
#include "parser.hpp"
#include "menu.hpp"
#include "meal.hpp"
#include "parsers/parsers.hpp"
#include <iostream>
#include <memory>
std::vector<std::string> days = {"MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"};
int main() {
std::vector<std::unique_ptr<LunchRest::Parser>> parsers;
parsers.emplace_back(new LunchRest::UDrevakaParser());
parsers.emplace_back(new LunchRest::PadagaliParser());
parsers.emplace_back(new LunchRest::LightOfIndiaParser());
parsers.emplace_back(new LunchRest::UKarlaParser());
// add parsers here
for(auto &x : parsers) {
x->parse();
std::cout << "RESTAURANT " << x->getRestaurant() << std::endl;
for(unsigned long int i = 0; i < x->getMenus().size(); i++) {
auto y = x->getMenus()[i];
if(y.isValid()) {
std::cout << days[i] << std::endl;
auto soupInd = y.getSoupIndex();
std::cout << "\t" << y.getMeals()[soupInd] << std::endl;
for(unsigned long int i = 0; i < y.getMeals().size(); i++) {
if(i != soupInd)
std::cout << "\t" << y.getMeals()[i] << std::endl;
}
}
}
}
}