「🏗️」 wip: work in progress, not done yet.
This commit is contained in:
40
ex00/BitcoinExchange.hpp
Normal file
40
ex00/BitcoinExchange.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user