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)