(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.127 and 1.128

version 1.127, 2007/06/12 18:15:51 version 1.128, 2007/09/13 08:17:11
Line 1319 
Line 1319 
     _rep = tmp;     _rep = tmp;
 } }
  
   /**
       Fast way to assign a given character string consisting of ASCII only and
       legal characters for a CIMName (i.e. letter, numbers and underscore)
       to a String reference.
   
       @param s reference to the String object which will be changed
       @param str character string
       @param n number of characters which shall be assigned from str to s
   */
   void AssignASCII(String& s, const char* str, Uint32 n)
   {
       class StringLayout
       {
       public:
           StringRep* rep;
       };
   
       StringLayout* that = (StringLayout*)&s;
   
       _checkNullPointer(str);
   
       if (n > that->rep->cap || that->rep->refs.get() != 1)
       {
           StringRep::unref(that->rep);
           that->rep = StringRep::alloc(n);
       }
   
       _copy(that->rep->data, str, n);
       that->rep->size = n;
       that->rep->data[that->rep->size] = 0;
   }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 /* /*


Legend:
Removed from v.1.127  
changed lines
  Added in v.1.128

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2