Logo Search packages:      
Sourcecode: osb-jscore version File versions  Download package

UString & KJS::UString::operator= ( const char *  c  ) 

Assignment operator.

Definition at line 766 of file ustring.cpp.

References KJS::UString::Rep::_hash, KJS::UString::Rep::baseString, KJS::UString::Rep::buf, KJS::UString::Rep::offset, KJS::UString::Rep::preCapacity, and KJS::UString::Rep::rc.

{
  int l = c ? strlen(c) : 0;
  UChar *d;
  if (rep->rc == 1 && l <= rep->capacity && !rep->baseString && rep->offset == 0 && rep->preCapacity == 0) {
    d = rep->buf;
    rep->_hash = 0;
  } else {
    release();
    d = static_cast<UChar *>(malloc(sizeof(UChar) * l));
    rep = Rep::create(d, l);
  }
  for (int i = 0; i < l; i++)
    d[i].uc = c[i];

  return *this;
}


Generated by  Doxygen 1.6.0   Back to index