-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (38 loc) · 1 KB
/
main.cpp
File metadata and controls
49 lines (38 loc) · 1 KB
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
#include "logindialog.h"
#include "ddatastore.h"
#include "db_parser.h"
#include "product_parser.h"
#include "main_window.h"
#include <QApplication>
#include <iostream>
#include <fstream>
#include <set>
#include <sstream>
#include <vector>
#include <iomanip>
using namespace std;
int main(int argc, char* argv[]){
if(argc < 2){
cerr << "Please specify a database file" << endl;
}
/****************
* Declare your derived DataStore object here replacing
* DataStore type to your derived type
****************/
DDataStore ds;
DDataStore* ds_ptr=&ds;
// Instantiate the parser
DBParser parser;
// Instantiate the individual product parsers we want
parser.addProductParser(new ProductBookParser);
parser.addProductParser(new ProductClothingParser);
parser.addProductParser(new ProductMovieParser);
if( parser.parse(argv[1], ds) ){
cerr << "Error parsing!" << endl;
return 1;
}
QApplication app(argc, argv);
loginDialog login(ds_ptr);
login.exec();
return app.exec();
}