/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* BitcoinExchange.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/21 10:38:49 by adjoly #+# #+# */ /* Updated: 2025/05/30 20:31:26 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include #include #include #include #define range(x) \ x.begin(); \ it != x.end(); \ it++ #define auto __auto_type typedef unsigned int uint32_t; typedef unsigned short uint16_t; struct token {}; void _log(std::string emoji, std::string what, std::string who, std::string str); class Date { public: Date(void); Date(std::string); Date(const Date &); ~Date(void); Date &operator=(const Date &); uint32_t getYear(void) const; uint16_t getMonth(void) const; uint16_t getDay(void) 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; bool operator>=(const Date &) const; protected: private: static const uint32_t _d_in_m[12]; bool _isMonthValid(uint16_t) const; bool _isDayValid(uint16_t, uint16_t) const; uint32_t _year; uint16_t _month; uint16_t _day; }; std::ostream &operator<<(std::ostream &, const Date &); class CsvParser { public: CsvParser(void); CsvParser(const CsvParser &); ~CsvParser(void); CsvParser &operator=(const CsvParser &); std::map getCsv(void) const; protected: private: std::ifstream _is; std::string _filename; std::map _csv; }; class BitcoinExchange { public: BitcoinExchange(void); BitcoinExchange(const BitcoinExchange &); ~BitcoinExchange(void); BitcoinExchange &operator=(const BitcoinExchange &); protected: private: void _nextToken(void); std::string _peekToken(void) const; };