55#define throw_(cls, msg) \
56 ((_desc_buffer << (msg)), \
57 throw_func<cls>(_desc_buffer.str()))
60 std::cerr <<
"Warning: " << message << std::endl;
65#define warning_(msg) \
66 ((_desc_buffer << (msg)), \
67 warning_func(_desc_buffer.str()))
71#define add_error_context(msg) \
72 ((long(_ctxt_buffer.tellp()) == 0) ? \
73 (_ctxt_buffer << (msg)) : \
74 (_ctxt_buffer << std::endl << (msg)))
80 const string::size_type pos = 0,
81 const string::size_type end_pos = 0);
84 const std::istream::pos_type pos,
85 const std::istream::pos_type end_pos,
86 const string&
prefix =
"");
88#define DECLARE_EXCEPTION(name, kind) \
89 class name : public kind { \
91 explicit name(const string& why) throw() : kind(why) {} \
92 virtual ~name() throw() {} \
void throw_func(const string &message)
std::ostringstream _desc_buffer
void warning_func(const string &message)
boost::filesystem::path path
std::ostringstream _ctxt_buffer
string line_context(const string &line, const string::size_type pos=0, const string::size_type end_pos=0)
string source_context(const path &file, const std::istream::pos_type pos, const std::istream::pos_type end_pos, const string &prefix="")
string file_context(const path &file, std::size_t line)
const char * what() const
error_count(std::size_t _count, std::string _msg)