]> git.tdb.fi Git - libs/datafile.git/blob - source/dataerror.h
5fca0c368f77b5b7db1a776ac58d0f85d82163c0
[libs/datafile.git] / source / dataerror.h
1 #ifndef MSP_DATAFILE_DATAERROR_H_
2 #define MSP_DATAFILE_DATAERROR_H_
3
4 #include <stdexcept>
5
6 namespace Msp {
7 namespace DataFile {
8
9 class data_error: public std::runtime_error
10 {
11 private:
12         std::string source;
13         unsigned line;
14
15 public:
16         data_error(const std::string &, unsigned, const std::string &);
17         data_error(const std::string &, unsigned, const std::exception &);
18         virtual ~data_error() throw() { }
19
20         const std::string &get_source() const { return source; }
21         unsigned get_line() const { return line; }
22
23 private:
24         std::string make_what(const std::string &, unsigned, const std::string &);
25 };
26
27 } // namespace DataFile
28 } // namespace Msp
29
30 #endif