]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/except.h
Move the definition of Input's operator bool to the header
[libs/datafile.git] / source / except.h
index 7107fe1625a856551812faa2381b597970ec511f..3ae83465496b4bc3d050840f6541e04a941c4f18 100644 (file)
@@ -4,21 +4,21 @@
 #include <stdexcept>
 #include <string>
 #include <typeinfo>
+#include "mspdatafile_api.h"
 
 namespace Msp {
 namespace DataFile {
 
-class data_error: public std::runtime_error
+class MSPDATAFILE_API 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 &);
        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; }
@@ -28,55 +28,49 @@ private:
 };
 
 
-class parse_error: public std::runtime_error
+class MSPDATAFILE_API parse_error: public std::runtime_error
 {
 public:
        parse_error(const std::string &);
-       virtual ~parse_error() throw() = default;
 };
 
 
-class syntax_error: public std::runtime_error
+class MSPDATAFILE_API syntax_error: public std::runtime_error
 {
 public:
        syntax_error(const std::string &t);
-       virtual ~syntax_error() throw() = default;
 };
 
 
-class bad_definition: public std::runtime_error
+class MSPDATAFILE_API bad_definition: public std::runtime_error
 {
 public:
        bad_definition(const std::string &w);
-       virtual ~bad_definition() throw() = default;
 };
 
 
-class nesting_error: public std::logic_error
+class MSPDATAFILE_API nesting_error: public std::logic_error
 {
 public:
        nesting_error(const std::string &);
-       virtual ~nesting_error() throw() = default;
 };
 
 
-class unknown_keyword: public std::runtime_error
+class MSPDATAFILE_API unknown_keyword: public std::runtime_error
 {
 public:
        unknown_keyword(const std::string &);
-       virtual ~unknown_keyword() throw() = default;
 };
 
 
-class invalid_signature: public std::runtime_error
+class MSPDATAFILE_API 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
+class MSPDATAFILE_API no_collection: public std::runtime_error
 {
 public:
        no_collection(const std::type_info &);