-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNameSurferDataBase.cpp
More file actions
70 lines (51 loc) · 1.39 KB
/
Copy pathNameSurferDataBase.cpp
File metadata and controls
70 lines (51 loc) · 1.39 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//Shamsadean Mirghani
//
//Project 2
//
#ifndef NAMESURFERDATACPP
#define NAMESURFERDATACPP
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <unistd.h>
#include<iostream>
#include<string>
#include "NameSurferDataBase.h"
using namespace std;
NameSurferDataBase::NameSurferDataBase(string filename) {
ifstream inFile;
inFile.open(filename);
string line;
string name;
string str;
string str1;
string str2;
string str3;
string str4;
string str5;
string str6;
string str7;
string str8;
string str9;
string str10;
stringstream tt;
while(inFile >> name >> str >> str1 >> str2 >> str3 >> str4 >> str5 >> str6 >> str7 >> str8 >> str9 >> str10) {
line = name + " " + str + " " + str1 + " " + str2 + " " + str3 + " " + str4 + " " + str5 + " " + str6 + " " + str7 + " " + str8 + " " + str9 + " " + str10;
//cout << line << endl;
transform(name.begin(), name.end(), name.begin(), ::tolower);
NameSurferEntry x(line);
//cout<<line<<endl;
database.InsertInOrder(x);
}
// database.PrintAll();
}
NameSurferEntry NameSurferDataBase::findEntry(string name) {
NameSurferEntry temp(name);
if(database.Search(temp)){
return temp;
}else{
return temp;
}
}
#endif