1
0

」 feat: finished ex00

This commit is contained in:
2025-06-03 11:41:31 +02:00
parent 003d8663d0
commit de9bd7ed8d
5 changed files with 166 additions and 18 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/21 10:38:49 by adjoly #+# #+# */
/* Updated: 2025/05/30 20:31:26 by adjoly ### ########.fr */
/* Updated: 2025/06/03 11:22:28 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,6 +16,7 @@
#include <iostream>
#include <map>
#include <string>
#include <utility>
#define range(x) \
x.begin(); \
@ -89,13 +90,31 @@ class CsvParser {
class BitcoinExchange {
public:
BitcoinExchange(void);
BitcoinExchange(char *av);
BitcoinExchange(const BitcoinExchange &);
~BitcoinExchange(void);
BitcoinExchange &operator=(const BitcoinExchange &);
void print(void);
protected:
private:
void _nextToken(void);
std::string _peekToken(void) const;
std::ifstream _is;
std::string _filename;
std::string _line;
CsvParser *_csv;
std::pair<Date, float> _parseLine(void);
void _printPair(std::pair<Date, float>);
};
class CompareDate {
public:
CompareDate(Date);
bool operator()(const std::pair<Date, float> &pair) const;
private:
Date _date;
};