diff --git a/ex00/src/BitcoinExchange.cpp b/ex00/src/BitcoinExchange.cpp index c709380..c774b04 100644 --- a/ex00/src/BitcoinExchange.cpp +++ b/ex00/src/BitcoinExchange.cpp @@ -184,7 +184,7 @@ static int get_input(const std::string& file_path, const std::map database; @@ -193,17 +193,4 @@ unsigned int get_price(const std::string& file_path) get_data(database); get_input(file_path, database); - - return 0; -} - -int main(int ac, char** av) -{ - if (ac != 2) - { - std::cout << "error: missing file" << std::endl; - return 1; - } - get_price(std::string(av[1])); - return 0; } diff --git a/ex00/src/BitcoinExchange.hpp b/ex00/src/BitcoinExchange.hpp index 4614fc9..a434681 100644 --- a/ex00/src/BitcoinExchange.hpp +++ b/ex00/src/BitcoinExchange.hpp @@ -4,3 +4,7 @@ #define DATA_PATERN "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2},[+\\-]*[0-9]*(\\.[0-9]+)?$" #define INPUT 0 #define DATABASE 1 + +#include + +void get_price(const std::string& file_path); diff --git a/ex00/src/main.cpp b/ex00/src/main.cpp new file mode 100644 index 0000000..3a4ec4d --- /dev/null +++ b/ex00/src/main.cpp @@ -0,0 +1,14 @@ +#include +#include "BitcoinExchange.hpp" + +int main(int ac, char** av) +{ + if (ac != 2) + { + std::cout << "error: missing file" << std::endl; + return 1; + } + get_price(std::string(av[1])); + return 0; +} +