8 #ifndef SCARAB_BASE_EXCEPTION_HH_ 9 #define SCARAB_BASE_EXCEPTION_HH_ 34 template<
typename x_derived >
44 template<
class x_streamable >
45 x_derived&
operator<<( x_streamable a_fragment );
46 x_derived&
operator<<(
const std::string& a_fragment );
47 x_derived&
operator<<(
const char* a_fragment );
49 virtual const char* what()
const noexcept;
55 template<
typename x_derived >
61 template<
typename x_derived >
63 std::exception( a_orig ),
64 f_error( a_orig.f_error )
67 template<
typename x_derived >
71 template<
typename x_derived >
78 template<
typename x_derived >
81 return f_error.c_str();
84 template<
typename x_derived >
85 template<
class x_streamable >
88 std::stringstream stream;
90 f_error += stream.str();
91 return *
static_cast< x_derived*
>(
this);
94 template<
typename x_derived >
97 f_error += a_fragment;
98 return *
static_cast< x_derived*
>(
this);
101 template<
typename x_derived >
104 f_error += std::string( a_fragment );
105 return *
static_cast< x_derived*
>(
this);
std::ostream & operator<<(std::ostream &in, const T &item)
output streaming for enumerations
SCARAB_API std::ostream & operator<<(std::ostream &out, const param_array &a_value)
Base class for exceptions with streaming operators.