Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Together these structs create a 'vehicle' object which contains the vehicle specification as well as owner information. Date was included in this header file
- as date in this case is a property of the vehicle. We have also grouped file I/O functions within this header as these functions are connected to gathering the information
- fed into the vehicle object
- */
- #ifndef INVDATATYPES_H
- #define INVDATATYPES_H
- #include <string>
- struct date
- {
- std::string timeStamp;
- int month;
- int day;
- int year;
- double jdn; ///julian date
- /// function converts string 05:11:2016 into month,day,year ints
- void dateToNumber(const std::string& timeStamp, int& month, int& day, int& year);
- void dateToJulian(int& month, int& day, int& year, double& jdn);
- ///ctor
- date();
- };
- struct options
- {
- std::string seat;
- int wheel_Size;
- std::string stereo;
- std::string winterPackage;
- ///ctor
- options();
- };
- struct owner
- {
- char ownerType;
- std::string first_name;
- std::string last_name;
- std::string address;
- std::string dealerZip;
- ///ctor
- owner();
- };
- struct vehicleSpecifications
- {
- std::string modelName;
- int engine_cyl;
- std::string transmission;
- date manufactureDate;
- date shipDate;
- options vehicleOptions;
- ///ctor
- vehicleSpecifications();
- };
- struct vehicle
- {
- int ID;
- vehicleSpecifications thisVehicle;
- owner thisOwner;
- ///our top level function for sorting by date
- static void sortByManufactureDate(vehicle vehiclearray[], int& numberofVehicles);
- ///ctor
- vehicle();
- };
- ///+ These function are file I/O functions
- void vehicleReadIn(std::ifstream& fin, vehicle *newVehicle, int& numberofVehicles);
- void optionsReadIn(std::ifstream& fin, vehicle *newVehicle, int& numberofVehicles);
- void ownerReadIn(std::ifstream& fin, vehicle *newVehicle, int& numberofVehicles);
- void fileHandle(std::ifstream& fin, std::string filename);
- ///- end file IO functions
- #endif // INVDATATYPES_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement