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

Diff for /pegasus/src/Pegasus/Common/String.cpp between version 1.81 and 1.82

version 1.81, 2003/10/02 19:10:27 version 1.82, 2003/10/03 01:21:55
Line 62 
Line 62 
  
 CString::CString(const CString& cstr) CString::CString(const CString& cstr)
 { {
       _rep = 0;
   
       if (cstr._rep)
       {
     _rep = (void*)new char[strlen((char*)cstr._rep)+1];     _rep = (void*)new char[strlen((char*)cstr._rep)+1];
     strcpy((char*)_rep, (char*)cstr._rep);     strcpy((char*)_rep, (char*)cstr._rep);
 } }
   }
  
 CString::CString(char* cstr) CString::CString(char* cstr)
     : _rep(cstr)     : _rep(cstr)
Line 74 
Line 79 
 CString::~CString() CString::~CString()
 { {
     if (_rep)     if (_rep)
       {
         delete [] (char*)_rep;         delete [] (char*)_rep;
 } }
   }
  
 CString& CString::operator=(const CString& cstr) CString& CString::operator=(const CString& cstr)
 { {
       if (&cstr != this)
       {
     if (_rep)     if (_rep)
     {     {
         delete [] (char*)_rep;         delete [] (char*)_rep;
         _rep = 0;         _rep = 0;
     }     }
           if (cstr._rep)
           {
     _rep = (char*)new char[strlen((char*)cstr._rep)+1];     _rep = (char*)new char[strlen((char*)cstr._rep)+1];
     strcpy((char*)_rep, (char*)cstr._rep);     strcpy((char*)_rep, (char*)cstr._rep);
           }
       }
     return *this;     return *this;
 } }
  
Line 239 
Line 252 
  
 String& String::operator=(const String& str) String& String::operator=(const String& str)
 { {
     return assign(str);      if (&str != this)
       {
           assign(str);
       }
       return *this;
 } }
  
 String& String::assign(const String& str) String& String::assign(const String& str)


Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2