(file) Return to Exception.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Exception.cpp between version 1.58 and 1.59

version 1.58, 2002/09/11 21:58:02 version 1.59, 2002/09/20 01:14:55
Line 33 
Line 33 
  
 #include <cstdio> #include <cstdio>
 #include "Exception.h" #include "Exception.h"
   #include <Pegasus/Common/ExceptionRep.h>
 #include <Pegasus/Common/CIMExceptionRep.h> #include <Pegasus/Common/CIMExceptionRep.h>
 #include "Tracer.h" #include "Tracer.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 Exception::Exception(const String& message) : _message(message)  Exception::Exception(const String& message)
   {
       _rep = new ExceptionRep();
       _rep->message = message;
   }
   
   Exception::Exception(const Exception& exception)
   {
       _rep = new ExceptionRep();
       _rep->message = exception._rep->message;
   }
   
   Exception::Exception()
 { {
 } }
  
 Exception::~Exception() Exception::~Exception()
 { {
       delete _rep;
 } }
  
 const String& Exception::getMessage() const const String& Exception::getMessage() const
 { {
     return _message;      return _rep->message;
 } }
  
  
Line 153 
Line 167 
 CIMException::CIMException( CIMException::CIMException(
     CIMStatusCode code,     CIMStatusCode code,
     const String& message)     const String& message)
     :  
     Exception(message)  
 { {
     _rep = new CIMExceptionRep();      CIMExceptionRep * tmp = new CIMExceptionRep ();
     _rep->code = code;      tmp->message = message;
     _rep->file = "";      tmp->code = code;
     _rep->line = 0;      tmp->file = "";
       tmp->line = 0;
       _rep = tmp;
 } }
  
 CIMException::CIMException(const CIMException & cimException) CIMException::CIMException(const CIMException & cimException)
     : Exception(cimException.getMessage())  
 { {
     _rep = new CIMExceptionRep();      CIMExceptionRep * tmp = new CIMExceptionRep ();
     _rep->code = cimException._rep->code;      CIMExceptionRep * rep;
     _rep->file = cimException._rep->file;      rep = reinterpret_cast<CIMExceptionRep*>(cimException._rep);
     _rep->line = cimException._rep->line;      tmp->message = rep->message;
       tmp->code = rep->code;
       tmp->file = rep->file;
       tmp->line = rep->line;
       _rep = tmp;
 } }
  
 CIMException& CIMException::operator=(const CIMException & cimException) CIMException& CIMException::operator=(const CIMException & cimException)
 { {
     _message = cimException._message;      CIMExceptionRep* left;
     _rep->code = cimException._rep->code;      CIMExceptionRep* right;
     _rep->file = cimException._rep->file;      left = reinterpret_cast<CIMExceptionRep*>(this->_rep);
     _rep->line = cimException._rep->line;      right = reinterpret_cast<CIMExceptionRep*>(cimException._rep);
       left->message = right->message;
       left->code = right->code;
       left->file = right->file;
       left->line = right->line;
     return *this;     return *this;
 } }
  
 CIMException::~CIMException() CIMException::~CIMException()
 { {
     delete _rep;  
 } }
  
 CIMStatusCode CIMException::getCode() const CIMStatusCode CIMException::getCode() const
 { {
     return _rep->code;      CIMExceptionRep* rep;
       rep = reinterpret_cast<CIMExceptionRep*>(_rep);
       return rep->code;
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2