]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/except.h
Cosmetic changes
[libs/datafile.git] / source / except.h
index e68ec481f4aa869ada66a660c59e06e195b6b34b..8357c7e33b8ce5d25f9d03c4557869cd52dab48e 100644 (file)
@@ -2,6 +2,8 @@
 #define MSP_DATAFILE_EXCEPT_H_
 
 #include <stdexcept>
+#include <string>
+#include <typeinfo>
 
 namespace Msp {
 namespace DataFile {
@@ -10,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; }
@@ -29,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;
 };
 
 
@@ -37,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;
 };
 
 
@@ -45,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;
 };
 
 
@@ -53,7 +56,30 @@ class nesting_error: public std::logic_error
 {
 public:
        nesting_error(const std::string &);
-       virtual ~nesting_error() throw() { }
+       ~nesting_error() throw() override = default;
+};
+
+
+class unknown_keyword: public std::runtime_error
+{
+public:
+       unknown_keyword(const std::string &);
+       ~unknown_keyword() throw() override = default;
+};
+
+
+class invalid_signature: public std::runtime_error
+{
+public:
+       invalid_signature(const std::string &, const std::string &);
+       ~invalid_signature() throw() override = default;
+};
+
+
+class no_collection: public std::runtime_error
+{
+public:
+       no_collection(const std::type_info &);
 };
 
 } // namespace DataFile