-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileInfo.h
51 lines (37 loc) · 1.36 KB
/
FileInfo.h
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
/****************************************************************
FILE: FileInfo.h
AUTHOR: Tommy Deng
s199762338
PURPOSE: Handles the reading and writing of data to and from
text files.
****************************************************************/
#ifndef FILEINFO_H
#define FILEINFO_H
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include "Plane.h"
using namespace std;
class FileInfo
{
public:
// Default constructor
FileInfo();
// Destructor
~FileInfo();
// load data from file
void readPassengers(const vector<Plane*> *plane);
void readFlightSchedule(const vector<Plane*> *plane);
void readDestination(const vector<Plane*> *plane);
// write data to file
void writePassengers(const vector<Plane*> *plane, int flightId, int seatId, bool append);
void setPassengerData(const vector<Plane*> *plane, int flightId, int seatId, bool reserved, string firstName, string lastName, string address, string phone);
void setBoardingPData(const vector<Plane*> *plane, int flightId, int seatId, string passType, string from, string toCity, string toCountry, string drink, string meal);
// upon exiting the program, clear and then edit the passenger file (sorted)
void updateFile(const vector<Plane*> *plane, int numPlanes);
void clearFile();
string parseUnderscore(string s);
string parseSpace(string s);
};
#endif // !FILEINFO_H