]> git.tdb.fi Git - libs/datafile.git/blob - source/except.h
4573e947297dedd3f8311b92842d7f62faa98aa4
[libs/datafile.git] / source / except.h
1 /* $Id$
2
3 This file is part of libmspdatafile
4 Copyright © 2006  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7 #ifndef MSP_DATAFILE_ERROR_H_
8 #define MSP_DATAFILE_ERROR_H_
9
10 #include <msp/core/except.h>
11
12 namespace Msp {
13 namespace DataFile {
14
15 class TypeError: public Exception
16 {
17 public:
18         TypeError(const std::string &w_): Exception(w_) { }
19 };
20
21 class ParseError: public Exception
22 {
23 public:
24         ParseError(const std::string &w_, const std::string &s, unsigned l): Exception(w_), source(s), line(l) { }
25         const std::string &get_source() const { return source; }
26         unsigned          get_line() const    { return line; }
27         ~ParseError() throw() { }
28 private:
29         std::string source;
30         unsigned    line;
31 };
32
33 } // namespace DataFile
34 } // namespace Msp
35
36 #endif