/** * @file scpp_exception.hpp * @bried Exception モジュールヘッダーファイル * @author Nomura Kei * @copyright 2003 - 2022 Nomura Kei */ #ifndef SCPP_EXCEPTION_HPP #define SCPP_EXCEPTION_HPP #include <exception> #include <string> #include <scpp.h> namespace scpp { /** * 例外基底クラス。 * libscpp で扱う例外は、本クラスを継承します。 */ class Throwable: public std::exception { public: Throwable() noexcept; Throwable(const Throwable& t) noexcept; Throwable(const std::string& msg) noexcept; virtual ~Throwable() noexcept; virtual const char* what() const noexcept; protected: std::string message; }; /** * 回復可能な例外クラス。 */ class Exception : public Throwable { public: Exception() noexcept; Exception(const Throwable& t) noexcept; Exception(const std::string& msg) noexcept; virtual ~Exception() noexcept; }; /** * 回復困難な例外クラス。 */ class Error : public Throwable { public: Error() noexcept; Error(const Throwable& t) noexcept; Error(const std::string& msg) noexcept; virtual ~Error() noexcept; }; } #endif // SCPP_EXCEPTION_HPP