#pragma once #include #include #include #include #include #include #include #include #include class BitcoinExchange { public: BitcoinExchange() = delete; BitcoinExchange(const std::string &data_file); BitcoinExchange(const BitcoinExchange &other); ~BitcoinExchange(); BitcoinExchange &operator=(const BitcoinExchange &other); void printData() const; void loadInputFile(const std::string &filename); class FileNotFoundException : public std::exception { public: virtual const char *what() const noexcept; }; class LineFormatException : public std::exception { public: virtual const char *what() const noexcept; }; class ValueNegativeException : public std::exception { public: virtual const char *what() const noexcept; }; class ValueTooLargeException : public std::exception { public: virtual const char *what() const noexcept; }; class DateInvalidException : public std::exception { public: virtual const char *what() const noexcept; }; private: std::map _data; long getTimestamp(const std::string &date) const; void loadDataFile(const std::string &filename); float getRate(long timestamp) const; float getValue(long timestamp, float amount) const; };