#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ senf::SystemException::SystemException(SystemException const & other)
- : std::stringstream(other.str(),std::ios::out), code_(other.code_)
+///////////////////////////////////////////////////////////////////////////
+// senf::Exception
+prefix_ senf::Exception::Exception(std::string const & description)
+ : message_(description)
{}
-prefix_ senf::SystemException::SystemException(std::string const & where, int code)
- : std::stringstream(std::ios::out), code_(code)
+///////////////////////////////////////////////////////////////////////////
+
+prefix_ senf::SystemException::SystemException(std::string const & where)
+{
+ init(where, errno);
+}
+
+prefix_ senf::SystemException::SystemException(int code)
{
- if (! where.empty())
- (*this) << where << ": ";
- (*this) << "(" << code_ << ") " << description();
+ init("", code);
}
-prefix_ char const * senf::SystemException::what()
- const throw()
+prefix_ senf::SystemException::SystemException(std::string const & where, int code)
{
- /// \fixme Replace the 'stringstream' base-class with our own stream with a specialized
- /// streambuf which allows to efficiently access the contents as a C string.
- buffer_ = this->str();
- return buffer_.c_str();
+ init(where, code);
}
-prefix_ int senf::SystemException::code()
+prefix_ int senf::SystemException::errorNumber()
const
{
return code_;
throw()
{}
-prefix_ void senf::throwErrno()
-{
- throwErrno("", errno);
-}
-
-prefix_ void senf::throwErrno(std::string const & where)
-{
- throwErrno(where, errno);
-}
-
-prefix_ void senf::throwErrno(int code)
-{
- throwErrno("", code);
-}
-
///////////////////////////////cci.e///////////////////////////////////////
#undef prefix_