(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.53 and 1.54

version 1.53, 2002/08/27 23:38:44 version 1.54, 2002/08/29 00:27:52
Line 40 
Line 40 
  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
 // //
   // CString
   //
   ///////////////////////////////////////////////////////////////////////////////
   
   CString::CString()
       : _rep(0)
   {
   }
   
   CString::CString(const CString& cstr)
   {
       _rep = new char[strlen(cstr._rep)+1];
       _rep = strcpy(_rep, cstr._rep);
   }
   
   CString::CString(char* cstr)
       : _rep(cstr)
   {
   }
   
   CString::~CString()
   {
       if (_rep)
           delete [] _rep;
   }
   
   CString::operator const char*() const
   {
       return _rep;
   }
   
   ///////////////////////////////////////////////////////////////////////////////
   //
 // String // String
 // //
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
Line 235 
Line 268 
     return _rep->c16a.getData();     return _rep->c16a.getData();
 } }
  
 char* String::allocateCString(Uint32 extraBytes, Boolean& truncatedCharacters) const  CString String::getCString() const
 { {
     truncatedCharacters = false;  
     Uint32 n = size() + 1;     Uint32 n = size() + 1;
     char* str = new char[n + extraBytes];      char* str = new char[n];
     char* p = str;     char* p = str;
     const Char16* q = getData();     const Char16* q = getData();
  
Line 248 
Line 280 
         Uint16 c = *q++;         Uint16 c = *q++;
         *p++ = char(c);         *p++ = char(c);
  
         if (c & 0xff00)          //if (c & 0xff00)
             truncatedCharacters = true;          //    truncatedCharacters = true;
     }     }
  
     return str;      return CString(str);
 }  
   
 char* String::allocateCString(Uint32 extraBytes) const  
 {  
     Boolean truncatedCharacters = false;  
     return allocateCString(extraBytes, truncatedCharacters);  
 } }
  
 Char16& String::operator[](Uint32 index) Char16& String::operator[](Uint32 index)


Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2