34 lines
741 B
C++
34 lines
741 B
C++
#ifndef LUNCH_REST_PARSER_H
|
|
#define LUNCH_REST_PARSER_H
|
|
|
|
#include "menu.hpp"
|
|
|
|
namespace LunchRest {
|
|
class Parser {
|
|
public:
|
|
Parser() = delete;
|
|
Parser(const std::string &url, const std::string &restaurant) :
|
|
_url(url), _restaurant(restaurant) {}
|
|
virtual ~Parser() = default;
|
|
const std::vector<Menu> &getMenus() {
|
|
return menus;
|
|
}
|
|
const std::string &getRestaurant() {
|
|
return _restaurant;
|
|
}
|
|
virtual void parse() = 0;
|
|
void clearMenus() {
|
|
menus.clear();
|
|
menus.resize(5);
|
|
for(auto &x : menus)
|
|
x.setInvalidMenu();
|
|
}
|
|
protected:
|
|
std::string _url;
|
|
std::string _restaurant;
|
|
std::vector<Menu> menus;
|
|
};
|
|
} // end of namespace LunchRest
|
|
|
|
#endif
|