Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define SOLATIS_EXCEPTION_DECL(name) \
- class name : public std::exception { \
- public : \
- name () : std::exception () {}; \
- name ( const name &that ) : std::exception () { \
- _what += that._what; \
- } \
- virtual ~name() throw(){}; \
- virtual const char *what() const throw() { \
- return _what.c_str(); \
- } \
- template<typename T> name & operator<<( const T& t ) { \
- _stream << t; \
- _what = _stream.str (); \
- return *this; \
- } \
- private: \
- mutable std::stringstream _stream; \
- std::string _what; \
- };
- SOLATIS_EXCEPTION_DECL(parse_exception);
- SOLATIS_EXCEPTION_DECL(integrity_exception);
- SOLATIS_EXCEPTION_DECL(fatal_exception);
Add Comment
Please, Sign In to add comment