-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
40 lines (32 loc) · 1.11 KB
/
main.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
#include "support_fn.hh"
#include "db_rw.hh"
#include <iostream>
#define uint unsigned int
using namespace std;
int main () {
cout<<endl;
cout<<"***************************************************************\n"
<<"* DB_ENGINE *\n"
<<"* --------- *\n"
<<"* Shivam Garg *\n"
<<"* 14074017 *\n"
<<"* ([email protected]) *\n"
<<"***************************************************************\n";
cout<<" PROGRAM SUCCESSFULLY STARTED.\n\n";
// create prior DB from db_backup
read_db_dat();
// main program loop
cout<<"> YOUR QUERIES HERE: ";
while (1) {
cout<<"\n>>> ";
string query;
cin.clear();
fflush(stdin);
query.clear();
getline (cin, query, ';');
// query was successful write it to db_backup
int type = parser(query);
if (type == 1 || type == 2)
write_db_dat(query);
}
}