-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrojanshop.cpp
54 lines (41 loc) · 1000 Bytes
/
trojanshop.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "login.h"
#include <QApplication>
#include <string>
#include <iostream>
#include <fstream>
#include <set>
#include <sstream>
#include <vector>
#include <iomanip>
#include <map>
#include "product.h"
#include "db_parser.h"
#include "product_parser.h"
#include "util.h"
#include "msort.h"
#include "login.h"
#include "my_datastore.h"
using namespace std;
int main(int argc, char* argv[]){
if(argc < 2){
cerr << "Please specify a database file" << endl;
}
MyDataStore* ds = new MyDataStore;
// Instantiate the parser
DBParser parser;
// Instantiate the individual product parsers we want
parser.addProductParser(new ProductBookParser);
parser.addProductParser(new ProductClothingParser);
parser.addProductParser(new ProductMovieParser);
// Now parse the database to populate the DataStore
if( parser.parse(argv[1], *ds) ){
cerr << "Error parsing!" << endl;
return 1;
}
QApplication app(argc, argv);
LogIn login_window(ds);
login_window.show();
app.exec();
delete ds;
return 0;
}