51 lines
1.0 KiB
C++
51 lines
1.0 KiB
C++
#include <exception>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
#include <sstream>
|
|
#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;
|
|
|
|
int getValue(void) const {return _value;}
|
|
|
|
private:
|
|
unsigned long long _value;
|
|
};
|
|
|
|
std::ostream &operator<<(std::ostream &, const Date &);
|
|
|
|
|
|
|
|
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 str(std::string input);
|
|
|
|
private:
|
|
void parseData(const std::string filename);
|
|
std::map<Date, double> _data;
|
|
};
|
|
|
|
|