#define MSP_DATAFILE_EXCEPT_H_
#include <stdexcept>
+#include <string>
+#include <typeinfo>
namespace Msp {
namespace DataFile {
{
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 &);
+ virtual ~data_error() throw() = default;
const std::string &get_source() const { return source; }
unsigned get_line() const { return line; }
{
public:
parse_error(const std::string &);
- virtual ~parse_error() throw() { }
+ virtual ~parse_error() throw() = default;
};
{
public:
syntax_error(const std::string &t);
- virtual ~syntax_error() throw() { }
+ virtual ~syntax_error() throw() = default;
};
{
public:
bad_definition(const std::string &w);
- virtual ~bad_definition() throw() { }
+ virtual ~bad_definition() throw() = default;
};
{
public:
nesting_error(const std::string &);
- virtual ~nesting_error() throw() { }
+ virtual ~nesting_error() throw() = default;
+};
+
+
+class unknown_keyword: public std::runtime_error
+{
+public:
+ unknown_keyword(const std::string &);
+ virtual ~unknown_keyword() throw() = default;
+};
+
+
+class invalid_signature: public std::runtime_error
+{
+public:
+ invalid_signature(const std::string &, const std::string &);
+ virtual ~invalid_signature() throw() = default;
+};
+
+
+class no_collection: public std::runtime_error
+{
+public:
+ no_collection(const std::type_info &);
};
} // namespace DataFile