/****************************************************************************** Trick Library 'ax' 補助例外クラスヘッダファイル Copyright(C) 2008 Wraith. All rights reserved. Coded by Wraith in Jun 17, 2008. ******************************************************************************/ /////////////////////////////////////////////////////////////////////////////// // // ■ axexcept.h // http://tricklib.com/cxx/ax/axexcept.h // // □ 関連ファイル // http://tricklib.com/cxx/ax/axconfig.h // http://tricklib.com/cxx/ax/axmemory.h // http://tricklib.com/cxx/ax/axiterat.h // http://tricklib.com/cxx/ax/axstring.h // // □ ライセンス情報 // http://tricklib.com/license.htm // // ★ このファイルはC++標準ライブラリの 相当のものになり、規格票 //  (ISO/IEC 14882, JIS X 3014)の 19 章に基づき実装されています。 // #include "axstring.h" #if !defined(TRICKLIB_AX_AXEXCEPT_H) #define TRICKLIB_AX_AXEXCEPT_H #include namespace tricklib { namespace ax { class exception { public: exception() { } exception(const exception &) { } exception & operator = (const exception &) { return *this; } virtual ~exception() { } virtual const char * what() const { return "Unknown Exception."; } }; class bad_exception : public exception { public: bad_exception() { } bad_exception(const bad_exception &) { } bad_exception & operator=(const bad_exception &) { return *this; } virtual ~bad_exception() { } virtual const char * what() const { return "Bad Exception."; } }; class bad_alloc : public exception { public: bad_alloc() { } bad_alloc(const bad_alloc&) { } bad_alloc& operator=(const bad_alloc&) { return *this; } virtual ~bad_alloc() { } virtual const char * what() const { return "Bad Alloc Exception."; } }; class bad_cast : public exception { public: bad_cast() { } bad_cast(const bad_cast&) { } bad_cast& operator=(const bad_cast&) { return *this; } virtual ~bad_cast() { } virtual const char * what() const { return "Bad Cast Exception."; } }; class bad_typeid : public exception { public: bad_typeid() { } bad_typeid(const bad_typeid &) { } bad_typeid & operator=(const bad_typeid &) { return *this; } virtual ~bad_typeid() { } virtual const char * what() const { return "Bad TypeID Exception."; } }; class logic_error : public exception { string what_value; public: explicit logic_error(const string & a_what_value) :what_value(a_what_value) { } virtual const char * what() const { return what_value.c_str(); } }; class domain_error : public logic_error { public: explicit domain_error(const string & a_what_value) :logic_error(a_what_value) { } }; class invalid_argument : public logic_error { public: explicit invalid_argument(const string & a_what_value) :logic_error(a_what_value) { } }; class length_error : public logic_error { public: explicit length_error(const string & a_what_value) :logic_error(a_what_value) { } }; class out_of_range : public logic_error { public: explicit out_of_range(const string & a_what_value) :logic_error(a_what_value) { } }; class runtime_error : public exception { string what_value; public: explicit runtime_error(const string & a_what_value) :what_value(a_what_value) { } virtual const char * what() const { return what_value.c_str(); } }; class range_error : public runtime_error { public: explicit range_error(const string & a_what_value) :runtime_error(a_what_value) { } }; class overflow_error : public runtime_error { public: explicit overflow_error(const string & a_what_value) :runtime_error(a_what_value) { } }; class underflow_error : public runtime_error { public: explicit underflow_error(const string & a_what_value) :runtime_error(a_what_value) { } }; } } #endif // !defined(TRICKLIB_AX_AXEXCEPT_H) /****************************************************************************** □■□■ Wraith the Trickster □■□■ ■□■□ 〜I'll go with heaven's advantage and fool's wisdom.〜 ■□■□ ******************************************************************************/