#include #include "Exception.h" #include "FileReader.h" #include "Museum.h" #include "Deserializer.h" #include "Parser.h" #include "View.h" #include "ViewController.h" using namespace std; static unique_ptr open(const char * url) noexcept { try { unique_ptr file = FileReader::open(url); return file; } catch (Exception & e) { printf("file open error: %s\n", e.what()); exit(EXIT_FAILURE); } } static void parse(FileStrategy & file, Deserializer & deserializer, const char * url) noexcept { try { Parser::parse(file, deserializer); } catch (Exception & e) { printf("parser error: %s (%s)\n", e.what(), url); exit(EXIT_FAILURE); } } int main(int argc, char** argv) { Museum museum {}; museum.set_pause(true); Deserializer deserializer { museum }; for (int i = 1; i < argc; i++) { char * url = argv[i]; unique_ptr file = open(url); parse(*file, deserializer, url); } View view { museum }; museum.set_pause(false); while (view.open); return EXIT_SUCCESS; }