-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCovidCollection.h
More file actions
47 lines (36 loc) · 1.06 KB
/
CovidCollection.h
File metadata and controls
47 lines (36 loc) · 1.06 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
//Name: Shayan Chabook
//student ID: 159844208
//email:schabook@myseneca.ca
//7/17/2022
#ifndef SDDS_COVIDCOLLECTION_H
#define SDDS_COVIDCOLLECTION_H
#include <iostream>
#include <string>
#include <vector>
#include <list>
namespace sdds {
struct Covid {
std::string country;
std::string city;
std::string variant;
int numOfCases;
int year;
int m_deaths;
};
class CovidCollection {
private:
std::vector<Covid> covid;
void trim(std::string& str);
void trim(std::string& str, std::string& line, int n);
public:
CovidCollection(std::string filename);
void display(std::ostream& out) const;
void sort(std::string criteria);
void cleanList();
bool inCollection(std::string variant) const;
std::list<Covid> getListForCountry(std::string country) const;
std::list<Covid> getListForVariant(std::string variant) const;
};
std::ostream& operator<<(std::ostream& out, const Covid& theCovid);
}
#endif //SDDS_COVIDCOLLECTION_H