#include <iostream>
#include <vector>
#include <fstream>
#include <time.h>
#include <chrono>
#include <sstream>
#include <algorithm>
class Clock {
private:
std::chrono::high_resolution_clock::time_point start;
public:
void Reset() {
start = std::chrono::high_resolution_clock::now();
}
double CurrentTime() {
auto end = std::chrono::high_resolution_clock::now();
double elapsed_us = std::chrono::duration std::micro>(end -start).count();
return elapsed_us;
}
};
class books{
private:
std::string type;
int ISBN;
public:
void setIsbn(int x) {
ISBN = x;
}
void setType(std::string y) {
type = y;
}
int putIsbn() {
return ISBN;
}
std::string putType() {
return type;
}
};
std::ostream &operator <<(std::ostream &out,std::vector &myvector) {
for (int i = 0; i < myvector.size(); i++) {
out << myvector[i].putIsbn() << std::endl;
out << myvector[i].putType() << std::endl;
}
return out;
}
int setVectorFile(std::string file, std::vector *myvector){
std::ifstream myfile;
myfile.open(file);
if (!myfile) {
std::cout << “Error: cannot open file ” << file<< std::endl;
return -1;
}
std::string character;
while (!myfile.eof()) {
books* pointer;
getline(myfile, character, ‘,’);
pointer = new books;
int x;
std::stringstream convertToInteger(character);
convertToInteger >> x;
pointer -> setIsbn(x);
getline(myfile,
PayPal Gateway not configured
PayPal Gateway not configured