]> Creatis software - creaBruker.git/blob - lib/src1/brukerexception.h
first try for exception
[creaBruker.git] / lib / src1 / brukerexception.h
1 //
2 #ifndef BRUKEREXCEPTION_H
3 #define BRUKEREXCEPTION_H
4
5 #include "brukerSystem.h"
6 #include <exception>
7 #include <string>
8
9
10 class creaBruker_EXPORT BrukerSizeException: public std::exception
11 {
12 public:
13     BrukerSizeException( const std::string& message,
14                       int lgt,
15                       int expected_lgt
16                       )
17       : m_message(message), m_lgt(lgt), m_expected_lgt(expected_lgt)
18     {}
19
20     ~BrukerSizeException() throw() {}
21     
22     virtual const char* what() const throw() {
23         return m_message.c_str();
24     }
25     
26    int getFoundLgt() const throw() {
27         return m_lgt;
28    }
29    
30    int getExpectedLgt() const throw() {
31         return m_expected_lgt;
32    }
33      
34 private:
35    std::string m_message;
36    int m_lgt;
37    int m_expected_lgt;
38
39 };
40
41 #endif