Egglib 2.1.11
C++ library reference manual
EggException.hpp
1 /*
2  Copyright 2009 Stéphane De Mita, Mathieu Siol
3 
4  This file is part of the EggLib library.
5 
6  EggLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  EggLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with EggLib. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef EGGLIB_EGGEXCEPTION_HPP
21 #define EGGLIB_EGGEXCEPTION_HPP
22 
23 #include <string>
24 #include <exception>
25 
26 namespace egglib {
27 
33  class EggException : public std::exception {
34  public:
36  EggException();
38  EggException(const char* message);
40  ~EggException() throw() {}
42  virtual const char* what() const throw();
43 
44  protected:
45  std::string message;
46 
47  };
48 
49 
55  class EggMemoryError : public EggException {
56  public:
60  ~EggMemoryError() throw() {}
61  };
62 
63 
70  public:
72  EggArgumentValueError(const char* m );
75  };
76 
77 
86  class EggRuntimeError : public EggException {
87  public:
89  EggRuntimeError(const char* m );
91  ~EggRuntimeError() throw() {}
92  };
93 
94 
100  class EggFormatError : public EggException {
101  public:
103  EggFormatError(const char* fileName, const char* expectedFormat, const char* m);
105  ~EggFormatError() throw() {}
107  std::string fileName() const;
109  std::string expectedFormat() const;
111  virtual const char* what_more() const;
112 
113  protected:
114  std::string fname;
115  std::string eformat;
116  };
117 
118 
125  public:
127  EggOpenFileError(const char* fileName );
129  ~EggOpenFileError() throw() {}
130  };
131 
132 
139  public:
144 
148  ~EggUnalignedError() throw() {}
149  };
150 
157  public:
161  EggInvalidCharacterError(char c, unsigned int seqIndex, unsigned int posIndex);
162 
167  };
168 
169 }
170 
171 
172 
173 #endif
Exception type for file/string formatting errors.
Definition: EggException.hpp:100
Exception type for invalid character.
Definition: EggException.hpp:156
Exception type for runtime errors.
Definition: EggException.hpp:86
Exception type for argument value errors.
Definition: EggException.hpp:69
Exception type for unaligned sequences.
Definition: EggException.hpp:138
~EggMemoryError()
Destructor.
Definition: EggException.hpp:60
Base exception type for errors occurring in this library.
Definition: EggException.hpp:33
~EggRuntimeError()
Destructor.
Definition: EggException.hpp:91
Exception type for memory errors.
Definition: EggException.hpp:55
~EggUnalignedError()
Destructor.
Definition: EggException.hpp:148
~EggOpenFileError()
Destructor.
Definition: EggException.hpp:129
Exception type for errors while opening a file.
Definition: EggException.hpp:124
~EggFormatError()
Destructor.
Definition: EggException.hpp:105
EggException()
Constructor with empty error message.
Definition: EggException.cpp:25
virtual const char * what() const
Gets error message.
Definition: EggException.cpp:34
Definition: ABC.cpp:37
~EggInvalidCharacterError()
Destructor.
Definition: EggException.hpp:166
~EggException()
Destructor.
Definition: EggException.hpp:40
~EggArgumentValueError()
Destructor.
Definition: EggException.hpp:74

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads