-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMyException.cpp
More file actions
56 lines (46 loc) · 1007 Bytes
/
CMyException.cpp
File metadata and controls
56 lines (46 loc) · 1007 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
52
53
54
55
56
/*
* File: CMyException.cpp
* Author: mwittig
*
* Created on June 18, 2010, 11:13 AM
*/
#include <string>
using namespace std;
#include "CMyException.h"
CMyException::CMyException()throw()
{
}
CMyException::CMyException(const char* orig) throw()
{
m_strErr = orig;
}
CMyException::CMyException(const std::string& orig) throw() {
m_strErr = orig;
}
CMyException::CMyException(const CMyException& orig) throw(){
m_strErr = orig.m_strErr;
}
CMyException& CMyException::operator= (const CMyException& orig) throw()
{
m_strErr = orig.m_strErr;
return *this;
}
CMyException CMyException::operator+(const std::string& value)
{
m_strErr.append(value);
return *this;
}
CMyException CMyException::operator+(const int& v)
{
m_strErr.append(std::to_string(v));
return *this;
}
CMyException CMyException::operator+(const size_t& v)
{
m_strErr.append(std::to_string(v));
return *this;
}
string CMyException::what() const throw()
{
return m_strErr;
}