Files
cpp09/ex00/main.cpp
2026-04-23 21:05:36 +02:00

43 lines
1.3 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/04/23 19:58:34 by aortigos #+# #+# */
/* Updated: 2026/04/23 20:48:10 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "BitcoinExchange/BitcoinExchange.hpp"
int main(int argc, char **argv)
{
if (argc != 2)
{
cout << "Usage: ./btc <database>" << endl;
return (0);
}
std::ifstream inFile(argv[1]);
if (!inFile)
{
cout << "Error: could not open database." << endl;
return (1);
}
BitcoinExchange bc;
try {
bc.readDatabase(inFile);
} catch (std::exception &e)
{
std::cout << e.what() << std::endl;
}
return (0);
}