X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fexcept.h;h=cc8c1fbdcd6b3a4f5b303023871d667b66287381;hb=HEAD;hp=ed9ca2337f98c667a4fa40014f9f8477cdf86314;hpb=193d36c8ce13cf2c5cd055fbd008f3003dda0a3e;p=libs%2Fdatafile.git diff --git a/source/except.h b/source/except.h index ed9ca23..8357c7e 100644 --- a/source/except.h +++ b/source/except.h @@ -2,6 +2,7 @@ #define MSP_DATAFILE_EXCEPT_H_ #include +#include #include namespace Msp { @@ -11,12 +12,13 @@ class data_error: public std::runtime_error { private: std::string source; - unsigned line; + unsigned line = 0; public: data_error(const std::string &, unsigned, const std::string &); data_error(const std::string &, unsigned, const std::exception &); - virtual ~data_error() throw() { } + data_error(const std::string &, unsigned, const data_error &); + ~data_error() throw() override = default; const std::string &get_source() const { return source; } unsigned get_line() const { return line; } @@ -30,7 +32,7 @@ class parse_error: public std::runtime_error { public: parse_error(const std::string &); - virtual ~parse_error() throw() { } + ~parse_error() throw() override = default; }; @@ -38,7 +40,7 @@ class syntax_error: public std::runtime_error { public: syntax_error(const std::string &t); - virtual ~syntax_error() throw() { } + ~syntax_error() throw() override = default; }; @@ -46,7 +48,7 @@ class bad_definition: public std::runtime_error { public: bad_definition(const std::string &w); - virtual ~bad_definition() throw() { } + ~bad_definition() throw() override = default; }; @@ -54,7 +56,7 @@ class nesting_error: public std::logic_error { public: nesting_error(const std::string &); - virtual ~nesting_error() throw() { } + ~nesting_error() throw() override = default; }; @@ -62,7 +64,7 @@ class unknown_keyword: public std::runtime_error { public: unknown_keyword(const std::string &); - virtual ~unknown_keyword() throw() { } + ~unknown_keyword() throw() override = default; }; @@ -70,7 +72,7 @@ class invalid_signature: public std::runtime_error { public: invalid_signature(const std::string &, const std::string &); - virtual ~invalid_signature() throw() { } + ~invalid_signature() throw() override = default; };