41 lines
894 B
C++
41 lines
894 B
C++
#include <iostream>
|
|
#include <fstream>
|
|
#include <cstdlib>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
class Date {
|
|
public:
|
|
Date(void);
|
|
Date(const std::string);
|
|
Date(const Date &);
|
|
Date &operator=(const Date &);
|
|
~Date(void);
|
|
|
|
bool operator==(const Date &) const;
|
|
bool operator!=(const Date &) const;
|
|
|
|
bool operator<(const Date &) const;
|
|
bool operator>(const Date &) const;
|
|
|
|
bool operator<=(const Date &) const;
|
|
bool operator>=(const Date &) const;
|
|
|
|
private:
|
|
unsigned long long _value;
|
|
};
|
|
|
|
class BitcoinExchange {
|
|
public:
|
|
BitcoinExchange(void) {parseData("data.csv");}
|
|
BitcoinExchange(const BitcoinExchange &other) {this->_data = other._data;}
|
|
BitcoinExchange &operator=(const BitcoinExchange &other) {this->_data = other._data; return *this;}
|
|
~BitcoinExchange(void) {}
|
|
|
|
void parseData(const std::string filename);
|
|
void str(std::string input);
|
|
|
|
private:
|
|
std::map<Date, double> _data;
|
|
};
|