/[escript]/branches/intelc_win32/esysUtils/src/EsysException.cpp
ViewVC logotype

Contents of /branches/intelc_win32/esysUtils/src/EsysException.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 742 - (show annotations)
Sat Jun 24 11:27:16 2006 UTC (13 years, 2 months ago) by woo409
File size: 2504 byte(s)
+ Initial commit of win32 port using intel c++ compiler 9.1.x for Windows
+ This version is failing some file handling tests in python
1 /*
2 ******************************************************************************
3 * *
4 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 ******************************************************************************
13 */
14
15 #include "EsysException.h"
16
17 using namespace std;
18 using namespace esysUtils;
19
20 ostream &operator<<(ostream &output, EsysException &inException){
21 output << inException.toString();
22 return output;
23 }
24
25 EsysException::EsysException():
26 exception()
27 {
28 }
29
30 EsysException::EsysException(const string &exceptionReason):
31 exception()
32 {
33 reason() << exceptionReason;
34 }
35
36 // Copy Constructor.
37 EsysException::EsysException(const EsysException &inException):
38 exception(inException)
39 {
40 *this=inException;
41 }
42
43 EsysException::EsysException( const char *cStr ):
44 exception()
45 {
46 reason() << cStr;
47 }
48
49 EsysException::~EsysException() throw()
50 {}
51
52 string EsysException::exceptionName() const
53 {
54 return "GeneralEsysException";
55 }
56 ostringstream& EsysException::reason()
57 {
58 return m_reason;
59 }
60 //
61 // Overloaded assignment operator.
62 EsysException& EsysException::operator=(const EsysException &inException) {
63 if (this != &inException) {
64 //
65 // call the base class operator=
66 // win32 refactor: parent class operator= shares pointer the result is
67 // all classes try to free the same pointer, dies on windows badly.
68 // this->exception::operator=(dynamic_cast<const exception&>(inException));
69 //
70 // copy the message buffer into this EsysException
71 m_reason << inException.m_reason.str(); // copy the message buffer into this EsysException
72 }
73 return *this;
74 }
75
76 // return the message as a string
77 string EsysException::toString() const {
78 return exceptionName() + ": " + m_reason.str();
79 }
80
81 const char* EsysException::what() const throw() {
82 //
83 m_exceptionMessage=toString();
84 return m_exceptionMessage.c_str();
85 }

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26