GlobalObjects
Lade ...
Suche ...
Keine Treffer
EuException.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_EUEXCEPTION_H
2#define INC_EUEXCEPTION_H
3//-----------------------------------------------------------------------------
36//-----------------------------------------------------------------------------
37#include "EuToolTypes.h"
38#include <stdexcept>
39//-----------------------------------------------------------------------------
40namespace eut
41{
42 //---------------------------------------------------------------------------
57 class ErrorNException : public std::runtime_error
58 {
59 private:
60 //============== Attribute
61 //-----------------------------------------------------------------------
72 //-----------------------------------------------------------------------
82 char const * m_FileName;
83 //-----------------------------------------------------------------------
94 //-----------------------------------------------------------------------
95
96 public:
97 //============== De- & Konstruktoren
98 //-----------------------------------------------------------------------
116 inline ErrorNException( const std::string & _Message, int iError, char const * chFileName, int iLine );
117 //-----------------------------------------------------------------------
135 inline ErrorNException( const char *_Message, int iError, char const * chFileName, int iLine );
136 //-----------------------------------------------------------------------
148 inline ErrorNException( const ErrorNException & rT );
149 //-----------------------------------------------------------------------
150
151 //============== Methoden
152 //-----------------------------------------------------------------------
164 inline int error() const;
165 //-----------------------------------------------------------------------
177 inline char const * fileName() const;
178 //-----------------------------------------------------------------------
190 inline int lineNumber() const;
191 //-----------------------------------------------------------------------
192
193 //-----------------------------------------------------------------------
205 inline ErrorNException & operator= ( const ErrorNException & rT );
206 //-----------------------------------------------------------------------
207 };
208
209 //---------------------------------------------------------------------------
210 #ifdef _MSC_VER
211 /* warning C4189: "t_iDEBUG_XXX": Lokale Variable ist initialisiert aber nicht referenziert */
212 #pragma warning( disable : 4189 )
213 #endif
214 //---------------------------------------------------------------------------
215 #if defined(__GNUC__)
216 /* Warnung: unused variable 't_iDEBUG_XXX' [-Wunused-variable] */
217 #pragma GCC diagnostic push
218 #pragma GCC diagnostic ignored "-Wunused-variable"
219 #endif
220 //---------------------------------------------------------------------------
221 inline ErrorNException::ErrorNException( const std::string& _Message, int iError, char const * chFileName, int iLine )
222 : std::runtime_error( _Message ),
223 m_iError( iError ),
224 m_FileName( chFileName ),
225 m_iLineNumber( iLine )
226 {
227 #ifdef _DEBUG
228 int t_iDEBUG_BreakPoint = 1;
229 #endif
230 }
231 //---------------------------------------------------------------------------
232 inline ErrorNException::ErrorNException( const char *_Message, int iError, char const * chFileName, int iLine )
233 : std::runtime_error( _Message ),
234 m_iError( iError ),
235 m_FileName( chFileName ),
236 m_iLineNumber( iLine )
237 {
238 #ifdef _DEBUG
239 int t_iDEBUG_BreakPoint = 1;
240 #endif
241 }
242 //---------------------------------------------------------------------------
243 #ifdef _MSC_VER
244 /* warning C4189: "t_iDEBUG_XXX": Lokale Variable ist initialisiert aber nicht referenziert */
245 #pragma warning( default : 4189 )
246 #endif
247 //---------------------------------------------------------------------------
248 #if defined(__GNUC__)
249 /* Warnung: unused variable 't_iDEBUG_XXX' [-Wunused-variable] */
250 #pragma GCC diagnostic pop
251 #endif
252 //---------------------------------------------------------------------------
254 : std::runtime_error( rT ),
255 m_iError( rT.m_iError ),
256 m_FileName( rT.m_FileName ),
257 m_iLineNumber( rT.m_iLineNumber )
258 {
259 }
260 //---------------------------------------------------------------------------
261 inline int ErrorNException::error() const
262 {
263 return m_iError;
264 }
265 //---------------------------------------------------------------------------
266 inline char const * ErrorNException::fileName() const
267 {
268 return m_FileName;
269 }
270 //---------------------------------------------------------------------------
272 {
273 return m_iLineNumber;
274 }
275 //---------------------------------------------------------------------------
277 {
278 if( this != & rT )
279 {
280 m_iError = rT.m_iError;
283 std::runtime_error::operator=( rT );
284 }
285 return *this;
286 }
287 //---------------------------------------------------------------------------
288} // namespace eut
289#endif
Für jede Bibliothek, hier 'EuTools' gibt es eine Typen-Datei.
Diese Exception-Klasse hat zusätzlich zur Message ein Integer-Attribute für eine Fehlernummer.
Definition EuException.h:58
char const * fileName() const
Definition EuException.h:266
char const * m_FileName
Definition EuException.h:82
int m_iLineNumber
Definition EuException.h:93
int error() const
Definition EuException.h:261
ErrorNException & operator=(const ErrorNException &rT)
Definition EuException.h:276
int lineNumber() const
Definition EuException.h:271
int m_iError
Definition EuException.h:71
ErrorNException(const std::string &_Message, int iError, char const *chFileName, int iLine)
Definition EuException.h:221
Definition IniFile.h:47