-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCException.cpp
More file actions
51 lines (38 loc) · 1016 Bytes
/
CException.cpp
File metadata and controls
51 lines (38 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
*
* \file CException.cpp
*
* \authors M. Laporte, D. Mathieu
*
* \date 10/02/2011
*
* \version V1.0
*
* \brief classe CException
*
**/
#include <iostream>
#include <string>
#include "CstCodErr.h"
#include "CException.h"
using namespace std;
#define CEXC nsUtil::CException
//==========================
// Classe nsUtil::CException
//==========================
CEXC::CException (const string & libelle /* = string () */,
const unsigned codErr /* = KNoExc */) noexcept
: myLibelle (libelle), myCodErr (codErr) {}
const string & CEXC::getLibelle (void) const noexcept
{
return myLibelle;
} // GetLibelle()
unsigned CEXC::getCodErr (void) const noexcept { return myCodErr; }
CEXC::~CException (void) noexcept {}
const char* CEXC::what (void) const noexcept { return myLibelle.c_str(); }
void CEXC::display (void) const
{
cout << "Exception : " << myLibelle << '\n'
<< "Code : " << myCodErr << endl;
} // Afficher()
#undef CEXC