X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.hh;h=5f00926f4c64ee639965351ef17bcd55647cc598;hb=c0b5c560da72983939b286632ac481e076649ddb;hp=eda57d1cbef217ce9f5a7be68cabc056b6e604cc;hpb=034f9bec0a66d26314fb6ebc83dedf1618a2c19d;p=senf.git diff --git a/Utils/Exception.hh b/Utils/Exception.hh index eda57d1..5f00926 100644 --- a/Utils/Exception.hh +++ b/Utils/Exception.hh @@ -34,6 +34,7 @@ #include #include #include +#include //#include "Exception.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -103,15 +104,10 @@ namespace senf { /////////////////////////////////////////////////////////////////////////// virtual char const * what() const throw(); + std::string const & message() const; - template - Exception & operator<<(Arg const & arg); ///< Extend exception description - /**< Adds \a arg converted to string to the end of the - exception description string. This operator allows to - use Exception instances like streams. The conversion is - performed using boost::lexical_cast and is - therefor identical to a streaming operation. - \see \ref exception */ + void append(std::string text); ///< Extend exception description + /**< Adds \a text to the description text. */ protected: Exception(std::string const & description = ""); ///< Initialize exception with string @@ -124,6 +120,17 @@ namespace senf { std::string message_; }; + template + typename boost::enable_if< boost::is_convertible, Exc & >::type + operator<<(Exc const & exc, Arg const & arg); ///< Extend exception description + /**< Adds \a arg converted to string to the end of the + exception description string. This operator allows to + use Exception instances like streams. The conversion is + performed using boost::lexical_cast and is + therefor identical to a streaming operation. + \see \ref exception */ + + # ifdef SENF_DEBUG # define _SENF_EXC_DEBUG_ARGS ,char const * file=0,int line=0 # define _SENF_EXC_DEBUG_ARGS_ND ,char const *file,int line