From 1a511386b2d9887320d8a5aba61957df1a830a4f Mon Sep 17 00:00:00 2001 From: lfirmin Date: Thu, 2 Apr 2026 09:44:09 +0200 Subject: [PATCH] push --- cpp_09/BitcoinExchange.cpp | 0 cpp_09/BitcoinExchange.hpp | 26 ++++++++++++++++++++++++++ ex00/Makefile | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 cpp_09/BitcoinExchange.cpp create mode 100644 cpp_09/BitcoinExchange.hpp diff --git a/cpp_09/BitcoinExchange.cpp b/cpp_09/BitcoinExchange.cpp new file mode 100644 index 0000000..e69de29 diff --git a/cpp_09/BitcoinExchange.hpp b/cpp_09/BitcoinExchange.hpp new file mode 100644 index 0000000..62855e5 --- /dev/null +++ b/cpp_09/BitcoinExchange.hpp @@ -0,0 +1,26 @@ +#ifndef BITCOINEXCHANGE_HPP +#define BITCOINEXCHANGE_HPP + +#include +#include + +class BitcoinExchange +{ + public: + BitcoinExchange(); + BitcoinExchange(const BitcoinExchange &other); + BitcoinExchange &operator=(const BitcoinExchange &other); + ~BitcoinExchange(); + + void loadDatabase(const std::string &filename); + void processInput(const std::string &filename); + + private: + std::map _data; + + float getRate(const std::string &date) const; + bool isValidDate(const std::string &date) const; + bool isValidValue(const std::string &value, float &out) const; +}; + +#endif diff --git a/ex00/Makefile b/ex00/Makefile index 8007857..06e53cf 100644 --- a/ex00/Makefile +++ b/ex00/Makefile @@ -3,7 +3,7 @@ CXXFLAGS = -Wall -Wextra -Werror -std=c++98 OBJDIR = obj SOURCES = Main.cpp OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.cpp=.o)) -NAME = Easyfind +NAME = btc all: $(NAME)