#include "src/exception.h"
namespace utakata {
+
+namespace unicode {
+class UniString;
+}
+
namespace exception {
class NullException : public exception::Exception {
// NULLであることが想定外である場合に送出される例外です。
public:
- NullException(const std::string& message, const ExceptionInfo& info) :
+ NullException(const unicode::UniString& message, const ExceptionInfo& info) :
Exception(message, info) {}
- // 前回送出された例外を記録します。
- NullException(const Exception& prev, const std::string& message,
+ NullException(const Exception& prev, const unicode::UniString& message,
const ExceptionInfo& info) :
Exception(prev, message, info) {}
- // message_の内容を表示します。
- virtual const char* what() const throw() {
- return std::string("NullException : " + message()).c_str();
- }
+ virtual const char* what() const throw() {return "NullException";}
};
class OutOfRangeException : public exception::Exception {
// 引数などが範囲外である場合などに送出される例外です。
public:
- OutOfRangeException(const std::string& message, const ExceptionInfo& info) :
- Exception(message, info) {}
+ OutOfRangeException(const unicode::UniString& message,
+ const ExceptionInfo& info)
+ : Exception(message, info) {}
- // 前回送出された例外を記録します。
- OutOfRangeException(const Exception& prev, const std::string& message,
- const ExceptionInfo& info) :
- Exception(prev, message, info) {}
+ OutOfRangeException(const Exception& prev, const unicode::UniString& message,
+ const ExceptionInfo& info)
+ : Exception(prev, message, info) {}
- // message_の内容を表示します。
- virtual const char* what() const throw() {
- return std::string("OutOfRangeException : " + message()).c_str();
- }
+ virtual const char* what() const throw() {return "OutOfRangeException";}
};
+
}
}