From: Mikko Rasa Date: Tue, 12 Jun 2007 18:42:05 +0000 (+0000) Subject: Add error.h X-Git-Tag: 1.0~28 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f3060db03f822573175e3d6bc1fa541217e16f65;p=libs%2Fdatafile.git Add error.h Update svn:ignore --- diff --git a/source/error.h b/source/error.h new file mode 100644 index 0000000..f8f7abd --- /dev/null +++ b/source/error.h @@ -0,0 +1,30 @@ +#ifndef MSP_PARSER_ERROR_H_ +#define MSP_PARSER_ERROR_H_ + +#include + +namespace Msp { +namespace Parser { + +class TypeError: public Exception +{ +public: + TypeError(const std::string &w_): Exception(w_) { } +}; + +class ParseError: public Exception +{ +public: + ParseError(const std::string &w_, const std::string &s, unsigned l): Exception(w_), source(s), line(l) { } + const std::string &get_source() const { return source; } + unsigned get_line() const { return line; } + ~ParseError() throw() { } +private: + std::string source; + unsigned line; +}; + +} // namespace Parser +} // namespace Msp + +#endif