main.cpp
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   main.cpp                                           :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <gychoi@student.42seoul.kr>         +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2023/12/31 16:50:56 by gychoi            #+#    #+#             */
 9  /*   Updated: 2024/01/14 22:50:33 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include <iostream>
14  
15  #include "BitcoinExchange.hpp"
16  
17  int	main(int argc, char* argv[])
18  {
19  	if (argc != 2)
20  	{
21  		std::cout << "Error: could not open file." << std::endl;
22  		return 1;
23  	}
24  	else
25  	{
26  		// ready to execute
27  	}
28  
29  	try
30  	{
31  		BitcoinExchange::setExchangeMap("./data.csv");
32  		BitcoinExchange::execute(argv[1]);
33  	}
34  	catch (std::exception& e)
35  	{
36  		std::cout << "Error: " << e.what() <<  std::endl;
37  		return 1;
38  	}
39  	return 0;
40  }